1 #define LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ LDKCVec_TransactionOutputsZ
2 #define CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free CVec_TransactionOutputsZ_free
4 // On OSX jlong (ie long long) is not equivalent to int64_t, so we override here
6 #include "org_ldk_impl_bindings.h"
12 #define LIKELY(v) __builtin_expect(!!(v), 1)
13 #define UNLIKELY(v) __builtin_expect(!!(v), 0)
15 #define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
16 #define MALLOC(a, _) malloc(a)
17 #define FREE(p) if ((uint64_t)(p) > 4096) { free(p); }
18 #define CHECK_ACCESS(p)
19 #define CHECK_INNER_FIELD_ACCESS_OR_NULL(v)
20 #define DO_ASSERT(a) (void)(a)
23 static jmethodID ordinal_meth = NULL;
24 static jmethodID slicedef_meth = NULL;
25 static jclass slicedef_cls = NULL;
26 JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class, jclass slicedef_class) {
27 ordinal_meth = (*env)->GetMethodID(env, enum_class, "ordinal", "()I");
28 CHECK(ordinal_meth != NULL);
29 slicedef_meth = (*env)->GetMethodID(env, slicedef_class, "<init>", "(JJJ)V");
30 CHECK(slicedef_meth != NULL);
31 slicedef_cls = (*env)->NewGlobalRef(env, slicedef_class);
32 CHECK(slicedef_cls != NULL);
35 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_deref_1bool (JNIEnv * env, jclass _a, jlong ptr) {
38 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_deref_1long (JNIEnv * env, jclass _a, jlong ptr) {
41 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_free_1heap_1ptr (JNIEnv * env, jclass _a, jlong ptr) {
44 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_read_1bytes (JNIEnv * env, jclass _b, jlong ptr, jlong len) {
45 jbyteArray ret_arr = (*env)->NewByteArray(env, len);
46 (*env)->SetByteArrayRegion(env, ret_arr, 0, len, (unsigned char*)ptr);
49 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes (JNIEnv * env, jclass _b, jlong slice_ptr) {
50 LDKu8slice *slice = (LDKu8slice*)slice_ptr;
51 jbyteArray ret_arr = (*env)->NewByteArray(env, slice->datalen);
52 (*env)->SetByteArrayRegion(env, ret_arr, 0, slice->datalen, slice->data);
55 JNIEXPORT int64_t impl_bindings_bytes_1to_1u8_1vec (JNIEnv * env, jclass _b, jbyteArray bytes) {
56 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8");
57 vec->datalen = (*env)->GetArrayLength(env, bytes);
58 vec->data = (uint8_t*)MALLOC(vec->datalen, "LDKCVec_u8Z Bytes");
59 (*env)->GetByteArrayRegion (env, bytes, 0, vec->datalen, vec->data);
62 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_txpointer_1get_1buffer (JNIEnv * env, jclass _b, jlong ptr) {
63 LDKTransaction *txdata = (LDKTransaction*)ptr;
65 slice.data = txdata->data;
66 slice.datalen = txdata->datalen;
67 return Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes(env, _b, (uint64_t)&slice);
69 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_new_1txpointer_1copy_1data (JNIEnv * env, jclass _b, jbyteArray bytes) {
70 LDKTransaction *txdata = (LDKTransaction*)MALLOC(sizeof(LDKTransaction), "LDKTransaction");
71 txdata->datalen = (*env)->GetArrayLength(env, bytes);
72 txdata->data = (uint8_t*)MALLOC(txdata->datalen, "Tx Data Bytes");
73 txdata->data_is_owned = false;
74 (*env)->GetByteArrayRegion (env, bytes, 0, txdata->datalen, txdata->data);
75 return (uint64_t)txdata;
77 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_txpointer_1free (JNIEnv * env, jclass _b, jlong ptr) {
78 LDKTransaction *tx = (LDKTransaction*)ptr;
79 tx->data_is_owned = true;
80 Transaction_free(*tx);
83 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len (JNIEnv * env, jclass _a, jlong ptr) {
84 // Check offsets of a few Vec types are all consistent as we're meant to be generic across types
85 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_SignatureZ, datalen), "Vec<*> needs to be mapped identically");
86 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_MessageSendEventZ, datalen), "Vec<*> needs to be mapped identically");
87 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_EventZ, datalen), "Vec<*> needs to be mapped identically");
88 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_C2Tuple_usizeTransactionZZ, datalen), "Vec<*> needs to be mapped identically");
89 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr;
90 return (uint64_t)vec->datalen;
92 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_new_1empty_1slice_1vec (JNIEnv * env, jclass _b) {
93 // Check sizes of a few Vec types are all consistent as we're meant to be generic across types
94 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_SignatureZ), "Vec<*> needs to be mapped identically");
95 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_MessageSendEventZ), "Vec<*> needs to be mapped identically");
96 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_EventZ), "Vec<*> needs to be mapped identically");
97 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "Vec<*> needs to be mapped identically");
98 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "Empty LDKCVec");
101 return (uint64_t)vec;
104 // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
105 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
106 _Static_assert(offsetof(LDKCVec_u8Z, data) == offsetof(LDKu8slice, data), "Vec<u8> and [u8] need to have been mapped identically");
107 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), "Vec<u8> and [u8] need to have been mapped identically");
109 _Static_assert(sizeof(jlong) == sizeof(int64_t), "We assume that j-types are the same as C types");
110 _Static_assert(sizeof(jbyte) == sizeof(char), "We assume that j-types are the same as C types");
111 _Static_assert(sizeof(void*) <= 8, "Pointers must fit into 64 bits");
113 typedef jlongArray int64_tArray;
114 typedef jbyteArray int8_tArray;
116 static inline jstring str_ref_to_java(JNIEnv *env, const char* chars, size_t len) {
117 // Sadly we need to create a temporary because Java can't accept a char* without a 0-terminator
118 char* conv_buf = MALLOC(len + 1, "str conv buf");
119 memcpy(conv_buf, chars, len);
121 jstring ret = (*env)->NewStringUTF(env, conv_buf);
125 static inline LDKStr java_to_owned_str(JNIEnv *env, jstring str) {
126 uint64_t str_len = (*env)->GetStringUTFLength(env, str);
127 char* newchars = MALLOC(str_len + 1, "String chars");
128 const char* jchars = (*env)->GetStringUTFChars(env, str, NULL);
129 memcpy(newchars, jchars, str_len);
130 newchars[str_len] = 0;
131 (*env)->ReleaseStringUTFChars(env, str, jchars);
135 .chars_is_owned = true
140 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1version(JNIEnv *env, jclass _c) {
141 return str_ref_to_java(env, check_get_ldk_bindings_version(), strlen(check_get_ldk_bindings_version()));
143 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1version(JNIEnv *env, jclass _c) {
144 return str_ref_to_java(env, check_get_ldk_version(), strlen(check_get_ldk_version()));
147 static jclass arr_of_B_clz = NULL;
148 static jclass arr_of_J_clz = NULL;
149 JNIEXPORT void Java_org_ldk_impl_bindings_init_1class_1cache(JNIEnv * env, jclass clz) {
150 arr_of_B_clz = (*env)->FindClass(env, "[B");
151 CHECK(arr_of_B_clz != NULL);
152 arr_of_B_clz = (*env)->NewGlobalRef(env, arr_of_B_clz);
153 arr_of_J_clz = (*env)->FindClass(env, "[J");
154 CHECK(arr_of_J_clz != NULL);
155 arr_of_J_clz = (*env)->NewGlobalRef(env, arr_of_J_clz);
157 static inline struct LDKThirtyTwoBytes ThirtyTwoBytes_clone(const struct LDKThirtyTwoBytes *orig) { struct LDKThirtyTwoBytes ret; memcpy(ret.data, orig->data, 32); return ret; }
159 static inline void* untag_ptr(uint64_t ptr) {
160 if (ptr < 4096) return (void*)ptr;
161 if (sizeof(void*) == 4) {
162 // For 32-bit systems, store pointers as 64-bit ints and use the 31st bit
163 return (void*)(uintptr_t)ptr;
165 // For 64-bit systems, assume the top byte is used for tagging, then
166 // use bit 9 ^ bit 10.
167 uint64_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
168 uintptr_t p = (ptr & ~(1ULL << 55)) | (tenth_bit << 55);
169 #ifdef LDK_DEBUG_BUILD
170 // On debug builds we also use the 11th bit as a debug flag
171 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
172 CHECK(tenth_bit != eleventh_bit);
178 static inline bool ptr_is_owned(uint64_t ptr) {
179 if(ptr < 4096) return true;
180 if (sizeof(void*) == 4) {
181 return ptr & (1ULL << 32);
183 uintptr_t ninth_bit = (((uintptr_t)ptr) & (1ULL << 55)) >> 55;
184 uintptr_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
185 #ifdef LDK_DEBUG_BUILD
186 // On debug builds we also use the 11th bit as a debug flag
187 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
188 CHECK(tenth_bit != eleventh_bit);
190 return (ninth_bit ^ tenth_bit) ? true : false;
193 static inline uint64_t tag_ptr(const void* ptr, bool is_owned) {
194 if ((uintptr_t)ptr < 4096) return (uint64_t)ptr;
195 if (sizeof(void*) == 4) {
196 return (((uint64_t)ptr) | ((is_owned ? 1ULL : 0) << 32));
198 CHECK(sizeof(uintptr_t) == 8);
199 uintptr_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
200 uintptr_t t = (((uintptr_t)ptr) | (((is_owned ? 1ULL : 0ULL) ^ tenth_bit) << 55));
201 #ifdef LDK_DEBUG_BUILD
202 uintptr_t ninth_bit = (((uintptr_t)ptr) & (1ULL << 55)) >> 55;
203 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
204 CHECK(ninth_bit == tenth_bit);
205 CHECK(ninth_bit == eleventh_bit);
208 CHECK(ptr_is_owned(t) == is_owned);
209 CHECK(untag_ptr(t) == ptr);
214 static inline LDKAccessError LDKAccessError_from_java(JNIEnv *env, jclass clz) {
215 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
216 if (UNLIKELY((*env)->ExceptionCheck(env))) {
217 (*env)->ExceptionDescribe(env);
218 (*env)->FatalError(env, "A call to AccessError.ordinal() from rust threw an exception.");
221 case 0: return LDKAccessError_UnknownChain;
222 case 1: return LDKAccessError_UnknownTx;
224 (*env)->FatalError(env, "A call to AccessError.ordinal() from rust returned an invalid value.");
225 abort(); // Unreachable, but will let the compiler know we don't return here
227 static jclass AccessError_class = NULL;
228 static jfieldID AccessError_LDKAccessError_UnknownChain = NULL;
229 static jfieldID AccessError_LDKAccessError_UnknownTx = NULL;
230 JNIEXPORT void JNICALL Java_org_ldk_enums_AccessError_init (JNIEnv *env, jclass clz) {
231 AccessError_class = (*env)->NewGlobalRef(env, clz);
232 CHECK(AccessError_class != NULL);
233 AccessError_LDKAccessError_UnknownChain = (*env)->GetStaticFieldID(env, AccessError_class, "LDKAccessError_UnknownChain", "Lorg/ldk/enums/AccessError;");
234 CHECK(AccessError_LDKAccessError_UnknownChain != NULL);
235 AccessError_LDKAccessError_UnknownTx = (*env)->GetStaticFieldID(env, AccessError_class, "LDKAccessError_UnknownTx", "Lorg/ldk/enums/AccessError;");
236 CHECK(AccessError_LDKAccessError_UnknownTx != NULL);
238 static inline jclass LDKAccessError_to_java(JNIEnv *env, LDKAccessError val) {
240 case LDKAccessError_UnknownChain:
241 return (*env)->GetStaticObjectField(env, AccessError_class, AccessError_LDKAccessError_UnknownChain);
242 case LDKAccessError_UnknownTx:
243 return (*env)->GetStaticObjectField(env, AccessError_class, AccessError_LDKAccessError_UnknownTx);
248 static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_java(JNIEnv *env, jclass clz) {
249 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
250 if (UNLIKELY((*env)->ExceptionCheck(env))) {
251 (*env)->ExceptionDescribe(env);
252 (*env)->FatalError(env, "A call to COption_NoneZ.ordinal() from rust threw an exception.");
255 case 0: return LDKCOption_NoneZ_Some;
256 case 1: return LDKCOption_NoneZ_None;
258 (*env)->FatalError(env, "A call to COption_NoneZ.ordinal() from rust returned an invalid value.");
259 abort(); // Unreachable, but will let the compiler know we don't return here
261 static jclass COption_NoneZ_class = NULL;
262 static jfieldID COption_NoneZ_LDKCOption_NoneZ_Some = NULL;
263 static jfieldID COption_NoneZ_LDKCOption_NoneZ_None = NULL;
264 JNIEXPORT void JNICALL Java_org_ldk_enums_COption_1NoneZ_init (JNIEnv *env, jclass clz) {
265 COption_NoneZ_class = (*env)->NewGlobalRef(env, clz);
266 CHECK(COption_NoneZ_class != NULL);
267 COption_NoneZ_LDKCOption_NoneZ_Some = (*env)->GetStaticFieldID(env, COption_NoneZ_class, "LDKCOption_NoneZ_Some", "Lorg/ldk/enums/COption_NoneZ;");
268 CHECK(COption_NoneZ_LDKCOption_NoneZ_Some != NULL);
269 COption_NoneZ_LDKCOption_NoneZ_None = (*env)->GetStaticFieldID(env, COption_NoneZ_class, "LDKCOption_NoneZ_None", "Lorg/ldk/enums/COption_NoneZ;");
270 CHECK(COption_NoneZ_LDKCOption_NoneZ_None != NULL);
272 static inline jclass LDKCOption_NoneZ_to_java(JNIEnv *env, LDKCOption_NoneZ val) {
274 case LDKCOption_NoneZ_Some:
275 return (*env)->GetStaticObjectField(env, COption_NoneZ_class, COption_NoneZ_LDKCOption_NoneZ_Some);
276 case LDKCOption_NoneZ_None:
277 return (*env)->GetStaticObjectField(env, COption_NoneZ_class, COption_NoneZ_LDKCOption_NoneZ_None);
282 static inline LDKChannelMonitorUpdateStatus LDKChannelMonitorUpdateStatus_from_java(JNIEnv *env, jclass clz) {
283 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
284 if (UNLIKELY((*env)->ExceptionCheck(env))) {
285 (*env)->ExceptionDescribe(env);
286 (*env)->FatalError(env, "A call to ChannelMonitorUpdateStatus.ordinal() from rust threw an exception.");
289 case 0: return LDKChannelMonitorUpdateStatus_Completed;
290 case 1: return LDKChannelMonitorUpdateStatus_InProgress;
291 case 2: return LDKChannelMonitorUpdateStatus_PermanentFailure;
293 (*env)->FatalError(env, "A call to ChannelMonitorUpdateStatus.ordinal() from rust returned an invalid value.");
294 abort(); // Unreachable, but will let the compiler know we don't return here
296 static jclass ChannelMonitorUpdateStatus_class = NULL;
297 static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed = NULL;
298 static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress = NULL;
299 static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure = NULL;
300 JNIEXPORT void JNICALL Java_org_ldk_enums_ChannelMonitorUpdateStatus_init (JNIEnv *env, jclass clz) {
301 ChannelMonitorUpdateStatus_class = (*env)->NewGlobalRef(env, clz);
302 CHECK(ChannelMonitorUpdateStatus_class != NULL);
303 ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_Completed", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
304 CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed != NULL);
305 ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_InProgress", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
306 CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress != NULL);
307 ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_PermanentFailure", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
308 CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure != NULL);
310 static inline jclass LDKChannelMonitorUpdateStatus_to_java(JNIEnv *env, LDKChannelMonitorUpdateStatus val) {
312 case LDKChannelMonitorUpdateStatus_Completed:
313 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed);
314 case LDKChannelMonitorUpdateStatus_InProgress:
315 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress);
316 case LDKChannelMonitorUpdateStatus_PermanentFailure:
317 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure);
322 static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass clz) {
323 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
324 if (UNLIKELY((*env)->ExceptionCheck(env))) {
325 (*env)->ExceptionDescribe(env);
326 (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust threw an exception.");
329 case 0: return LDKConfirmationTarget_Background;
330 case 1: return LDKConfirmationTarget_Normal;
331 case 2: return LDKConfirmationTarget_HighPriority;
333 (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust returned an invalid value.");
334 abort(); // Unreachable, but will let the compiler know we don't return here
336 static jclass ConfirmationTarget_class = NULL;
337 static jfieldID ConfirmationTarget_LDKConfirmationTarget_Background = NULL;
338 static jfieldID ConfirmationTarget_LDKConfirmationTarget_Normal = NULL;
339 static jfieldID ConfirmationTarget_LDKConfirmationTarget_HighPriority = NULL;
340 JNIEXPORT void JNICALL Java_org_ldk_enums_ConfirmationTarget_init (JNIEnv *env, jclass clz) {
341 ConfirmationTarget_class = (*env)->NewGlobalRef(env, clz);
342 CHECK(ConfirmationTarget_class != NULL);
343 ConfirmationTarget_LDKConfirmationTarget_Background = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_Background", "Lorg/ldk/enums/ConfirmationTarget;");
344 CHECK(ConfirmationTarget_LDKConfirmationTarget_Background != NULL);
345 ConfirmationTarget_LDKConfirmationTarget_Normal = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_Normal", "Lorg/ldk/enums/ConfirmationTarget;");
346 CHECK(ConfirmationTarget_LDKConfirmationTarget_Normal != NULL);
347 ConfirmationTarget_LDKConfirmationTarget_HighPriority = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_HighPriority", "Lorg/ldk/enums/ConfirmationTarget;");
348 CHECK(ConfirmationTarget_LDKConfirmationTarget_HighPriority != NULL);
350 static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) {
352 case LDKConfirmationTarget_Background:
353 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_Background);
354 case LDKConfirmationTarget_Normal:
355 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_Normal);
356 case LDKConfirmationTarget_HighPriority:
357 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_HighPriority);
362 static inline LDKCreationError LDKCreationError_from_java(JNIEnv *env, jclass clz) {
363 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
364 if (UNLIKELY((*env)->ExceptionCheck(env))) {
365 (*env)->ExceptionDescribe(env);
366 (*env)->FatalError(env, "A call to CreationError.ordinal() from rust threw an exception.");
369 case 0: return LDKCreationError_DescriptionTooLong;
370 case 1: return LDKCreationError_RouteTooLong;
371 case 2: return LDKCreationError_TimestampOutOfBounds;
372 case 3: return LDKCreationError_InvalidAmount;
373 case 4: return LDKCreationError_MissingRouteHints;
375 (*env)->FatalError(env, "A call to CreationError.ordinal() from rust returned an invalid value.");
376 abort(); // Unreachable, but will let the compiler know we don't return here
378 static jclass CreationError_class = NULL;
379 static jfieldID CreationError_LDKCreationError_DescriptionTooLong = NULL;
380 static jfieldID CreationError_LDKCreationError_RouteTooLong = NULL;
381 static jfieldID CreationError_LDKCreationError_TimestampOutOfBounds = NULL;
382 static jfieldID CreationError_LDKCreationError_InvalidAmount = NULL;
383 static jfieldID CreationError_LDKCreationError_MissingRouteHints = NULL;
384 JNIEXPORT void JNICALL Java_org_ldk_enums_CreationError_init (JNIEnv *env, jclass clz) {
385 CreationError_class = (*env)->NewGlobalRef(env, clz);
386 CHECK(CreationError_class != NULL);
387 CreationError_LDKCreationError_DescriptionTooLong = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_DescriptionTooLong", "Lorg/ldk/enums/CreationError;");
388 CHECK(CreationError_LDKCreationError_DescriptionTooLong != NULL);
389 CreationError_LDKCreationError_RouteTooLong = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_RouteTooLong", "Lorg/ldk/enums/CreationError;");
390 CHECK(CreationError_LDKCreationError_RouteTooLong != NULL);
391 CreationError_LDKCreationError_TimestampOutOfBounds = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_TimestampOutOfBounds", "Lorg/ldk/enums/CreationError;");
392 CHECK(CreationError_LDKCreationError_TimestampOutOfBounds != NULL);
393 CreationError_LDKCreationError_InvalidAmount = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_InvalidAmount", "Lorg/ldk/enums/CreationError;");
394 CHECK(CreationError_LDKCreationError_InvalidAmount != NULL);
395 CreationError_LDKCreationError_MissingRouteHints = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_MissingRouteHints", "Lorg/ldk/enums/CreationError;");
396 CHECK(CreationError_LDKCreationError_MissingRouteHints != NULL);
398 static inline jclass LDKCreationError_to_java(JNIEnv *env, LDKCreationError val) {
400 case LDKCreationError_DescriptionTooLong:
401 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_DescriptionTooLong);
402 case LDKCreationError_RouteTooLong:
403 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_RouteTooLong);
404 case LDKCreationError_TimestampOutOfBounds:
405 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_TimestampOutOfBounds);
406 case LDKCreationError_InvalidAmount:
407 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_InvalidAmount);
408 case LDKCreationError_MissingRouteHints:
409 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_MissingRouteHints);
414 static inline LDKCurrency LDKCurrency_from_java(JNIEnv *env, jclass clz) {
415 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
416 if (UNLIKELY((*env)->ExceptionCheck(env))) {
417 (*env)->ExceptionDescribe(env);
418 (*env)->FatalError(env, "A call to Currency.ordinal() from rust threw an exception.");
421 case 0: return LDKCurrency_Bitcoin;
422 case 1: return LDKCurrency_BitcoinTestnet;
423 case 2: return LDKCurrency_Regtest;
424 case 3: return LDKCurrency_Simnet;
425 case 4: return LDKCurrency_Signet;
427 (*env)->FatalError(env, "A call to Currency.ordinal() from rust returned an invalid value.");
428 abort(); // Unreachable, but will let the compiler know we don't return here
430 static jclass Currency_class = NULL;
431 static jfieldID Currency_LDKCurrency_Bitcoin = NULL;
432 static jfieldID Currency_LDKCurrency_BitcoinTestnet = NULL;
433 static jfieldID Currency_LDKCurrency_Regtest = NULL;
434 static jfieldID Currency_LDKCurrency_Simnet = NULL;
435 static jfieldID Currency_LDKCurrency_Signet = NULL;
436 JNIEXPORT void JNICALL Java_org_ldk_enums_Currency_init (JNIEnv *env, jclass clz) {
437 Currency_class = (*env)->NewGlobalRef(env, clz);
438 CHECK(Currency_class != NULL);
439 Currency_LDKCurrency_Bitcoin = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Bitcoin", "Lorg/ldk/enums/Currency;");
440 CHECK(Currency_LDKCurrency_Bitcoin != NULL);
441 Currency_LDKCurrency_BitcoinTestnet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_BitcoinTestnet", "Lorg/ldk/enums/Currency;");
442 CHECK(Currency_LDKCurrency_BitcoinTestnet != NULL);
443 Currency_LDKCurrency_Regtest = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Regtest", "Lorg/ldk/enums/Currency;");
444 CHECK(Currency_LDKCurrency_Regtest != NULL);
445 Currency_LDKCurrency_Simnet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Simnet", "Lorg/ldk/enums/Currency;");
446 CHECK(Currency_LDKCurrency_Simnet != NULL);
447 Currency_LDKCurrency_Signet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Signet", "Lorg/ldk/enums/Currency;");
448 CHECK(Currency_LDKCurrency_Signet != NULL);
450 static inline jclass LDKCurrency_to_java(JNIEnv *env, LDKCurrency val) {
452 case LDKCurrency_Bitcoin:
453 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Bitcoin);
454 case LDKCurrency_BitcoinTestnet:
455 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_BitcoinTestnet);
456 case LDKCurrency_Regtest:
457 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Regtest);
458 case LDKCurrency_Simnet:
459 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Simnet);
460 case LDKCurrency_Signet:
461 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Signet);
466 static inline LDKIOError LDKIOError_from_java(JNIEnv *env, jclass clz) {
467 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
468 if (UNLIKELY((*env)->ExceptionCheck(env))) {
469 (*env)->ExceptionDescribe(env);
470 (*env)->FatalError(env, "A call to IOError.ordinal() from rust threw an exception.");
473 case 0: return LDKIOError_NotFound;
474 case 1: return LDKIOError_PermissionDenied;
475 case 2: return LDKIOError_ConnectionRefused;
476 case 3: return LDKIOError_ConnectionReset;
477 case 4: return LDKIOError_ConnectionAborted;
478 case 5: return LDKIOError_NotConnected;
479 case 6: return LDKIOError_AddrInUse;
480 case 7: return LDKIOError_AddrNotAvailable;
481 case 8: return LDKIOError_BrokenPipe;
482 case 9: return LDKIOError_AlreadyExists;
483 case 10: return LDKIOError_WouldBlock;
484 case 11: return LDKIOError_InvalidInput;
485 case 12: return LDKIOError_InvalidData;
486 case 13: return LDKIOError_TimedOut;
487 case 14: return LDKIOError_WriteZero;
488 case 15: return LDKIOError_Interrupted;
489 case 16: return LDKIOError_Other;
490 case 17: return LDKIOError_UnexpectedEof;
492 (*env)->FatalError(env, "A call to IOError.ordinal() from rust returned an invalid value.");
493 abort(); // Unreachable, but will let the compiler know we don't return here
495 static jclass IOError_class = NULL;
496 static jfieldID IOError_LDKIOError_NotFound = NULL;
497 static jfieldID IOError_LDKIOError_PermissionDenied = NULL;
498 static jfieldID IOError_LDKIOError_ConnectionRefused = NULL;
499 static jfieldID IOError_LDKIOError_ConnectionReset = NULL;
500 static jfieldID IOError_LDKIOError_ConnectionAborted = NULL;
501 static jfieldID IOError_LDKIOError_NotConnected = NULL;
502 static jfieldID IOError_LDKIOError_AddrInUse = NULL;
503 static jfieldID IOError_LDKIOError_AddrNotAvailable = NULL;
504 static jfieldID IOError_LDKIOError_BrokenPipe = NULL;
505 static jfieldID IOError_LDKIOError_AlreadyExists = NULL;
506 static jfieldID IOError_LDKIOError_WouldBlock = NULL;
507 static jfieldID IOError_LDKIOError_InvalidInput = NULL;
508 static jfieldID IOError_LDKIOError_InvalidData = NULL;
509 static jfieldID IOError_LDKIOError_TimedOut = NULL;
510 static jfieldID IOError_LDKIOError_WriteZero = NULL;
511 static jfieldID IOError_LDKIOError_Interrupted = NULL;
512 static jfieldID IOError_LDKIOError_Other = NULL;
513 static jfieldID IOError_LDKIOError_UnexpectedEof = NULL;
514 JNIEXPORT void JNICALL Java_org_ldk_enums_IOError_init (JNIEnv *env, jclass clz) {
515 IOError_class = (*env)->NewGlobalRef(env, clz);
516 CHECK(IOError_class != NULL);
517 IOError_LDKIOError_NotFound = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_NotFound", "Lorg/ldk/enums/IOError;");
518 CHECK(IOError_LDKIOError_NotFound != NULL);
519 IOError_LDKIOError_PermissionDenied = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_PermissionDenied", "Lorg/ldk/enums/IOError;");
520 CHECK(IOError_LDKIOError_PermissionDenied != NULL);
521 IOError_LDKIOError_ConnectionRefused = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionRefused", "Lorg/ldk/enums/IOError;");
522 CHECK(IOError_LDKIOError_ConnectionRefused != NULL);
523 IOError_LDKIOError_ConnectionReset = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionReset", "Lorg/ldk/enums/IOError;");
524 CHECK(IOError_LDKIOError_ConnectionReset != NULL);
525 IOError_LDKIOError_ConnectionAborted = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionAborted", "Lorg/ldk/enums/IOError;");
526 CHECK(IOError_LDKIOError_ConnectionAborted != NULL);
527 IOError_LDKIOError_NotConnected = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_NotConnected", "Lorg/ldk/enums/IOError;");
528 CHECK(IOError_LDKIOError_NotConnected != NULL);
529 IOError_LDKIOError_AddrInUse = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AddrInUse", "Lorg/ldk/enums/IOError;");
530 CHECK(IOError_LDKIOError_AddrInUse != NULL);
531 IOError_LDKIOError_AddrNotAvailable = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AddrNotAvailable", "Lorg/ldk/enums/IOError;");
532 CHECK(IOError_LDKIOError_AddrNotAvailable != NULL);
533 IOError_LDKIOError_BrokenPipe = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_BrokenPipe", "Lorg/ldk/enums/IOError;");
534 CHECK(IOError_LDKIOError_BrokenPipe != NULL);
535 IOError_LDKIOError_AlreadyExists = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AlreadyExists", "Lorg/ldk/enums/IOError;");
536 CHECK(IOError_LDKIOError_AlreadyExists != NULL);
537 IOError_LDKIOError_WouldBlock = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_WouldBlock", "Lorg/ldk/enums/IOError;");
538 CHECK(IOError_LDKIOError_WouldBlock != NULL);
539 IOError_LDKIOError_InvalidInput = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_InvalidInput", "Lorg/ldk/enums/IOError;");
540 CHECK(IOError_LDKIOError_InvalidInput != NULL);
541 IOError_LDKIOError_InvalidData = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_InvalidData", "Lorg/ldk/enums/IOError;");
542 CHECK(IOError_LDKIOError_InvalidData != NULL);
543 IOError_LDKIOError_TimedOut = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_TimedOut", "Lorg/ldk/enums/IOError;");
544 CHECK(IOError_LDKIOError_TimedOut != NULL);
545 IOError_LDKIOError_WriteZero = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_WriteZero", "Lorg/ldk/enums/IOError;");
546 CHECK(IOError_LDKIOError_WriteZero != NULL);
547 IOError_LDKIOError_Interrupted = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_Interrupted", "Lorg/ldk/enums/IOError;");
548 CHECK(IOError_LDKIOError_Interrupted != NULL);
549 IOError_LDKIOError_Other = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_Other", "Lorg/ldk/enums/IOError;");
550 CHECK(IOError_LDKIOError_Other != NULL);
551 IOError_LDKIOError_UnexpectedEof = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_UnexpectedEof", "Lorg/ldk/enums/IOError;");
552 CHECK(IOError_LDKIOError_UnexpectedEof != NULL);
554 static inline jclass LDKIOError_to_java(JNIEnv *env, LDKIOError val) {
556 case LDKIOError_NotFound:
557 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_NotFound);
558 case LDKIOError_PermissionDenied:
559 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_PermissionDenied);
560 case LDKIOError_ConnectionRefused:
561 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionRefused);
562 case LDKIOError_ConnectionReset:
563 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionReset);
564 case LDKIOError_ConnectionAborted:
565 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionAborted);
566 case LDKIOError_NotConnected:
567 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_NotConnected);
568 case LDKIOError_AddrInUse:
569 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AddrInUse);
570 case LDKIOError_AddrNotAvailable:
571 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AddrNotAvailable);
572 case LDKIOError_BrokenPipe:
573 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_BrokenPipe);
574 case LDKIOError_AlreadyExists:
575 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AlreadyExists);
576 case LDKIOError_WouldBlock:
577 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_WouldBlock);
578 case LDKIOError_InvalidInput:
579 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_InvalidInput);
580 case LDKIOError_InvalidData:
581 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_InvalidData);
582 case LDKIOError_TimedOut:
583 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_TimedOut);
584 case LDKIOError_WriteZero:
585 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_WriteZero);
586 case LDKIOError_Interrupted:
587 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_Interrupted);
588 case LDKIOError_Other:
589 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_Other);
590 case LDKIOError_UnexpectedEof:
591 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_UnexpectedEof);
596 static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass clz) {
597 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
598 if (UNLIKELY((*env)->ExceptionCheck(env))) {
599 (*env)->ExceptionDescribe(env);
600 (*env)->FatalError(env, "A call to Level.ordinal() from rust threw an exception.");
603 case 0: return LDKLevel_Gossip;
604 case 1: return LDKLevel_Trace;
605 case 2: return LDKLevel_Debug;
606 case 3: return LDKLevel_Info;
607 case 4: return LDKLevel_Warn;
608 case 5: return LDKLevel_Error;
610 (*env)->FatalError(env, "A call to Level.ordinal() from rust returned an invalid value.");
611 abort(); // Unreachable, but will let the compiler know we don't return here
613 static jclass Level_class = NULL;
614 static jfieldID Level_LDKLevel_Gossip = NULL;
615 static jfieldID Level_LDKLevel_Trace = NULL;
616 static jfieldID Level_LDKLevel_Debug = NULL;
617 static jfieldID Level_LDKLevel_Info = NULL;
618 static jfieldID Level_LDKLevel_Warn = NULL;
619 static jfieldID Level_LDKLevel_Error = NULL;
620 JNIEXPORT void JNICALL Java_org_ldk_enums_Level_init (JNIEnv *env, jclass clz) {
621 Level_class = (*env)->NewGlobalRef(env, clz);
622 CHECK(Level_class != NULL);
623 Level_LDKLevel_Gossip = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Gossip", "Lorg/ldk/enums/Level;");
624 CHECK(Level_LDKLevel_Gossip != NULL);
625 Level_LDKLevel_Trace = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Trace", "Lorg/ldk/enums/Level;");
626 CHECK(Level_LDKLevel_Trace != NULL);
627 Level_LDKLevel_Debug = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Debug", "Lorg/ldk/enums/Level;");
628 CHECK(Level_LDKLevel_Debug != NULL);
629 Level_LDKLevel_Info = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Info", "Lorg/ldk/enums/Level;");
630 CHECK(Level_LDKLevel_Info != NULL);
631 Level_LDKLevel_Warn = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Warn", "Lorg/ldk/enums/Level;");
632 CHECK(Level_LDKLevel_Warn != NULL);
633 Level_LDKLevel_Error = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Error", "Lorg/ldk/enums/Level;");
634 CHECK(Level_LDKLevel_Error != NULL);
636 static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
638 case LDKLevel_Gossip:
639 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Gossip);
641 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Trace);
643 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Debug);
645 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Info);
647 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Warn);
649 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Error);
654 static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass clz) {
655 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
656 if (UNLIKELY((*env)->ExceptionCheck(env))) {
657 (*env)->ExceptionDescribe(env);
658 (*env)->FatalError(env, "A call to Network.ordinal() from rust threw an exception.");
661 case 0: return LDKNetwork_Bitcoin;
662 case 1: return LDKNetwork_Testnet;
663 case 2: return LDKNetwork_Regtest;
664 case 3: return LDKNetwork_Signet;
666 (*env)->FatalError(env, "A call to Network.ordinal() from rust returned an invalid value.");
667 abort(); // Unreachable, but will let the compiler know we don't return here
669 static jclass Network_class = NULL;
670 static jfieldID Network_LDKNetwork_Bitcoin = NULL;
671 static jfieldID Network_LDKNetwork_Testnet = NULL;
672 static jfieldID Network_LDKNetwork_Regtest = NULL;
673 static jfieldID Network_LDKNetwork_Signet = NULL;
674 JNIEXPORT void JNICALL Java_org_ldk_enums_Network_init (JNIEnv *env, jclass clz) {
675 Network_class = (*env)->NewGlobalRef(env, clz);
676 CHECK(Network_class != NULL);
677 Network_LDKNetwork_Bitcoin = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Bitcoin", "Lorg/ldk/enums/Network;");
678 CHECK(Network_LDKNetwork_Bitcoin != NULL);
679 Network_LDKNetwork_Testnet = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Testnet", "Lorg/ldk/enums/Network;");
680 CHECK(Network_LDKNetwork_Testnet != NULL);
681 Network_LDKNetwork_Regtest = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Regtest", "Lorg/ldk/enums/Network;");
682 CHECK(Network_LDKNetwork_Regtest != NULL);
683 Network_LDKNetwork_Signet = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Signet", "Lorg/ldk/enums/Network;");
684 CHECK(Network_LDKNetwork_Signet != NULL);
686 static inline jclass LDKNetwork_to_java(JNIEnv *env, LDKNetwork val) {
688 case LDKNetwork_Bitcoin:
689 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Bitcoin);
690 case LDKNetwork_Testnet:
691 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Testnet);
692 case LDKNetwork_Regtest:
693 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Regtest);
694 case LDKNetwork_Signet:
695 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Signet);
700 static inline LDKRecipient LDKRecipient_from_java(JNIEnv *env, jclass clz) {
701 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
702 if (UNLIKELY((*env)->ExceptionCheck(env))) {
703 (*env)->ExceptionDescribe(env);
704 (*env)->FatalError(env, "A call to Recipient.ordinal() from rust threw an exception.");
707 case 0: return LDKRecipient_Node;
708 case 1: return LDKRecipient_PhantomNode;
710 (*env)->FatalError(env, "A call to Recipient.ordinal() from rust returned an invalid value.");
711 abort(); // Unreachable, but will let the compiler know we don't return here
713 static jclass Recipient_class = NULL;
714 static jfieldID Recipient_LDKRecipient_Node = NULL;
715 static jfieldID Recipient_LDKRecipient_PhantomNode = NULL;
716 JNIEXPORT void JNICALL Java_org_ldk_enums_Recipient_init (JNIEnv *env, jclass clz) {
717 Recipient_class = (*env)->NewGlobalRef(env, clz);
718 CHECK(Recipient_class != NULL);
719 Recipient_LDKRecipient_Node = (*env)->GetStaticFieldID(env, Recipient_class, "LDKRecipient_Node", "Lorg/ldk/enums/Recipient;");
720 CHECK(Recipient_LDKRecipient_Node != NULL);
721 Recipient_LDKRecipient_PhantomNode = (*env)->GetStaticFieldID(env, Recipient_class, "LDKRecipient_PhantomNode", "Lorg/ldk/enums/Recipient;");
722 CHECK(Recipient_LDKRecipient_PhantomNode != NULL);
724 static inline jclass LDKRecipient_to_java(JNIEnv *env, LDKRecipient val) {
726 case LDKRecipient_Node:
727 return (*env)->GetStaticObjectField(env, Recipient_class, Recipient_LDKRecipient_Node);
728 case LDKRecipient_PhantomNode:
729 return (*env)->GetStaticObjectField(env, Recipient_class, Recipient_LDKRecipient_PhantomNode);
734 static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass clz) {
735 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
736 if (UNLIKELY((*env)->ExceptionCheck(env))) {
737 (*env)->ExceptionDescribe(env);
738 (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust threw an exception.");
741 case 0: return LDKSecp256k1Error_IncorrectSignature;
742 case 1: return LDKSecp256k1Error_InvalidMessage;
743 case 2: return LDKSecp256k1Error_InvalidPublicKey;
744 case 3: return LDKSecp256k1Error_InvalidSignature;
745 case 4: return LDKSecp256k1Error_InvalidSecretKey;
746 case 5: return LDKSecp256k1Error_InvalidSharedSecret;
747 case 6: return LDKSecp256k1Error_InvalidRecoveryId;
748 case 7: return LDKSecp256k1Error_InvalidTweak;
749 case 8: return LDKSecp256k1Error_NotEnoughMemory;
750 case 9: return LDKSecp256k1Error_InvalidPublicKeySum;
751 case 10: return LDKSecp256k1Error_InvalidParityValue;
753 (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust returned an invalid value.");
754 abort(); // Unreachable, but will let the compiler know we don't return here
756 static jclass Secp256k1Error_class = NULL;
757 static jfieldID Secp256k1Error_LDKSecp256k1Error_IncorrectSignature = NULL;
758 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidMessage = NULL;
759 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey = NULL;
760 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSignature = NULL;
761 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = NULL;
762 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = NULL;
763 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = NULL;
764 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL;
765 static jfieldID Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL;
766 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = NULL;
767 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = NULL;
768 JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jclass clz) {
769 Secp256k1Error_class = (*env)->NewGlobalRef(env, clz);
770 CHECK(Secp256k1Error_class != NULL);
771 Secp256k1Error_LDKSecp256k1Error_IncorrectSignature = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_IncorrectSignature", "Lorg/ldk/enums/Secp256k1Error;");
772 CHECK(Secp256k1Error_LDKSecp256k1Error_IncorrectSignature != NULL);
773 Secp256k1Error_LDKSecp256k1Error_InvalidMessage = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidMessage", "Lorg/ldk/enums/Secp256k1Error;");
774 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidMessage != NULL);
775 Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKey", "Lorg/ldk/enums/Secp256k1Error;");
776 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey != NULL);
777 Secp256k1Error_LDKSecp256k1Error_InvalidSignature = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSignature", "Lorg/ldk/enums/Secp256k1Error;");
778 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSignature != NULL);
779 Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/enums/Secp256k1Error;");
780 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey != NULL);
781 Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSharedSecret", "Lorg/ldk/enums/Secp256k1Error;");
782 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret != NULL);
783 Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/enums/Secp256k1Error;");
784 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId != NULL);
785 Secp256k1Error_LDKSecp256k1Error_InvalidTweak = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/enums/Secp256k1Error;");
786 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidTweak != NULL);
787 Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/enums/Secp256k1Error;");
788 CHECK(Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory != NULL);
789 Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKeySum", "Lorg/ldk/enums/Secp256k1Error;");
790 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum != NULL);
791 Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidParityValue", "Lorg/ldk/enums/Secp256k1Error;");
792 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidParityValue != NULL);
794 static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) {
796 case LDKSecp256k1Error_IncorrectSignature:
797 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_IncorrectSignature);
798 case LDKSecp256k1Error_InvalidMessage:
799 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidMessage);
800 case LDKSecp256k1Error_InvalidPublicKey:
801 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey);
802 case LDKSecp256k1Error_InvalidSignature:
803 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSignature);
804 case LDKSecp256k1Error_InvalidSecretKey:
805 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey);
806 case LDKSecp256k1Error_InvalidSharedSecret:
807 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret);
808 case LDKSecp256k1Error_InvalidRecoveryId:
809 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId);
810 case LDKSecp256k1Error_InvalidTweak:
811 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidTweak);
812 case LDKSecp256k1Error_NotEnoughMemory:
813 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory);
814 case LDKSecp256k1Error_InvalidPublicKeySum:
815 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum);
816 case LDKSecp256k1Error_InvalidParityValue:
817 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidParityValue);
822 static inline LDKSemanticError LDKSemanticError_from_java(JNIEnv *env, jclass clz) {
823 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
824 if (UNLIKELY((*env)->ExceptionCheck(env))) {
825 (*env)->ExceptionDescribe(env);
826 (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust threw an exception.");
829 case 0: return LDKSemanticError_NoPaymentHash;
830 case 1: return LDKSemanticError_MultiplePaymentHashes;
831 case 2: return LDKSemanticError_NoDescription;
832 case 3: return LDKSemanticError_MultipleDescriptions;
833 case 4: return LDKSemanticError_NoPaymentSecret;
834 case 5: return LDKSemanticError_MultiplePaymentSecrets;
835 case 6: return LDKSemanticError_InvalidFeatures;
836 case 7: return LDKSemanticError_InvalidRecoveryId;
837 case 8: return LDKSemanticError_InvalidSignature;
838 case 9: return LDKSemanticError_ImpreciseAmount;
840 (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust returned an invalid value.");
841 abort(); // Unreachable, but will let the compiler know we don't return here
843 static jclass SemanticError_class = NULL;
844 static jfieldID SemanticError_LDKSemanticError_NoPaymentHash = NULL;
845 static jfieldID SemanticError_LDKSemanticError_MultiplePaymentHashes = NULL;
846 static jfieldID SemanticError_LDKSemanticError_NoDescription = NULL;
847 static jfieldID SemanticError_LDKSemanticError_MultipleDescriptions = NULL;
848 static jfieldID SemanticError_LDKSemanticError_NoPaymentSecret = NULL;
849 static jfieldID SemanticError_LDKSemanticError_MultiplePaymentSecrets = NULL;
850 static jfieldID SemanticError_LDKSemanticError_InvalidFeatures = NULL;
851 static jfieldID SemanticError_LDKSemanticError_InvalidRecoveryId = NULL;
852 static jfieldID SemanticError_LDKSemanticError_InvalidSignature = NULL;
853 static jfieldID SemanticError_LDKSemanticError_ImpreciseAmount = NULL;
854 JNIEXPORT void JNICALL Java_org_ldk_enums_SemanticError_init (JNIEnv *env, jclass clz) {
855 SemanticError_class = (*env)->NewGlobalRef(env, clz);
856 CHECK(SemanticError_class != NULL);
857 SemanticError_LDKSemanticError_NoPaymentHash = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoPaymentHash", "Lorg/ldk/enums/SemanticError;");
858 CHECK(SemanticError_LDKSemanticError_NoPaymentHash != NULL);
859 SemanticError_LDKSemanticError_MultiplePaymentHashes = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultiplePaymentHashes", "Lorg/ldk/enums/SemanticError;");
860 CHECK(SemanticError_LDKSemanticError_MultiplePaymentHashes != NULL);
861 SemanticError_LDKSemanticError_NoDescription = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoDescription", "Lorg/ldk/enums/SemanticError;");
862 CHECK(SemanticError_LDKSemanticError_NoDescription != NULL);
863 SemanticError_LDKSemanticError_MultipleDescriptions = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultipleDescriptions", "Lorg/ldk/enums/SemanticError;");
864 CHECK(SemanticError_LDKSemanticError_MultipleDescriptions != NULL);
865 SemanticError_LDKSemanticError_NoPaymentSecret = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoPaymentSecret", "Lorg/ldk/enums/SemanticError;");
866 CHECK(SemanticError_LDKSemanticError_NoPaymentSecret != NULL);
867 SemanticError_LDKSemanticError_MultiplePaymentSecrets = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultiplePaymentSecrets", "Lorg/ldk/enums/SemanticError;");
868 CHECK(SemanticError_LDKSemanticError_MultiplePaymentSecrets != NULL);
869 SemanticError_LDKSemanticError_InvalidFeatures = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidFeatures", "Lorg/ldk/enums/SemanticError;");
870 CHECK(SemanticError_LDKSemanticError_InvalidFeatures != NULL);
871 SemanticError_LDKSemanticError_InvalidRecoveryId = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidRecoveryId", "Lorg/ldk/enums/SemanticError;");
872 CHECK(SemanticError_LDKSemanticError_InvalidRecoveryId != NULL);
873 SemanticError_LDKSemanticError_InvalidSignature = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidSignature", "Lorg/ldk/enums/SemanticError;");
874 CHECK(SemanticError_LDKSemanticError_InvalidSignature != NULL);
875 SemanticError_LDKSemanticError_ImpreciseAmount = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_ImpreciseAmount", "Lorg/ldk/enums/SemanticError;");
876 CHECK(SemanticError_LDKSemanticError_ImpreciseAmount != NULL);
878 static inline jclass LDKSemanticError_to_java(JNIEnv *env, LDKSemanticError val) {
880 case LDKSemanticError_NoPaymentHash:
881 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoPaymentHash);
882 case LDKSemanticError_MultiplePaymentHashes:
883 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultiplePaymentHashes);
884 case LDKSemanticError_NoDescription:
885 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoDescription);
886 case LDKSemanticError_MultipleDescriptions:
887 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultipleDescriptions);
888 case LDKSemanticError_NoPaymentSecret:
889 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoPaymentSecret);
890 case LDKSemanticError_MultiplePaymentSecrets:
891 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultiplePaymentSecrets);
892 case LDKSemanticError_InvalidFeatures:
893 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidFeatures);
894 case LDKSemanticError_InvalidRecoveryId:
895 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidRecoveryId);
896 case LDKSemanticError_InvalidSignature:
897 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidSignature);
898 case LDKSemanticError_ImpreciseAmount:
899 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_ImpreciseAmount);
904 static inline LDKSiPrefix LDKSiPrefix_from_java(JNIEnv *env, jclass clz) {
905 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
906 if (UNLIKELY((*env)->ExceptionCheck(env))) {
907 (*env)->ExceptionDescribe(env);
908 (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust threw an exception.");
911 case 0: return LDKSiPrefix_Milli;
912 case 1: return LDKSiPrefix_Micro;
913 case 2: return LDKSiPrefix_Nano;
914 case 3: return LDKSiPrefix_Pico;
916 (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust returned an invalid value.");
917 abort(); // Unreachable, but will let the compiler know we don't return here
919 static jclass SiPrefix_class = NULL;
920 static jfieldID SiPrefix_LDKSiPrefix_Milli = NULL;
921 static jfieldID SiPrefix_LDKSiPrefix_Micro = NULL;
922 static jfieldID SiPrefix_LDKSiPrefix_Nano = NULL;
923 static jfieldID SiPrefix_LDKSiPrefix_Pico = NULL;
924 JNIEXPORT void JNICALL Java_org_ldk_enums_SiPrefix_init (JNIEnv *env, jclass clz) {
925 SiPrefix_class = (*env)->NewGlobalRef(env, clz);
926 CHECK(SiPrefix_class != NULL);
927 SiPrefix_LDKSiPrefix_Milli = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Milli", "Lorg/ldk/enums/SiPrefix;");
928 CHECK(SiPrefix_LDKSiPrefix_Milli != NULL);
929 SiPrefix_LDKSiPrefix_Micro = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Micro", "Lorg/ldk/enums/SiPrefix;");
930 CHECK(SiPrefix_LDKSiPrefix_Micro != NULL);
931 SiPrefix_LDKSiPrefix_Nano = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Nano", "Lorg/ldk/enums/SiPrefix;");
932 CHECK(SiPrefix_LDKSiPrefix_Nano != NULL);
933 SiPrefix_LDKSiPrefix_Pico = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Pico", "Lorg/ldk/enums/SiPrefix;");
934 CHECK(SiPrefix_LDKSiPrefix_Pico != NULL);
936 static inline jclass LDKSiPrefix_to_java(JNIEnv *env, LDKSiPrefix val) {
938 case LDKSiPrefix_Milli:
939 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Milli);
940 case LDKSiPrefix_Micro:
941 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Micro);
942 case LDKSiPrefix_Nano:
943 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Nano);
944 case LDKSiPrefix_Pico:
945 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Pico);
950 struct LDKThirtyTwoBytes BigEndianScalar_get_bytes (struct LDKBigEndianScalar* thing) {
951 LDKThirtyTwoBytes ret = { .data = *thing->big_endian_bytes };
954 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1get_1bytes(JNIEnv *env, jclass clz, int64_t thing) {
955 LDKBigEndianScalar* thing_conv = (LDKBigEndianScalar*)untag_ptr(thing);
956 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
957 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BigEndianScalar_get_bytes(thing_conv).data);
961 static void BigEndianScalar_free (struct LDKBigEndianScalar thing) {}
962 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1free(JNIEnv *env, jclass clz, int64_t thing) {
963 if (!ptr_is_owned(thing)) return;
964 void* thing_ptr = untag_ptr(thing);
965 CHECK_ACCESS(thing_ptr);
966 LDKBigEndianScalar thing_conv = *(LDKBigEndianScalar*)(thing_ptr);
967 FREE(untag_ptr(thing));
968 BigEndianScalar_free(thing_conv);
971 static jclass LDKBech32Error_MissingSeparator_class = NULL;
972 static jmethodID LDKBech32Error_MissingSeparator_meth = NULL;
973 static jclass LDKBech32Error_InvalidChecksum_class = NULL;
974 static jmethodID LDKBech32Error_InvalidChecksum_meth = NULL;
975 static jclass LDKBech32Error_InvalidLength_class = NULL;
976 static jmethodID LDKBech32Error_InvalidLength_meth = NULL;
977 static jclass LDKBech32Error_InvalidChar_class = NULL;
978 static jmethodID LDKBech32Error_InvalidChar_meth = NULL;
979 static jclass LDKBech32Error_InvalidData_class = NULL;
980 static jmethodID LDKBech32Error_InvalidData_meth = NULL;
981 static jclass LDKBech32Error_InvalidPadding_class = NULL;
982 static jmethodID LDKBech32Error_InvalidPadding_meth = NULL;
983 static jclass LDKBech32Error_MixedCase_class = NULL;
984 static jmethodID LDKBech32Error_MixedCase_meth = NULL;
985 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBech32Error_init (JNIEnv *env, jclass clz) {
986 LDKBech32Error_MissingSeparator_class =
987 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$MissingSeparator"));
988 CHECK(LDKBech32Error_MissingSeparator_class != NULL);
989 LDKBech32Error_MissingSeparator_meth = (*env)->GetMethodID(env, LDKBech32Error_MissingSeparator_class, "<init>", "()V");
990 CHECK(LDKBech32Error_MissingSeparator_meth != NULL);
991 LDKBech32Error_InvalidChecksum_class =
992 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidChecksum"));
993 CHECK(LDKBech32Error_InvalidChecksum_class != NULL);
994 LDKBech32Error_InvalidChecksum_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidChecksum_class, "<init>", "()V");
995 CHECK(LDKBech32Error_InvalidChecksum_meth != NULL);
996 LDKBech32Error_InvalidLength_class =
997 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidLength"));
998 CHECK(LDKBech32Error_InvalidLength_class != NULL);
999 LDKBech32Error_InvalidLength_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidLength_class, "<init>", "()V");
1000 CHECK(LDKBech32Error_InvalidLength_meth != NULL);
1001 LDKBech32Error_InvalidChar_class =
1002 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidChar"));
1003 CHECK(LDKBech32Error_InvalidChar_class != NULL);
1004 LDKBech32Error_InvalidChar_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidChar_class, "<init>", "(I)V");
1005 CHECK(LDKBech32Error_InvalidChar_meth != NULL);
1006 LDKBech32Error_InvalidData_class =
1007 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidData"));
1008 CHECK(LDKBech32Error_InvalidData_class != NULL);
1009 LDKBech32Error_InvalidData_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidData_class, "<init>", "(B)V");
1010 CHECK(LDKBech32Error_InvalidData_meth != NULL);
1011 LDKBech32Error_InvalidPadding_class =
1012 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidPadding"));
1013 CHECK(LDKBech32Error_InvalidPadding_class != NULL);
1014 LDKBech32Error_InvalidPadding_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidPadding_class, "<init>", "()V");
1015 CHECK(LDKBech32Error_InvalidPadding_meth != NULL);
1016 LDKBech32Error_MixedCase_class =
1017 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$MixedCase"));
1018 CHECK(LDKBech32Error_MixedCase_class != NULL);
1019 LDKBech32Error_MixedCase_meth = (*env)->GetMethodID(env, LDKBech32Error_MixedCase_class, "<init>", "()V");
1020 CHECK(LDKBech32Error_MixedCase_meth != NULL);
1022 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBech32Error_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1023 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
1025 case LDKBech32Error_MissingSeparator: {
1026 return (*env)->NewObject(env, LDKBech32Error_MissingSeparator_class, LDKBech32Error_MissingSeparator_meth);
1028 case LDKBech32Error_InvalidChecksum: {
1029 return (*env)->NewObject(env, LDKBech32Error_InvalidChecksum_class, LDKBech32Error_InvalidChecksum_meth);
1031 case LDKBech32Error_InvalidLength: {
1032 return (*env)->NewObject(env, LDKBech32Error_InvalidLength_class, LDKBech32Error_InvalidLength_meth);
1034 case LDKBech32Error_InvalidChar: {
1035 int32_t invalid_char_conv = obj->invalid_char;
1036 return (*env)->NewObject(env, LDKBech32Error_InvalidChar_class, LDKBech32Error_InvalidChar_meth, invalid_char_conv);
1038 case LDKBech32Error_InvalidData: {
1039 int8_t invalid_data_conv = obj->invalid_data;
1040 return (*env)->NewObject(env, LDKBech32Error_InvalidData_class, LDKBech32Error_InvalidData_meth, invalid_data_conv);
1042 case LDKBech32Error_InvalidPadding: {
1043 return (*env)->NewObject(env, LDKBech32Error_InvalidPadding_class, LDKBech32Error_InvalidPadding_meth);
1045 case LDKBech32Error_MixedCase: {
1046 return (*env)->NewObject(env, LDKBech32Error_MixedCase_class, LDKBech32Error_MixedCase_meth);
1051 static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
1052 LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen };
1053 memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
1056 struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) { return CVec_u8Z_clone(&thing->script_pubkey);}JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t thing) {
1057 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
1058 LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
1059 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
1060 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
1061 CVec_u8Z_free(ret_var);
1065 uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1value(JNIEnv *env, jclass clz, int64_t thing) {
1066 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
1067 int64_t ret_conv = TxOut_get_value(thing_conv);
1071 static inline struct LDKBlindedRoute CResult_BlindedRouteNoneZ_get_ok(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner){
1072 LDKBlindedRoute ret = *owner->contents.result;
1073 ret.is_owned = false;
1076 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1077 LDKCResult_BlindedRouteNoneZ* owner_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(owner);
1078 LDKBlindedRoute ret_var = CResult_BlindedRouteNoneZ_get_ok(owner_conv);
1079 int64_t ret_ref = 0;
1080 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1081 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1085 static inline void CResult_BlindedRouteNoneZ_get_err(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner){
1086 CHECK(!owner->result_ok);
1087 return *owner->contents.err;
1089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1090 LDKCResult_BlindedRouteNoneZ* owner_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(owner);
1091 CResult_BlindedRouteNoneZ_get_err(owner_conv);
1094 static jclass LDKDecodeError_UnknownVersion_class = NULL;
1095 static jmethodID LDKDecodeError_UnknownVersion_meth = NULL;
1096 static jclass LDKDecodeError_UnknownRequiredFeature_class = NULL;
1097 static jmethodID LDKDecodeError_UnknownRequiredFeature_meth = NULL;
1098 static jclass LDKDecodeError_InvalidValue_class = NULL;
1099 static jmethodID LDKDecodeError_InvalidValue_meth = NULL;
1100 static jclass LDKDecodeError_ShortRead_class = NULL;
1101 static jmethodID LDKDecodeError_ShortRead_meth = NULL;
1102 static jclass LDKDecodeError_BadLengthDescriptor_class = NULL;
1103 static jmethodID LDKDecodeError_BadLengthDescriptor_meth = NULL;
1104 static jclass LDKDecodeError_Io_class = NULL;
1105 static jmethodID LDKDecodeError_Io_meth = NULL;
1106 static jclass LDKDecodeError_UnsupportedCompression_class = NULL;
1107 static jmethodID LDKDecodeError_UnsupportedCompression_meth = NULL;
1108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDecodeError_init (JNIEnv *env, jclass clz) {
1109 LDKDecodeError_UnknownVersion_class =
1110 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnknownVersion"));
1111 CHECK(LDKDecodeError_UnknownVersion_class != NULL);
1112 LDKDecodeError_UnknownVersion_meth = (*env)->GetMethodID(env, LDKDecodeError_UnknownVersion_class, "<init>", "()V");
1113 CHECK(LDKDecodeError_UnknownVersion_meth != NULL);
1114 LDKDecodeError_UnknownRequiredFeature_class =
1115 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnknownRequiredFeature"));
1116 CHECK(LDKDecodeError_UnknownRequiredFeature_class != NULL);
1117 LDKDecodeError_UnknownRequiredFeature_meth = (*env)->GetMethodID(env, LDKDecodeError_UnknownRequiredFeature_class, "<init>", "()V");
1118 CHECK(LDKDecodeError_UnknownRequiredFeature_meth != NULL);
1119 LDKDecodeError_InvalidValue_class =
1120 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$InvalidValue"));
1121 CHECK(LDKDecodeError_InvalidValue_class != NULL);
1122 LDKDecodeError_InvalidValue_meth = (*env)->GetMethodID(env, LDKDecodeError_InvalidValue_class, "<init>", "()V");
1123 CHECK(LDKDecodeError_InvalidValue_meth != NULL);
1124 LDKDecodeError_ShortRead_class =
1125 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$ShortRead"));
1126 CHECK(LDKDecodeError_ShortRead_class != NULL);
1127 LDKDecodeError_ShortRead_meth = (*env)->GetMethodID(env, LDKDecodeError_ShortRead_class, "<init>", "()V");
1128 CHECK(LDKDecodeError_ShortRead_meth != NULL);
1129 LDKDecodeError_BadLengthDescriptor_class =
1130 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$BadLengthDescriptor"));
1131 CHECK(LDKDecodeError_BadLengthDescriptor_class != NULL);
1132 LDKDecodeError_BadLengthDescriptor_meth = (*env)->GetMethodID(env, LDKDecodeError_BadLengthDescriptor_class, "<init>", "()V");
1133 CHECK(LDKDecodeError_BadLengthDescriptor_meth != NULL);
1134 LDKDecodeError_Io_class =
1135 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$Io"));
1136 CHECK(LDKDecodeError_Io_class != NULL);
1137 LDKDecodeError_Io_meth = (*env)->GetMethodID(env, LDKDecodeError_Io_class, "<init>", "(Lorg/ldk/enums/IOError;)V");
1138 CHECK(LDKDecodeError_Io_meth != NULL);
1139 LDKDecodeError_UnsupportedCompression_class =
1140 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnsupportedCompression"));
1141 CHECK(LDKDecodeError_UnsupportedCompression_class != NULL);
1142 LDKDecodeError_UnsupportedCompression_meth = (*env)->GetMethodID(env, LDKDecodeError_UnsupportedCompression_class, "<init>", "()V");
1143 CHECK(LDKDecodeError_UnsupportedCompression_meth != NULL);
1145 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1146 LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr);
1148 case LDKDecodeError_UnknownVersion: {
1149 return (*env)->NewObject(env, LDKDecodeError_UnknownVersion_class, LDKDecodeError_UnknownVersion_meth);
1151 case LDKDecodeError_UnknownRequiredFeature: {
1152 return (*env)->NewObject(env, LDKDecodeError_UnknownRequiredFeature_class, LDKDecodeError_UnknownRequiredFeature_meth);
1154 case LDKDecodeError_InvalidValue: {
1155 return (*env)->NewObject(env, LDKDecodeError_InvalidValue_class, LDKDecodeError_InvalidValue_meth);
1157 case LDKDecodeError_ShortRead: {
1158 return (*env)->NewObject(env, LDKDecodeError_ShortRead_class, LDKDecodeError_ShortRead_meth);
1160 case LDKDecodeError_BadLengthDescriptor: {
1161 return (*env)->NewObject(env, LDKDecodeError_BadLengthDescriptor_class, LDKDecodeError_BadLengthDescriptor_meth);
1163 case LDKDecodeError_Io: {
1164 jclass io_conv = LDKIOError_to_java(env, obj->io);
1165 return (*env)->NewObject(env, LDKDecodeError_Io_class, LDKDecodeError_Io_meth, io_conv);
1167 case LDKDecodeError_UnsupportedCompression: {
1168 return (*env)->NewObject(env, LDKDecodeError_UnsupportedCompression_class, LDKDecodeError_UnsupportedCompression_meth);
1173 static inline struct LDKBlindedRoute CResult_BlindedRouteDecodeErrorZ_get_ok(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){
1174 LDKBlindedRoute ret = *owner->contents.result;
1175 ret.is_owned = false;
1178 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1179 LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner);
1180 LDKBlindedRoute ret_var = CResult_BlindedRouteDecodeErrorZ_get_ok(owner_conv);
1181 int64_t ret_ref = 0;
1182 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1183 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1187 static inline struct LDKDecodeError CResult_BlindedRouteDecodeErrorZ_get_err(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){
1188 CHECK(!owner->result_ok);
1189 return DecodeError_clone(&*owner->contents.err);
1191 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1192 LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner);
1193 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1194 *ret_copy = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv);
1195 int64_t ret_ref = tag_ptr(ret_copy, true);
1199 static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
1200 LDKBlindedHop ret = *owner->contents.result;
1201 ret.is_owned = false;
1204 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1205 LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
1206 LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv);
1207 int64_t ret_ref = 0;
1208 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1209 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1213 static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
1214 CHECK(!owner->result_ok);
1215 return DecodeError_clone(&*owner->contents.err);
1217 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1218 LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
1219 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1220 *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv);
1221 int64_t ret_ref = tag_ptr(ret_copy, true);
1225 static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
1226 CHECK(owner->result_ok);
1227 return *owner->contents.result;
1229 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1230 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
1231 CResult_NoneNoneZ_get_ok(owner_conv);
1234 static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
1235 CHECK(!owner->result_ok);
1236 return *owner->contents.err;
1238 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1239 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
1240 CResult_NoneNoneZ_get_err(owner_conv);
1243 static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
1244 LDKCounterpartyCommitmentSecrets ret = *owner->contents.result;
1245 ret.is_owned = false;
1248 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1249 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
1250 LDKCounterpartyCommitmentSecrets ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(owner_conv);
1251 int64_t ret_ref = 0;
1252 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1253 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1257 static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
1258 CHECK(!owner->result_ok);
1259 return DecodeError_clone(&*owner->contents.err);
1261 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1262 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
1263 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1264 *ret_copy = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
1265 int64_t ret_ref = tag_ptr(ret_copy, true);
1269 static inline struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
1270 CHECK(owner->result_ok);
1271 return *owner->contents.result;
1273 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1274 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
1275 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
1276 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes);
1280 static inline enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
1281 CHECK(!owner->result_ok);
1282 return *owner->contents.err;
1284 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1285 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
1286 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_SecretKeyErrorZ_get_err(owner_conv));
1290 static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
1291 CHECK(owner->result_ok);
1292 return *owner->contents.result;
1294 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1295 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
1296 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
1297 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form);
1301 static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
1302 CHECK(!owner->result_ok);
1303 return *owner->contents.err;
1305 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1306 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
1307 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PublicKeyErrorZ_get_err(owner_conv));
1311 static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
1312 LDKTxCreationKeys ret = *owner->contents.result;
1313 ret.is_owned = false;
1316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1317 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
1318 LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv);
1319 int64_t ret_ref = 0;
1320 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1321 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1325 static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
1326 CHECK(!owner->result_ok);
1327 return DecodeError_clone(&*owner->contents.err);
1329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1330 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
1331 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1332 *ret_copy = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
1333 int64_t ret_ref = tag_ptr(ret_copy, true);
1337 static inline struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
1338 LDKChannelPublicKeys ret = *owner->contents.result;
1339 ret.is_owned = false;
1342 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1343 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
1344 LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv);
1345 int64_t ret_ref = 0;
1346 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1347 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1351 static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
1352 CHECK(!owner->result_ok);
1353 return DecodeError_clone(&*owner->contents.err);
1355 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1356 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
1357 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1358 *ret_copy = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
1359 int64_t ret_ref = tag_ptr(ret_copy, true);
1363 static inline struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
1364 LDKTxCreationKeys ret = *owner->contents.result;
1365 ret.is_owned = false;
1368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1369 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
1370 LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv);
1371 int64_t ret_ref = 0;
1372 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1373 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1377 static inline enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
1378 CHECK(!owner->result_ok);
1379 return *owner->contents.err;
1381 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1382 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
1383 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_TxCreationKeysErrorZ_get_err(owner_conv));
1387 static jclass LDKCOption_u32Z_Some_class = NULL;
1388 static jmethodID LDKCOption_u32Z_Some_meth = NULL;
1389 static jclass LDKCOption_u32Z_None_class = NULL;
1390 static jmethodID LDKCOption_u32Z_None_meth = NULL;
1391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u32Z_init (JNIEnv *env, jclass clz) {
1392 LDKCOption_u32Z_Some_class =
1393 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$Some"));
1394 CHECK(LDKCOption_u32Z_Some_class != NULL);
1395 LDKCOption_u32Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_Some_class, "<init>", "(I)V");
1396 CHECK(LDKCOption_u32Z_Some_meth != NULL);
1397 LDKCOption_u32Z_None_class =
1398 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$None"));
1399 CHECK(LDKCOption_u32Z_None_class != NULL);
1400 LDKCOption_u32Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_None_class, "<init>", "()V");
1401 CHECK(LDKCOption_u32Z_None_meth != NULL);
1403 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1404 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
1406 case LDKCOption_u32Z_Some: {
1407 int32_t some_conv = obj->some;
1408 return (*env)->NewObject(env, LDKCOption_u32Z_Some_class, LDKCOption_u32Z_Some_meth, some_conv);
1410 case LDKCOption_u32Z_None: {
1411 return (*env)->NewObject(env, LDKCOption_u32Z_None_class, LDKCOption_u32Z_None_meth);
1416 static inline struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
1417 LDKHTLCOutputInCommitment ret = *owner->contents.result;
1418 ret.is_owned = false;
1421 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1422 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
1423 LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv);
1424 int64_t ret_ref = 0;
1425 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1426 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1430 static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
1431 CHECK(!owner->result_ok);
1432 return DecodeError_clone(&*owner->contents.err);
1434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1435 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
1436 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1437 *ret_copy = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
1438 int64_t ret_ref = tag_ptr(ret_copy, true);
1442 static inline struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1443 LDKCounterpartyChannelTransactionParameters ret = *owner->contents.result;
1444 ret.is_owned = false;
1447 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1448 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1449 LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
1450 int64_t ret_ref = 0;
1451 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1452 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1456 static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1457 CHECK(!owner->result_ok);
1458 return DecodeError_clone(&*owner->contents.err);
1460 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1461 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1462 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1463 *ret_copy = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
1464 int64_t ret_ref = tag_ptr(ret_copy, true);
1468 static inline struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1469 LDKChannelTransactionParameters ret = *owner->contents.result;
1470 ret.is_owned = false;
1473 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1474 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1475 LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
1476 int64_t ret_ref = 0;
1477 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1478 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1482 static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1483 CHECK(!owner->result_ok);
1484 return DecodeError_clone(&*owner->contents.err);
1486 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1487 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1488 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1489 *ret_copy = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
1490 int64_t ret_ref = tag_ptr(ret_copy, true);
1494 static inline struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1495 LDKHolderCommitmentTransaction ret = *owner->contents.result;
1496 ret.is_owned = false;
1499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1500 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1501 LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
1502 int64_t ret_ref = 0;
1503 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1504 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1508 static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1509 CHECK(!owner->result_ok);
1510 return DecodeError_clone(&*owner->contents.err);
1512 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1513 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1514 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1515 *ret_copy = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1516 int64_t ret_ref = tag_ptr(ret_copy, true);
1520 static inline struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1521 LDKBuiltCommitmentTransaction ret = *owner->contents.result;
1522 ret.is_owned = false;
1525 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1526 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1527 LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
1528 int64_t ret_ref = 0;
1529 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1530 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1534 static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1535 CHECK(!owner->result_ok);
1536 return DecodeError_clone(&*owner->contents.err);
1538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1539 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1540 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1541 *ret_copy = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1542 int64_t ret_ref = tag_ptr(ret_copy, true);
1546 static inline struct LDKTrustedClosingTransaction CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
1547 LDKTrustedClosingTransaction ret = *owner->contents.result;
1548 ret.is_owned = false;
1551 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1552 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
1553 LDKTrustedClosingTransaction ret_var = CResult_TrustedClosingTransactionNoneZ_get_ok(owner_conv);
1554 int64_t ret_ref = 0;
1555 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1556 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1560 static inline void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
1561 CHECK(!owner->result_ok);
1562 return *owner->contents.err;
1564 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1565 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
1566 CResult_TrustedClosingTransactionNoneZ_get_err(owner_conv);
1569 static inline struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1570 LDKCommitmentTransaction ret = *owner->contents.result;
1571 ret.is_owned = false;
1574 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1575 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1576 LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
1577 int64_t ret_ref = 0;
1578 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1579 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1583 static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1584 CHECK(!owner->result_ok);
1585 return DecodeError_clone(&*owner->contents.err);
1587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1588 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1589 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1590 *ret_copy = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1591 int64_t ret_ref = tag_ptr(ret_copy, true);
1595 static inline struct LDKTrustedCommitmentTransaction CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
1596 LDKTrustedCommitmentTransaction ret = *owner->contents.result;
1597 ret.is_owned = false;
1600 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1601 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
1602 LDKTrustedCommitmentTransaction ret_var = CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv);
1603 int64_t ret_ref = 0;
1604 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1605 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1609 static inline void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
1610 CHECK(!owner->result_ok);
1611 return *owner->contents.err;
1613 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1614 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
1615 CResult_TrustedCommitmentTransactionNoneZ_get_err(owner_conv);
1618 static inline struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
1619 CHECK(owner->result_ok);
1620 return *owner->contents.result;
1622 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1623 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
1624 LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv);
1625 jobjectArray ret_arr = NULL;
1626 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
1628 for (size_t i = 0; i < ret_var.datalen; i++) {
1629 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
1630 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
1631 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
1637 static inline void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
1638 CHECK(!owner->result_ok);
1639 return *owner->contents.err;
1641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1642 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
1643 CResult_CVec_SignatureZNoneZ_get_err(owner_conv);
1646 static inline struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1647 LDKShutdownScript ret = *owner->contents.result;
1648 ret.is_owned = false;
1651 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1652 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1653 LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv);
1654 int64_t ret_ref = 0;
1655 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1656 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1660 static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1661 CHECK(!owner->result_ok);
1662 return DecodeError_clone(&*owner->contents.err);
1664 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1665 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1666 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1667 *ret_copy = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
1668 int64_t ret_ref = tag_ptr(ret_copy, true);
1672 static inline struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1673 LDKShutdownScript ret = *owner->contents.result;
1674 ret.is_owned = false;
1677 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1678 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1679 LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv);
1680 int64_t ret_ref = 0;
1681 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1682 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1686 static inline struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1687 LDKInvalidShutdownScript ret = *owner->contents.err;
1688 ret.is_owned = false;
1691 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1692 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1693 LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv);
1694 int64_t ret_ref = 0;
1695 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1696 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1700 static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) {
1701 LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen };
1702 for (size_t i = 0; i < ret.datalen; i++) {
1703 ret.data[i] = RouteHop_clone(&orig->data[i]);
1707 typedef struct LDKScore_JCalls {
1708 atomic_size_t refcnt;
1711 jmethodID channel_penalty_msat_meth;
1712 jmethodID payment_path_failed_meth;
1713 jmethodID payment_path_successful_meth;
1714 jmethodID probe_failed_meth;
1715 jmethodID probe_successful_meth;
1716 jmethodID write_meth;
1718 static void LDKScore_JCalls_free(void* this_arg) {
1719 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1720 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1722 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1723 if (get_jenv_res == JNI_EDETACHED) {
1724 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1726 DO_ASSERT(get_jenv_res == JNI_OK);
1728 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
1729 if (get_jenv_res == JNI_EDETACHED) {
1730 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1735 uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) {
1736 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1738 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1739 if (get_jenv_res == JNI_EDETACHED) {
1740 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1742 DO_ASSERT(get_jenv_res == JNI_OK);
1744 int64_t short_channel_id_conv = short_channel_id;
1745 LDKNodeId source_var = *source;
1746 int64_t source_ref = 0;
1747 source_var = NodeId_clone(&source_var);
1748 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var);
1749 source_ref = tag_ptr(source_var.inner, source_var.is_owned);
1750 LDKNodeId target_var = *target;
1751 int64_t target_ref = 0;
1752 target_var = NodeId_clone(&target_var);
1753 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var);
1754 target_ref = tag_ptr(target_var.inner, target_var.is_owned);
1755 LDKChannelUsage usage_var = usage;
1756 int64_t usage_ref = 0;
1757 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var);
1758 usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned);
1759 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
1761 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id_conv, source_ref, target_ref, usage_ref);
1762 if (UNLIKELY((*env)->ExceptionCheck(env))) {
1763 (*env)->ExceptionDescribe(env);
1764 (*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception.");
1766 if (get_jenv_res == JNI_EDETACHED) {
1767 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1771 void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
1772 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1774 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1775 if (get_jenv_res == JNI_EDETACHED) {
1776 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1778 DO_ASSERT(get_jenv_res == JNI_OK);
1780 LDKCVec_RouteHopZ path_var = path;
1781 int64_tArray path_arr = NULL;
1782 path_arr = (*env)->NewLongArray(env, path_var.datalen);
1783 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
1784 for (size_t k = 0; k < path_var.datalen; k++) {
1785 LDKRouteHop path_conv_10_var = path_var.data[k];
1786 int64_t path_conv_10_ref = 0;
1787 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1788 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
1789 path_arr_ptr[k] = path_conv_10_ref;
1791 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
1792 FREE(path_var.data);
1793 int64_t short_channel_id_conv = short_channel_id;
1794 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
1796 (*env)->CallVoidMethod(env, obj, j_calls->payment_path_failed_meth, path_arr, short_channel_id_conv);
1797 if (UNLIKELY((*env)->ExceptionCheck(env))) {
1798 (*env)->ExceptionDescribe(env);
1799 (*env)->FatalError(env, "A call to payment_path_failed in LDKScore from rust threw an exception.");
1801 if (get_jenv_res == JNI_EDETACHED) {
1802 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1805 void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
1806 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1808 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1809 if (get_jenv_res == JNI_EDETACHED) {
1810 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1812 DO_ASSERT(get_jenv_res == JNI_OK);
1814 LDKCVec_RouteHopZ path_var = path;
1815 int64_tArray path_arr = NULL;
1816 path_arr = (*env)->NewLongArray(env, path_var.datalen);
1817 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
1818 for (size_t k = 0; k < path_var.datalen; k++) {
1819 LDKRouteHop path_conv_10_var = path_var.data[k];
1820 int64_t path_conv_10_ref = 0;
1821 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1822 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
1823 path_arr_ptr[k] = path_conv_10_ref;
1825 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
1826 FREE(path_var.data);
1827 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
1829 (*env)->CallVoidMethod(env, obj, j_calls->payment_path_successful_meth, path_arr);
1830 if (UNLIKELY((*env)->ExceptionCheck(env))) {
1831 (*env)->ExceptionDescribe(env);
1832 (*env)->FatalError(env, "A call to payment_path_successful in LDKScore from rust threw an exception.");
1834 if (get_jenv_res == JNI_EDETACHED) {
1835 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1838 void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
1839 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1841 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1842 if (get_jenv_res == JNI_EDETACHED) {
1843 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1845 DO_ASSERT(get_jenv_res == JNI_OK);
1847 LDKCVec_RouteHopZ path_var = path;
1848 int64_tArray path_arr = NULL;
1849 path_arr = (*env)->NewLongArray(env, path_var.datalen);
1850 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
1851 for (size_t k = 0; k < path_var.datalen; k++) {
1852 LDKRouteHop path_conv_10_var = path_var.data[k];
1853 int64_t path_conv_10_ref = 0;
1854 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1855 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
1856 path_arr_ptr[k] = path_conv_10_ref;
1858 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
1859 FREE(path_var.data);
1860 int64_t short_channel_id_conv = short_channel_id;
1861 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
1863 (*env)->CallVoidMethod(env, obj, j_calls->probe_failed_meth, path_arr, short_channel_id_conv);
1864 if (UNLIKELY((*env)->ExceptionCheck(env))) {
1865 (*env)->ExceptionDescribe(env);
1866 (*env)->FatalError(env, "A call to probe_failed in LDKScore from rust threw an exception.");
1868 if (get_jenv_res == JNI_EDETACHED) {
1869 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1872 void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
1873 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1875 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1876 if (get_jenv_res == JNI_EDETACHED) {
1877 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1879 DO_ASSERT(get_jenv_res == JNI_OK);
1881 LDKCVec_RouteHopZ path_var = path;
1882 int64_tArray path_arr = NULL;
1883 path_arr = (*env)->NewLongArray(env, path_var.datalen);
1884 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
1885 for (size_t k = 0; k < path_var.datalen; k++) {
1886 LDKRouteHop path_conv_10_var = path_var.data[k];
1887 int64_t path_conv_10_ref = 0;
1888 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1889 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
1890 path_arr_ptr[k] = path_conv_10_ref;
1892 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
1893 FREE(path_var.data);
1894 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
1896 (*env)->CallVoidMethod(env, obj, j_calls->probe_successful_meth, path_arr);
1897 if (UNLIKELY((*env)->ExceptionCheck(env))) {
1898 (*env)->ExceptionDescribe(env);
1899 (*env)->FatalError(env, "A call to probe_successful in LDKScore from rust threw an exception.");
1901 if (get_jenv_res == JNI_EDETACHED) {
1902 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1905 LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
1906 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1908 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1909 if (get_jenv_res == JNI_EDETACHED) {
1910 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1912 DO_ASSERT(get_jenv_res == JNI_OK);
1914 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
1916 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
1917 if (UNLIKELY((*env)->ExceptionCheck(env))) {
1918 (*env)->ExceptionDescribe(env);
1919 (*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception.");
1921 LDKCVec_u8Z ret_ref;
1922 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
1923 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
1924 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
1925 if (get_jenv_res == JNI_EDETACHED) {
1926 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1930 static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
1931 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
1932 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1934 static inline LDKScore LDKScore_init (JNIEnv *env, jclass clz, jobject o) {
1935 jclass c = (*env)->GetObjectClass(env, o);
1937 LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls");
1938 atomic_init(&calls->refcnt, 1);
1939 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1940 calls->o = (*env)->NewWeakGlobalRef(env, o);
1941 calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJJ)J");
1942 CHECK(calls->channel_penalty_msat_meth != NULL);
1943 calls->payment_path_failed_meth = (*env)->GetMethodID(env, c, "payment_path_failed", "([JJ)V");
1944 CHECK(calls->payment_path_failed_meth != NULL);
1945 calls->payment_path_successful_meth = (*env)->GetMethodID(env, c, "payment_path_successful", "([J)V");
1946 CHECK(calls->payment_path_successful_meth != NULL);
1947 calls->probe_failed_meth = (*env)->GetMethodID(env, c, "probe_failed", "([JJ)V");
1948 CHECK(calls->probe_failed_meth != NULL);
1949 calls->probe_successful_meth = (*env)->GetMethodID(env, c, "probe_successful", "([J)V");
1950 CHECK(calls->probe_successful_meth != NULL);
1951 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
1952 CHECK(calls->write_meth != NULL);
1955 .this_arg = (void*) calls,
1956 .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
1957 .payment_path_failed = payment_path_failed_LDKScore_jcall,
1958 .payment_path_successful = payment_path_successful_LDKScore_jcall,
1959 .probe_failed = probe_failed_LDKScore_jcall,
1960 .probe_successful = probe_successful_LDKScore_jcall,
1961 .write = write_LDKScore_jcall,
1962 .free = LDKScore_JCalls_free,
1966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKScore_1new(JNIEnv *env, jclass clz, jobject o) {
1967 LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore");
1968 *res_ptr = LDKScore_init(env, clz, o);
1969 return tag_ptr(res_ptr, true);
1971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t source, int64_t target, int64_t usage) {
1972 void* this_arg_ptr = untag_ptr(this_arg);
1973 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
1974 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
1975 LDKNodeId source_conv;
1976 source_conv.inner = untag_ptr(source);
1977 source_conv.is_owned = ptr_is_owned(source);
1978 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
1979 source_conv.is_owned = false;
1980 LDKNodeId target_conv;
1981 target_conv.inner = untag_ptr(target);
1982 target_conv.is_owned = ptr_is_owned(target);
1983 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
1984 target_conv.is_owned = false;
1985 LDKChannelUsage usage_conv;
1986 usage_conv.inner = untag_ptr(usage);
1987 usage_conv.is_owned = ptr_is_owned(usage);
1988 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv);
1989 usage_conv = ChannelUsage_clone(&usage_conv);
1990 int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv);
1994 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path, int64_t short_channel_id) {
1995 void* this_arg_ptr = untag_ptr(this_arg);
1996 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
1997 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
1998 LDKCVec_RouteHopZ path_constr;
1999 path_constr.datalen = (*env)->GetArrayLength(env, path);
2000 if (path_constr.datalen > 0)
2001 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
2003 path_constr.data = NULL;
2004 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
2005 for (size_t k = 0; k < path_constr.datalen; k++) {
2006 int64_t path_conv_10 = path_vals[k];
2007 LDKRouteHop path_conv_10_conv;
2008 path_conv_10_conv.inner = untag_ptr(path_conv_10);
2009 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
2010 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
2011 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
2012 path_constr.data[k] = path_conv_10_conv;
2014 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
2015 (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
2018 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) {
2019 void* this_arg_ptr = untag_ptr(this_arg);
2020 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2021 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2022 LDKCVec_RouteHopZ path_constr;
2023 path_constr.datalen = (*env)->GetArrayLength(env, path);
2024 if (path_constr.datalen > 0)
2025 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
2027 path_constr.data = NULL;
2028 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
2029 for (size_t k = 0; k < path_constr.datalen; k++) {
2030 int64_t path_conv_10 = path_vals[k];
2031 LDKRouteHop path_conv_10_conv;
2032 path_conv_10_conv.inner = untag_ptr(path_conv_10);
2033 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
2034 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
2035 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
2036 path_constr.data[k] = path_conv_10_conv;
2038 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
2039 (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
2042 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1probe_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path, int64_t short_channel_id) {
2043 void* this_arg_ptr = untag_ptr(this_arg);
2044 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2045 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2046 LDKCVec_RouteHopZ path_constr;
2047 path_constr.datalen = (*env)->GetArrayLength(env, path);
2048 if (path_constr.datalen > 0)
2049 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
2051 path_constr.data = NULL;
2052 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
2053 for (size_t k = 0; k < path_constr.datalen; k++) {
2054 int64_t path_conv_10 = path_vals[k];
2055 LDKRouteHop path_conv_10_conv;
2056 path_conv_10_conv.inner = untag_ptr(path_conv_10);
2057 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
2058 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
2059 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
2060 path_constr.data[k] = path_conv_10_conv;
2062 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
2063 (this_arg_conv->probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
2066 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1probe_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) {
2067 void* this_arg_ptr = untag_ptr(this_arg);
2068 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2069 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2070 LDKCVec_RouteHopZ path_constr;
2071 path_constr.datalen = (*env)->GetArrayLength(env, path);
2072 if (path_constr.datalen > 0)
2073 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
2075 path_constr.data = NULL;
2076 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
2077 for (size_t k = 0; k < path_constr.datalen; k++) {
2078 int64_t path_conv_10 = path_vals[k];
2079 LDKRouteHop path_conv_10_conv;
2080 path_conv_10_conv.inner = untag_ptr(path_conv_10);
2081 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
2082 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
2083 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
2084 path_constr.data[k] = path_conv_10_conv;
2086 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
2087 (this_arg_conv->probe_successful)(this_arg_conv->this_arg, path_constr);
2090 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Score_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
2091 void* this_arg_ptr = untag_ptr(this_arg);
2092 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2093 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2094 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
2095 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
2096 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
2097 CVec_u8Z_free(ret_var);
2101 typedef struct LDKLockableScore_JCalls {
2102 atomic_size_t refcnt;
2105 jmethodID lock_meth;
2106 } LDKLockableScore_JCalls;
2107 static void LDKLockableScore_JCalls_free(void* this_arg) {
2108 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
2109 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2111 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2112 if (get_jenv_res == JNI_EDETACHED) {
2113 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2115 DO_ASSERT(get_jenv_res == JNI_OK);
2117 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
2118 if (get_jenv_res == JNI_EDETACHED) {
2119 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2124 LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
2125 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
2127 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2128 if (get_jenv_res == JNI_EDETACHED) {
2129 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2131 DO_ASSERT(get_jenv_res == JNI_OK);
2133 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2135 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->lock_meth);
2136 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2137 (*env)->ExceptionDescribe(env);
2138 (*env)->FatalError(env, "A call to lock in LDKLockableScore from rust threw an exception.");
2140 void* ret_ptr = untag_ptr(ret);
2141 CHECK_ACCESS(ret_ptr);
2142 LDKScore ret_conv = *(LDKScore*)(ret_ptr);
2143 if (ret_conv.free == LDKScore_JCalls_free) {
2144 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2145 LDKScore_JCalls_cloned(&ret_conv);
2146 }// WARNING: we may need a move here but no clone is available for LDKScore
2148 if (get_jenv_res == JNI_EDETACHED) {
2149 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2153 static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
2154 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
2155 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2157 static inline LDKLockableScore LDKLockableScore_init (JNIEnv *env, jclass clz, jobject o) {
2158 jclass c = (*env)->GetObjectClass(env, o);
2160 LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
2161 atomic_init(&calls->refcnt, 1);
2162 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2163 calls->o = (*env)->NewWeakGlobalRef(env, o);
2164 calls->lock_meth = (*env)->GetMethodID(env, c, "lock", "()J");
2165 CHECK(calls->lock_meth != NULL);
2167 LDKLockableScore ret = {
2168 .this_arg = (void*) calls,
2169 .lock = lock_LDKLockableScore_jcall,
2170 .free = LDKLockableScore_JCalls_free,
2174 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLockableScore_1new(JNIEnv *env, jclass clz, jobject o) {
2175 LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
2176 *res_ptr = LDKLockableScore_init(env, clz, o);
2177 return tag_ptr(res_ptr, true);
2179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1lock(JNIEnv *env, jclass clz, int64_t this_arg) {
2180 void* this_arg_ptr = untag_ptr(this_arg);
2181 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2182 LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
2183 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
2184 *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
2185 return tag_ptr(ret_ret, true);
2188 typedef struct LDKWriteableScore_JCalls {
2189 atomic_size_t refcnt;
2192 LDKLockableScore_JCalls* LockableScore;
2193 jmethodID write_meth;
2194 } LDKWriteableScore_JCalls;
2195 static void LDKWriteableScore_JCalls_free(void* this_arg) {
2196 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
2197 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2199 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2200 if (get_jenv_res == JNI_EDETACHED) {
2201 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2203 DO_ASSERT(get_jenv_res == JNI_OK);
2205 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
2206 if (get_jenv_res == JNI_EDETACHED) {
2207 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2212 LDKCVec_u8Z write_LDKWriteableScore_jcall(const void* this_arg) {
2213 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
2215 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2216 if (get_jenv_res == JNI_EDETACHED) {
2217 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2219 DO_ASSERT(get_jenv_res == JNI_OK);
2221 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2223 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
2224 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2225 (*env)->ExceptionDescribe(env);
2226 (*env)->FatalError(env, "A call to write in LDKWriteableScore from rust threw an exception.");
2228 LDKCVec_u8Z ret_ref;
2229 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
2230 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
2231 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
2232 if (get_jenv_res == JNI_EDETACHED) {
2233 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2237 static void LDKWriteableScore_JCalls_cloned(LDKWriteableScore* new_obj) {
2238 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) new_obj->this_arg;
2239 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2240 atomic_fetch_add_explicit(&j_calls->LockableScore->refcnt, 1, memory_order_release);
2242 static inline LDKWriteableScore LDKWriteableScore_init (JNIEnv *env, jclass clz, jobject o, jobject LockableScore) {
2243 jclass c = (*env)->GetObjectClass(env, o);
2245 LDKWriteableScore_JCalls *calls = MALLOC(sizeof(LDKWriteableScore_JCalls), "LDKWriteableScore_JCalls");
2246 atomic_init(&calls->refcnt, 1);
2247 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2248 calls->o = (*env)->NewWeakGlobalRef(env, o);
2249 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
2250 CHECK(calls->write_meth != NULL);
2252 LDKWriteableScore ret = {
2253 .this_arg = (void*) calls,
2254 .write = write_LDKWriteableScore_jcall,
2255 .free = LDKWriteableScore_JCalls_free,
2256 .LockableScore = LDKLockableScore_init(env, clz, LockableScore),
2258 calls->LockableScore = ret.LockableScore.this_arg;
2261 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableScore_1new(JNIEnv *env, jclass clz, jobject o, jobject LockableScore) {
2262 LDKWriteableScore *res_ptr = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
2263 *res_ptr = LDKWriteableScore_init(env, clz, o, LockableScore);
2264 return tag_ptr(res_ptr, true);
2266 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableScore_1get_1LockableScore(JNIEnv *env, jclass clz, int64_t arg) {
2267 LDKWriteableScore *inp = (LDKWriteableScore *)untag_ptr(arg);
2268 return tag_ptr(&inp->LockableScore, false);
2270 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WriteableScore_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
2271 void* this_arg_ptr = untag_ptr(this_arg);
2272 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2273 LDKWriteableScore* this_arg_conv = (LDKWriteableScore*)this_arg_ptr;
2274 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
2275 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
2276 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
2277 CVec_u8Z_free(ret_var);
2281 static jclass LDKCOption_WriteableScoreZ_Some_class = NULL;
2282 static jmethodID LDKCOption_WriteableScoreZ_Some_meth = NULL;
2283 static jclass LDKCOption_WriteableScoreZ_None_class = NULL;
2284 static jmethodID LDKCOption_WriteableScoreZ_None_meth = NULL;
2285 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1WriteableScoreZ_init (JNIEnv *env, jclass clz) {
2286 LDKCOption_WriteableScoreZ_Some_class =
2287 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_WriteableScoreZ$Some"));
2288 CHECK(LDKCOption_WriteableScoreZ_Some_class != NULL);
2289 LDKCOption_WriteableScoreZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_WriteableScoreZ_Some_class, "<init>", "(J)V");
2290 CHECK(LDKCOption_WriteableScoreZ_Some_meth != NULL);
2291 LDKCOption_WriteableScoreZ_None_class =
2292 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_WriteableScoreZ$None"));
2293 CHECK(LDKCOption_WriteableScoreZ_None_class != NULL);
2294 LDKCOption_WriteableScoreZ_None_meth = (*env)->GetMethodID(env, LDKCOption_WriteableScoreZ_None_class, "<init>", "()V");
2295 CHECK(LDKCOption_WriteableScoreZ_None_meth != NULL);
2297 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1WriteableScoreZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2298 LDKCOption_WriteableScoreZ *obj = (LDKCOption_WriteableScoreZ*)untag_ptr(ptr);
2300 case LDKCOption_WriteableScoreZ_Some: {
2301 LDKWriteableScore* some_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
2302 *some_ret = obj->some;
2303 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
2304 if ((*some_ret).free == LDKWriteableScore_JCalls_free) {
2305 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2306 LDKWriteableScore_JCalls_cloned(&(*some_ret));
2308 return (*env)->NewObject(env, LDKCOption_WriteableScoreZ_Some_class, LDKCOption_WriteableScoreZ_Some_meth, tag_ptr(some_ret, true));
2310 case LDKCOption_WriteableScoreZ_None: {
2311 return (*env)->NewObject(env, LDKCOption_WriteableScoreZ_None_class, LDKCOption_WriteableScoreZ_None_meth);
2316 static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
2317 CHECK(owner->result_ok);
2318 return *owner->contents.result;
2320 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2321 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
2322 CResult_NoneErrorZ_get_ok(owner_conv);
2325 static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
2326 CHECK(!owner->result_ok);
2327 return *owner->contents.err;
2329 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2330 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
2331 jclass ret_conv = LDKIOError_to_java(env, CResult_NoneErrorZ_get_err(owner_conv));
2335 static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
2336 LDKRouteHop ret = *owner->contents.result;
2337 ret.is_owned = false;
2340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2341 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
2342 LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
2343 int64_t ret_ref = 0;
2344 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2345 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2349 static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
2350 CHECK(!owner->result_ok);
2351 return DecodeError_clone(&*owner->contents.err);
2353 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2354 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
2355 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2356 *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
2357 int64_t ret_ref = tag_ptr(ret_copy, true);
2361 static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) {
2362 LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen };
2363 for (size_t i = 0; i < ret.datalen; i++) {
2364 ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]);
2368 static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
2369 LDKRoute ret = *owner->contents.result;
2370 ret.is_owned = false;
2373 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2374 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
2375 LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv);
2376 int64_t ret_ref = 0;
2377 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2378 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2382 static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
2383 CHECK(!owner->result_ok);
2384 return DecodeError_clone(&*owner->contents.err);
2386 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2387 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
2388 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2389 *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv);
2390 int64_t ret_ref = tag_ptr(ret_copy, true);
2394 static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
2395 LDKRouteParameters ret = *owner->contents.result;
2396 ret.is_owned = false;
2399 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2400 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
2401 LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv);
2402 int64_t ret_ref = 0;
2403 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2404 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2408 static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
2409 CHECK(!owner->result_ok);
2410 return DecodeError_clone(&*owner->contents.err);
2412 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2413 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
2414 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2415 *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
2416 int64_t ret_ref = tag_ptr(ret_copy, true);
2420 static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
2421 LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
2422 for (size_t i = 0; i < ret.datalen; i++) {
2423 ret.data[i] = RouteHint_clone(&orig->data[i]);
2427 static jclass LDKCOption_u64Z_Some_class = NULL;
2428 static jmethodID LDKCOption_u64Z_Some_meth = NULL;
2429 static jclass LDKCOption_u64Z_None_class = NULL;
2430 static jmethodID LDKCOption_u64Z_None_meth = NULL;
2431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u64Z_init (JNIEnv *env, jclass clz) {
2432 LDKCOption_u64Z_Some_class =
2433 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$Some"));
2434 CHECK(LDKCOption_u64Z_Some_class != NULL);
2435 LDKCOption_u64Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_Some_class, "<init>", "(J)V");
2436 CHECK(LDKCOption_u64Z_Some_meth != NULL);
2437 LDKCOption_u64Z_None_class =
2438 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$None"));
2439 CHECK(LDKCOption_u64Z_None_class != NULL);
2440 LDKCOption_u64Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_None_class, "<init>", "()V");
2441 CHECK(LDKCOption_u64Z_None_meth != NULL);
2443 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2444 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
2446 case LDKCOption_u64Z_Some: {
2447 int64_t some_conv = obj->some;
2448 return (*env)->NewObject(env, LDKCOption_u64Z_Some_class, LDKCOption_u64Z_Some_meth, some_conv);
2450 case LDKCOption_u64Z_None: {
2451 return (*env)->NewObject(env, LDKCOption_u64Z_None_class, LDKCOption_u64Z_None_meth);
2456 static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
2457 LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
2458 memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
2461 static inline struct LDKPaymentParameters CResult_PaymentParametersDecodeErrorZ_get_ok(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
2462 LDKPaymentParameters ret = *owner->contents.result;
2463 ret.is_owned = false;
2466 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2467 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
2468 LDKPaymentParameters ret_var = CResult_PaymentParametersDecodeErrorZ_get_ok(owner_conv);
2469 int64_t ret_ref = 0;
2470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2471 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2475 static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
2476 CHECK(!owner->result_ok);
2477 return DecodeError_clone(&*owner->contents.err);
2479 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2480 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
2481 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2482 *ret_copy = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
2483 int64_t ret_ref = tag_ptr(ret_copy, true);
2487 static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
2488 LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
2489 for (size_t i = 0; i < ret.datalen; i++) {
2490 ret.data[i] = RouteHintHop_clone(&orig->data[i]);
2494 static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
2495 LDKRouteHint ret = *owner->contents.result;
2496 ret.is_owned = false;
2499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2500 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
2501 LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv);
2502 int64_t ret_ref = 0;
2503 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2504 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2508 static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
2509 CHECK(!owner->result_ok);
2510 return DecodeError_clone(&*owner->contents.err);
2512 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2513 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
2514 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2515 *ret_copy = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
2516 int64_t ret_ref = tag_ptr(ret_copy, true);
2520 static inline struct LDKRouteHintHop CResult_RouteHintHopDecodeErrorZ_get_ok(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
2521 LDKRouteHintHop ret = *owner->contents.result;
2522 ret.is_owned = false;
2525 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2526 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
2527 LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv);
2528 int64_t ret_ref = 0;
2529 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2530 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2534 static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
2535 CHECK(!owner->result_ok);
2536 return DecodeError_clone(&*owner->contents.err);
2538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2539 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
2540 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2541 *ret_copy = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
2542 int64_t ret_ref = tag_ptr(ret_copy, true);
2546 static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
2547 LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
2548 for (size_t i = 0; i < ret.datalen; i++) {
2549 ret.data[i] = ChannelDetails_clone(&orig->data[i]);
2553 static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
2554 LDKRoute ret = *owner->contents.result;
2555 ret.is_owned = false;
2558 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2559 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
2560 LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
2561 int64_t ret_ref = 0;
2562 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2563 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2567 static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
2568 LDKLightningError ret = *owner->contents.err;
2569 ret.is_owned = false;
2572 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2573 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
2574 LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
2575 int64_t ret_ref = 0;
2576 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2577 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2581 static jclass LDKPaymentPurpose_InvoicePayment_class = NULL;
2582 static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL;
2583 static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL;
2584 static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL;
2585 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) {
2586 LDKPaymentPurpose_InvoicePayment_class =
2587 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment"));
2588 CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL);
2589 LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[B)V");
2590 CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL);
2591 LDKPaymentPurpose_SpontaneousPayment_class =
2592 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment"));
2593 CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL);
2594 LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "<init>", "([B)V");
2595 CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL);
2597 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2598 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
2600 case LDKPaymentPurpose_InvoicePayment: {
2601 int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
2602 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data);
2603 int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
2604 (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data);
2605 return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr);
2607 case LDKPaymentPurpose_SpontaneousPayment: {
2608 int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32);
2609 (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data);
2610 return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr);
2615 static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
2616 CHECK(owner->result_ok);
2617 return PaymentPurpose_clone(&*owner->contents.result);
2619 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2620 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
2621 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
2622 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv);
2623 int64_t ret_ref = tag_ptr(ret_copy, true);
2627 static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
2628 CHECK(!owner->result_ok);
2629 return DecodeError_clone(&*owner->contents.err);
2631 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2632 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
2633 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2634 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
2635 int64_t ret_ref = tag_ptr(ret_copy, true);
2639 static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL;
2640 static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL;
2641 static jclass LDKClosureReason_HolderForceClosed_class = NULL;
2642 static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL;
2643 static jclass LDKClosureReason_CooperativeClosure_class = NULL;
2644 static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL;
2645 static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL;
2646 static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL;
2647 static jclass LDKClosureReason_FundingTimedOut_class = NULL;
2648 static jmethodID LDKClosureReason_FundingTimedOut_meth = NULL;
2649 static jclass LDKClosureReason_ProcessingError_class = NULL;
2650 static jmethodID LDKClosureReason_ProcessingError_meth = NULL;
2651 static jclass LDKClosureReason_DisconnectedPeer_class = NULL;
2652 static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL;
2653 static jclass LDKClosureReason_OutdatedChannelManager_class = NULL;
2654 static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL;
2655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) {
2656 LDKClosureReason_CounterpartyForceClosed_class =
2657 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed"));
2658 CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL);
2659 LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "<init>", "(Ljava/lang/String;)V");
2660 CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL);
2661 LDKClosureReason_HolderForceClosed_class =
2662 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$HolderForceClosed"));
2663 CHECK(LDKClosureReason_HolderForceClosed_class != NULL);
2664 LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "<init>", "()V");
2665 CHECK(LDKClosureReason_HolderForceClosed_meth != NULL);
2666 LDKClosureReason_CooperativeClosure_class =
2667 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CooperativeClosure"));
2668 CHECK(LDKClosureReason_CooperativeClosure_class != NULL);
2669 LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "<init>", "()V");
2670 CHECK(LDKClosureReason_CooperativeClosure_meth != NULL);
2671 LDKClosureReason_CommitmentTxConfirmed_class =
2672 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed"));
2673 CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL);
2674 LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "<init>", "()V");
2675 CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL);
2676 LDKClosureReason_FundingTimedOut_class =
2677 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$FundingTimedOut"));
2678 CHECK(LDKClosureReason_FundingTimedOut_class != NULL);
2679 LDKClosureReason_FundingTimedOut_meth = (*env)->GetMethodID(env, LDKClosureReason_FundingTimedOut_class, "<init>", "()V");
2680 CHECK(LDKClosureReason_FundingTimedOut_meth != NULL);
2681 LDKClosureReason_ProcessingError_class =
2682 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$ProcessingError"));
2683 CHECK(LDKClosureReason_ProcessingError_class != NULL);
2684 LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "<init>", "(Ljava/lang/String;)V");
2685 CHECK(LDKClosureReason_ProcessingError_meth != NULL);
2686 LDKClosureReason_DisconnectedPeer_class =
2687 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer"));
2688 CHECK(LDKClosureReason_DisconnectedPeer_class != NULL);
2689 LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "<init>", "()V");
2690 CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL);
2691 LDKClosureReason_OutdatedChannelManager_class =
2692 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager"));
2693 CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL);
2694 LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "<init>", "()V");
2695 CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL);
2697 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2698 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
2700 case LDKClosureReason_CounterpartyForceClosed: {
2701 LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg;
2702 jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len);
2703 return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv);
2705 case LDKClosureReason_HolderForceClosed: {
2706 return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth);
2708 case LDKClosureReason_CooperativeClosure: {
2709 return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth);
2711 case LDKClosureReason_CommitmentTxConfirmed: {
2712 return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth);
2714 case LDKClosureReason_FundingTimedOut: {
2715 return (*env)->NewObject(env, LDKClosureReason_FundingTimedOut_class, LDKClosureReason_FundingTimedOut_meth);
2717 case LDKClosureReason_ProcessingError: {
2718 LDKStr err_str = obj->processing_error.err;
2719 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
2720 return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv);
2722 case LDKClosureReason_DisconnectedPeer: {
2723 return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth);
2725 case LDKClosureReason_OutdatedChannelManager: {
2726 return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth);
2731 static jclass LDKCOption_ClosureReasonZ_Some_class = NULL;
2732 static jmethodID LDKCOption_ClosureReasonZ_Some_meth = NULL;
2733 static jclass LDKCOption_ClosureReasonZ_None_class = NULL;
2734 static jmethodID LDKCOption_ClosureReasonZ_None_meth = NULL;
2735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init (JNIEnv *env, jclass clz) {
2736 LDKCOption_ClosureReasonZ_Some_class =
2737 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some"));
2738 CHECK(LDKCOption_ClosureReasonZ_Some_class != NULL);
2739 LDKCOption_ClosureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_Some_class, "<init>", "(J)V");
2740 CHECK(LDKCOption_ClosureReasonZ_Some_meth != NULL);
2741 LDKCOption_ClosureReasonZ_None_class =
2742 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None"));
2743 CHECK(LDKCOption_ClosureReasonZ_None_class != NULL);
2744 LDKCOption_ClosureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_None_class, "<init>", "()V");
2745 CHECK(LDKCOption_ClosureReasonZ_None_meth != NULL);
2747 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ClosureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2748 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
2750 case LDKCOption_ClosureReasonZ_Some: {
2751 int64_t some_ref = tag_ptr(&obj->some, false);
2752 return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_Some_class, LDKCOption_ClosureReasonZ_Some_meth, some_ref);
2754 case LDKCOption_ClosureReasonZ_None: {
2755 return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_None_class, LDKCOption_ClosureReasonZ_None_meth);
2760 static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
2761 CHECK(owner->result_ok);
2762 return COption_ClosureReasonZ_clone(&*owner->contents.result);
2764 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2765 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
2766 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
2767 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv);
2768 int64_t ret_ref = tag_ptr(ret_copy, true);
2772 static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
2773 CHECK(!owner->result_ok);
2774 return DecodeError_clone(&*owner->contents.err);
2776 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2777 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
2778 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2779 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
2780 int64_t ret_ref = tag_ptr(ret_copy, true);
2784 static jclass LDKHTLCDestination_NextHopChannel_class = NULL;
2785 static jmethodID LDKHTLCDestination_NextHopChannel_meth = NULL;
2786 static jclass LDKHTLCDestination_UnknownNextHop_class = NULL;
2787 static jmethodID LDKHTLCDestination_UnknownNextHop_meth = NULL;
2788 static jclass LDKHTLCDestination_FailedPayment_class = NULL;
2789 static jmethodID LDKHTLCDestination_FailedPayment_meth = NULL;
2790 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCDestination_init (JNIEnv *env, jclass clz) {
2791 LDKHTLCDestination_NextHopChannel_class =
2792 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$NextHopChannel"));
2793 CHECK(LDKHTLCDestination_NextHopChannel_class != NULL);
2794 LDKHTLCDestination_NextHopChannel_meth = (*env)->GetMethodID(env, LDKHTLCDestination_NextHopChannel_class, "<init>", "([B[B)V");
2795 CHECK(LDKHTLCDestination_NextHopChannel_meth != NULL);
2796 LDKHTLCDestination_UnknownNextHop_class =
2797 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$UnknownNextHop"));
2798 CHECK(LDKHTLCDestination_UnknownNextHop_class != NULL);
2799 LDKHTLCDestination_UnknownNextHop_meth = (*env)->GetMethodID(env, LDKHTLCDestination_UnknownNextHop_class, "<init>", "(J)V");
2800 CHECK(LDKHTLCDestination_UnknownNextHop_meth != NULL);
2801 LDKHTLCDestination_FailedPayment_class =
2802 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$FailedPayment"));
2803 CHECK(LDKHTLCDestination_FailedPayment_class != NULL);
2804 LDKHTLCDestination_FailedPayment_meth = (*env)->GetMethodID(env, LDKHTLCDestination_FailedPayment_class, "<init>", "([B)V");
2805 CHECK(LDKHTLCDestination_FailedPayment_meth != NULL);
2807 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2808 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
2810 case LDKHTLCDestination_NextHopChannel: {
2811 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2812 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->next_hop_channel.node_id.compressed_form);
2813 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
2814 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->next_hop_channel.channel_id.data);
2815 return (*env)->NewObject(env, LDKHTLCDestination_NextHopChannel_class, LDKHTLCDestination_NextHopChannel_meth, node_id_arr, channel_id_arr);
2817 case LDKHTLCDestination_UnknownNextHop: {
2818 int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid;
2819 return (*env)->NewObject(env, LDKHTLCDestination_UnknownNextHop_class, LDKHTLCDestination_UnknownNextHop_meth, requested_forward_scid_conv);
2821 case LDKHTLCDestination_FailedPayment: {
2822 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
2823 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->failed_payment.payment_hash.data);
2824 return (*env)->NewObject(env, LDKHTLCDestination_FailedPayment_class, LDKHTLCDestination_FailedPayment_meth, payment_hash_arr);
2829 static jclass LDKCOption_HTLCDestinationZ_Some_class = NULL;
2830 static jmethodID LDKCOption_HTLCDestinationZ_Some_meth = NULL;
2831 static jclass LDKCOption_HTLCDestinationZ_None_class = NULL;
2832 static jmethodID LDKCOption_HTLCDestinationZ_None_meth = NULL;
2833 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1HTLCDestinationZ_init (JNIEnv *env, jclass clz) {
2834 LDKCOption_HTLCDestinationZ_Some_class =
2835 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCDestinationZ$Some"));
2836 CHECK(LDKCOption_HTLCDestinationZ_Some_class != NULL);
2837 LDKCOption_HTLCDestinationZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_HTLCDestinationZ_Some_class, "<init>", "(J)V");
2838 CHECK(LDKCOption_HTLCDestinationZ_Some_meth != NULL);
2839 LDKCOption_HTLCDestinationZ_None_class =
2840 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCDestinationZ$None"));
2841 CHECK(LDKCOption_HTLCDestinationZ_None_class != NULL);
2842 LDKCOption_HTLCDestinationZ_None_meth = (*env)->GetMethodID(env, LDKCOption_HTLCDestinationZ_None_class, "<init>", "()V");
2843 CHECK(LDKCOption_HTLCDestinationZ_None_meth != NULL);
2845 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1HTLCDestinationZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2846 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
2848 case LDKCOption_HTLCDestinationZ_Some: {
2849 int64_t some_ref = tag_ptr(&obj->some, false);
2850 return (*env)->NewObject(env, LDKCOption_HTLCDestinationZ_Some_class, LDKCOption_HTLCDestinationZ_Some_meth, some_ref);
2852 case LDKCOption_HTLCDestinationZ_None: {
2853 return (*env)->NewObject(env, LDKCOption_HTLCDestinationZ_None_class, LDKCOption_HTLCDestinationZ_None_meth);
2858 static inline struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
2859 CHECK(owner->result_ok);
2860 return COption_HTLCDestinationZ_clone(&*owner->contents.result);
2862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2863 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
2864 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
2865 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(owner_conv);
2866 int64_t ret_ref = tag_ptr(ret_copy, true);
2870 static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
2871 CHECK(!owner->result_ok);
2872 return DecodeError_clone(&*owner->contents.err);
2874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2875 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
2876 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2877 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
2878 int64_t ret_ref = tag_ptr(ret_copy, true);
2882 static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL;
2883 static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL;
2884 static jclass LDKNetworkUpdate_ChannelFailure_class = NULL;
2885 static jmethodID LDKNetworkUpdate_ChannelFailure_meth = NULL;
2886 static jclass LDKNetworkUpdate_NodeFailure_class = NULL;
2887 static jmethodID LDKNetworkUpdate_NodeFailure_meth = NULL;
2888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JNIEnv *env, jclass clz) {
2889 LDKNetworkUpdate_ChannelUpdateMessage_class =
2890 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelUpdateMessage"));
2891 CHECK(LDKNetworkUpdate_ChannelUpdateMessage_class != NULL);
2892 LDKNetworkUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelUpdateMessage_class, "<init>", "(J)V");
2893 CHECK(LDKNetworkUpdate_ChannelUpdateMessage_meth != NULL);
2894 LDKNetworkUpdate_ChannelFailure_class =
2895 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelFailure"));
2896 CHECK(LDKNetworkUpdate_ChannelFailure_class != NULL);
2897 LDKNetworkUpdate_ChannelFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelFailure_class, "<init>", "(JZ)V");
2898 CHECK(LDKNetworkUpdate_ChannelFailure_meth != NULL);
2899 LDKNetworkUpdate_NodeFailure_class =
2900 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$NodeFailure"));
2901 CHECK(LDKNetworkUpdate_NodeFailure_class != NULL);
2902 LDKNetworkUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_NodeFailure_class, "<init>", "([BZ)V");
2903 CHECK(LDKNetworkUpdate_NodeFailure_meth != NULL);
2905 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2906 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
2908 case LDKNetworkUpdate_ChannelUpdateMessage: {
2909 LDKChannelUpdate msg_var = obj->channel_update_message.msg;
2910 int64_t msg_ref = 0;
2911 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2912 msg_ref = tag_ptr(msg_var.inner, false);
2913 return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref);
2915 case LDKNetworkUpdate_ChannelFailure: {
2916 int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
2917 jboolean is_permanent_conv = obj->channel_failure.is_permanent;
2918 return (*env)->NewObject(env, LDKNetworkUpdate_ChannelFailure_class, LDKNetworkUpdate_ChannelFailure_meth, short_channel_id_conv, is_permanent_conv);
2920 case LDKNetworkUpdate_NodeFailure: {
2921 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2922 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->node_failure.node_id.compressed_form);
2923 jboolean is_permanent_conv = obj->node_failure.is_permanent;
2924 return (*env)->NewObject(env, LDKNetworkUpdate_NodeFailure_class, LDKNetworkUpdate_NodeFailure_meth, node_id_arr, is_permanent_conv);
2929 static jclass LDKCOption_NetworkUpdateZ_Some_class = NULL;
2930 static jmethodID LDKCOption_NetworkUpdateZ_Some_meth = NULL;
2931 static jclass LDKCOption_NetworkUpdateZ_None_class = NULL;
2932 static jmethodID LDKCOption_NetworkUpdateZ_None_meth = NULL;
2933 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetworkUpdateZ_init (JNIEnv *env, jclass clz) {
2934 LDKCOption_NetworkUpdateZ_Some_class =
2935 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$Some"));
2936 CHECK(LDKCOption_NetworkUpdateZ_Some_class != NULL);
2937 LDKCOption_NetworkUpdateZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_Some_class, "<init>", "(J)V");
2938 CHECK(LDKCOption_NetworkUpdateZ_Some_meth != NULL);
2939 LDKCOption_NetworkUpdateZ_None_class =
2940 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$None"));
2941 CHECK(LDKCOption_NetworkUpdateZ_None_class != NULL);
2942 LDKCOption_NetworkUpdateZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_None_class, "<init>", "()V");
2943 CHECK(LDKCOption_NetworkUpdateZ_None_meth != NULL);
2945 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetworkUpdateZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2946 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
2948 case LDKCOption_NetworkUpdateZ_Some: {
2949 int64_t some_ref = tag_ptr(&obj->some, false);
2950 return (*env)->NewObject(env, LDKCOption_NetworkUpdateZ_Some_class, LDKCOption_NetworkUpdateZ_Some_meth, some_ref);
2952 case LDKCOption_NetworkUpdateZ_None: {
2953 return (*env)->NewObject(env, LDKCOption_NetworkUpdateZ_None_class, LDKCOption_NetworkUpdateZ_None_meth);
2958 static jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL;
2959 static jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL;
2960 static jclass LDKSpendableOutputDescriptor_DelayedPaymentOutput_class = NULL;
2961 static jmethodID LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = NULL;
2962 static jclass LDKSpendableOutputDescriptor_StaticPaymentOutput_class = NULL;
2963 static jmethodID LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = NULL;
2964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv *env, jclass clz) {
2965 LDKSpendableOutputDescriptor_StaticOutput_class =
2966 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput"));
2967 CHECK(LDKSpendableOutputDescriptor_StaticOutput_class != NULL);
2968 LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "<init>", "(JJ)V");
2969 CHECK(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL);
2970 LDKSpendableOutputDescriptor_DelayedPaymentOutput_class =
2971 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$DelayedPaymentOutput"));
2972 CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_class != NULL);
2973 LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, "<init>", "(J)V");
2974 CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth != NULL);
2975 LDKSpendableOutputDescriptor_StaticPaymentOutput_class =
2976 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticPaymentOutput"));
2977 CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_class != NULL);
2978 LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, "<init>", "(J)V");
2979 CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_meth != NULL);
2981 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2982 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
2984 case LDKSpendableOutputDescriptor_StaticOutput: {
2985 LDKOutPoint outpoint_var = obj->static_output.outpoint;
2986 int64_t outpoint_ref = 0;
2987 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var);
2988 outpoint_ref = tag_ptr(outpoint_var.inner, false);
2989 LDKTxOut* output_ref = &obj->static_output.output;
2990 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, tag_ptr(output_ref, false));
2992 case LDKSpendableOutputDescriptor_DelayedPaymentOutput: {
2993 LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
2994 int64_t delayed_payment_output_ref = 0;
2995 CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var);
2996 delayed_payment_output_ref = tag_ptr(delayed_payment_output_var.inner, false);
2997 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref);
2999 case LDKSpendableOutputDescriptor_StaticPaymentOutput: {
3000 LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
3001 int64_t static_payment_output_ref = 0;
3002 CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var);
3003 static_payment_output_ref = tag_ptr(static_payment_output_var.inner, false);
3004 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref);
3009 static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) {
3010 LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen };
3011 for (size_t i = 0; i < ret.datalen; i++) {
3012 ret.data[i] = SpendableOutputDescriptor_clone(&orig->data[i]);
3016 static jclass LDKEvent_FundingGenerationReady_class = NULL;
3017 static jmethodID LDKEvent_FundingGenerationReady_meth = NULL;
3018 static jclass LDKEvent_PaymentReceived_class = NULL;
3019 static jmethodID LDKEvent_PaymentReceived_meth = NULL;
3020 static jclass LDKEvent_PaymentClaimed_class = NULL;
3021 static jmethodID LDKEvent_PaymentClaimed_meth = NULL;
3022 static jclass LDKEvent_PaymentSent_class = NULL;
3023 static jmethodID LDKEvent_PaymentSent_meth = NULL;
3024 static jclass LDKEvent_PaymentFailed_class = NULL;
3025 static jmethodID LDKEvent_PaymentFailed_meth = NULL;
3026 static jclass LDKEvent_PaymentPathSuccessful_class = NULL;
3027 static jmethodID LDKEvent_PaymentPathSuccessful_meth = NULL;
3028 static jclass LDKEvent_PaymentPathFailed_class = NULL;
3029 static jmethodID LDKEvent_PaymentPathFailed_meth = NULL;
3030 static jclass LDKEvent_ProbeSuccessful_class = NULL;
3031 static jmethodID LDKEvent_ProbeSuccessful_meth = NULL;
3032 static jclass LDKEvent_ProbeFailed_class = NULL;
3033 static jmethodID LDKEvent_ProbeFailed_meth = NULL;
3034 static jclass LDKEvent_PendingHTLCsForwardable_class = NULL;
3035 static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL;
3036 static jclass LDKEvent_SpendableOutputs_class = NULL;
3037 static jmethodID LDKEvent_SpendableOutputs_meth = NULL;
3038 static jclass LDKEvent_PaymentForwarded_class = NULL;
3039 static jmethodID LDKEvent_PaymentForwarded_meth = NULL;
3040 static jclass LDKEvent_ChannelClosed_class = NULL;
3041 static jmethodID LDKEvent_ChannelClosed_meth = NULL;
3042 static jclass LDKEvent_DiscardFunding_class = NULL;
3043 static jmethodID LDKEvent_DiscardFunding_meth = NULL;
3044 static jclass LDKEvent_OpenChannelRequest_class = NULL;
3045 static jmethodID LDKEvent_OpenChannelRequest_meth = NULL;
3046 static jclass LDKEvent_HTLCHandlingFailed_class = NULL;
3047 static jmethodID LDKEvent_HTLCHandlingFailed_meth = NULL;
3048 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) {
3049 LDKEvent_FundingGenerationReady_class =
3050 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingGenerationReady"));
3051 CHECK(LDKEvent_FundingGenerationReady_class != NULL);
3052 LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "<init>", "([B[BJ[BJ)V");
3053 CHECK(LDKEvent_FundingGenerationReady_meth != NULL);
3054 LDKEvent_PaymentReceived_class =
3055 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentReceived"));
3056 CHECK(LDKEvent_PaymentReceived_class != NULL);
3057 LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([BJJ)V");
3058 CHECK(LDKEvent_PaymentReceived_meth != NULL);
3059 LDKEvent_PaymentClaimed_class =
3060 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimed"));
3061 CHECK(LDKEvent_PaymentClaimed_class != NULL);
3062 LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "<init>", "([BJJ)V");
3063 CHECK(LDKEvent_PaymentClaimed_meth != NULL);
3064 LDKEvent_PaymentSent_class =
3065 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent"));
3066 CHECK(LDKEvent_PaymentSent_class != NULL);
3067 LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B[B[BJ)V");
3068 CHECK(LDKEvent_PaymentSent_meth != NULL);
3069 LDKEvent_PaymentFailed_class =
3070 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentFailed"));
3071 CHECK(LDKEvent_PaymentFailed_class != NULL);
3072 LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "<init>", "([B[B)V");
3073 CHECK(LDKEvent_PaymentFailed_meth != NULL);
3074 LDKEvent_PaymentPathSuccessful_class =
3075 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful"));
3076 CHECK(LDKEvent_PaymentPathSuccessful_class != NULL);
3077 LDKEvent_PaymentPathSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathSuccessful_class, "<init>", "([B[B[J)V");
3078 CHECK(LDKEvent_PaymentPathSuccessful_meth != NULL);
3079 LDKEvent_PaymentPathFailed_class =
3080 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathFailed"));
3081 CHECK(LDKEvent_PaymentPathFailed_class != NULL);
3082 LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([B[BZJZ[JJJ)V");
3083 CHECK(LDKEvent_PaymentPathFailed_meth != NULL);
3084 LDKEvent_ProbeSuccessful_class =
3085 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ProbeSuccessful"));
3086 CHECK(LDKEvent_ProbeSuccessful_class != NULL);
3087 LDKEvent_ProbeSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_ProbeSuccessful_class, "<init>", "([B[B[J)V");
3088 CHECK(LDKEvent_ProbeSuccessful_meth != NULL);
3089 LDKEvent_ProbeFailed_class =
3090 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ProbeFailed"));
3091 CHECK(LDKEvent_ProbeFailed_class != NULL);
3092 LDKEvent_ProbeFailed_meth = (*env)->GetMethodID(env, LDKEvent_ProbeFailed_class, "<init>", "([B[B[JJ)V");
3093 CHECK(LDKEvent_ProbeFailed_meth != NULL);
3094 LDKEvent_PendingHTLCsForwardable_class =
3095 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable"));
3096 CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL);
3097 LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "<init>", "(J)V");
3098 CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL);
3099 LDKEvent_SpendableOutputs_class =
3100 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$SpendableOutputs"));
3101 CHECK(LDKEvent_SpendableOutputs_class != NULL);
3102 LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "<init>", "([J)V");
3103 CHECK(LDKEvent_SpendableOutputs_meth != NULL);
3104 LDKEvent_PaymentForwarded_class =
3105 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentForwarded"));
3106 CHECK(LDKEvent_PaymentForwarded_class != NULL);
3107 LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "<init>", "([B[BJZ)V");
3108 CHECK(LDKEvent_PaymentForwarded_meth != NULL);
3109 LDKEvent_ChannelClosed_class =
3110 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed"));
3111 CHECK(LDKEvent_ChannelClosed_class != NULL);
3112 LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "<init>", "([BJJ)V");
3113 CHECK(LDKEvent_ChannelClosed_meth != NULL);
3114 LDKEvent_DiscardFunding_class =
3115 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding"));
3116 CHECK(LDKEvent_DiscardFunding_class != NULL);
3117 LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "<init>", "([B[B)V");
3118 CHECK(LDKEvent_DiscardFunding_meth != NULL);
3119 LDKEvent_OpenChannelRequest_class =
3120 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OpenChannelRequest"));
3121 CHECK(LDKEvent_OpenChannelRequest_class != NULL);
3122 LDKEvent_OpenChannelRequest_meth = (*env)->GetMethodID(env, LDKEvent_OpenChannelRequest_class, "<init>", "([B[BJJJ)V");
3123 CHECK(LDKEvent_OpenChannelRequest_meth != NULL);
3124 LDKEvent_HTLCHandlingFailed_class =
3125 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$HTLCHandlingFailed"));
3126 CHECK(LDKEvent_HTLCHandlingFailed_class != NULL);
3127 LDKEvent_HTLCHandlingFailed_meth = (*env)->GetMethodID(env, LDKEvent_HTLCHandlingFailed_class, "<init>", "([BJ)V");
3128 CHECK(LDKEvent_HTLCHandlingFailed_meth != NULL);
3130 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3131 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
3133 case LDKEvent_FundingGenerationReady: {
3134 int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
3135 (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data);
3136 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
3137 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->funding_generation_ready.counterparty_node_id.compressed_form);
3138 int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis;
3139 LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
3140 int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen);
3141 (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data);
3142 int64_t user_channel_id_conv = obj->funding_generation_ready.user_channel_id;
3143 return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, counterparty_node_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_conv);
3145 case LDKEvent_PaymentReceived: {
3146 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3147 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data);
3148 int64_t amount_msat_conv = obj->payment_received.amount_msat;
3149 int64_t purpose_ref = tag_ptr(&obj->payment_received.purpose, false);
3150 return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, amount_msat_conv, purpose_ref);
3152 case LDKEvent_PaymentClaimed: {
3153 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3154 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_claimed.payment_hash.data);
3155 int64_t amount_msat_conv = obj->payment_claimed.amount_msat;
3156 int64_t purpose_ref = tag_ptr(&obj->payment_claimed.purpose, false);
3157 return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, payment_hash_arr, amount_msat_conv, purpose_ref);
3159 case LDKEvent_PaymentSent: {
3160 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3161 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data);
3162 int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
3163 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data);
3164 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3165 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data);
3166 int64_t fee_paid_msat_ref = tag_ptr(&obj->payment_sent.fee_paid_msat, false);
3167 return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref);
3169 case LDKEvent_PaymentFailed: {
3170 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3171 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data);
3172 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3173 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data);
3174 return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr);
3176 case LDKEvent_PaymentPathSuccessful: {
3177 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3178 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_successful.payment_id.data);
3179 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3180 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_successful.payment_hash.data);
3181 LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
3182 int64_tArray path_arr = NULL;
3183 path_arr = (*env)->NewLongArray(env, path_var.datalen);
3184 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
3185 for (size_t k = 0; k < path_var.datalen; k++) {
3186 LDKRouteHop path_conv_10_var = path_var.data[k];
3187 int64_t path_conv_10_ref = 0;
3188 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
3189 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
3190 path_arr_ptr[k] = path_conv_10_ref;
3192 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
3193 return (*env)->NewObject(env, LDKEvent_PaymentPathSuccessful_class, LDKEvent_PaymentPathSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr);
3195 case LDKEvent_PaymentPathFailed: {
3196 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3197 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data);
3198 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3199 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data);
3200 jboolean payment_failed_permanently_conv = obj->payment_path_failed.payment_failed_permanently;
3201 int64_t network_update_ref = tag_ptr(&obj->payment_path_failed.network_update, false);
3202 jboolean all_paths_failed_conv = obj->payment_path_failed.all_paths_failed;
3203 LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
3204 int64_tArray path_arr = NULL;
3205 path_arr = (*env)->NewLongArray(env, path_var.datalen);
3206 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
3207 for (size_t k = 0; k < path_var.datalen; k++) {
3208 LDKRouteHop path_conv_10_var = path_var.data[k];
3209 int64_t path_conv_10_ref = 0;
3210 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
3211 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
3212 path_arr_ptr[k] = path_conv_10_ref;
3214 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
3215 int64_t short_channel_id_ref = tag_ptr(&obj->payment_path_failed.short_channel_id, false);
3216 LDKRouteParameters retry_var = obj->payment_path_failed.retry;
3217 int64_t retry_ref = 0;
3218 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var);
3219 retry_ref = tag_ptr(retry_var.inner, false);
3220 return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, payment_failed_permanently_conv, network_update_ref, all_paths_failed_conv, path_arr, short_channel_id_ref, retry_ref);
3222 case LDKEvent_ProbeSuccessful: {
3223 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3224 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->probe_successful.payment_id.data);
3225 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3226 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->probe_successful.payment_hash.data);
3227 LDKCVec_RouteHopZ path_var = obj->probe_successful.path;
3228 int64_tArray path_arr = NULL;
3229 path_arr = (*env)->NewLongArray(env, path_var.datalen);
3230 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
3231 for (size_t k = 0; k < path_var.datalen; k++) {
3232 LDKRouteHop path_conv_10_var = path_var.data[k];
3233 int64_t path_conv_10_ref = 0;
3234 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
3235 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
3236 path_arr_ptr[k] = path_conv_10_ref;
3238 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
3239 return (*env)->NewObject(env, LDKEvent_ProbeSuccessful_class, LDKEvent_ProbeSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr);
3241 case LDKEvent_ProbeFailed: {
3242 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3243 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->probe_failed.payment_id.data);
3244 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3245 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->probe_failed.payment_hash.data);
3246 LDKCVec_RouteHopZ path_var = obj->probe_failed.path;
3247 int64_tArray path_arr = NULL;
3248 path_arr = (*env)->NewLongArray(env, path_var.datalen);
3249 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
3250 for (size_t k = 0; k < path_var.datalen; k++) {
3251 LDKRouteHop path_conv_10_var = path_var.data[k];
3252 int64_t path_conv_10_ref = 0;
3253 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
3254 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
3255 path_arr_ptr[k] = path_conv_10_ref;
3257 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
3258 int64_t short_channel_id_ref = tag_ptr(&obj->probe_failed.short_channel_id, false);
3259 return (*env)->NewObject(env, LDKEvent_ProbeFailed_class, LDKEvent_ProbeFailed_meth, payment_id_arr, payment_hash_arr, path_arr, short_channel_id_ref);
3261 case LDKEvent_PendingHTLCsForwardable: {
3262 int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable;
3263 return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, time_forwardable_conv);
3265 case LDKEvent_SpendableOutputs: {
3266 LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
3267 int64_tArray outputs_arr = NULL;
3268 outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
3269 int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL);
3270 for (size_t b = 0; b < outputs_var.datalen; b++) {
3271 int64_t outputs_conv_27_ref = tag_ptr(&outputs_var.data[b], false);
3272 outputs_arr_ptr[b] = outputs_conv_27_ref;
3274 (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0);
3275 return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr);
3277 case LDKEvent_PaymentForwarded: {
3278 int8_tArray prev_channel_id_arr = (*env)->NewByteArray(env, 32);
3279 (*env)->SetByteArrayRegion(env, prev_channel_id_arr, 0, 32, obj->payment_forwarded.prev_channel_id.data);
3280 int8_tArray next_channel_id_arr = (*env)->NewByteArray(env, 32);
3281 (*env)->SetByteArrayRegion(env, next_channel_id_arr, 0, 32, obj->payment_forwarded.next_channel_id.data);
3282 int64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false);
3283 jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx;
3284 return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, prev_channel_id_arr, next_channel_id_arr, fee_earned_msat_ref, claim_from_onchain_tx_conv);
3286 case LDKEvent_ChannelClosed: {
3287 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
3288 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data);
3289 int64_t user_channel_id_conv = obj->channel_closed.user_channel_id;
3290 int64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false);
3291 return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, user_channel_id_conv, reason_ref);
3293 case LDKEvent_DiscardFunding: {
3294 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
3295 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data);
3296 LDKTransaction transaction_var = obj->discard_funding.transaction;
3297 int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen);
3298 (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data);
3299 return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr);
3301 case LDKEvent_OpenChannelRequest: {
3302 int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
3303 (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->open_channel_request.temporary_channel_id.data);
3304 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
3305 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->open_channel_request.counterparty_node_id.compressed_form);
3306 int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis;
3307 int64_t push_msat_conv = obj->open_channel_request.push_msat;
3308 LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type;
3309 int64_t channel_type_ref = 0;
3310 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
3311 channel_type_ref = tag_ptr(channel_type_var.inner, false);
3312 return (*env)->NewObject(env, LDKEvent_OpenChannelRequest_class, LDKEvent_OpenChannelRequest_meth, temporary_channel_id_arr, counterparty_node_id_arr, funding_satoshis_conv, push_msat_conv, channel_type_ref);
3314 case LDKEvent_HTLCHandlingFailed: {
3315 int8_tArray prev_channel_id_arr = (*env)->NewByteArray(env, 32);
3316 (*env)->SetByteArrayRegion(env, prev_channel_id_arr, 0, 32, obj->htlc_handling_failed.prev_channel_id.data);
3317 int64_t failed_next_destination_ref = tag_ptr(&obj->htlc_handling_failed.failed_next_destination, false);
3318 return (*env)->NewObject(env, LDKEvent_HTLCHandlingFailed_class, LDKEvent_HTLCHandlingFailed_meth, prev_channel_id_arr, failed_next_destination_ref);
3323 static jclass LDKCOption_EventZ_Some_class = NULL;
3324 static jmethodID LDKCOption_EventZ_Some_meth = NULL;
3325 static jclass LDKCOption_EventZ_None_class = NULL;
3326 static jmethodID LDKCOption_EventZ_None_meth = NULL;
3327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init (JNIEnv *env, jclass clz) {
3328 LDKCOption_EventZ_Some_class =
3329 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$Some"));
3330 CHECK(LDKCOption_EventZ_Some_class != NULL);
3331 LDKCOption_EventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_Some_class, "<init>", "(J)V");
3332 CHECK(LDKCOption_EventZ_Some_meth != NULL);
3333 LDKCOption_EventZ_None_class =
3334 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$None"));
3335 CHECK(LDKCOption_EventZ_None_class != NULL);
3336 LDKCOption_EventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_None_class, "<init>", "()V");
3337 CHECK(LDKCOption_EventZ_None_meth != NULL);
3339 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1EventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3340 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
3342 case LDKCOption_EventZ_Some: {
3343 int64_t some_ref = tag_ptr(&obj->some, false);
3344 return (*env)->NewObject(env, LDKCOption_EventZ_Some_class, LDKCOption_EventZ_Some_meth, some_ref);
3346 case LDKCOption_EventZ_None: {
3347 return (*env)->NewObject(env, LDKCOption_EventZ_None_class, LDKCOption_EventZ_None_meth);
3352 static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
3353 CHECK(owner->result_ok);
3354 return COption_EventZ_clone(&*owner->contents.result);
3356 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3357 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
3358 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
3359 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv);
3360 int64_t ret_ref = tag_ptr(ret_copy, true);
3364 static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
3365 CHECK(!owner->result_ok);
3366 return DecodeError_clone(&*owner->contents.err);
3368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3369 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
3370 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3371 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
3372 int64_t ret_ref = tag_ptr(ret_copy, true);
3376 static jclass LDKErrorAction_DisconnectPeer_class = NULL;
3377 static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL;
3378 static jclass LDKErrorAction_IgnoreError_class = NULL;
3379 static jmethodID LDKErrorAction_IgnoreError_meth = NULL;
3380 static jclass LDKErrorAction_IgnoreAndLog_class = NULL;
3381 static jmethodID LDKErrorAction_IgnoreAndLog_meth = NULL;
3382 static jclass LDKErrorAction_IgnoreDuplicateGossip_class = NULL;
3383 static jmethodID LDKErrorAction_IgnoreDuplicateGossip_meth = NULL;
3384 static jclass LDKErrorAction_SendErrorMessage_class = NULL;
3385 static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL;
3386 static jclass LDKErrorAction_SendWarningMessage_class = NULL;
3387 static jmethodID LDKErrorAction_SendWarningMessage_meth = NULL;
3388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv *env, jclass clz) {
3389 LDKErrorAction_DisconnectPeer_class =
3390 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$DisconnectPeer"));
3391 CHECK(LDKErrorAction_DisconnectPeer_class != NULL);
3392 LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "<init>", "(J)V");
3393 CHECK(LDKErrorAction_DisconnectPeer_meth != NULL);
3394 LDKErrorAction_IgnoreError_class =
3395 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreError"));
3396 CHECK(LDKErrorAction_IgnoreError_class != NULL);
3397 LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "<init>", "()V");
3398 CHECK(LDKErrorAction_IgnoreError_meth != NULL);
3399 LDKErrorAction_IgnoreAndLog_class =
3400 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreAndLog"));
3401 CHECK(LDKErrorAction_IgnoreAndLog_class != NULL);
3402 LDKErrorAction_IgnoreAndLog_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreAndLog_class, "<init>", "(Lorg/ldk/enums/Level;)V");
3403 CHECK(LDKErrorAction_IgnoreAndLog_meth != NULL);
3404 LDKErrorAction_IgnoreDuplicateGossip_class =
3405 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreDuplicateGossip"));
3406 CHECK(LDKErrorAction_IgnoreDuplicateGossip_class != NULL);
3407 LDKErrorAction_IgnoreDuplicateGossip_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreDuplicateGossip_class, "<init>", "()V");
3408 CHECK(LDKErrorAction_IgnoreDuplicateGossip_meth != NULL);
3409 LDKErrorAction_SendErrorMessage_class =
3410 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$SendErrorMessage"));
3411 CHECK(LDKErrorAction_SendErrorMessage_class != NULL);
3412 LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "<init>", "(J)V");
3413 CHECK(LDKErrorAction_SendErrorMessage_meth != NULL);
3414 LDKErrorAction_SendWarningMessage_class =
3415 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$SendWarningMessage"));
3416 CHECK(LDKErrorAction_SendWarningMessage_class != NULL);
3417 LDKErrorAction_SendWarningMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendWarningMessage_class, "<init>", "(JLorg/ldk/enums/Level;)V");
3418 CHECK(LDKErrorAction_SendWarningMessage_meth != NULL);
3420 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3421 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
3423 case LDKErrorAction_DisconnectPeer: {
3424 LDKErrorMessage msg_var = obj->disconnect_peer.msg;
3425 int64_t msg_ref = 0;
3426 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3427 msg_ref = tag_ptr(msg_var.inner, false);
3428 return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref);
3430 case LDKErrorAction_IgnoreError: {
3431 return (*env)->NewObject(env, LDKErrorAction_IgnoreError_class, LDKErrorAction_IgnoreError_meth);
3433 case LDKErrorAction_IgnoreAndLog: {
3434 jclass ignore_and_log_conv = LDKLevel_to_java(env, obj->ignore_and_log);
3435 return (*env)->NewObject(env, LDKErrorAction_IgnoreAndLog_class, LDKErrorAction_IgnoreAndLog_meth, ignore_and_log_conv);
3437 case LDKErrorAction_IgnoreDuplicateGossip: {
3438 return (*env)->NewObject(env, LDKErrorAction_IgnoreDuplicateGossip_class, LDKErrorAction_IgnoreDuplicateGossip_meth);
3440 case LDKErrorAction_SendErrorMessage: {
3441 LDKErrorMessage msg_var = obj->send_error_message.msg;
3442 int64_t msg_ref = 0;
3443 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3444 msg_ref = tag_ptr(msg_var.inner, false);
3445 return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref);
3447 case LDKErrorAction_SendWarningMessage: {
3448 LDKWarningMessage msg_var = obj->send_warning_message.msg;
3449 int64_t msg_ref = 0;
3450 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3451 msg_ref = tag_ptr(msg_var.inner, false);
3452 jclass log_level_conv = LDKLevel_to_java(env, obj->send_warning_message.log_level);
3453 return (*env)->NewObject(env, LDKErrorAction_SendWarningMessage_class, LDKErrorAction_SendWarningMessage_meth, msg_ref, log_level_conv);
3458 static jclass LDKMessageSendEvent_SendAcceptChannel_class = NULL;
3459 static jmethodID LDKMessageSendEvent_SendAcceptChannel_meth = NULL;
3460 static jclass LDKMessageSendEvent_SendOpenChannel_class = NULL;
3461 static jmethodID LDKMessageSendEvent_SendOpenChannel_meth = NULL;
3462 static jclass LDKMessageSendEvent_SendFundingCreated_class = NULL;
3463 static jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL;
3464 static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL;
3465 static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL;
3466 static jclass LDKMessageSendEvent_SendChannelReady_class = NULL;
3467 static jmethodID LDKMessageSendEvent_SendChannelReady_meth = NULL;
3468 static jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL;
3469 static jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL;
3470 static jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL;
3471 static jmethodID LDKMessageSendEvent_UpdateHTLCs_meth = NULL;
3472 static jclass LDKMessageSendEvent_SendRevokeAndACK_class = NULL;
3473 static jmethodID LDKMessageSendEvent_SendRevokeAndACK_meth = NULL;
3474 static jclass LDKMessageSendEvent_SendClosingSigned_class = NULL;
3475 static jmethodID LDKMessageSendEvent_SendClosingSigned_meth = NULL;
3476 static jclass LDKMessageSendEvent_SendShutdown_class = NULL;
3477 static jmethodID LDKMessageSendEvent_SendShutdown_meth = NULL;
3478 static jclass LDKMessageSendEvent_SendChannelReestablish_class = NULL;
3479 static jmethodID LDKMessageSendEvent_SendChannelReestablish_meth = NULL;
3480 static jclass LDKMessageSendEvent_SendChannelAnnouncement_class = NULL;
3481 static jmethodID LDKMessageSendEvent_SendChannelAnnouncement_meth = NULL;
3482 static jclass LDKMessageSendEvent_BroadcastChannelAnnouncement_class = NULL;
3483 static jmethodID LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = NULL;
3484 static jclass LDKMessageSendEvent_BroadcastChannelUpdate_class = NULL;
3485 static jmethodID LDKMessageSendEvent_BroadcastChannelUpdate_meth = NULL;
3486 static jclass LDKMessageSendEvent_SendChannelUpdate_class = NULL;
3487 static jmethodID LDKMessageSendEvent_SendChannelUpdate_meth = NULL;
3488 static jclass LDKMessageSendEvent_HandleError_class = NULL;
3489 static jmethodID LDKMessageSendEvent_HandleError_meth = NULL;
3490 static jclass LDKMessageSendEvent_SendChannelRangeQuery_class = NULL;
3491 static jmethodID LDKMessageSendEvent_SendChannelRangeQuery_meth = NULL;
3492 static jclass LDKMessageSendEvent_SendShortIdsQuery_class = NULL;
3493 static jmethodID LDKMessageSendEvent_SendShortIdsQuery_meth = NULL;
3494 static jclass LDKMessageSendEvent_SendReplyChannelRange_class = NULL;
3495 static jmethodID LDKMessageSendEvent_SendReplyChannelRange_meth = NULL;
3496 static jclass LDKMessageSendEvent_SendGossipTimestampFilter_class = NULL;
3497 static jmethodID LDKMessageSendEvent_SendGossipTimestampFilter_meth = NULL;
3498 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv *env, jclass clz) {
3499 LDKMessageSendEvent_SendAcceptChannel_class =
3500 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel"));
3501 CHECK(LDKMessageSendEvent_SendAcceptChannel_class != NULL);
3502 LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "<init>", "([BJ)V");
3503 CHECK(LDKMessageSendEvent_SendAcceptChannel_meth != NULL);
3504 LDKMessageSendEvent_SendOpenChannel_class =
3505 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel"));
3506 CHECK(LDKMessageSendEvent_SendOpenChannel_class != NULL);
3507 LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "<init>", "([BJ)V");
3508 CHECK(LDKMessageSendEvent_SendOpenChannel_meth != NULL);
3509 LDKMessageSendEvent_SendFundingCreated_class =
3510 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated"));
3511 CHECK(LDKMessageSendEvent_SendFundingCreated_class != NULL);
3512 LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "<init>", "([BJ)V");
3513 CHECK(LDKMessageSendEvent_SendFundingCreated_meth != NULL);
3514 LDKMessageSendEvent_SendFundingSigned_class =
3515 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned"));
3516 CHECK(LDKMessageSendEvent_SendFundingSigned_class != NULL);
3517 LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "<init>", "([BJ)V");
3518 CHECK(LDKMessageSendEvent_SendFundingSigned_meth != NULL);
3519 LDKMessageSendEvent_SendChannelReady_class =
3520 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReady"));
3521 CHECK(LDKMessageSendEvent_SendChannelReady_class != NULL);
3522 LDKMessageSendEvent_SendChannelReady_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReady_class, "<init>", "([BJ)V");
3523 CHECK(LDKMessageSendEvent_SendChannelReady_meth != NULL);
3524 LDKMessageSendEvent_SendAnnouncementSignatures_class =
3525 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures"));
3526 CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL);
3527 LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "<init>", "([BJ)V");
3528 CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL);
3529 LDKMessageSendEvent_UpdateHTLCs_class =
3530 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs"));
3531 CHECK(LDKMessageSendEvent_UpdateHTLCs_class != NULL);
3532 LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "<init>", "([BJ)V");
3533 CHECK(LDKMessageSendEvent_UpdateHTLCs_meth != NULL);
3534 LDKMessageSendEvent_SendRevokeAndACK_class =
3535 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK"));
3536 CHECK(LDKMessageSendEvent_SendRevokeAndACK_class != NULL);
3537 LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "<init>", "([BJ)V");
3538 CHECK(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL);
3539 LDKMessageSendEvent_SendClosingSigned_class =
3540 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned"));
3541 CHECK(LDKMessageSendEvent_SendClosingSigned_class != NULL);
3542 LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "<init>", "([BJ)V");
3543 CHECK(LDKMessageSendEvent_SendClosingSigned_meth != NULL);
3544 LDKMessageSendEvent_SendShutdown_class =
3545 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown"));
3546 CHECK(LDKMessageSendEvent_SendShutdown_class != NULL);
3547 LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "<init>", "([BJ)V");
3548 CHECK(LDKMessageSendEvent_SendShutdown_meth != NULL);
3549 LDKMessageSendEvent_SendChannelReestablish_class =
3550 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish"));
3551 CHECK(LDKMessageSendEvent_SendChannelReestablish_class != NULL);
3552 LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "<init>", "([BJ)V");
3553 CHECK(LDKMessageSendEvent_SendChannelReestablish_meth != NULL);
3554 LDKMessageSendEvent_SendChannelAnnouncement_class =
3555 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelAnnouncement"));
3556 CHECK(LDKMessageSendEvent_SendChannelAnnouncement_class != NULL);
3557 LDKMessageSendEvent_SendChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelAnnouncement_class, "<init>", "([BJJ)V");
3558 CHECK(LDKMessageSendEvent_SendChannelAnnouncement_meth != NULL);
3559 LDKMessageSendEvent_BroadcastChannelAnnouncement_class =
3560 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement"));
3561 CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL);
3562 LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "<init>", "(JJ)V");
3563 CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL);
3564 LDKMessageSendEvent_BroadcastChannelUpdate_class =
3565 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate"));
3566 CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL);
3567 LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "<init>", "(J)V");
3568 CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL);
3569 LDKMessageSendEvent_SendChannelUpdate_class =
3570 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelUpdate"));
3571 CHECK(LDKMessageSendEvent_SendChannelUpdate_class != NULL);
3572 LDKMessageSendEvent_SendChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelUpdate_class, "<init>", "([BJ)V");
3573 CHECK(LDKMessageSendEvent_SendChannelUpdate_meth != NULL);
3574 LDKMessageSendEvent_HandleError_class =
3575 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$HandleError"));
3576 CHECK(LDKMessageSendEvent_HandleError_class != NULL);
3577 LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "<init>", "([BJ)V");
3578 CHECK(LDKMessageSendEvent_HandleError_meth != NULL);
3579 LDKMessageSendEvent_SendChannelRangeQuery_class =
3580 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelRangeQuery"));
3581 CHECK(LDKMessageSendEvent_SendChannelRangeQuery_class != NULL);
3582 LDKMessageSendEvent_SendChannelRangeQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelRangeQuery_class, "<init>", "([BJ)V");
3583 CHECK(LDKMessageSendEvent_SendChannelRangeQuery_meth != NULL);
3584 LDKMessageSendEvent_SendShortIdsQuery_class =
3585 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShortIdsQuery"));
3586 CHECK(LDKMessageSendEvent_SendShortIdsQuery_class != NULL);
3587 LDKMessageSendEvent_SendShortIdsQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShortIdsQuery_class, "<init>", "([BJ)V");
3588 CHECK(LDKMessageSendEvent_SendShortIdsQuery_meth != NULL);
3589 LDKMessageSendEvent_SendReplyChannelRange_class =
3590 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendReplyChannelRange"));
3591 CHECK(LDKMessageSendEvent_SendReplyChannelRange_class != NULL);
3592 LDKMessageSendEvent_SendReplyChannelRange_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendReplyChannelRange_class, "<init>", "([BJ)V");
3593 CHECK(LDKMessageSendEvent_SendReplyChannelRange_meth != NULL);
3594 LDKMessageSendEvent_SendGossipTimestampFilter_class =
3595 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendGossipTimestampFilter"));
3596 CHECK(LDKMessageSendEvent_SendGossipTimestampFilter_class != NULL);
3597 LDKMessageSendEvent_SendGossipTimestampFilter_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendGossipTimestampFilter_class, "<init>", "([BJ)V");
3598 CHECK(LDKMessageSendEvent_SendGossipTimestampFilter_meth != NULL);
3600 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3601 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
3603 case LDKMessageSendEvent_SendAcceptChannel: {
3604 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3605 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_accept_channel.node_id.compressed_form);
3606 LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
3607 int64_t msg_ref = 0;
3608 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3609 msg_ref = tag_ptr(msg_var.inner, false);
3610 return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref);
3612 case LDKMessageSendEvent_SendOpenChannel: {
3613 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3614 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_open_channel.node_id.compressed_form);
3615 LDKOpenChannel msg_var = obj->send_open_channel.msg;
3616 int64_t msg_ref = 0;
3617 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3618 msg_ref = tag_ptr(msg_var.inner, false);
3619 return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref);
3621 case LDKMessageSendEvent_SendFundingCreated: {
3622 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3623 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_created.node_id.compressed_form);
3624 LDKFundingCreated msg_var = obj->send_funding_created.msg;
3625 int64_t msg_ref = 0;
3626 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3627 msg_ref = tag_ptr(msg_var.inner, false);
3628 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref);
3630 case LDKMessageSendEvent_SendFundingSigned: {
3631 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3632 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_signed.node_id.compressed_form);
3633 LDKFundingSigned msg_var = obj->send_funding_signed.msg;
3634 int64_t msg_ref = 0;
3635 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3636 msg_ref = tag_ptr(msg_var.inner, false);
3637 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref);
3639 case LDKMessageSendEvent_SendChannelReady: {
3640 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3641 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_ready.node_id.compressed_form);
3642 LDKChannelReady msg_var = obj->send_channel_ready.msg;
3643 int64_t msg_ref = 0;
3644 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3645 msg_ref = tag_ptr(msg_var.inner, false);
3646 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReady_class, LDKMessageSendEvent_SendChannelReady_meth, node_id_arr, msg_ref);
3648 case LDKMessageSendEvent_SendAnnouncementSignatures: {
3649 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3650 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_announcement_signatures.node_id.compressed_form);
3651 LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
3652 int64_t msg_ref = 0;
3653 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3654 msg_ref = tag_ptr(msg_var.inner, false);
3655 return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref);
3657 case LDKMessageSendEvent_UpdateHTLCs: {
3658 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3659 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->update_htl_cs.node_id.compressed_form);
3660 LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
3661 int64_t updates_ref = 0;
3662 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var);
3663 updates_ref = tag_ptr(updates_var.inner, false);
3664 return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref);
3666 case LDKMessageSendEvent_SendRevokeAndACK: {
3667 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3668 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_revoke_and_ack.node_id.compressed_form);
3669 LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
3670 int64_t msg_ref = 0;
3671 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3672 msg_ref = tag_ptr(msg_var.inner, false);
3673 return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref);
3675 case LDKMessageSendEvent_SendClosingSigned: {
3676 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3677 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_closing_signed.node_id.compressed_form);
3678 LDKClosingSigned msg_var = obj->send_closing_signed.msg;
3679 int64_t msg_ref = 0;
3680 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3681 msg_ref = tag_ptr(msg_var.inner, false);
3682 return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref);
3684 case LDKMessageSendEvent_SendShutdown: {
3685 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3686 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_shutdown.node_id.compressed_form);
3687 LDKShutdown msg_var = obj->send_shutdown.msg;
3688 int64_t msg_ref = 0;
3689 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3690 msg_ref = tag_ptr(msg_var.inner, false);
3691 return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref);
3693 case LDKMessageSendEvent_SendChannelReestablish: {
3694 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3695 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_reestablish.node_id.compressed_form);
3696 LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
3697 int64_t msg_ref = 0;
3698 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3699 msg_ref = tag_ptr(msg_var.inner, false);
3700 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref);
3702 case LDKMessageSendEvent_SendChannelAnnouncement: {
3703 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3704 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_announcement.node_id.compressed_form);
3705 LDKChannelAnnouncement msg_var = obj->send_channel_announcement.msg;
3706 int64_t msg_ref = 0;
3707 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3708 msg_ref = tag_ptr(msg_var.inner, false);
3709 LDKChannelUpdate update_msg_var = obj->send_channel_announcement.update_msg;
3710 int64_t update_msg_ref = 0;
3711 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
3712 update_msg_ref = tag_ptr(update_msg_var.inner, false);
3713 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelAnnouncement_class, LDKMessageSendEvent_SendChannelAnnouncement_meth, node_id_arr, msg_ref, update_msg_ref);
3715 case LDKMessageSendEvent_BroadcastChannelAnnouncement: {
3716 LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
3717 int64_t msg_ref = 0;
3718 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3719 msg_ref = tag_ptr(msg_var.inner, false);
3720 LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
3721 int64_t update_msg_ref = 0;
3722 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
3723 update_msg_ref = tag_ptr(update_msg_var.inner, false);
3724 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref);
3726 case LDKMessageSendEvent_BroadcastChannelUpdate: {
3727 LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
3728 int64_t msg_ref = 0;
3729 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3730 msg_ref = tag_ptr(msg_var.inner, false);
3731 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref);
3733 case LDKMessageSendEvent_SendChannelUpdate: {
3734 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3735 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_update.node_id.compressed_form);
3736 LDKChannelUpdate msg_var = obj->send_channel_update.msg;
3737 int64_t msg_ref = 0;
3738 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3739 msg_ref = tag_ptr(msg_var.inner, false);
3740 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref);
3742 case LDKMessageSendEvent_HandleError: {
3743 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3744 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->handle_error.node_id.compressed_form);
3745 int64_t action_ref = tag_ptr(&obj->handle_error.action, false);
3746 return (*env)->NewObject(env, LDKMessageSendEvent_HandleError_class, LDKMessageSendEvent_HandleError_meth, node_id_arr, action_ref);
3748 case LDKMessageSendEvent_SendChannelRangeQuery: {
3749 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3750 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_range_query.node_id.compressed_form);
3751 LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
3752 int64_t msg_ref = 0;
3753 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3754 msg_ref = tag_ptr(msg_var.inner, false);
3755 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref);
3757 case LDKMessageSendEvent_SendShortIdsQuery: {
3758 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3759 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_short_ids_query.node_id.compressed_form);
3760 LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
3761 int64_t msg_ref = 0;
3762 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3763 msg_ref = tag_ptr(msg_var.inner, false);
3764 return (*env)->NewObject(env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref);
3766 case LDKMessageSendEvent_SendReplyChannelRange: {
3767 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3768 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_reply_channel_range.node_id.compressed_form);
3769 LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
3770 int64_t msg_ref = 0;
3771 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3772 msg_ref = tag_ptr(msg_var.inner, false);
3773 return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref);
3775 case LDKMessageSendEvent_SendGossipTimestampFilter: {
3776 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3777 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_gossip_timestamp_filter.node_id.compressed_form);
3778 LDKGossipTimestampFilter msg_var = obj->send_gossip_timestamp_filter.msg;
3779 int64_t msg_ref = 0;
3780 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3781 msg_ref = tag_ptr(msg_var.inner, false);
3782 return (*env)->NewObject(env, LDKMessageSendEvent_SendGossipTimestampFilter_class, LDKMessageSendEvent_SendGossipTimestampFilter_meth, node_id_arr, msg_ref);
3787 static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) {
3788 LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen };
3789 for (size_t i = 0; i < ret.datalen; i++) {
3790 ret.data[i] = MessageSendEvent_clone(&orig->data[i]);
3794 static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
3795 CHECK(owner->result_ok);
3796 return TxOut_clone(&*owner->contents.result);
3798 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3799 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
3800 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
3801 *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv);
3802 return tag_ptr(ret_ref, true);
3805 static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
3806 CHECK(!owner->result_ok);
3807 return AccessError_clone(&*owner->contents.err);
3809 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3810 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
3811 jclass ret_conv = LDKAccessError_to_java(env, CResult_TxOutAccessErrorZ_get_err(owner_conv));
3815 static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
3818 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
3819 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
3820 int64_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv);
3824 static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
3827 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
3828 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
3829 LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv);
3830 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
3831 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
3835 static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) {
3836 LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen };
3837 for (size_t i = 0; i < ret.datalen; i++) {
3838 ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]);
3842 static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) {
3843 LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ clone bytes"), .datalen = orig->datalen };
3844 for (size_t i = 0; i < ret.datalen; i++) {
3845 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
3849 static jclass LDKMonitorEvent_HTLCEvent_class = NULL;
3850 static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL;
3851 static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL;
3852 static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL;
3853 static jclass LDKMonitorEvent_Completed_class = NULL;
3854 static jmethodID LDKMonitorEvent_Completed_meth = NULL;
3855 static jclass LDKMonitorEvent_UpdateFailed_class = NULL;
3856 static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL;
3857 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) {
3858 LDKMonitorEvent_HTLCEvent_class =
3859 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent"));
3860 CHECK(LDKMonitorEvent_HTLCEvent_class != NULL);
3861 LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "<init>", "(J)V");
3862 CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL);
3863 LDKMonitorEvent_CommitmentTxConfirmed_class =
3864 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed"));
3865 CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL);
3866 LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "<init>", "(J)V");
3867 CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL);
3868 LDKMonitorEvent_Completed_class =
3869 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$Completed"));
3870 CHECK(LDKMonitorEvent_Completed_class != NULL);
3871 LDKMonitorEvent_Completed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_Completed_class, "<init>", "(JJ)V");
3872 CHECK(LDKMonitorEvent_Completed_meth != NULL);
3873 LDKMonitorEvent_UpdateFailed_class =
3874 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed"));
3875 CHECK(LDKMonitorEvent_UpdateFailed_class != NULL);
3876 LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "<init>", "(J)V");
3877 CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL);
3879 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3880 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
3882 case LDKMonitorEvent_HTLCEvent: {
3883 LDKHTLCUpdate htlc_event_var = obj->htlc_event;
3884 int64_t htlc_event_ref = 0;
3885 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var);
3886 htlc_event_ref = tag_ptr(htlc_event_var.inner, false);
3887 return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref);
3889 case LDKMonitorEvent_CommitmentTxConfirmed: {
3890 LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
3891 int64_t commitment_tx_confirmed_ref = 0;
3892 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var);
3893 commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
3894 return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref);
3896 case LDKMonitorEvent_Completed: {
3897 LDKOutPoint funding_txo_var = obj->completed.funding_txo;
3898 int64_t funding_txo_ref = 0;
3899 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
3900 funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
3901 int64_t monitor_update_id_conv = obj->completed.monitor_update_id;
3902 return (*env)->NewObject(env, LDKMonitorEvent_Completed_class, LDKMonitorEvent_Completed_meth, funding_txo_ref, monitor_update_id_conv);
3904 case LDKMonitorEvent_UpdateFailed: {
3905 LDKOutPoint update_failed_var = obj->update_failed;
3906 int64_t update_failed_ref = 0;
3907 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var);
3908 update_failed_ref = tag_ptr(update_failed_var.inner, false);
3909 return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref);
3914 static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) {
3915 LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen };
3916 for (size_t i = 0; i < ret.datalen; i++) {
3917 ret.data[i] = MonitorEvent_clone(&orig->data[i]);
3921 static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
3922 LDKOutPoint ret = owner->a;
3923 ret.is_owned = false;
3926 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
3927 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
3928 LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv);
3929 int64_t ret_ref = 0;
3930 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3931 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3935 static inline struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
3936 return CVec_MonitorEventZ_clone(&owner->b);
3938 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
3939 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
3940 LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv);
3941 int64_tArray ret_arr = NULL;
3942 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
3943 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
3944 for (size_t o = 0; o < ret_var.datalen; o++) {
3945 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
3946 *ret_conv_14_copy = ret_var.data[o];
3947 int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
3948 ret_arr_ptr[o] = ret_conv_14_ref;
3950 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
3955 static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
3958 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
3959 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
3960 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
3961 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form);
3965 static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) {
3966 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen };
3967 for (size_t i = 0; i < ret.datalen; i++) {
3968 ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]);
3972 static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
3973 LDKFixedPenaltyScorer ret = *owner->contents.result;
3974 ret.is_owned = false;
3977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3978 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
3979 LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv);
3980 int64_t ret_ref = 0;
3981 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3982 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3986 static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
3987 CHECK(!owner->result_ok);
3988 return DecodeError_clone(&*owner->contents.err);
3990 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3991 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
3992 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3993 *ret_copy = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
3994 int64_t ret_ref = tag_ptr(ret_copy, true);
3998 static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
4001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4002 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
4003 int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv);
4007 static inline uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
4010 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4011 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
4012 int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv);
4016 static jclass LDKCOption_C2Tuple_u64u64ZZ_Some_class = NULL;
4017 static jmethodID LDKCOption_C2Tuple_u64u64ZZ_Some_meth = NULL;
4018 static jclass LDKCOption_C2Tuple_u64u64ZZ_None_class = NULL;
4019 static jmethodID LDKCOption_C2Tuple_u64u64ZZ_None_meth = NULL;
4020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1u64u64ZZ_init (JNIEnv *env, jclass clz) {
4021 LDKCOption_C2Tuple_u64u64ZZ_Some_class =
4022 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_u64u64ZZ$Some"));
4023 CHECK(LDKCOption_C2Tuple_u64u64ZZ_Some_class != NULL);
4024 LDKCOption_C2Tuple_u64u64ZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_u64u64ZZ_Some_class, "<init>", "(J)V");
4025 CHECK(LDKCOption_C2Tuple_u64u64ZZ_Some_meth != NULL);
4026 LDKCOption_C2Tuple_u64u64ZZ_None_class =
4027 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_u64u64ZZ$None"));
4028 CHECK(LDKCOption_C2Tuple_u64u64ZZ_None_class != NULL);
4029 LDKCOption_C2Tuple_u64u64ZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_u64u64ZZ_None_class, "<init>", "()V");
4030 CHECK(LDKCOption_C2Tuple_u64u64ZZ_None_meth != NULL);
4032 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1u64u64ZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4033 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
4035 case LDKCOption_C2Tuple_u64u64ZZ_Some: {
4036 LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
4037 *some_conv = obj->some;
4038 *some_conv = C2Tuple_u64u64Z_clone(some_conv);
4039 return (*env)->NewObject(env, LDKCOption_C2Tuple_u64u64ZZ_Some_class, LDKCOption_C2Tuple_u64u64ZZ_Some_meth, tag_ptr(some_conv, true));
4041 case LDKCOption_C2Tuple_u64u64ZZ_None: {
4042 return (*env)->NewObject(env, LDKCOption_C2Tuple_u64u64ZZ_None_class, LDKCOption_C2Tuple_u64u64ZZ_None_meth);
4047 static inline LDKCVec_NodeIdZ CVec_NodeIdZ_clone(const LDKCVec_NodeIdZ *orig) {
4048 LDKCVec_NodeIdZ ret = { .data = MALLOC(sizeof(LDKNodeId) * orig->datalen, "LDKCVec_NodeIdZ clone bytes"), .datalen = orig->datalen };
4049 for (size_t i = 0; i < ret.datalen; i++) {
4050 ret.data[i] = NodeId_clone(&orig->data[i]);
4054 typedef struct LDKLogger_JCalls {
4055 atomic_size_t refcnt;
4060 static void LDKLogger_JCalls_free(void* this_arg) {
4061 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
4062 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4064 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4065 if (get_jenv_res == JNI_EDETACHED) {
4066 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4068 DO_ASSERT(get_jenv_res == JNI_OK);
4070 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
4071 if (get_jenv_res == JNI_EDETACHED) {
4072 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4077 void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) {
4078 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
4080 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4081 if (get_jenv_res == JNI_EDETACHED) {
4082 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4084 DO_ASSERT(get_jenv_res == JNI_OK);
4086 LDKRecord record_var = *record;
4087 int64_t record_ref = 0;
4088 record_var = Record_clone(&record_var);
4089 CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var);
4090 record_ref = tag_ptr(record_var.inner, record_var.is_owned);
4091 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4093 (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref);
4094 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4095 (*env)->ExceptionDescribe(env);
4096 (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception.");
4098 if (get_jenv_res == JNI_EDETACHED) {
4099 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4102 static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
4103 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
4104 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4106 static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) {
4107 jclass c = (*env)->GetObjectClass(env, o);
4109 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
4110 atomic_init(&calls->refcnt, 1);
4111 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
4112 calls->o = (*env)->NewWeakGlobalRef(env, o);
4113 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V");
4114 CHECK(calls->log_meth != NULL);
4117 .this_arg = (void*) calls,
4118 .log = log_LDKLogger_jcall,
4119 .free = LDKLogger_JCalls_free,
4123 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new(JNIEnv *env, jclass clz, jobject o) {
4124 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
4125 *res_ptr = LDKLogger_init(env, clz, o);
4126 return tag_ptr(res_ptr, true);
4128 static inline struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
4129 LDKProbabilisticScorer ret = *owner->contents.result;
4130 ret.is_owned = false;
4133 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4134 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
4135 LDKProbabilisticScorer ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_ok(owner_conv);
4136 int64_t ret_ref = 0;
4137 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4138 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4142 static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
4143 CHECK(!owner->result_ok);
4144 return DecodeError_clone(&*owner->contents.err);
4146 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4147 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
4148 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4149 *ret_copy = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
4150 int64_t ret_ref = tag_ptr(ret_copy, true);
4154 static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
4155 LDKInitFeatures ret = *owner->contents.result;
4156 ret.is_owned = false;
4159 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4160 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
4161 LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv);
4162 int64_t ret_ref = 0;
4163 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4164 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4168 static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
4169 CHECK(!owner->result_ok);
4170 return DecodeError_clone(&*owner->contents.err);
4172 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4173 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
4174 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4175 *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
4176 int64_t ret_ref = tag_ptr(ret_copy, true);
4180 static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
4181 LDKChannelFeatures ret = *owner->contents.result;
4182 ret.is_owned = false;
4185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4186 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
4187 LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv);
4188 int64_t ret_ref = 0;
4189 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4190 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4194 static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
4195 CHECK(!owner->result_ok);
4196 return DecodeError_clone(&*owner->contents.err);
4198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4199 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
4200 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4201 *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
4202 int64_t ret_ref = tag_ptr(ret_copy, true);
4206 static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
4207 LDKNodeFeatures ret = *owner->contents.result;
4208 ret.is_owned = false;
4211 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4212 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
4213 LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv);
4214 int64_t ret_ref = 0;
4215 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4216 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4220 static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
4221 CHECK(!owner->result_ok);
4222 return DecodeError_clone(&*owner->contents.err);
4224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4225 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
4226 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4227 *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
4228 int64_t ret_ref = tag_ptr(ret_copy, true);
4232 static inline struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
4233 LDKInvoiceFeatures ret = *owner->contents.result;
4234 ret.is_owned = false;
4237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4238 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
4239 LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner_conv);
4240 int64_t ret_ref = 0;
4241 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4242 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4246 static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
4247 CHECK(!owner->result_ok);
4248 return DecodeError_clone(&*owner->contents.err);
4250 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4251 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
4252 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4253 *ret_copy = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
4254 int64_t ret_ref = tag_ptr(ret_copy, true);
4258 static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
4259 LDKChannelTypeFeatures ret = *owner->contents.result;
4260 ret.is_owned = false;
4263 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4264 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
4265 LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv);
4266 int64_t ret_ref = 0;
4267 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4268 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4272 static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
4273 CHECK(!owner->result_ok);
4274 return DecodeError_clone(&*owner->contents.err);
4276 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4277 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
4278 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4279 *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
4280 int64_t ret_ref = tag_ptr(ret_copy, true);
4284 static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
4285 LDKNodeId ret = *owner->contents.result;
4286 ret.is_owned = false;
4289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4290 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
4291 LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv);
4292 int64_t ret_ref = 0;
4293 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4294 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4298 static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
4299 CHECK(!owner->result_ok);
4300 return DecodeError_clone(&*owner->contents.err);
4302 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4303 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
4304 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4305 *ret_copy = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
4306 int64_t ret_ref = tag_ptr(ret_copy, true);
4310 static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
4311 CHECK(owner->result_ok);
4312 return COption_NetworkUpdateZ_clone(&*owner->contents.result);
4314 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4315 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
4316 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
4317 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv);
4318 int64_t ret_ref = tag_ptr(ret_copy, true);
4322 static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
4323 CHECK(!owner->result_ok);
4324 return DecodeError_clone(&*owner->contents.err);
4326 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4327 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
4328 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4329 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
4330 int64_t ret_ref = tag_ptr(ret_copy, true);
4334 typedef struct LDKAccess_JCalls {
4335 atomic_size_t refcnt;
4338 jmethodID get_utxo_meth;
4340 static void LDKAccess_JCalls_free(void* this_arg) {
4341 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
4342 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4344 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4345 if (get_jenv_res == JNI_EDETACHED) {
4346 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4348 DO_ASSERT(get_jenv_res == JNI_OK);
4350 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
4351 if (get_jenv_res == JNI_EDETACHED) {
4352 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4357 LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
4358 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
4360 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4361 if (get_jenv_res == JNI_EDETACHED) {
4362 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4364 DO_ASSERT(get_jenv_res == JNI_OK);
4366 int8_tArray genesis_hash_arr = (*env)->NewByteArray(env, 32);
4367 (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash);
4368 int64_t short_channel_id_conv = short_channel_id;
4369 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4371 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id_conv);
4372 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4373 (*env)->ExceptionDescribe(env);
4374 (*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception.");
4376 void* ret_ptr = untag_ptr(ret);
4377 CHECK_ACCESS(ret_ptr);
4378 LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
4379 FREE(untag_ptr(ret));
4380 if (get_jenv_res == JNI_EDETACHED) {
4381 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4385 static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
4386 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
4387 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4389 static inline LDKAccess LDKAccess_init (JNIEnv *env, jclass clz, jobject o) {
4390 jclass c = (*env)->GetObjectClass(env, o);
4392 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
4393 atomic_init(&calls->refcnt, 1);
4394 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
4395 calls->o = (*env)->NewWeakGlobalRef(env, o);
4396 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
4397 CHECK(calls->get_utxo_meth != NULL);
4400 .this_arg = (void*) calls,
4401 .get_utxo = get_utxo_LDKAccess_jcall,
4402 .free = LDKAccess_JCalls_free,
4406 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new(JNIEnv *env, jclass clz, jobject o) {
4407 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
4408 *res_ptr = LDKAccess_init(env, clz, o);
4409 return tag_ptr(res_ptr, true);
4411 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) {
4412 void* this_arg_ptr = untag_ptr(this_arg);
4413 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4414 LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
4415 unsigned char genesis_hash_arr[32];
4416 CHECK((*env)->GetArrayLength(env, genesis_hash) == 32);
4417 (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr);
4418 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
4419 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
4420 *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
4421 return tag_ptr(ret_conv, true);
4424 static jclass LDKCOption_AccessZ_Some_class = NULL;
4425 static jmethodID LDKCOption_AccessZ_Some_meth = NULL;
4426 static jclass LDKCOption_AccessZ_None_class = NULL;
4427 static jmethodID LDKCOption_AccessZ_None_meth = NULL;
4428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AccessZ_init (JNIEnv *env, jclass clz) {
4429 LDKCOption_AccessZ_Some_class =
4430 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$Some"));
4431 CHECK(LDKCOption_AccessZ_Some_class != NULL);
4432 LDKCOption_AccessZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_Some_class, "<init>", "(J)V");
4433 CHECK(LDKCOption_AccessZ_Some_meth != NULL);
4434 LDKCOption_AccessZ_None_class =
4435 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$None"));
4436 CHECK(LDKCOption_AccessZ_None_class != NULL);
4437 LDKCOption_AccessZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_None_class, "<init>", "()V");
4438 CHECK(LDKCOption_AccessZ_None_meth != NULL);
4440 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4441 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
4443 case LDKCOption_AccessZ_Some: {
4444 LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
4445 *some_ret = obj->some;
4446 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
4447 if ((*some_ret).free == LDKAccess_JCalls_free) {
4448 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4449 LDKAccess_JCalls_cloned(&(*some_ret));
4451 return (*env)->NewObject(env, LDKCOption_AccessZ_Some_class, LDKCOption_AccessZ_Some_meth, tag_ptr(some_ret, true));
4453 case LDKCOption_AccessZ_None: {
4454 return (*env)->NewObject(env, LDKCOption_AccessZ_None_class, LDKCOption_AccessZ_None_meth);
4459 static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
4460 CHECK(owner->result_ok);
4461 return *owner->contents.result;
4463 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4464 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
4465 jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv);
4469 static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
4470 LDKLightningError ret = *owner->contents.err;
4471 ret.is_owned = false;
4474 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4475 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
4476 LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv);
4477 int64_t ret_ref = 0;
4478 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4479 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4483 static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
4484 LDKChannelAnnouncement ret = owner->a;
4485 ret.is_owned = false;
4488 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4489 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
4490 LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv);
4491 int64_t ret_ref = 0;
4492 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4493 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4497 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
4498 LDKChannelUpdate ret = owner->b;
4499 ret.is_owned = false;
4502 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4503 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
4504 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv);
4505 int64_t ret_ref = 0;
4506 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4507 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4511 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
4512 LDKChannelUpdate ret = owner->c;
4513 ret.is_owned = false;
4516 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
4517 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
4518 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv);
4519 int64_t ret_ref = 0;
4520 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4521 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4525 static jclass LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class = NULL;
4526 static jmethodID LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth = NULL;
4527 static jclass LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class = NULL;
4528 static jmethodID LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth = NULL;
4529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_init (JNIEnv *env, jclass clz) {
4530 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class =
4531 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ$Some"));
4532 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class != NULL);
4533 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class, "<init>", "(J)V");
4534 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth != NULL);
4535 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class =
4536 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ$None"));
4537 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class != NULL);
4538 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class, "<init>", "()V");
4539 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth != NULL);
4541 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4542 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *obj = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(ptr);
4544 case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some: {
4545 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* some_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
4546 *some_conv = obj->some;
4547 *some_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(some_conv);
4548 return (*env)->NewObject(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth, tag_ptr(some_conv, true));
4550 case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None: {
4551 return (*env)->NewObject(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth);
4556 static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
4557 CHECK(owner->result_ok);
4558 return *owner->contents.result;
4560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4561 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
4562 CResult_NoneLightningErrorZ_get_ok(owner_conv);
4565 static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
4566 LDKLightningError ret = *owner->contents.err;
4567 ret.is_owned = false;
4570 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4571 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
4572 LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv);
4573 int64_t ret_ref = 0;
4574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4579 static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
4580 LDKChannelUpdateInfo ret = *owner->contents.result;
4581 ret.is_owned = false;
4584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4585 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
4586 LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv);
4587 int64_t ret_ref = 0;
4588 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4589 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4593 static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
4594 CHECK(!owner->result_ok);
4595 return DecodeError_clone(&*owner->contents.err);
4597 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4598 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
4599 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4600 *ret_copy = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
4601 int64_t ret_ref = tag_ptr(ret_copy, true);
4605 static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
4606 LDKChannelInfo ret = *owner->contents.result;
4607 ret.is_owned = false;
4610 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4611 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
4612 LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv);
4613 int64_t ret_ref = 0;
4614 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4615 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4619 static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
4620 CHECK(!owner->result_ok);
4621 return DecodeError_clone(&*owner->contents.err);
4623 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4624 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
4625 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4626 *ret_copy = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
4627 int64_t ret_ref = tag_ptr(ret_copy, true);
4631 static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
4632 LDKRoutingFees ret = *owner->contents.result;
4633 ret.is_owned = false;
4636 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4637 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
4638 LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv);
4639 int64_t ret_ref = 0;
4640 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4641 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4645 static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
4646 CHECK(!owner->result_ok);
4647 return DecodeError_clone(&*owner->contents.err);
4649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4650 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
4651 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4652 *ret_copy = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
4653 int64_t ret_ref = tag_ptr(ret_copy, true);
4657 static jclass LDKNetAddress_IPv4_class = NULL;
4658 static jmethodID LDKNetAddress_IPv4_meth = NULL;
4659 static jclass LDKNetAddress_IPv6_class = NULL;
4660 static jmethodID LDKNetAddress_IPv6_meth = NULL;
4661 static jclass LDKNetAddress_OnionV2_class = NULL;
4662 static jmethodID LDKNetAddress_OnionV2_meth = NULL;
4663 static jclass LDKNetAddress_OnionV3_class = NULL;
4664 static jmethodID LDKNetAddress_OnionV3_meth = NULL;
4665 static jclass LDKNetAddress_Hostname_class = NULL;
4666 static jmethodID LDKNetAddress_Hostname_meth = NULL;
4667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv *env, jclass clz) {
4668 LDKNetAddress_IPv4_class =
4669 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv4"));
4670 CHECK(LDKNetAddress_IPv4_class != NULL);
4671 LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "<init>", "([BS)V");
4672 CHECK(LDKNetAddress_IPv4_meth != NULL);
4673 LDKNetAddress_IPv6_class =
4674 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv6"));
4675 CHECK(LDKNetAddress_IPv6_class != NULL);
4676 LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "<init>", "([BS)V");
4677 CHECK(LDKNetAddress_IPv6_meth != NULL);
4678 LDKNetAddress_OnionV2_class =
4679 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV2"));
4680 CHECK(LDKNetAddress_OnionV2_class != NULL);
4681 LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "<init>", "([B)V");
4682 CHECK(LDKNetAddress_OnionV2_meth != NULL);
4683 LDKNetAddress_OnionV3_class =
4684 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV3"));
4685 CHECK(LDKNetAddress_OnionV3_class != NULL);
4686 LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "<init>", "([BSBS)V");
4687 CHECK(LDKNetAddress_OnionV3_meth != NULL);
4688 LDKNetAddress_Hostname_class =
4689 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$Hostname"));
4690 CHECK(LDKNetAddress_Hostname_class != NULL);
4691 LDKNetAddress_Hostname_meth = (*env)->GetMethodID(env, LDKNetAddress_Hostname_class, "<init>", "(JS)V");
4692 CHECK(LDKNetAddress_Hostname_meth != NULL);
4694 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4695 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
4697 case LDKNetAddress_IPv4: {
4698 int8_tArray addr_arr = (*env)->NewByteArray(env, 4);
4699 (*env)->SetByteArrayRegion(env, addr_arr, 0, 4, obj->i_pv4.addr.data);
4700 int16_t port_conv = obj->i_pv4.port;
4701 return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_arr, port_conv);
4703 case LDKNetAddress_IPv6: {
4704 int8_tArray addr_arr = (*env)->NewByteArray(env, 16);
4705 (*env)->SetByteArrayRegion(env, addr_arr, 0, 16, obj->i_pv6.addr.data);
4706 int16_t port_conv = obj->i_pv6.port;
4707 return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, port_conv);
4709 case LDKNetAddress_OnionV2: {
4710 int8_tArray onion_v2_arr = (*env)->NewByteArray(env, 12);
4711 (*env)->SetByteArrayRegion(env, onion_v2_arr, 0, 12, obj->onion_v2.data);
4712 return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, onion_v2_arr);
4714 case LDKNetAddress_OnionV3: {
4715 int8_tArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32);
4716 (*env)->SetByteArrayRegion(env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data);
4717 int16_t checksum_conv = obj->onion_v3.checksum;
4718 int8_t version_conv = obj->onion_v3.version;
4719 int16_t port_conv = obj->onion_v3.port;
4720 return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, checksum_conv, version_conv, port_conv);
4722 case LDKNetAddress_Hostname: {
4723 LDKHostname hostname_var = obj->hostname.hostname;
4724 int64_t hostname_ref = 0;
4725 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_var);
4726 hostname_ref = tag_ptr(hostname_var.inner, false);
4727 int16_t port_conv = obj->hostname.port;
4728 return (*env)->NewObject(env, LDKNetAddress_Hostname_class, LDKNetAddress_Hostname_meth, hostname_ref, port_conv);
4733 static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) {
4734 LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen };
4735 for (size_t i = 0; i < ret.datalen; i++) {
4736 ret.data[i] = NetAddress_clone(&orig->data[i]);
4740 static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
4741 LDKNodeAnnouncementInfo ret = *owner->contents.result;
4742 ret.is_owned = false;
4745 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4746 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
4747 LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv);
4748 int64_t ret_ref = 0;
4749 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4750 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4754 static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
4755 CHECK(!owner->result_ok);
4756 return DecodeError_clone(&*owner->contents.err);
4758 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4759 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
4760 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4761 *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
4762 int64_t ret_ref = tag_ptr(ret_copy, true);
4766 static inline struct LDKNodeAlias CResult_NodeAliasDecodeErrorZ_get_ok(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
4767 LDKNodeAlias ret = *owner->contents.result;
4768 ret.is_owned = false;
4771 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4772 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
4773 LDKNodeAlias ret_var = CResult_NodeAliasDecodeErrorZ_get_ok(owner_conv);
4774 int64_t ret_ref = 0;
4775 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4776 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4780 static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
4781 CHECK(!owner->result_ok);
4782 return DecodeError_clone(&*owner->contents.err);
4784 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4785 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
4786 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4787 *ret_copy = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
4788 int64_t ret_ref = tag_ptr(ret_copy, true);
4792 static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
4793 LDKNodeInfo ret = *owner->contents.result;
4794 ret.is_owned = false;
4797 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4798 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
4799 LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv);
4800 int64_t ret_ref = 0;
4801 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4802 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4806 static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
4807 CHECK(!owner->result_ok);
4808 return DecodeError_clone(&*owner->contents.err);
4810 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4811 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
4812 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4813 *ret_copy = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
4814 int64_t ret_ref = tag_ptr(ret_copy, true);
4818 static inline struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
4819 LDKNetworkGraph ret = *owner->contents.result;
4820 ret.is_owned = false;
4823 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4824 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
4825 LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv);
4826 int64_t ret_ref = 0;
4827 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4828 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4832 static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
4833 CHECK(!owner->result_ok);
4834 return DecodeError_clone(&*owner->contents.err);
4836 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4837 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
4838 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4839 *ret_copy = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
4840 int64_t ret_ref = tag_ptr(ret_copy, true);
4844 static jclass LDKCOption_CVec_NetAddressZZ_Some_class = NULL;
4845 static jmethodID LDKCOption_CVec_NetAddressZZ_Some_meth = NULL;
4846 static jclass LDKCOption_CVec_NetAddressZZ_None_class = NULL;
4847 static jmethodID LDKCOption_CVec_NetAddressZZ_None_meth = NULL;
4848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1NetAddressZZ_init (JNIEnv *env, jclass clz) {
4849 LDKCOption_CVec_NetAddressZZ_Some_class =
4850 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some"));
4851 CHECK(LDKCOption_CVec_NetAddressZZ_Some_class != NULL);
4852 LDKCOption_CVec_NetAddressZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_Some_class, "<init>", "([J)V");
4853 CHECK(LDKCOption_CVec_NetAddressZZ_Some_meth != NULL);
4854 LDKCOption_CVec_NetAddressZZ_None_class =
4855 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None"));
4856 CHECK(LDKCOption_CVec_NetAddressZZ_None_class != NULL);
4857 LDKCOption_CVec_NetAddressZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_None_class, "<init>", "()V");
4858 CHECK(LDKCOption_CVec_NetAddressZZ_None_meth != NULL);
4860 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4861 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
4863 case LDKCOption_CVec_NetAddressZZ_Some: {
4864 LDKCVec_NetAddressZ some_var = obj->some;
4865 int64_tArray some_arr = NULL;
4866 some_arr = (*env)->NewLongArray(env, some_var.datalen);
4867 int64_t *some_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, some_arr, NULL);
4868 for (size_t m = 0; m < some_var.datalen; m++) {
4869 int64_t some_conv_12_ref = tag_ptr(&some_var.data[m], false);
4870 some_arr_ptr[m] = some_conv_12_ref;
4872 (*env)->ReleasePrimitiveArrayCritical(env, some_arr, some_arr_ptr, 0);
4873 return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_Some_class, LDKCOption_CVec_NetAddressZZ_Some_meth, some_arr);
4875 case LDKCOption_CVec_NetAddressZZ_None: {
4876 return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_None_class, LDKCOption_CVec_NetAddressZZ_None_meth);
4881 static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4882 LDKDelayedPaymentOutputDescriptor ret = *owner->contents.result;
4883 ret.is_owned = false;
4886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4887 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4888 LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
4889 int64_t ret_ref = 0;
4890 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4891 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4895 static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4896 CHECK(!owner->result_ok);
4897 return DecodeError_clone(&*owner->contents.err);
4899 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4900 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4901 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4902 *ret_copy = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
4903 int64_t ret_ref = tag_ptr(ret_copy, true);
4907 static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4908 LDKStaticPaymentOutputDescriptor ret = *owner->contents.result;
4909 ret.is_owned = false;
4912 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4913 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4914 LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
4915 int64_t ret_ref = 0;
4916 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4917 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4921 static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4922 CHECK(!owner->result_ok);
4923 return DecodeError_clone(&*owner->contents.err);
4925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4926 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4927 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4928 *ret_copy = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
4929 int64_t ret_ref = tag_ptr(ret_copy, true);
4933 static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4934 CHECK(owner->result_ok);
4935 return SpendableOutputDescriptor_clone(&*owner->contents.result);
4937 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4938 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4939 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
4940 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
4941 int64_t ret_ref = tag_ptr(ret_copy, true);
4945 static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4946 CHECK(!owner->result_ok);
4947 return DecodeError_clone(&*owner->contents.err);
4949 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4950 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4951 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4952 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
4953 int64_t ret_ref = tag_ptr(ret_copy, true);
4957 static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) {
4958 LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen };
4959 for (size_t i = 0; i < ret.datalen; i++) {
4960 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
4964 static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
4967 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4968 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
4969 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
4970 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form);
4974 static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
4977 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4978 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
4979 LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv);
4980 jobjectArray ret_arr = NULL;
4981 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
4983 for (size_t i = 0; i < ret_var.datalen; i++) {
4984 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
4985 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
4986 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
4992 static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
4993 CHECK(owner->result_ok);
4994 return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result);
4996 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4997 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
4998 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
4999 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv);
5000 return tag_ptr(ret_conv, true);
5003 static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
5004 CHECK(!owner->result_ok);
5005 return *owner->contents.err;
5007 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5008 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
5009 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv);
5012 static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
5013 CHECK(owner->result_ok);
5014 return *owner->contents.result;
5016 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5017 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
5018 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
5019 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form);
5023 static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
5024 CHECK(!owner->result_ok);
5025 return *owner->contents.err;
5027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5028 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
5029 CResult_SignatureNoneZ_get_err(owner_conv);
5032 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
5035 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
5036 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
5037 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
5038 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form);
5042 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
5045 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
5046 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
5047 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
5048 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form);
5052 static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
5053 CHECK(owner->result_ok);
5054 return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result);
5056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5057 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
5058 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
5059 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv);
5060 return tag_ptr(ret_conv, true);
5063 static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
5064 CHECK(!owner->result_ok);
5065 return *owner->contents.err;
5067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5068 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
5069 CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv);
5072 static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
5073 CHECK(owner->result_ok);
5074 return *owner->contents.result;
5076 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5077 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
5078 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5079 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes);
5083 static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
5084 CHECK(!owner->result_ok);
5085 return *owner->contents.err;
5087 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5088 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
5089 CResult_SecretKeyNoneZ_get_err(owner_conv);
5092 static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
5093 CHECK(owner->result_ok);
5094 return *owner->contents.result;
5096 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5097 LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
5098 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
5099 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyNoneZ_get_ok(owner_conv).compressed_form);
5103 static inline void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
5104 CHECK(!owner->result_ok);
5105 return *owner->contents.err;
5107 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5108 LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
5109 CResult_PublicKeyNoneZ_get_err(owner_conv);
5112 static jclass LDKCOption_ScalarZ_Some_class = NULL;
5113 static jmethodID LDKCOption_ScalarZ_Some_meth = NULL;
5114 static jclass LDKCOption_ScalarZ_None_class = NULL;
5115 static jmethodID LDKCOption_ScalarZ_None_meth = NULL;
5116 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ScalarZ_init (JNIEnv *env, jclass clz) {
5117 LDKCOption_ScalarZ_Some_class =
5118 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ScalarZ$Some"));
5119 CHECK(LDKCOption_ScalarZ_Some_class != NULL);
5120 LDKCOption_ScalarZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ScalarZ_Some_class, "<init>", "(J)V");
5121 CHECK(LDKCOption_ScalarZ_Some_meth != NULL);
5122 LDKCOption_ScalarZ_None_class =
5123 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ScalarZ$None"));
5124 CHECK(LDKCOption_ScalarZ_None_class != NULL);
5125 LDKCOption_ScalarZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ScalarZ_None_class, "<init>", "()V");
5126 CHECK(LDKCOption_ScalarZ_None_meth != NULL);
5128 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ScalarZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5129 LDKCOption_ScalarZ *obj = (LDKCOption_ScalarZ*)untag_ptr(ptr);
5131 case LDKCOption_ScalarZ_Some: {
5132 LDKBigEndianScalar* some_ref = &obj->some;
5133 return (*env)->NewObject(env, LDKCOption_ScalarZ_Some_class, LDKCOption_ScalarZ_Some_meth, tag_ptr(some_ref, false));
5135 case LDKCOption_ScalarZ_None: {
5136 return (*env)->NewObject(env, LDKCOption_ScalarZ_None_class, LDKCOption_ScalarZ_None_meth);
5141 static inline struct LDKThirtyTwoBytes CResult_SharedSecretNoneZ_get_ok(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
5142 CHECK(owner->result_ok);
5143 return ThirtyTwoBytes_clone(&*owner->contents.result);
5145 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5146 LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
5147 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5148 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SharedSecretNoneZ_get_ok(owner_conv).data);
5152 static inline void CResult_SharedSecretNoneZ_get_err(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
5153 CHECK(!owner->result_ok);
5154 return *owner->contents.err;
5156 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5157 LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
5158 CResult_SharedSecretNoneZ_get_err(owner_conv);
5161 typedef struct LDKBaseSign_JCalls {
5162 atomic_size_t refcnt;
5165 jmethodID get_per_commitment_point_meth;
5166 jmethodID release_commitment_secret_meth;
5167 jmethodID validate_holder_commitment_meth;
5168 jmethodID channel_keys_id_meth;
5169 jmethodID sign_counterparty_commitment_meth;
5170 jmethodID validate_counterparty_revocation_meth;
5171 jmethodID sign_holder_commitment_and_htlcs_meth;
5172 jmethodID sign_justice_revoked_output_meth;
5173 jmethodID sign_justice_revoked_htlc_meth;
5174 jmethodID sign_counterparty_htlc_transaction_meth;
5175 jmethodID sign_closing_transaction_meth;
5176 jmethodID sign_holder_anchor_input_meth;
5177 jmethodID sign_channel_announcement_meth;
5178 jmethodID ready_channel_meth;
5179 } LDKBaseSign_JCalls;
5180 static void LDKBaseSign_JCalls_free(void* this_arg) {
5181 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5182 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5184 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5185 if (get_jenv_res == JNI_EDETACHED) {
5186 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5188 DO_ASSERT(get_jenv_res == JNI_OK);
5190 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
5191 if (get_jenv_res == JNI_EDETACHED) {
5192 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5197 LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
5198 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5200 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5201 if (get_jenv_res == JNI_EDETACHED) {
5202 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5204 DO_ASSERT(get_jenv_res == JNI_OK);
5206 int64_t idx_conv = idx;
5207 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5209 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv);
5210 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5211 (*env)->ExceptionDescribe(env);
5212 (*env)->FatalError(env, "A call to get_per_commitment_point in LDKBaseSign from rust threw an exception.");
5214 LDKPublicKey ret_ref;
5215 CHECK((*env)->GetArrayLength(env, ret) == 33);
5216 (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
5217 if (get_jenv_res == JNI_EDETACHED) {
5218 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5222 LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
5223 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5225 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5226 if (get_jenv_res == JNI_EDETACHED) {
5227 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5229 DO_ASSERT(get_jenv_res == JNI_OK);
5231 int64_t idx_conv = idx;
5232 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5234 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv);
5235 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5236 (*env)->ExceptionDescribe(env);
5237 (*env)->FatalError(env, "A call to release_commitment_secret in LDKBaseSign from rust threw an exception.");
5239 LDKThirtyTwoBytes ret_ref;
5240 CHECK((*env)->GetArrayLength(env, ret) == 32);
5241 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
5242 if (get_jenv_res == JNI_EDETACHED) {
5243 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5247 LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
5248 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5250 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5251 if (get_jenv_res == JNI_EDETACHED) {
5252 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5254 DO_ASSERT(get_jenv_res == JNI_OK);
5256 LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
5257 int64_t holder_tx_ref = 0;
5258 holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var);
5259 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var);
5260 holder_tx_ref = tag_ptr(holder_tx_var.inner, holder_tx_var.is_owned);
5261 LDKCVec_PaymentPreimageZ preimages_var = preimages;
5262 jobjectArray preimages_arr = NULL;
5263 preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL);
5265 for (size_t i = 0; i < preimages_var.datalen; i++) {
5266 int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32);
5267 (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data);
5268 (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr);
5271 FREE(preimages_var.data);
5272 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5274 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_holder_commitment_meth, holder_tx_ref, preimages_arr);
5275 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5276 (*env)->ExceptionDescribe(env);
5277 (*env)->FatalError(env, "A call to validate_holder_commitment in LDKBaseSign from rust threw an exception.");
5279 void* ret_ptr = untag_ptr(ret);
5280 CHECK_ACCESS(ret_ptr);
5281 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
5282 FREE(untag_ptr(ret));
5283 if (get_jenv_res == JNI_EDETACHED) {
5284 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5288 LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) {
5289 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5291 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5292 if (get_jenv_res == JNI_EDETACHED) {
5293 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5295 DO_ASSERT(get_jenv_res == JNI_OK);
5297 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5299 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth);
5300 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5301 (*env)->ExceptionDescribe(env);
5302 (*env)->FatalError(env, "A call to channel_keys_id in LDKBaseSign from rust threw an exception.");
5304 LDKThirtyTwoBytes ret_ref;
5305 CHECK((*env)->GetArrayLength(env, ret) == 32);
5306 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
5307 if (get_jenv_res == JNI_EDETACHED) {
5308 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5312 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
5313 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5315 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5316 if (get_jenv_res == JNI_EDETACHED) {
5317 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5319 DO_ASSERT(get_jenv_res == JNI_OK);
5321 LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
5322 int64_t commitment_tx_ref = 0;
5323 commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var);
5324 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
5325 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
5326 LDKCVec_PaymentPreimageZ preimages_var = preimages;
5327 jobjectArray preimages_arr = NULL;
5328 preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL);
5330 for (size_t i = 0; i < preimages_var.datalen; i++) {
5331 int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32);
5332 (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data);
5333 (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr);
5336 FREE(preimages_var.data);
5337 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5339 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_commitment_meth, commitment_tx_ref, preimages_arr);
5340 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5341 (*env)->ExceptionDescribe(env);
5342 (*env)->FatalError(env, "A call to sign_counterparty_commitment in LDKBaseSign from rust threw an exception.");
5344 void* ret_ptr = untag_ptr(ret);
5345 CHECK_ACCESS(ret_ptr);
5346 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
5347 FREE(untag_ptr(ret));
5348 if (get_jenv_res == JNI_EDETACHED) {
5349 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5353 LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
5354 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5356 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5357 if (get_jenv_res == JNI_EDETACHED) {
5358 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5360 DO_ASSERT(get_jenv_res == JNI_OK);
5362 int64_t idx_conv = idx;
5363 int8_tArray secret_arr = (*env)->NewByteArray(env, 32);
5364 (*env)->SetByteArrayRegion(env, secret_arr, 0, 32, *secret);
5365 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5367 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_counterparty_revocation_meth, idx_conv, secret_arr);
5368 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5369 (*env)->ExceptionDescribe(env);
5370 (*env)->FatalError(env, "A call to validate_counterparty_revocation in LDKBaseSign from rust threw an exception.");
5372 void* ret_ptr = untag_ptr(ret);
5373 CHECK_ACCESS(ret_ptr);
5374 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
5375 FREE(untag_ptr(ret));
5376 if (get_jenv_res == JNI_EDETACHED) {
5377 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5381 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
5382 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5384 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5385 if (get_jenv_res == JNI_EDETACHED) {
5386 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5388 DO_ASSERT(get_jenv_res == JNI_OK);
5390 LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
5391 int64_t commitment_tx_ref = 0;
5392 commitment_tx_var = HolderCommitmentTransaction_clone(&commitment_tx_var);
5393 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
5394 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
5395 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5397 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref);
5398 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5399 (*env)->ExceptionDescribe(env);
5400 (*env)->FatalError(env, "A call to sign_holder_commitment_and_htlcs in LDKBaseSign from rust threw an exception.");
5402 void* ret_ptr = untag_ptr(ret);
5403 CHECK_ACCESS(ret_ptr);
5404 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
5405 FREE(untag_ptr(ret));
5406 if (get_jenv_res == JNI_EDETACHED) {
5407 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5411 LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32]) {
5412 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5414 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5415 if (get_jenv_res == JNI_EDETACHED) {
5416 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5418 DO_ASSERT(get_jenv_res == JNI_OK);
5420 LDKTransaction justice_tx_var = justice_tx;
5421 int8_tArray justice_tx_arr = (*env)->NewByteArray(env, justice_tx_var.datalen);
5422 (*env)->SetByteArrayRegion(env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data);
5423 Transaction_free(justice_tx_var);
5424 int64_t input_conv = input;
5425 int64_t amount_conv = amount;
5426 int8_tArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
5427 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
5428 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5430 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_output_meth, justice_tx_arr, input_conv, amount_conv, per_commitment_key_arr);
5431 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5432 (*env)->ExceptionDescribe(env);
5433 (*env)->FatalError(env, "A call to sign_justice_revoked_output in LDKBaseSign from rust threw an exception.");
5435 void* ret_ptr = untag_ptr(ret);
5436 CHECK_ACCESS(ret_ptr);
5437 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
5438 FREE(untag_ptr(ret));
5439 if (get_jenv_res == JNI_EDETACHED) {
5440 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5444 LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
5445 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5447 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5448 if (get_jenv_res == JNI_EDETACHED) {
5449 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5451 DO_ASSERT(get_jenv_res == JNI_OK);
5453 LDKTransaction justice_tx_var = justice_tx;
5454 int8_tArray justice_tx_arr = (*env)->NewByteArray(env, justice_tx_var.datalen);
5455 (*env)->SetByteArrayRegion(env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data);
5456 Transaction_free(justice_tx_var);
5457 int64_t input_conv = input;
5458 int64_t amount_conv = amount;
5459 int8_tArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
5460 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
5461 LDKHTLCOutputInCommitment htlc_var = *htlc;
5462 int64_t htlc_ref = 0;
5463 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
5464 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
5465 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
5466 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5468 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_htlc_meth, justice_tx_arr, input_conv, amount_conv, per_commitment_key_arr, htlc_ref);
5469 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5470 (*env)->ExceptionDescribe(env);
5471 (*env)->FatalError(env, "A call to sign_justice_revoked_htlc in LDKBaseSign from rust threw an exception.");
5473 void* ret_ptr = untag_ptr(ret);
5474 CHECK_ACCESS(ret_ptr);
5475 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
5476 FREE(untag_ptr(ret));
5477 if (get_jenv_res == JNI_EDETACHED) {
5478 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5482 LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
5483 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5485 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5486 if (get_jenv_res == JNI_EDETACHED) {
5487 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5489 DO_ASSERT(get_jenv_res == JNI_OK);
5491 LDKTransaction htlc_tx_var = htlc_tx;
5492 int8_tArray htlc_tx_arr = (*env)->NewByteArray(env, htlc_tx_var.datalen);
5493 (*env)->SetByteArrayRegion(env, htlc_tx_arr, 0, htlc_tx_var.datalen, htlc_tx_var.data);
5494 Transaction_free(htlc_tx_var);
5495 int64_t input_conv = input;
5496 int64_t amount_conv = amount;
5497 int8_tArray per_commitment_point_arr = (*env)->NewByteArray(env, 33);
5498 (*env)->SetByteArrayRegion(env, per_commitment_point_arr, 0, 33, per_commitment_point.compressed_form);
5499 LDKHTLCOutputInCommitment htlc_var = *htlc;
5500 int64_t htlc_ref = 0;
5501 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
5502 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
5503 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
5504 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5506 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input_conv, amount_conv, per_commitment_point_arr, htlc_ref);
5507 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5508 (*env)->ExceptionDescribe(env);
5509 (*env)->FatalError(env, "A call to sign_counterparty_htlc_transaction in LDKBaseSign from rust threw an exception.");
5511 void* ret_ptr = untag_ptr(ret);
5512 CHECK_ACCESS(ret_ptr);
5513 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
5514 FREE(untag_ptr(ret));
5515 if (get_jenv_res == JNI_EDETACHED) {
5516 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5520 LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
5521 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5523 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5524 if (get_jenv_res == JNI_EDETACHED) {
5525 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5527 DO_ASSERT(get_jenv_res == JNI_OK);
5529 LDKClosingTransaction closing_tx_var = *closing_tx;
5530 int64_t closing_tx_ref = 0;
5531 closing_tx_var = ClosingTransaction_clone(&closing_tx_var);
5532 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
5533 closing_tx_ref = tag_ptr(closing_tx_var.inner, closing_tx_var.is_owned);
5534 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5536 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_closing_transaction_meth, closing_tx_ref);
5537 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5538 (*env)->ExceptionDescribe(env);
5539 (*env)->FatalError(env, "A call to sign_closing_transaction in LDKBaseSign from rust threw an exception.");
5541 void* ret_ptr = untag_ptr(ret);
5542 CHECK_ACCESS(ret_ptr);
5543 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
5544 FREE(untag_ptr(ret));
5545 if (get_jenv_res == JNI_EDETACHED) {
5546 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5550 LDKCResult_SignatureNoneZ sign_holder_anchor_input_LDKBaseSign_jcall(const void* this_arg, LDKTransaction anchor_tx, uintptr_t input) {
5551 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5553 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5554 if (get_jenv_res == JNI_EDETACHED) {
5555 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5557 DO_ASSERT(get_jenv_res == JNI_OK);
5559 LDKTransaction anchor_tx_var = anchor_tx;
5560 int8_tArray anchor_tx_arr = (*env)->NewByteArray(env, anchor_tx_var.datalen);
5561 (*env)->SetByteArrayRegion(env, anchor_tx_arr, 0, anchor_tx_var.datalen, anchor_tx_var.data);
5562 Transaction_free(anchor_tx_var);
5563 int64_t input_conv = input;
5564 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5566 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_anchor_input_meth, anchor_tx_arr, input_conv);
5567 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5568 (*env)->ExceptionDescribe(env);
5569 (*env)->FatalError(env, "A call to sign_holder_anchor_input in LDKBaseSign from rust threw an exception.");
5571 void* ret_ptr = untag_ptr(ret);
5572 CHECK_ACCESS(ret_ptr);
5573 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
5574 FREE(untag_ptr(ret));
5575 if (get_jenv_res == JNI_EDETACHED) {
5576 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5580 LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
5581 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5583 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5584 if (get_jenv_res == JNI_EDETACHED) {
5585 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5587 DO_ASSERT(get_jenv_res == JNI_OK);
5589 LDKUnsignedChannelAnnouncement msg_var = *msg;
5590 int64_t msg_ref = 0;
5591 msg_var = UnsignedChannelAnnouncement_clone(&msg_var);
5592 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
5593 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
5594 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5596 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_channel_announcement_meth, msg_ref);
5597 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5598 (*env)->ExceptionDescribe(env);
5599 (*env)->FatalError(env, "A call to sign_channel_announcement in LDKBaseSign from rust threw an exception.");
5601 void* ret_ptr = untag_ptr(ret);
5602 CHECK_ACCESS(ret_ptr);
5603 LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr);
5604 FREE(untag_ptr(ret));
5605 if (get_jenv_res == JNI_EDETACHED) {
5606 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5610 void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
5611 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
5613 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5614 if (get_jenv_res == JNI_EDETACHED) {
5615 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5617 DO_ASSERT(get_jenv_res == JNI_OK);
5619 LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
5620 int64_t channel_parameters_ref = 0;
5621 channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
5622 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
5623 channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
5624 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5626 (*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref);
5627 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5628 (*env)->ExceptionDescribe(env);
5629 (*env)->FatalError(env, "A call to ready_channel in LDKBaseSign from rust threw an exception.");
5631 if (get_jenv_res == JNI_EDETACHED) {
5632 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5635 static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
5636 jclass c = (*env)->GetObjectClass(env, o);
5638 LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
5639 atomic_init(&calls->refcnt, 1);
5640 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
5641 calls->o = (*env)->NewWeakGlobalRef(env, o);
5642 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)[B");
5643 CHECK(calls->get_per_commitment_point_meth != NULL);
5644 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B");
5645 CHECK(calls->release_commitment_secret_meth != NULL);
5646 calls->validate_holder_commitment_meth = (*env)->GetMethodID(env, c, "validate_holder_commitment", "(J[[B)J");
5647 CHECK(calls->validate_holder_commitment_meth != NULL);
5648 calls->channel_keys_id_meth = (*env)->GetMethodID(env, c, "channel_keys_id", "()[B");
5649 CHECK(calls->channel_keys_id_meth != NULL);
5650 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(J[[B)J");
5651 CHECK(calls->sign_counterparty_commitment_meth != NULL);
5652 calls->validate_counterparty_revocation_meth = (*env)->GetMethodID(env, c, "validate_counterparty_revocation", "(J[B)J");
5653 CHECK(calls->validate_counterparty_revocation_meth != NULL);
5654 calls->sign_holder_commitment_and_htlcs_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_and_htlcs", "(J)J");
5655 CHECK(calls->sign_holder_commitment_and_htlcs_meth != NULL);
5656 calls->sign_justice_revoked_output_meth = (*env)->GetMethodID(env, c, "sign_justice_revoked_output", "([BJJ[B)J");
5657 CHECK(calls->sign_justice_revoked_output_meth != NULL);
5658 calls->sign_justice_revoked_htlc_meth = (*env)->GetMethodID(env, c, "sign_justice_revoked_htlc", "([BJJ[BJ)J");
5659 CHECK(calls->sign_justice_revoked_htlc_meth != NULL);
5660 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "([BJJ[BJ)J");
5661 CHECK(calls->sign_counterparty_htlc_transaction_meth != NULL);
5662 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
5663 CHECK(calls->sign_closing_transaction_meth != NULL);
5664 calls->sign_holder_anchor_input_meth = (*env)->GetMethodID(env, c, "sign_holder_anchor_input", "([BJ)J");
5665 CHECK(calls->sign_holder_anchor_input_meth != NULL);
5666 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
5667 CHECK(calls->sign_channel_announcement_meth != NULL);
5668 calls->ready_channel_meth = (*env)->GetMethodID(env, c, "ready_channel", "(J)V");
5669 CHECK(calls->ready_channel_meth != NULL);
5671 LDKChannelPublicKeys pubkeys_conv;
5672 pubkeys_conv.inner = untag_ptr(pubkeys);
5673 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
5674 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
5677 .this_arg = (void*) calls,
5678 .get_per_commitment_point = get_per_commitment_point_LDKBaseSign_jcall,
5679 .release_commitment_secret = release_commitment_secret_LDKBaseSign_jcall,
5680 .validate_holder_commitment = validate_holder_commitment_LDKBaseSign_jcall,
5681 .channel_keys_id = channel_keys_id_LDKBaseSign_jcall,
5682 .sign_counterparty_commitment = sign_counterparty_commitment_LDKBaseSign_jcall,
5683 .validate_counterparty_revocation = validate_counterparty_revocation_LDKBaseSign_jcall,
5684 .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKBaseSign_jcall,
5685 .sign_justice_revoked_output = sign_justice_revoked_output_LDKBaseSign_jcall,
5686 .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall,
5687 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall,
5688 .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall,
5689 .sign_holder_anchor_input = sign_holder_anchor_input_LDKBaseSign_jcall,
5690 .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall,
5691 .ready_channel = ready_channel_LDKBaseSign_jcall,
5692 .free = LDKBaseSign_JCalls_free,
5693 .pubkeys = pubkeys_conv,
5694 .set_pubkeys = NULL,
5698 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKBaseSign_1new(JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
5699 LDKBaseSign *res_ptr = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
5700 *res_ptr = LDKBaseSign_init(env, clz, o, pubkeys);
5701 return tag_ptr(res_ptr, true);
5703 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
5704 void* this_arg_ptr = untag_ptr(this_arg);
5705 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5706 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5707 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
5708 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form);
5712 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
5713 void* this_arg_ptr = untag_ptr(this_arg);
5714 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5715 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5716 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5717 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data);
5721 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1holder_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t holder_tx, jobjectArray preimages) {
5722 void* this_arg_ptr = untag_ptr(this_arg);
5723 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5724 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5725 LDKHolderCommitmentTransaction holder_tx_conv;
5726 holder_tx_conv.inner = untag_ptr(holder_tx);
5727 holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
5728 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
5729 holder_tx_conv.is_owned = false;
5730 LDKCVec_PaymentPreimageZ preimages_constr;
5731 preimages_constr.datalen = (*env)->GetArrayLength(env, preimages);
5732 if (preimages_constr.datalen > 0)
5733 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
5735 preimages_constr.data = NULL;
5736 for (size_t i = 0; i < preimages_constr.datalen; i++) {
5737 int8_tArray preimages_conv_8 = (*env)->GetObjectArrayElement(env, preimages, i);
5738 LDKThirtyTwoBytes preimages_conv_8_ref;
5739 CHECK((*env)->GetArrayLength(env, preimages_conv_8) == 32);
5740 (*env)->GetByteArrayRegion(env, preimages_conv_8, 0, 32, preimages_conv_8_ref.data);
5741 preimages_constr.data[i] = preimages_conv_8_ref;
5743 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
5744 *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
5745 return tag_ptr(ret_conv, true);
5748 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
5749 void* this_arg_ptr = untag_ptr(this_arg);
5750 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5751 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5752 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5753 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data);
5757 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterparty_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx, jobjectArray preimages) {
5758 void* this_arg_ptr = untag_ptr(this_arg);
5759 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5760 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5761 LDKCommitmentTransaction commitment_tx_conv;
5762 commitment_tx_conv.inner = untag_ptr(commitment_tx);
5763 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
5764 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
5765 commitment_tx_conv.is_owned = false;
5766 LDKCVec_PaymentPreimageZ preimages_constr;
5767 preimages_constr.datalen = (*env)->GetArrayLength(env, preimages);
5768 if (preimages_constr.datalen > 0)
5769 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
5771 preimages_constr.data = NULL;
5772 for (size_t i = 0; i < preimages_constr.datalen; i++) {
5773 int8_tArray preimages_conv_8 = (*env)->GetObjectArrayElement(env, preimages, i);
5774 LDKThirtyTwoBytes preimages_conv_8_ref;
5775 CHECK((*env)->GetArrayLength(env, preimages_conv_8) == 32);
5776 (*env)->GetByteArrayRegion(env, preimages_conv_8, 0, 32, preimages_conv_8_ref.data);
5777 preimages_constr.data[i] = preimages_conv_8_ref;
5779 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
5780 *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, preimages_constr);
5781 return tag_ptr(ret_conv, true);
5784 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1counterparty_1revocation(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx, int8_tArray secret) {
5785 void* this_arg_ptr = untag_ptr(this_arg);
5786 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5787 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5788 unsigned char secret_arr[32];
5789 CHECK((*env)->GetArrayLength(env, secret) == 32);
5790 (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_arr);
5791 unsigned char (*secret_ref)[32] = &secret_arr;
5792 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
5793 *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref);
5794 return tag_ptr(ret_conv, true);
5797 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1commitment_1and_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) {
5798 void* this_arg_ptr = untag_ptr(this_arg);
5799 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5800 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5801 LDKHolderCommitmentTransaction commitment_tx_conv;
5802 commitment_tx_conv.inner = untag_ptr(commitment_tx);
5803 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
5804 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
5805 commitment_tx_conv.is_owned = false;
5806 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
5807 *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv);
5808 return tag_ptr(ret_conv, true);
5811 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1justice_1revoked_1output(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key) {
5812 void* this_arg_ptr = untag_ptr(this_arg);
5813 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5814 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5815 LDKTransaction justice_tx_ref;
5816 justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
5817 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
5818 (*env)->GetByteArrayRegion(env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data);
5819 justice_tx_ref.data_is_owned = true;
5820 unsigned char per_commitment_key_arr[32];
5821 CHECK((*env)->GetArrayLength(env, per_commitment_key) == 32);
5822 (*env)->GetByteArrayRegion(env, per_commitment_key, 0, 32, per_commitment_key_arr);
5823 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
5824 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
5825 *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref);
5826 return tag_ptr(ret_conv, true);
5829 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1justice_1revoked_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, int64_t htlc) {
5830 void* this_arg_ptr = untag_ptr(this_arg);
5831 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5832 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5833 LDKTransaction justice_tx_ref;
5834 justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
5835 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
5836 (*env)->GetByteArrayRegion(env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data);
5837 justice_tx_ref.data_is_owned = true;
5838 unsigned char per_commitment_key_arr[32];
5839 CHECK((*env)->GetArrayLength(env, per_commitment_key) == 32);
5840 (*env)->GetByteArrayRegion(env, per_commitment_key, 0, 32, per_commitment_key_arr);
5841 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
5842 LDKHTLCOutputInCommitment htlc_conv;
5843 htlc_conv.inner = untag_ptr(htlc);
5844 htlc_conv.is_owned = ptr_is_owned(htlc);
5845 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
5846 htlc_conv.is_owned = false;
5847 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
5848 *ret_conv = (this_arg_conv->sign_justice_revoked_htlc)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref, &htlc_conv);
5849 return tag_ptr(ret_conv, true);
5852 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterparty_1htlc_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, int64_t htlc) {
5853 void* this_arg_ptr = untag_ptr(this_arg);
5854 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5855 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5856 LDKTransaction htlc_tx_ref;
5857 htlc_tx_ref.datalen = (*env)->GetArrayLength(env, htlc_tx);
5858 htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
5859 (*env)->GetByteArrayRegion(env, htlc_tx, 0, htlc_tx_ref.datalen, htlc_tx_ref.data);
5860 htlc_tx_ref.data_is_owned = true;
5861 LDKPublicKey per_commitment_point_ref;
5862 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
5863 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
5864 LDKHTLCOutputInCommitment htlc_conv;
5865 htlc_conv.inner = untag_ptr(htlc);
5866 htlc_conv.is_owned = ptr_is_owned(htlc);
5867 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
5868 htlc_conv.is_owned = false;
5869 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
5870 *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_ref, input, amount, per_commitment_point_ref, &htlc_conv);
5871 return tag_ptr(ret_conv, true);
5874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1closing_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int64_t closing_tx) {
5875 void* this_arg_ptr = untag_ptr(this_arg);
5876 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5877 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5878 LDKClosingTransaction closing_tx_conv;
5879 closing_tx_conv.inner = untag_ptr(closing_tx);
5880 closing_tx_conv.is_owned = ptr_is_owned(closing_tx);
5881 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv);
5882 closing_tx_conv.is_owned = false;
5883 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
5884 *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv);
5885 return tag_ptr(ret_conv, true);
5888 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1anchor_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray anchor_tx, int64_t input) {
5889 void* this_arg_ptr = untag_ptr(this_arg);
5890 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5891 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5892 LDKTransaction anchor_tx_ref;
5893 anchor_tx_ref.datalen = (*env)->GetArrayLength(env, anchor_tx);
5894 anchor_tx_ref.data = MALLOC(anchor_tx_ref.datalen, "LDKTransaction Bytes");
5895 (*env)->GetByteArrayRegion(env, anchor_tx, 0, anchor_tx_ref.datalen, anchor_tx_ref.data);
5896 anchor_tx_ref.data_is_owned = true;
5897 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
5898 *ret_conv = (this_arg_conv->sign_holder_anchor_input)(this_arg_conv->this_arg, anchor_tx_ref, input);
5899 return tag_ptr(ret_conv, true);
5902 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
5903 void* this_arg_ptr = untag_ptr(this_arg);
5904 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5905 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5906 LDKUnsignedChannelAnnouncement msg_conv;
5907 msg_conv.inner = untag_ptr(msg);
5908 msg_conv.is_owned = ptr_is_owned(msg);
5909 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
5910 msg_conv.is_owned = false;
5911 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
5912 *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
5913 return tag_ptr(ret_conv, true);
5916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) {
5917 void* this_arg_ptr = untag_ptr(this_arg);
5918 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5919 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5920 LDKChannelTransactionParameters channel_parameters_conv;
5921 channel_parameters_conv.inner = untag_ptr(channel_parameters);
5922 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
5923 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
5924 channel_parameters_conv.is_owned = false;
5925 (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
5928 LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) {
5929 if (this_arg->set_pubkeys != NULL)
5930 this_arg->set_pubkeys(this_arg);
5931 return this_arg->pubkeys;
5933 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
5934 void* this_arg_ptr = untag_ptr(this_arg);
5935 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5936 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5937 LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
5938 int64_t ret_ref = 0;
5939 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5940 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5944 typedef struct LDKSign_JCalls {
5945 atomic_size_t refcnt;
5948 LDKBaseSign_JCalls* BaseSign;
5949 jmethodID write_meth;
5951 static void LDKSign_JCalls_free(void* this_arg) {
5952 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
5953 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5955 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5956 if (get_jenv_res == JNI_EDETACHED) {
5957 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5959 DO_ASSERT(get_jenv_res == JNI_OK);
5961 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
5962 if (get_jenv_res == JNI_EDETACHED) {
5963 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5968 LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
5969 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
5971 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5972 if (get_jenv_res == JNI_EDETACHED) {
5973 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5975 DO_ASSERT(get_jenv_res == JNI_OK);
5977 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5979 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
5980 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5981 (*env)->ExceptionDescribe(env);
5982 (*env)->FatalError(env, "A call to write in LDKSign from rust threw an exception.");
5984 LDKCVec_u8Z ret_ref;
5985 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
5986 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5987 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
5988 if (get_jenv_res == JNI_EDETACHED) {
5989 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5993 static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
5994 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
5995 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5996 atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
5998 static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, jobject BaseSign, int64_t pubkeys) {
5999 jclass c = (*env)->GetObjectClass(env, o);
6001 LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
6002 atomic_init(&calls->refcnt, 1);
6003 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6004 calls->o = (*env)->NewWeakGlobalRef(env, o);
6005 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
6006 CHECK(calls->write_meth != NULL);
6008 LDKChannelPublicKeys pubkeys_conv;
6009 pubkeys_conv.inner = untag_ptr(pubkeys);
6010 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
6011 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
6014 .this_arg = (void*) calls,
6015 .write = write_LDKSign_jcall,
6016 .cloned = LDKSign_JCalls_cloned,
6017 .free = LDKSign_JCalls_free,
6018 .BaseSign = LDKBaseSign_init(env, clz, BaseSign, pubkeys),
6020 calls->BaseSign = ret.BaseSign.this_arg;
6023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSign_1new(JNIEnv *env, jclass clz, jobject o, jobject BaseSign, int64_t pubkeys) {
6024 LDKSign *res_ptr = MALLOC(sizeof(LDKSign), "LDKSign");
6025 *res_ptr = LDKSign_init(env, clz, o, BaseSign, pubkeys);
6026 return tag_ptr(res_ptr, true);
6028 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSign_1get_1BaseSign(JNIEnv *env, jclass clz, int64_t arg) {
6029 LDKSign *inp = (LDKSign *)untag_ptr(arg);
6030 return tag_ptr(&inp->BaseSign, false);
6032 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
6033 void* this_arg_ptr = untag_ptr(this_arg);
6034 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6035 LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
6036 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
6037 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
6038 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
6039 CVec_u8Z_free(ret_var);
6043 static inline struct LDKSign CResult_SignDecodeErrorZ_get_ok(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
6044 CHECK(owner->result_ok);
6045 return Sign_clone(&*owner->contents.result);
6047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6048 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
6049 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
6050 *ret_ret = CResult_SignDecodeErrorZ_get_ok(owner_conv);
6051 return tag_ptr(ret_ret, true);
6054 static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
6055 CHECK(!owner->result_ok);
6056 return DecodeError_clone(&*owner->contents.err);
6058 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6059 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
6060 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6061 *ret_copy = CResult_SignDecodeErrorZ_get_err(owner_conv);
6062 int64_t ret_ref = tag_ptr(ret_copy, true);
6066 static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
6067 CHECK(owner->result_ok);
6068 return *owner->contents.result;
6070 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6071 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
6072 int8_tArray ret_arr = (*env)->NewByteArray(env, 68);
6073 (*env)->SetByteArrayRegion(env, ret_arr, 0, 68, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form);
6077 static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
6078 CHECK(!owner->result_ok);
6079 return *owner->contents.err;
6081 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6082 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
6083 CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
6086 static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
6087 LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
6088 for (size_t i = 0; i < ret.datalen; i++) {
6089 ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
6093 static inline struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
6094 CHECK(owner->result_ok);
6095 return CVec_CVec_u8ZZ_clone(&*owner->contents.result);
6097 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6098 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
6099 LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv);
6100 jobjectArray ret_arr = NULL;
6101 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
6103 for (size_t i = 0; i < ret_var.datalen; i++) {
6104 LDKCVec_u8Z ret_conv_8_var = ret_var.data[i];
6105 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen);
6106 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data);
6107 CVec_u8Z_free(ret_conv_8_var);
6108 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
6115 static inline void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
6116 CHECK(!owner->result_ok);
6117 return *owner->contents.err;
6119 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6120 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
6121 CResult_CVec_CVec_u8ZZNoneZ_get_err(owner_conv);
6124 static inline struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
6125 LDKInMemorySigner ret = *owner->contents.result;
6126 ret.is_owned = false;
6129 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6130 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
6131 LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv);
6132 int64_t ret_ref = 0;
6133 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6134 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6138 static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
6139 CHECK(!owner->result_ok);
6140 return DecodeError_clone(&*owner->contents.err);
6142 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6143 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
6144 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6145 *ret_copy = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
6146 int64_t ret_ref = tag_ptr(ret_copy, true);
6150 static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
6151 LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
6152 for (size_t i = 0; i < ret.datalen; i++) {
6153 ret.data[i] = TxOut_clone(&orig->data[i]);
6157 static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
6158 CHECK(owner->result_ok);
6159 return *owner->contents.result;
6161 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6162 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
6163 LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv);
6164 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
6165 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
6169 static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
6170 CHECK(!owner->result_ok);
6171 return *owner->contents.err;
6173 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6174 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
6175 CResult_TransactionNoneZ_get_err(owner_conv);
6178 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6179 return ThirtyTwoBytes_clone(&owner->a);
6181 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
6182 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6183 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6184 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data);
6188 static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6189 LDKChannelMonitor ret = owner->b;
6190 ret.is_owned = false;
6193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
6194 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6195 LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv);
6196 int64_t ret_ref = 0;
6197 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6198 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6202 static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(const LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *orig) {
6203 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ clone bytes"), .datalen = orig->datalen };
6204 for (size_t i = 0; i < ret.datalen; i++) {
6205 ret.data[i] = C2Tuple_BlockHashChannelMonitorZ_clone(&orig->data[i]);
6209 static inline struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner){
6210 CHECK(owner->result_ok);
6211 return CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(&*owner->contents.result);
6213 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6214 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(owner);
6215 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret_var = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(owner_conv);
6216 int64_tArray ret_arr = NULL;
6217 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
6218 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
6219 for (size_t j = 0; j < ret_var.datalen; j++) {
6220 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv_35_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
6221 *ret_conv_35_conv = ret_var.data[j];
6222 ret_arr_ptr[j] = tag_ptr(ret_conv_35_conv, true);
6224 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
6229 static inline enum LDKIOError CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner){
6230 CHECK(!owner->result_ok);
6231 return *owner->contents.err;
6233 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6234 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(owner);
6235 jclass ret_conv = LDKIOError_to_java(env, CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(owner_conv));
6239 static jclass LDKCOption_u16Z_Some_class = NULL;
6240 static jmethodID LDKCOption_u16Z_Some_meth = NULL;
6241 static jclass LDKCOption_u16Z_None_class = NULL;
6242 static jmethodID LDKCOption_u16Z_None_meth = NULL;
6243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u16Z_init (JNIEnv *env, jclass clz) {
6244 LDKCOption_u16Z_Some_class =
6245 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$Some"));
6246 CHECK(LDKCOption_u16Z_Some_class != NULL);
6247 LDKCOption_u16Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_Some_class, "<init>", "(S)V");
6248 CHECK(LDKCOption_u16Z_Some_meth != NULL);
6249 LDKCOption_u16Z_None_class =
6250 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$None"));
6251 CHECK(LDKCOption_u16Z_None_class != NULL);
6252 LDKCOption_u16Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_None_class, "<init>", "()V");
6253 CHECK(LDKCOption_u16Z_None_meth != NULL);
6255 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u16Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
6256 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
6258 case LDKCOption_u16Z_Some: {
6259 int16_t some_conv = obj->some;
6260 return (*env)->NewObject(env, LDKCOption_u16Z_Some_class, LDKCOption_u16Z_Some_meth, some_conv);
6262 case LDKCOption_u16Z_None: {
6263 return (*env)->NewObject(env, LDKCOption_u16Z_None_class, LDKCOption_u16Z_None_meth);
6268 static jclass LDKAPIError_APIMisuseError_class = NULL;
6269 static jmethodID LDKAPIError_APIMisuseError_meth = NULL;
6270 static jclass LDKAPIError_FeeRateTooHigh_class = NULL;
6271 static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL;
6272 static jclass LDKAPIError_RouteError_class = NULL;
6273 static jmethodID LDKAPIError_RouteError_meth = NULL;
6274 static jclass LDKAPIError_ChannelUnavailable_class = NULL;
6275 static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL;
6276 static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL;
6277 static jmethodID LDKAPIError_MonitorUpdateInProgress_meth = NULL;
6278 static jclass LDKAPIError_IncompatibleShutdownScript_class = NULL;
6279 static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL;
6280 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) {
6281 LDKAPIError_APIMisuseError_class =
6282 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$APIMisuseError"));
6283 CHECK(LDKAPIError_APIMisuseError_class != NULL);
6284 LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "<init>", "(Ljava/lang/String;)V");
6285 CHECK(LDKAPIError_APIMisuseError_meth != NULL);
6286 LDKAPIError_FeeRateTooHigh_class =
6287 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh"));
6288 CHECK(LDKAPIError_FeeRateTooHigh_class != NULL);
6289 LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "<init>", "(Ljava/lang/String;I)V");
6290 CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL);
6291 LDKAPIError_RouteError_class =
6292 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$RouteError"));
6293 CHECK(LDKAPIError_RouteError_class != NULL);
6294 LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "<init>", "(Ljava/lang/String;)V");
6295 CHECK(LDKAPIError_RouteError_meth != NULL);
6296 LDKAPIError_ChannelUnavailable_class =
6297 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable"));
6298 CHECK(LDKAPIError_ChannelUnavailable_class != NULL);
6299 LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "<init>", "(Ljava/lang/String;)V");
6300 CHECK(LDKAPIError_ChannelUnavailable_meth != NULL);
6301 LDKAPIError_MonitorUpdateInProgress_class =
6302 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateInProgress"));
6303 CHECK(LDKAPIError_MonitorUpdateInProgress_class != NULL);
6304 LDKAPIError_MonitorUpdateInProgress_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateInProgress_class, "<init>", "()V");
6305 CHECK(LDKAPIError_MonitorUpdateInProgress_meth != NULL);
6306 LDKAPIError_IncompatibleShutdownScript_class =
6307 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript"));
6308 CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL);
6309 LDKAPIError_IncompatibleShutdownScript_meth = (*env)->GetMethodID(env, LDKAPIError_IncompatibleShutdownScript_class, "<init>", "(J)V");
6310 CHECK(LDKAPIError_IncompatibleShutdownScript_meth != NULL);
6312 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
6313 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
6315 case LDKAPIError_APIMisuseError: {
6316 LDKStr err_str = obj->api_misuse_error.err;
6317 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
6318 return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_conv);
6320 case LDKAPIError_FeeRateTooHigh: {
6321 LDKStr err_str = obj->fee_rate_too_high.err;
6322 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
6323 int32_t feerate_conv = obj->fee_rate_too_high.feerate;
6324 return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_conv, feerate_conv);
6326 case LDKAPIError_RouteError: {
6327 LDKStr err_str = obj->route_error.err;
6328 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
6329 return (*env)->NewObject(env, LDKAPIError_RouteError_class, LDKAPIError_RouteError_meth, err_conv);
6331 case LDKAPIError_ChannelUnavailable: {
6332 LDKStr err_str = obj->channel_unavailable.err;
6333 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
6334 return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_conv);
6336 case LDKAPIError_MonitorUpdateInProgress: {
6337 return (*env)->NewObject(env, LDKAPIError_MonitorUpdateInProgress_class, LDKAPIError_MonitorUpdateInProgress_meth);
6339 case LDKAPIError_IncompatibleShutdownScript: {
6340 LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
6341 int64_t script_ref = 0;
6342 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
6343 script_ref = tag_ptr(script_var.inner, false);
6344 return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref);
6349 static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
6350 CHECK(owner->result_ok);
6351 return *owner->contents.result;
6353 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6354 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
6355 CResult_NoneAPIErrorZ_get_ok(owner_conv);
6358 static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
6359 CHECK(!owner->result_ok);
6360 return APIError_clone(&*owner->contents.err);
6362 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6363 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
6364 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
6365 *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
6366 int64_t ret_ref = tag_ptr(ret_copy, true);
6370 static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
6371 LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
6372 for (size_t i = 0; i < ret.datalen; i++) {
6373 ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
6377 static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
6378 LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
6379 for (size_t i = 0; i < ret.datalen; i++) {
6380 ret.data[i] = APIError_clone(&orig->data[i]);
6384 static inline struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
6385 CHECK(owner->result_ok);
6386 return ThirtyTwoBytes_clone(&*owner->contents.result);
6388 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6389 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
6390 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6391 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult__u832APIErrorZ_get_ok(owner_conv).data);
6395 static inline struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
6396 CHECK(!owner->result_ok);
6397 return APIError_clone(&*owner->contents.err);
6399 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6400 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
6401 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
6402 *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv);
6403 int64_t ret_ref = tag_ptr(ret_copy, true);
6407 static jclass LDKPaymentSendFailure_ParameterError_class = NULL;
6408 static jmethodID LDKPaymentSendFailure_ParameterError_meth = NULL;
6409 static jclass LDKPaymentSendFailure_PathParameterError_class = NULL;
6410 static jmethodID LDKPaymentSendFailure_PathParameterError_meth = NULL;
6411 static jclass LDKPaymentSendFailure_AllFailedRetrySafe_class = NULL;
6412 static jmethodID LDKPaymentSendFailure_AllFailedRetrySafe_meth = NULL;
6413 static jclass LDKPaymentSendFailure_PartialFailure_class = NULL;
6414 static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL;
6415 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) {
6416 LDKPaymentSendFailure_ParameterError_class =
6417 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError"));
6418 CHECK(LDKPaymentSendFailure_ParameterError_class != NULL);
6419 LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "<init>", "(J)V");
6420 CHECK(LDKPaymentSendFailure_ParameterError_meth != NULL);
6421 LDKPaymentSendFailure_PathParameterError_class =
6422 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError"));
6423 CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL);
6424 LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "<init>", "([J)V");
6425 CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL);
6426 LDKPaymentSendFailure_AllFailedRetrySafe_class =
6427 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedRetrySafe"));
6428 CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_class != NULL);
6429 LDKPaymentSendFailure_AllFailedRetrySafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, "<init>", "([J)V");
6430 CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_meth != NULL);
6431 LDKPaymentSendFailure_PartialFailure_class =
6432 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure"));
6433 CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL);
6434 LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "([JJ[B)V");
6435 CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL);
6437 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
6438 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
6440 case LDKPaymentSendFailure_ParameterError: {
6441 int64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false);
6442 return (*env)->NewObject(env, LDKPaymentSendFailure_ParameterError_class, LDKPaymentSendFailure_ParameterError_meth, parameter_error_ref);
6444 case LDKPaymentSendFailure_PathParameterError: {
6445 LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
6446 int64_tArray path_parameter_error_arr = NULL;
6447 path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen);
6448 int64_t *path_parameter_error_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_parameter_error_arr, NULL);
6449 for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
6450 LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
6451 *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w];
6452 *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
6453 path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true);
6455 (*env)->ReleasePrimitiveArrayCritical(env, path_parameter_error_arr, path_parameter_error_arr_ptr, 0);
6456 return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth, path_parameter_error_arr);
6458 case LDKPaymentSendFailure_AllFailedRetrySafe: {
6459 LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
6460 int64_tArray all_failed_retry_safe_arr = NULL;
6461 all_failed_retry_safe_arr = (*env)->NewLongArray(env, all_failed_retry_safe_var.datalen);
6462 int64_t *all_failed_retry_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_retry_safe_arr, NULL);
6463 for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
6464 int64_t all_failed_retry_safe_conv_10_ref = tag_ptr(&all_failed_retry_safe_var.data[k], false);
6465 all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref;
6467 (*env)->ReleasePrimitiveArrayCritical(env, all_failed_retry_safe_arr, all_failed_retry_safe_arr_ptr, 0);
6468 return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, LDKPaymentSendFailure_AllFailedRetrySafe_meth, all_failed_retry_safe_arr);
6470 case LDKPaymentSendFailure_PartialFailure: {
6471 LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
6472 int64_tArray results_arr = NULL;
6473 results_arr = (*env)->NewLongArray(env, results_var.datalen);
6474 int64_t *results_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, results_arr, NULL);
6475 for (size_t w = 0; w < results_var.datalen; w++) {
6476 LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
6477 *results_conv_22_conv = results_var.data[w];
6478 *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
6479 results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true);
6481 (*env)->ReleasePrimitiveArrayCritical(env, results_arr, results_arr_ptr, 0);
6482 LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
6483 int64_t failed_paths_retry_ref = 0;
6484 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var);
6485 failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false);
6486 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
6487 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->partial_failure.payment_id.data);
6488 return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, results_arr, failed_paths_retry_ref, payment_id_arr);
6493 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
6494 CHECK(owner->result_ok);
6495 return ThirtyTwoBytes_clone(&*owner->contents.result);
6497 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6498 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
6499 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6500 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data);
6504 static inline struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
6505 CHECK(!owner->result_ok);
6506 return PaymentSendFailure_clone(&*owner->contents.err);
6508 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6509 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
6510 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
6511 *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv);
6512 int64_t ret_ref = tag_ptr(ret_copy, true);
6516 static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
6517 CHECK(owner->result_ok);
6518 return *owner->contents.result;
6520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6521 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
6522 CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
6525 static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
6526 CHECK(!owner->result_ok);
6527 return PaymentSendFailure_clone(&*owner->contents.err);
6529 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6530 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
6531 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
6532 *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
6533 int64_t ret_ref = tag_ptr(ret_copy, true);
6537 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
6538 return ThirtyTwoBytes_clone(&owner->a);
6540 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
6541 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
6542 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6543 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data);
6547 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
6548 return ThirtyTwoBytes_clone(&owner->b);
6550 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
6551 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
6552 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6553 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data);
6557 static inline struct LDKC2Tuple_PaymentHashPaymentIdZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
6558 CHECK(owner->result_ok);
6559 return C2Tuple_PaymentHashPaymentIdZ_clone(&*owner->contents.result);
6561 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6562 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
6563 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
6564 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv);
6565 return tag_ptr(ret_conv, true);
6568 static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
6569 CHECK(!owner->result_ok);
6570 return PaymentSendFailure_clone(&*owner->contents.err);
6572 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6573 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
6574 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
6575 *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv);
6576 int64_t ret_ref = tag_ptr(ret_copy, true);
6580 static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) {
6581 LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen };
6582 for (size_t i = 0; i < ret.datalen; i++) {
6583 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
6587 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
6588 return ThirtyTwoBytes_clone(&owner->a);
6590 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
6591 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
6592 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6593 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data);
6597 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
6598 return ThirtyTwoBytes_clone(&owner->b);
6600 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
6601 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
6602 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6603 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data);
6607 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
6608 CHECK(owner->result_ok);
6609 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
6611 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6612 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
6613 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
6614 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv);
6615 return tag_ptr(ret_conv, true);
6618 static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
6619 CHECK(!owner->result_ok);
6620 return *owner->contents.err;
6622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6623 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
6624 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner_conv);
6627 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
6628 CHECK(owner->result_ok);
6629 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
6631 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6632 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
6633 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
6634 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv);
6635 return tag_ptr(ret_conv, true);
6638 static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
6639 CHECK(!owner->result_ok);
6640 return APIError_clone(&*owner->contents.err);
6642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6643 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
6644 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
6645 *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv);
6646 int64_t ret_ref = tag_ptr(ret_copy, true);
6650 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
6651 CHECK(owner->result_ok);
6652 return ThirtyTwoBytes_clone(&*owner->contents.result);
6654 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6655 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
6656 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6657 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data);
6661 static inline void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
6662 CHECK(!owner->result_ok);
6663 return *owner->contents.err;
6665 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6666 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
6667 CResult_PaymentSecretNoneZ_get_err(owner_conv);
6670 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
6671 CHECK(owner->result_ok);
6672 return ThirtyTwoBytes_clone(&*owner->contents.result);
6674 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6675 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
6676 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6677 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data);
6681 static inline struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
6682 CHECK(!owner->result_ok);
6683 return APIError_clone(&*owner->contents.err);
6685 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6686 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
6687 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
6688 *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv);
6689 int64_t ret_ref = tag_ptr(ret_copy, true);
6693 static inline struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
6694 CHECK(owner->result_ok);
6695 return ThirtyTwoBytes_clone(&*owner->contents.result);
6697 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6698 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
6699 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6700 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data);
6704 static inline struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
6705 CHECK(!owner->result_ok);
6706 return APIError_clone(&*owner->contents.err);
6708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6709 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
6710 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
6711 *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv);
6712 int64_t ret_ref = tag_ptr(ret_copy, true);
6716 static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
6717 LDKCounterpartyForwardingInfo ret = *owner->contents.result;
6718 ret.is_owned = false;
6721 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6722 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
6723 LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(owner_conv);
6724 int64_t ret_ref = 0;
6725 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6726 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6730 static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
6731 CHECK(!owner->result_ok);
6732 return DecodeError_clone(&*owner->contents.err);
6734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6735 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
6736 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6737 *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
6738 int64_t ret_ref = tag_ptr(ret_copy, true);
6742 static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
6743 LDKChannelCounterparty ret = *owner->contents.result;
6744 ret.is_owned = false;
6747 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6748 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
6749 LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_ok(owner_conv);
6750 int64_t ret_ref = 0;
6751 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6752 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6756 static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
6757 CHECK(!owner->result_ok);
6758 return DecodeError_clone(&*owner->contents.err);
6760 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6761 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
6762 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6763 *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
6764 int64_t ret_ref = tag_ptr(ret_copy, true);
6768 static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
6769 LDKChannelDetails ret = *owner->contents.result;
6770 ret.is_owned = false;
6773 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6774 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
6775 LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_get_ok(owner_conv);
6776 int64_t ret_ref = 0;
6777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6782 static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
6783 CHECK(!owner->result_ok);
6784 return DecodeError_clone(&*owner->contents.err);
6786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6787 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
6788 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6789 *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
6790 int64_t ret_ref = tag_ptr(ret_copy, true);
6794 static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
6795 LDKPhantomRouteHints ret = *owner->contents.result;
6796 ret.is_owned = false;
6799 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6800 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
6801 LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_ok(owner_conv);
6802 int64_t ret_ref = 0;
6803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6808 static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
6809 CHECK(!owner->result_ok);
6810 return DecodeError_clone(&*owner->contents.err);
6812 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6813 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
6814 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6815 *ret_copy = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
6816 int64_t ret_ref = tag_ptr(ret_copy, true);
6820 static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
6821 LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
6822 for (size_t i = 0; i < ret.datalen; i++) {
6823 ret.data[i] = ChannelMonitor_clone(&orig->data[i]);
6827 typedef struct LDKWatch_JCalls {
6828 atomic_size_t refcnt;
6831 jmethodID watch_channel_meth;
6832 jmethodID update_channel_meth;
6833 jmethodID release_pending_monitor_events_meth;
6835 static void LDKWatch_JCalls_free(void* this_arg) {
6836 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
6837 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
6839 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6840 if (get_jenv_res == JNI_EDETACHED) {
6841 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6843 DO_ASSERT(get_jenv_res == JNI_OK);
6845 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
6846 if (get_jenv_res == JNI_EDETACHED) {
6847 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6852 LDKChannelMonitorUpdateStatus watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
6853 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
6855 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6856 if (get_jenv_res == JNI_EDETACHED) {
6857 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6859 DO_ASSERT(get_jenv_res == JNI_OK);
6861 LDKOutPoint funding_txo_var = funding_txo;
6862 int64_t funding_txo_ref = 0;
6863 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
6864 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
6865 LDKChannelMonitor monitor_var = monitor;
6866 int64_t monitor_ref = 0;
6867 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
6868 monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
6869 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6871 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
6872 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6873 (*env)->ExceptionDescribe(env);
6874 (*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception.");
6876 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
6877 if (get_jenv_res == JNI_EDETACHED) {
6878 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6882 LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
6883 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
6885 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6886 if (get_jenv_res == JNI_EDETACHED) {
6887 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6889 DO_ASSERT(get_jenv_res == JNI_OK);
6891 LDKOutPoint funding_txo_var = funding_txo;
6892 int64_t funding_txo_ref = 0;
6893 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
6894 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
6895 LDKChannelMonitorUpdate update_var = update;
6896 int64_t update_ref = 0;
6897 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
6898 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
6899 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6901 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref);
6902 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6903 (*env)->ExceptionDescribe(env);
6904 (*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception.");
6906 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
6907 if (get_jenv_res == JNI_EDETACHED) {
6908 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6912 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
6913 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
6915 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6916 if (get_jenv_res == JNI_EDETACHED) {
6917 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6919 DO_ASSERT(get_jenv_res == JNI_OK);
6921 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6923 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth);
6924 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6925 (*env)->ExceptionDescribe(env);
6926 (*env)->FatalError(env, "A call to release_pending_monitor_events in LDKWatch from rust threw an exception.");
6928 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr;
6929 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
6930 if (ret_constr.datalen > 0)
6931 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
6933 ret_constr.data = NULL;
6934 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
6935 for (size_t x = 0; x < ret_constr.datalen; x++) {
6936 int64_t ret_conv_49 = ret_vals[x];
6937 void* ret_conv_49_ptr = untag_ptr(ret_conv_49);
6938 CHECK_ACCESS(ret_conv_49_ptr);
6939 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr);
6940 FREE(untag_ptr(ret_conv_49));
6941 ret_constr.data[x] = ret_conv_49_conv;
6943 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
6944 if (get_jenv_res == JNI_EDETACHED) {
6945 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6949 static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
6950 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
6951 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6953 static inline LDKWatch LDKWatch_init (JNIEnv *env, jclass clz, jobject o) {
6954 jclass c = (*env)->GetObjectClass(env, o);
6956 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
6957 atomic_init(&calls->refcnt, 1);
6958 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6959 calls->o = (*env)->NewWeakGlobalRef(env, o);
6960 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
6961 CHECK(calls->watch_channel_meth != NULL);
6962 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
6963 CHECK(calls->update_channel_meth != NULL);
6964 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()[J");
6965 CHECK(calls->release_pending_monitor_events_meth != NULL);
6968 .this_arg = (void*) calls,
6969 .watch_channel = watch_channel_LDKWatch_jcall,
6970 .update_channel = update_channel_LDKWatch_jcall,
6971 .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
6972 .free = LDKWatch_JCalls_free,
6976 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new(JNIEnv *env, jclass clz, jobject o) {
6977 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
6978 *res_ptr = LDKWatch_init(env, clz, o);
6979 return tag_ptr(res_ptr, true);
6981 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) {
6982 void* this_arg_ptr = untag_ptr(this_arg);
6983 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6984 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
6985 LDKOutPoint funding_txo_conv;
6986 funding_txo_conv.inner = untag_ptr(funding_txo);
6987 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
6988 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
6989 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
6990 LDKChannelMonitor monitor_conv;
6991 monitor_conv.inner = untag_ptr(monitor);
6992 monitor_conv.is_owned = ptr_is_owned(monitor);
6993 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
6994 monitor_conv = ChannelMonitor_clone(&monitor_conv);
6995 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv));
6999 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t update) {
7000 void* this_arg_ptr = untag_ptr(this_arg);
7001 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7002 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
7003 LDKOutPoint funding_txo_conv;
7004 funding_txo_conv.inner = untag_ptr(funding_txo);
7005 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
7006 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
7007 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
7008 LDKChannelMonitorUpdate update_conv;
7009 update_conv.inner = untag_ptr(update);
7010 update_conv.is_owned = ptr_is_owned(update);
7011 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
7012 update_conv = ChannelMonitorUpdate_clone(&update_conv);
7013 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv));
7017 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
7018 void* this_arg_ptr = untag_ptr(this_arg);
7019 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7020 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
7021 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
7022 int64_tArray ret_arr = NULL;
7023 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
7024 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
7025 for (size_t x = 0; x < ret_var.datalen; x++) {
7026 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
7027 *ret_conv_49_conv = ret_var.data[x];
7028 ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true);
7030 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
7035 typedef struct LDKBroadcasterInterface_JCalls {
7036 atomic_size_t refcnt;
7039 jmethodID broadcast_transaction_meth;
7040 } LDKBroadcasterInterface_JCalls;
7041 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
7042 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
7043 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7045 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7046 if (get_jenv_res == JNI_EDETACHED) {
7047 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7049 DO_ASSERT(get_jenv_res == JNI_OK);
7051 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7052 if (get_jenv_res == JNI_EDETACHED) {
7053 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7058 void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
7059 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
7061 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7062 if (get_jenv_res == JNI_EDETACHED) {
7063 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7065 DO_ASSERT(get_jenv_res == JNI_OK);
7067 LDKTransaction tx_var = tx;
7068 int8_tArray tx_arr = (*env)->NewByteArray(env, tx_var.datalen);
7069 (*env)->SetByteArrayRegion(env, tx_arr, 0, tx_var.datalen, tx_var.data);
7070 Transaction_free(tx_var);
7071 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7073 (*env)->CallVoidMethod(env, obj, j_calls->broadcast_transaction_meth, tx_arr);
7074 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7075 (*env)->ExceptionDescribe(env);
7076 (*env)->FatalError(env, "A call to broadcast_transaction in LDKBroadcasterInterface from rust threw an exception.");
7078 if (get_jenv_res == JNI_EDETACHED) {
7079 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7082 static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
7083 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
7084 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7086 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv *env, jclass clz, jobject o) {
7087 jclass c = (*env)->GetObjectClass(env, o);
7089 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
7090 atomic_init(&calls->refcnt, 1);
7091 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7092 calls->o = (*env)->NewWeakGlobalRef(env, o);
7093 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "([B)V");
7094 CHECK(calls->broadcast_transaction_meth != NULL);
7096 LDKBroadcasterInterface ret = {
7097 .this_arg = (void*) calls,
7098 .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
7099 .free = LDKBroadcasterInterface_JCalls_free,
7103 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new(JNIEnv *env, jclass clz, jobject o) {
7104 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
7105 *res_ptr = LDKBroadcasterInterface_init(env, clz, o);
7106 return tag_ptr(res_ptr, true);
7108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray tx) {
7109 void* this_arg_ptr = untag_ptr(this_arg);
7110 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7111 LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
7112 LDKTransaction tx_ref;
7113 tx_ref.datalen = (*env)->GetArrayLength(env, tx);
7114 tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
7115 (*env)->GetByteArrayRegion(env, tx, 0, tx_ref.datalen, tx_ref.data);
7116 tx_ref.data_is_owned = true;
7117 (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
7120 typedef struct LDKKeysInterface_JCalls {
7121 atomic_size_t refcnt;
7124 jmethodID get_node_secret_meth;
7125 jmethodID get_node_id_meth;
7126 jmethodID ecdh_meth;
7127 jmethodID get_destination_script_meth;
7128 jmethodID get_shutdown_scriptpubkey_meth;
7129 jmethodID get_channel_signer_meth;
7130 jmethodID get_secure_random_bytes_meth;
7131 jmethodID read_chan_signer_meth;
7132 jmethodID sign_invoice_meth;
7133 jmethodID get_inbound_payment_key_material_meth;
7134 } LDKKeysInterface_JCalls;
7135 static void LDKKeysInterface_JCalls_free(void* this_arg) {
7136 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7137 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7139 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7140 if (get_jenv_res == JNI_EDETACHED) {
7141 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7143 DO_ASSERT(get_jenv_res == JNI_OK);
7145 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7146 if (get_jenv_res == JNI_EDETACHED) {
7147 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7152 LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
7153 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7155 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7156 if (get_jenv_res == JNI_EDETACHED) {
7157 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7159 DO_ASSERT(get_jenv_res == JNI_OK);
7161 jclass recipient_conv = LDKRecipient_to_java(env, recipient);
7162 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7164 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_node_secret_meth, recipient_conv);
7165 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7166 (*env)->ExceptionDescribe(env);
7167 (*env)->FatalError(env, "A call to get_node_secret in LDKKeysInterface from rust threw an exception.");
7169 void* ret_ptr = untag_ptr(ret);
7170 CHECK_ACCESS(ret_ptr);
7171 LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr);
7172 FREE(untag_ptr(ret));
7173 if (get_jenv_res == JNI_EDETACHED) {
7174 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7178 LDKCResult_PublicKeyNoneZ get_node_id_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
7179 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7181 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7182 if (get_jenv_res == JNI_EDETACHED) {
7183 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7185 DO_ASSERT(get_jenv_res == JNI_OK);
7187 jclass recipient_conv = LDKRecipient_to_java(env, recipient);
7188 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7190 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_node_id_meth, recipient_conv);
7191 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7192 (*env)->ExceptionDescribe(env);
7193 (*env)->FatalError(env, "A call to get_node_id in LDKKeysInterface from rust threw an exception.");
7195 void* ret_ptr = untag_ptr(ret);
7196 CHECK_ACCESS(ret_ptr);
7197 LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr);
7198 FREE(untag_ptr(ret));
7199 if (get_jenv_res == JNI_EDETACHED) {
7200 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7204 LDKCResult_SharedSecretNoneZ ecdh_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient, LDKPublicKey other_key, LDKCOption_ScalarZ tweak) {
7205 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7207 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7208 if (get_jenv_res == JNI_EDETACHED) {
7209 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7211 DO_ASSERT(get_jenv_res == JNI_OK);
7213 jclass recipient_conv = LDKRecipient_to_java(env, recipient);
7214 int8_tArray other_key_arr = (*env)->NewByteArray(env, 33);
7215 (*env)->SetByteArrayRegion(env, other_key_arr, 0, 33, other_key.compressed_form);
7216 LDKCOption_ScalarZ *tweak_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
7217 *tweak_copy = tweak;
7218 int64_t tweak_ref = tag_ptr(tweak_copy, true);
7219 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7221 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->ecdh_meth, recipient_conv, other_key_arr, tweak_ref);
7222 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7223 (*env)->ExceptionDescribe(env);
7224 (*env)->FatalError(env, "A call to ecdh in LDKKeysInterface from rust threw an exception.");
7226 void* ret_ptr = untag_ptr(ret);
7227 CHECK_ACCESS(ret_ptr);
7228 LDKCResult_SharedSecretNoneZ ret_conv = *(LDKCResult_SharedSecretNoneZ*)(ret_ptr);
7229 FREE(untag_ptr(ret));
7230 if (get_jenv_res == JNI_EDETACHED) {
7231 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7235 LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
7236 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7238 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7239 if (get_jenv_res == JNI_EDETACHED) {
7240 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7242 DO_ASSERT(get_jenv_res == JNI_OK);
7244 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7246 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth);
7247 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7248 (*env)->ExceptionDescribe(env);
7249 (*env)->FatalError(env, "A call to get_destination_script in LDKKeysInterface from rust threw an exception.");
7251 LDKCVec_u8Z ret_ref;
7252 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
7253 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
7254 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
7255 if (get_jenv_res == JNI_EDETACHED) {
7256 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7260 LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
7261 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7263 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7264 if (get_jenv_res == JNI_EDETACHED) {
7265 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7267 DO_ASSERT(get_jenv_res == JNI_OK);
7269 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7271 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_shutdown_scriptpubkey_meth);
7272 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7273 (*env)->ExceptionDescribe(env);
7274 (*env)->FatalError(env, "A call to get_shutdown_scriptpubkey in LDKKeysInterface from rust threw an exception.");
7276 LDKShutdownScript ret_conv;
7277 ret_conv.inner = untag_ptr(ret);
7278 ret_conv.is_owned = ptr_is_owned(ret);
7279 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
7280 if (get_jenv_res == JNI_EDETACHED) {
7281 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7285 LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
7286 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7288 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7289 if (get_jenv_res == JNI_EDETACHED) {
7290 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7292 DO_ASSERT(get_jenv_res == JNI_OK);
7294 jboolean inbound_conv = inbound;
7295 int64_t channel_value_satoshis_conv = channel_value_satoshis;
7296 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7298 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_channel_signer_meth, inbound_conv, channel_value_satoshis_conv);
7299 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7300 (*env)->ExceptionDescribe(env);
7301 (*env)->FatalError(env, "A call to get_channel_signer in LDKKeysInterface from rust threw an exception.");
7303 void* ret_ptr = untag_ptr(ret);
7304 CHECK_ACCESS(ret_ptr);
7305 LDKSign ret_conv = *(LDKSign*)(ret_ptr);
7306 FREE(untag_ptr(ret));
7307 if (get_jenv_res == JNI_EDETACHED) {
7308 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7312 LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
7313 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7315 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7316 if (get_jenv_res == JNI_EDETACHED) {
7317 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7319 DO_ASSERT(get_jenv_res == JNI_OK);
7321 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7323 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth);
7324 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7325 (*env)->ExceptionDescribe(env);
7326 (*env)->FatalError(env, "A call to get_secure_random_bytes in LDKKeysInterface from rust threw an exception.");
7328 LDKThirtyTwoBytes ret_ref;
7329 CHECK((*env)->GetArrayLength(env, ret) == 32);
7330 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
7331 if (get_jenv_res == JNI_EDETACHED) {
7332 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7336 LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
7337 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7339 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7340 if (get_jenv_res == JNI_EDETACHED) {
7341 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7343 DO_ASSERT(get_jenv_res == JNI_OK);
7345 LDKu8slice reader_var = reader;
7346 int8_tArray reader_arr = (*env)->NewByteArray(env, reader_var.datalen);
7347 (*env)->SetByteArrayRegion(env, reader_arr, 0, reader_var.datalen, reader_var.data);
7348 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7350 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr);
7351 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7352 (*env)->ExceptionDescribe(env);
7353 (*env)->FatalError(env, "A call to read_chan_signer in LDKKeysInterface from rust threw an exception.");
7355 void* ret_ptr = untag_ptr(ret);
7356 CHECK_ACCESS(ret_ptr);
7357 LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
7358 FREE(untag_ptr(ret));
7359 if (get_jenv_res == JNI_EDETACHED) {
7360 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7364 LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_u5Z invoice_data, LDKRecipient receipient) {
7365 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7367 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7368 if (get_jenv_res == JNI_EDETACHED) {
7369 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7371 DO_ASSERT(get_jenv_res == JNI_OK);
7373 LDKu8slice hrp_bytes_var = hrp_bytes;
7374 int8_tArray hrp_bytes_arr = (*env)->NewByteArray(env, hrp_bytes_var.datalen);
7375 (*env)->SetByteArrayRegion(env, hrp_bytes_arr, 0, hrp_bytes_var.datalen, hrp_bytes_var.data);
7376 LDKCVec_u5Z invoice_data_var = invoice_data;
7377 jobjectArray invoice_data_arr = NULL;
7378 invoice_data_arr = (*env)->NewByteArray(env, invoice_data_var.datalen);
7379 int8_t *invoice_data_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, invoice_data_arr, NULL);
7380 for (size_t h = 0; h < invoice_data_var.datalen; h++) {
7381 uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0;
7382 invoice_data_arr_ptr[h] = invoice_data_conv_7_val;
7384 (*env)->ReleasePrimitiveArrayCritical(env, invoice_data_arr, invoice_data_arr_ptr, 0);
7385 FREE(invoice_data_var.data);
7386 jclass receipient_conv = LDKRecipient_to_java(env, receipient);
7387 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7389 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, hrp_bytes_arr, invoice_data_arr, receipient_conv);
7390 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7391 (*env)->ExceptionDescribe(env);
7392 (*env)->FatalError(env, "A call to sign_invoice in LDKKeysInterface from rust threw an exception.");
7394 void* ret_ptr = untag_ptr(ret);
7395 CHECK_ACCESS(ret_ptr);
7396 LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
7397 FREE(untag_ptr(ret));
7398 if (get_jenv_res == JNI_EDETACHED) {
7399 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7403 LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
7404 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
7406 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7407 if (get_jenv_res == JNI_EDETACHED) {
7408 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7410 DO_ASSERT(get_jenv_res == JNI_OK);
7412 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7414 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_inbound_payment_key_material_meth);
7415 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7416 (*env)->ExceptionDescribe(env);
7417 (*env)->FatalError(env, "A call to get_inbound_payment_key_material in LDKKeysInterface from rust threw an exception.");
7419 LDKThirtyTwoBytes ret_ref;
7420 CHECK((*env)->GetArrayLength(env, ret) == 32);
7421 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
7422 if (get_jenv_res == JNI_EDETACHED) {
7423 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7427 static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
7428 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
7429 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7431 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv *env, jclass clz, jobject o) {
7432 jclass c = (*env)->GetObjectClass(env, o);
7434 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
7435 atomic_init(&calls->refcnt, 1);
7436 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7437 calls->o = (*env)->NewWeakGlobalRef(env, o);
7438 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "(Lorg/ldk/enums/Recipient;)J");
7439 CHECK(calls->get_node_secret_meth != NULL);
7440 calls->get_node_id_meth = (*env)->GetMethodID(env, c, "get_node_id", "(Lorg/ldk/enums/Recipient;)J");
7441 CHECK(calls->get_node_id_meth != NULL);
7442 calls->ecdh_meth = (*env)->GetMethodID(env, c, "ecdh", "(Lorg/ldk/enums/Recipient;[BJ)J");
7443 CHECK(calls->ecdh_meth != NULL);
7444 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()[B");
7445 CHECK(calls->get_destination_script_meth != NULL);
7446 calls->get_shutdown_scriptpubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_scriptpubkey", "()J");
7447 CHECK(calls->get_shutdown_scriptpubkey_meth != NULL);
7448 calls->get_channel_signer_meth = (*env)->GetMethodID(env, c, "get_channel_signer", "(ZJ)J");
7449 CHECK(calls->get_channel_signer_meth != NULL);
7450 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B");
7451 CHECK(calls->get_secure_random_bytes_meth != NULL);
7452 calls->read_chan_signer_meth = (*env)->GetMethodID(env, c, "read_chan_signer", "([B)J");
7453 CHECK(calls->read_chan_signer_meth != NULL);
7454 calls->sign_invoice_meth = (*env)->GetMethodID(env, c, "sign_invoice", "([B[BLorg/ldk/enums/Recipient;)J");
7455 CHECK(calls->sign_invoice_meth != NULL);
7456 calls->get_inbound_payment_key_material_meth = (*env)->GetMethodID(env, c, "get_inbound_payment_key_material", "()[B");
7457 CHECK(calls->get_inbound_payment_key_material_meth != NULL);
7459 LDKKeysInterface ret = {
7460 .this_arg = (void*) calls,
7461 .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
7462 .get_node_id = get_node_id_LDKKeysInterface_jcall,
7463 .ecdh = ecdh_LDKKeysInterface_jcall,
7464 .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
7465 .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
7466 .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
7467 .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
7468 .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
7469 .sign_invoice = sign_invoice_LDKKeysInterface_jcall,
7470 .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
7471 .free = LDKKeysInterface_JCalls_free,
7475 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new(JNIEnv *env, jclass clz, jobject o) {
7476 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
7477 *res_ptr = LDKKeysInterface_init(env, clz, o);
7478 return tag_ptr(res_ptr, true);
7480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient) {
7481 void* this_arg_ptr = untag_ptr(this_arg);
7482 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7483 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
7484 LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
7485 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
7486 *ret_conv = (this_arg_conv->get_node_secret)(this_arg_conv->this_arg, recipient_conv);
7487 return tag_ptr(ret_conv, true);
7490 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient) {
7491 void* this_arg_ptr = untag_ptr(this_arg);
7492 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7493 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
7494 LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
7495 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
7496 *ret_conv = (this_arg_conv->get_node_id)(this_arg_conv->this_arg, recipient_conv);
7497 return tag_ptr(ret_conv, true);
7500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1ecdh(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient, int8_tArray other_key, int64_t tweak) {
7501 void* this_arg_ptr = untag_ptr(this_arg);
7502 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7503 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
7504 LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
7505 LDKPublicKey other_key_ref;
7506 CHECK((*env)->GetArrayLength(env, other_key) == 33);
7507 (*env)->GetByteArrayRegion(env, other_key, 0, 33, other_key_ref.compressed_form);
7508 void* tweak_ptr = untag_ptr(tweak);
7509 CHECK_ACCESS(tweak_ptr);
7510 LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
7511 // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
7512 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
7513 *ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
7514 return tag_ptr(ret_conv, true);
7517 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1destination_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
7518 void* this_arg_ptr = untag_ptr(this_arg);
7519 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7520 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
7521 LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
7522 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
7523 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
7524 CVec_u8Z_free(ret_var);
7528 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
7529 void* this_arg_ptr = untag_ptr(this_arg);
7530 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7531 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
7532 LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
7533 int64_t ret_ref = 0;
7534 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7535 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7539 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
7540 void* this_arg_ptr = untag_ptr(this_arg);
7541 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7542 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
7543 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
7544 *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
7545 return tag_ptr(ret_ret, true);
7548 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1secure_1random_1bytes(JNIEnv *env, jclass clz, int64_t this_arg) {
7549 void* this_arg_ptr = untag_ptr(this_arg);
7550 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7551 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
7552 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7553 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data);
7557 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1read_1chan_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray reader) {
7558 void* this_arg_ptr = untag_ptr(this_arg);
7559 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7560 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
7561 LDKu8slice reader_ref;
7562 reader_ref.datalen = (*env)->GetArrayLength(env, reader);
7563 reader_ref.data = (*env)->GetByteArrayElements (env, reader, NULL);
7564 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
7565 *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
7566 (*env)->ReleaseByteArrayElements(env, reader, (int8_t*)reader_ref.data, 0);
7567 return tag_ptr(ret_conv, true);
7570 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1sign_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray hrp_bytes, jobjectArray invoice_data, jclass receipient) {
7571 void* this_arg_ptr = untag_ptr(this_arg);
7572 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7573 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
7574 LDKu8slice hrp_bytes_ref;
7575 hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes);
7576 hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL);
7577 LDKCVec_u5Z invoice_data_constr;
7578 invoice_data_constr.datalen = (*env)->GetArrayLength(env, invoice_data);
7579 if (invoice_data_constr.datalen > 0)
7580 invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
7582 invoice_data_constr.data = NULL;
7583 int8_t* invoice_data_vals = (*env)->GetByteArrayElements (env, invoice_data, NULL);
7584 for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
7585 int8_t invoice_data_conv_7 = invoice_data_vals[h];
7587 invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 };
7589 (*env)->ReleaseByteArrayElements(env, invoice_data, invoice_data_vals, 0);
7590 LDKRecipient receipient_conv = LDKRecipient_from_java(env, receipient);
7591 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
7592 *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, receipient_conv);
7593 (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0);
7594 return tag_ptr(ret_conv, true);
7597 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1inbound_1payment_1key_1material(JNIEnv *env, jclass clz, int64_t this_arg) {
7598 void* this_arg_ptr = untag_ptr(this_arg);
7599 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7600 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
7601 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7602 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data);
7606 typedef struct LDKFeeEstimator_JCalls {
7607 atomic_size_t refcnt;
7610 jmethodID get_est_sat_per_1000_weight_meth;
7611 } LDKFeeEstimator_JCalls;
7612 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
7613 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
7614 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7616 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7617 if (get_jenv_res == JNI_EDETACHED) {
7618 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7620 DO_ASSERT(get_jenv_res == JNI_OK);
7622 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7623 if (get_jenv_res == JNI_EDETACHED) {
7624 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7629 uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
7630 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
7632 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7633 if (get_jenv_res == JNI_EDETACHED) {
7634 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7636 DO_ASSERT(get_jenv_res == JNI_OK);
7638 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(env, confirmation_target);
7639 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7641 int32_t ret = (*env)->CallIntMethod(env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
7642 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7643 (*env)->ExceptionDescribe(env);
7644 (*env)->FatalError(env, "A call to get_est_sat_per_1000_weight in LDKFeeEstimator from rust threw an exception.");
7646 if (get_jenv_res == JNI_EDETACHED) {
7647 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7651 static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
7652 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
7653 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7655 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv *env, jclass clz, jobject o) {
7656 jclass c = (*env)->GetObjectClass(env, o);
7658 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
7659 atomic_init(&calls->refcnt, 1);
7660 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7661 calls->o = (*env)->NewWeakGlobalRef(env, o);
7662 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/enums/ConfirmationTarget;)I");
7663 CHECK(calls->get_est_sat_per_1000_weight_meth != NULL);
7665 LDKFeeEstimator ret = {
7666 .this_arg = (void*) calls,
7667 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
7668 .free = LDKFeeEstimator_JCalls_free,
7672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new(JNIEnv *env, jclass clz, jobject o) {
7673 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
7674 *res_ptr = LDKFeeEstimator_init(env, clz, o);
7675 return tag_ptr(res_ptr, true);
7677 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_arg, jclass confirmation_target) {
7678 void* this_arg_ptr = untag_ptr(this_arg);
7679 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7680 LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
7681 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(env, confirmation_target);
7682 int32_t ret_conv = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
7686 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
7687 return ThirtyTwoBytes_clone(&owner->a);
7689 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7690 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
7691 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7692 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data);
7696 static inline struct LDKChannelManager C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
7697 LDKChannelManager ret = owner->b;
7698 ret.is_owned = false;
7701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7702 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
7703 LDKChannelManager ret_var = C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv);
7704 int64_t ret_ref = 0;
7705 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7706 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7710 static inline struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
7711 CHECK(owner->result_ok);
7712 return &*owner->contents.result;
7714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7715 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
7716 int64_t ret_ret = tag_ptr(CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv), false);
7720 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
7721 CHECK(!owner->result_ok);
7722 return DecodeError_clone(&*owner->contents.err);
7724 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7725 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
7726 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7727 *ret_copy = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
7728 int64_t ret_ref = tag_ptr(ret_copy, true);
7732 static inline struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
7733 LDKChannelConfig ret = *owner->contents.result;
7734 ret.is_owned = false;
7737 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7738 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
7739 LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv);
7740 int64_t ret_ref = 0;
7741 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7742 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7746 static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
7747 CHECK(!owner->result_ok);
7748 return DecodeError_clone(&*owner->contents.err);
7750 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7751 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
7752 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7753 *ret_copy = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
7754 int64_t ret_ref = tag_ptr(ret_copy, true);
7758 static inline struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
7759 LDKOutPoint ret = *owner->contents.result;
7760 ret.is_owned = false;
7763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7764 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
7765 LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv);
7766 int64_t ret_ref = 0;
7767 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7768 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7772 static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
7773 CHECK(!owner->result_ok);
7774 return DecodeError_clone(&*owner->contents.err);
7776 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7777 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
7778 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7779 *ret_copy = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
7780 int64_t ret_ref = tag_ptr(ret_copy, true);
7784 typedef struct LDKType_JCalls {
7785 atomic_size_t refcnt;
7788 jmethodID type_id_meth;
7789 jmethodID debug_str_meth;
7790 jmethodID write_meth;
7792 static void LDKType_JCalls_free(void* this_arg) {
7793 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
7794 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7796 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7797 if (get_jenv_res == JNI_EDETACHED) {
7798 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7800 DO_ASSERT(get_jenv_res == JNI_OK);
7802 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7803 if (get_jenv_res == JNI_EDETACHED) {
7804 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7809 uint16_t type_id_LDKType_jcall(const void* this_arg) {
7810 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
7812 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7813 if (get_jenv_res == JNI_EDETACHED) {
7814 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7816 DO_ASSERT(get_jenv_res == JNI_OK);
7818 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7820 int16_t ret = (*env)->CallShortMethod(env, obj, j_calls->type_id_meth);
7821 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7822 (*env)->ExceptionDescribe(env);
7823 (*env)->FatalError(env, "A call to type_id in LDKType from rust threw an exception.");
7825 if (get_jenv_res == JNI_EDETACHED) {
7826 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7830 LDKStr debug_str_LDKType_jcall(const void* this_arg) {
7831 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
7833 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7834 if (get_jenv_res == JNI_EDETACHED) {
7835 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7837 DO_ASSERT(get_jenv_res == JNI_OK);
7839 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7841 jstring ret = (*env)->CallObjectMethod(env, obj, j_calls->debug_str_meth);
7842 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7843 (*env)->ExceptionDescribe(env);
7844 (*env)->FatalError(env, "A call to debug_str in LDKType from rust threw an exception.");
7846 LDKStr ret_conv = java_to_owned_str(env, ret);
7847 if (get_jenv_res == JNI_EDETACHED) {
7848 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7852 LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
7853 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
7855 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7856 if (get_jenv_res == JNI_EDETACHED) {
7857 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7859 DO_ASSERT(get_jenv_res == JNI_OK);
7861 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7863 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
7864 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7865 (*env)->ExceptionDescribe(env);
7866 (*env)->FatalError(env, "A call to write in LDKType from rust threw an exception.");
7868 LDKCVec_u8Z ret_ref;
7869 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
7870 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
7871 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
7872 if (get_jenv_res == JNI_EDETACHED) {
7873 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7877 static void LDKType_JCalls_cloned(LDKType* new_obj) {
7878 LDKType_JCalls *j_calls = (LDKType_JCalls*) new_obj->this_arg;
7879 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7881 static inline LDKType LDKType_init (JNIEnv *env, jclass clz, jobject o) {
7882 jclass c = (*env)->GetObjectClass(env, o);
7884 LDKType_JCalls *calls = MALLOC(sizeof(LDKType_JCalls), "LDKType_JCalls");
7885 atomic_init(&calls->refcnt, 1);
7886 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7887 calls->o = (*env)->NewWeakGlobalRef(env, o);
7888 calls->type_id_meth = (*env)->GetMethodID(env, c, "type_id", "()S");
7889 CHECK(calls->type_id_meth != NULL);
7890 calls->debug_str_meth = (*env)->GetMethodID(env, c, "debug_str", "()Ljava/lang/String;");
7891 CHECK(calls->debug_str_meth != NULL);
7892 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
7893 CHECK(calls->write_meth != NULL);
7896 .this_arg = (void*) calls,
7897 .type_id = type_id_LDKType_jcall,
7898 .debug_str = debug_str_LDKType_jcall,
7899 .write = write_LDKType_jcall,
7900 .cloned = LDKType_JCalls_cloned,
7901 .free = LDKType_JCalls_free,
7905 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKType_1new(JNIEnv *env, jclass clz, jobject o) {
7906 LDKType *res_ptr = MALLOC(sizeof(LDKType), "LDKType");
7907 *res_ptr = LDKType_init(env, clz, o);
7908 return tag_ptr(res_ptr, true);
7910 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Type_1type_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
7911 void* this_arg_ptr = untag_ptr(this_arg);
7912 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7913 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
7914 int16_t ret_conv = (this_arg_conv->type_id)(this_arg_conv->this_arg);
7918 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Type_1debug_1str(JNIEnv *env, jclass clz, int64_t this_arg) {
7919 void* this_arg_ptr = untag_ptr(this_arg);
7920 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7921 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
7922 LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
7923 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
7928 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Type_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
7929 void* this_arg_ptr = untag_ptr(this_arg);
7930 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7931 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
7932 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
7933 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
7934 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
7935 CVec_u8Z_free(ret_var);
7939 static jclass LDKCOption_TypeZ_Some_class = NULL;
7940 static jmethodID LDKCOption_TypeZ_Some_meth = NULL;
7941 static jclass LDKCOption_TypeZ_None_class = NULL;
7942 static jmethodID LDKCOption_TypeZ_None_meth = NULL;
7943 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1TypeZ_init (JNIEnv *env, jclass clz) {
7944 LDKCOption_TypeZ_Some_class =
7945 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$Some"));
7946 CHECK(LDKCOption_TypeZ_Some_class != NULL);
7947 LDKCOption_TypeZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_Some_class, "<init>", "(J)V");
7948 CHECK(LDKCOption_TypeZ_Some_meth != NULL);
7949 LDKCOption_TypeZ_None_class =
7950 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$None"));
7951 CHECK(LDKCOption_TypeZ_None_class != NULL);
7952 LDKCOption_TypeZ_None_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_None_class, "<init>", "()V");
7953 CHECK(LDKCOption_TypeZ_None_meth != NULL);
7955 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1TypeZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
7956 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
7958 case LDKCOption_TypeZ_Some: {
7959 LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
7960 *some_ret = Type_clone(&obj->some);
7961 return (*env)->NewObject(env, LDKCOption_TypeZ_Some_class, LDKCOption_TypeZ_Some_meth, tag_ptr(some_ret, true));
7963 case LDKCOption_TypeZ_None: {
7964 return (*env)->NewObject(env, LDKCOption_TypeZ_None_class, LDKCOption_TypeZ_None_meth);
7969 static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
7970 CHECK(owner->result_ok);
7971 return COption_TypeZ_clone(&*owner->contents.result);
7973 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7974 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
7975 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
7976 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv);
7977 int64_t ret_ref = tag_ptr(ret_copy, true);
7981 static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
7982 CHECK(!owner->result_ok);
7983 return DecodeError_clone(&*owner->contents.err);
7985 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7986 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
7987 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7988 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
7989 int64_t ret_ref = tag_ptr(ret_copy, true);
7993 static jclass LDKPaymentError_Invoice_class = NULL;
7994 static jmethodID LDKPaymentError_Invoice_meth = NULL;
7995 static jclass LDKPaymentError_Routing_class = NULL;
7996 static jmethodID LDKPaymentError_Routing_meth = NULL;
7997 static jclass LDKPaymentError_Sending_class = NULL;
7998 static jmethodID LDKPaymentError_Sending_meth = NULL;
7999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentError_init (JNIEnv *env, jclass clz) {
8000 LDKPaymentError_Invoice_class =
8001 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Invoice"));
8002 CHECK(LDKPaymentError_Invoice_class != NULL);
8003 LDKPaymentError_Invoice_meth = (*env)->GetMethodID(env, LDKPaymentError_Invoice_class, "<init>", "(Ljava/lang/String;)V");
8004 CHECK(LDKPaymentError_Invoice_meth != NULL);
8005 LDKPaymentError_Routing_class =
8006 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Routing"));
8007 CHECK(LDKPaymentError_Routing_class != NULL);
8008 LDKPaymentError_Routing_meth = (*env)->GetMethodID(env, LDKPaymentError_Routing_class, "<init>", "(J)V");
8009 CHECK(LDKPaymentError_Routing_meth != NULL);
8010 LDKPaymentError_Sending_class =
8011 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Sending"));
8012 CHECK(LDKPaymentError_Sending_class != NULL);
8013 LDKPaymentError_Sending_meth = (*env)->GetMethodID(env, LDKPaymentError_Sending_class, "<init>", "(J)V");
8014 CHECK(LDKPaymentError_Sending_meth != NULL);
8016 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
8017 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
8019 case LDKPaymentError_Invoice: {
8020 LDKStr invoice_str = obj->invoice;
8021 jstring invoice_conv = str_ref_to_java(env, invoice_str.chars, invoice_str.len);
8022 return (*env)->NewObject(env, LDKPaymentError_Invoice_class, LDKPaymentError_Invoice_meth, invoice_conv);
8024 case LDKPaymentError_Routing: {
8025 LDKLightningError routing_var = obj->routing;
8026 int64_t routing_ref = 0;
8027 CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var);
8028 routing_ref = tag_ptr(routing_var.inner, false);
8029 return (*env)->NewObject(env, LDKPaymentError_Routing_class, LDKPaymentError_Routing_meth, routing_ref);
8031 case LDKPaymentError_Sending: {
8032 int64_t sending_ref = tag_ptr(&obj->sending, false);
8033 return (*env)->NewObject(env, LDKPaymentError_Sending_class, LDKPaymentError_Sending_meth, sending_ref);
8038 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
8039 CHECK(owner->result_ok);
8040 return ThirtyTwoBytes_clone(&*owner->contents.result);
8042 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8043 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
8044 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
8045 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentIdPaymentErrorZ_get_ok(owner_conv).data);
8049 static inline struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
8050 CHECK(!owner->result_ok);
8051 return PaymentError_clone(&*owner->contents.err);
8053 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8054 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
8055 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
8056 *ret_copy = CResult_PaymentIdPaymentErrorZ_get_err(owner_conv);
8057 int64_t ret_ref = tag_ptr(ret_copy, true);
8061 static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
8062 LDKInFlightHtlcs ret = *owner->contents.result;
8063 ret.is_owned = false;
8066 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8067 LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
8068 LDKInFlightHtlcs ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_ok(owner_conv);
8069 int64_t ret_ref = 0;
8070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8075 static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
8076 CHECK(!owner->result_ok);
8077 return DecodeError_clone(&*owner->contents.err);
8079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8080 LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
8081 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8082 *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv);
8083 int64_t ret_ref = tag_ptr(ret_copy, true);
8087 static jclass LDKParseError_Bech32Error_class = NULL;
8088 static jmethodID LDKParseError_Bech32Error_meth = NULL;
8089 static jclass LDKParseError_ParseAmountError_class = NULL;
8090 static jmethodID LDKParseError_ParseAmountError_meth = NULL;
8091 static jclass LDKParseError_MalformedSignature_class = NULL;
8092 static jmethodID LDKParseError_MalformedSignature_meth = NULL;
8093 static jclass LDKParseError_BadPrefix_class = NULL;
8094 static jmethodID LDKParseError_BadPrefix_meth = NULL;
8095 static jclass LDKParseError_UnknownCurrency_class = NULL;
8096 static jmethodID LDKParseError_UnknownCurrency_meth = NULL;
8097 static jclass LDKParseError_UnknownSiPrefix_class = NULL;
8098 static jmethodID LDKParseError_UnknownSiPrefix_meth = NULL;
8099 static jclass LDKParseError_MalformedHRP_class = NULL;
8100 static jmethodID LDKParseError_MalformedHRP_meth = NULL;
8101 static jclass LDKParseError_TooShortDataPart_class = NULL;
8102 static jmethodID LDKParseError_TooShortDataPart_meth = NULL;
8103 static jclass LDKParseError_UnexpectedEndOfTaggedFields_class = NULL;
8104 static jmethodID LDKParseError_UnexpectedEndOfTaggedFields_meth = NULL;
8105 static jclass LDKParseError_DescriptionDecodeError_class = NULL;
8106 static jmethodID LDKParseError_DescriptionDecodeError_meth = NULL;
8107 static jclass LDKParseError_PaddingError_class = NULL;
8108 static jmethodID LDKParseError_PaddingError_meth = NULL;
8109 static jclass LDKParseError_IntegerOverflowError_class = NULL;
8110 static jmethodID LDKParseError_IntegerOverflowError_meth = NULL;
8111 static jclass LDKParseError_InvalidSegWitProgramLength_class = NULL;
8112 static jmethodID LDKParseError_InvalidSegWitProgramLength_meth = NULL;
8113 static jclass LDKParseError_InvalidPubKeyHashLength_class = NULL;
8114 static jmethodID LDKParseError_InvalidPubKeyHashLength_meth = NULL;
8115 static jclass LDKParseError_InvalidScriptHashLength_class = NULL;
8116 static jmethodID LDKParseError_InvalidScriptHashLength_meth = NULL;
8117 static jclass LDKParseError_InvalidRecoveryId_class = NULL;
8118 static jmethodID LDKParseError_InvalidRecoveryId_meth = NULL;
8119 static jclass LDKParseError_InvalidSliceLength_class = NULL;
8120 static jmethodID LDKParseError_InvalidSliceLength_meth = NULL;
8121 static jclass LDKParseError_Skip_class = NULL;
8122 static jmethodID LDKParseError_Skip_meth = NULL;
8123 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseError_init (JNIEnv *env, jclass clz) {
8124 LDKParseError_Bech32Error_class =
8125 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Bech32Error"));
8126 CHECK(LDKParseError_Bech32Error_class != NULL);
8127 LDKParseError_Bech32Error_meth = (*env)->GetMethodID(env, LDKParseError_Bech32Error_class, "<init>", "(J)V");
8128 CHECK(LDKParseError_Bech32Error_meth != NULL);
8129 LDKParseError_ParseAmountError_class =
8130 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$ParseAmountError"));
8131 CHECK(LDKParseError_ParseAmountError_class != NULL);
8132 LDKParseError_ParseAmountError_meth = (*env)->GetMethodID(env, LDKParseError_ParseAmountError_class, "<init>", "(I)V");
8133 CHECK(LDKParseError_ParseAmountError_meth != NULL);
8134 LDKParseError_MalformedSignature_class =
8135 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedSignature"));
8136 CHECK(LDKParseError_MalformedSignature_class != NULL);
8137 LDKParseError_MalformedSignature_meth = (*env)->GetMethodID(env, LDKParseError_MalformedSignature_class, "<init>", "(Lorg/ldk/enums/Secp256k1Error;)V");
8138 CHECK(LDKParseError_MalformedSignature_meth != NULL);
8139 LDKParseError_BadPrefix_class =
8140 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$BadPrefix"));
8141 CHECK(LDKParseError_BadPrefix_class != NULL);
8142 LDKParseError_BadPrefix_meth = (*env)->GetMethodID(env, LDKParseError_BadPrefix_class, "<init>", "()V");
8143 CHECK(LDKParseError_BadPrefix_meth != NULL);
8144 LDKParseError_UnknownCurrency_class =
8145 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownCurrency"));
8146 CHECK(LDKParseError_UnknownCurrency_class != NULL);
8147 LDKParseError_UnknownCurrency_meth = (*env)->GetMethodID(env, LDKParseError_UnknownCurrency_class, "<init>", "()V");
8148 CHECK(LDKParseError_UnknownCurrency_meth != NULL);
8149 LDKParseError_UnknownSiPrefix_class =
8150 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownSiPrefix"));
8151 CHECK(LDKParseError_UnknownSiPrefix_class != NULL);
8152 LDKParseError_UnknownSiPrefix_meth = (*env)->GetMethodID(env, LDKParseError_UnknownSiPrefix_class, "<init>", "()V");
8153 CHECK(LDKParseError_UnknownSiPrefix_meth != NULL);
8154 LDKParseError_MalformedHRP_class =
8155 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedHRP"));
8156 CHECK(LDKParseError_MalformedHRP_class != NULL);
8157 LDKParseError_MalformedHRP_meth = (*env)->GetMethodID(env, LDKParseError_MalformedHRP_class, "<init>", "()V");
8158 CHECK(LDKParseError_MalformedHRP_meth != NULL);
8159 LDKParseError_TooShortDataPart_class =
8160 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$TooShortDataPart"));
8161 CHECK(LDKParseError_TooShortDataPart_class != NULL);
8162 LDKParseError_TooShortDataPart_meth = (*env)->GetMethodID(env, LDKParseError_TooShortDataPart_class, "<init>", "()V");
8163 CHECK(LDKParseError_TooShortDataPart_meth != NULL);
8164 LDKParseError_UnexpectedEndOfTaggedFields_class =
8165 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnexpectedEndOfTaggedFields"));
8166 CHECK(LDKParseError_UnexpectedEndOfTaggedFields_class != NULL);
8167 LDKParseError_UnexpectedEndOfTaggedFields_meth = (*env)->GetMethodID(env, LDKParseError_UnexpectedEndOfTaggedFields_class, "<init>", "()V");
8168 CHECK(LDKParseError_UnexpectedEndOfTaggedFields_meth != NULL);
8169 LDKParseError_DescriptionDecodeError_class =
8170 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$DescriptionDecodeError"));
8171 CHECK(LDKParseError_DescriptionDecodeError_class != NULL);
8172 LDKParseError_DescriptionDecodeError_meth = (*env)->GetMethodID(env, LDKParseError_DescriptionDecodeError_class, "<init>", "(I)V");
8173 CHECK(LDKParseError_DescriptionDecodeError_meth != NULL);
8174 LDKParseError_PaddingError_class =
8175 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$PaddingError"));
8176 CHECK(LDKParseError_PaddingError_class != NULL);
8177 LDKParseError_PaddingError_meth = (*env)->GetMethodID(env, LDKParseError_PaddingError_class, "<init>", "()V");
8178 CHECK(LDKParseError_PaddingError_meth != NULL);
8179 LDKParseError_IntegerOverflowError_class =
8180 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$IntegerOverflowError"));
8181 CHECK(LDKParseError_IntegerOverflowError_class != NULL);
8182 LDKParseError_IntegerOverflowError_meth = (*env)->GetMethodID(env, LDKParseError_IntegerOverflowError_class, "<init>", "()V");
8183 CHECK(LDKParseError_IntegerOverflowError_meth != NULL);
8184 LDKParseError_InvalidSegWitProgramLength_class =
8185 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSegWitProgramLength"));
8186 CHECK(LDKParseError_InvalidSegWitProgramLength_class != NULL);
8187 LDKParseError_InvalidSegWitProgramLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSegWitProgramLength_class, "<init>", "()V");
8188 CHECK(LDKParseError_InvalidSegWitProgramLength_meth != NULL);
8189 LDKParseError_InvalidPubKeyHashLength_class =
8190 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidPubKeyHashLength"));
8191 CHECK(LDKParseError_InvalidPubKeyHashLength_class != NULL);
8192 LDKParseError_InvalidPubKeyHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidPubKeyHashLength_class, "<init>", "()V");
8193 CHECK(LDKParseError_InvalidPubKeyHashLength_meth != NULL);
8194 LDKParseError_InvalidScriptHashLength_class =
8195 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidScriptHashLength"));
8196 CHECK(LDKParseError_InvalidScriptHashLength_class != NULL);
8197 LDKParseError_InvalidScriptHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidScriptHashLength_class, "<init>", "()V");
8198 CHECK(LDKParseError_InvalidScriptHashLength_meth != NULL);
8199 LDKParseError_InvalidRecoveryId_class =
8200 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidRecoveryId"));
8201 CHECK(LDKParseError_InvalidRecoveryId_class != NULL);
8202 LDKParseError_InvalidRecoveryId_meth = (*env)->GetMethodID(env, LDKParseError_InvalidRecoveryId_class, "<init>", "()V");
8203 CHECK(LDKParseError_InvalidRecoveryId_meth != NULL);
8204 LDKParseError_InvalidSliceLength_class =
8205 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSliceLength"));
8206 CHECK(LDKParseError_InvalidSliceLength_class != NULL);
8207 LDKParseError_InvalidSliceLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSliceLength_class, "<init>", "(Ljava/lang/String;)V");
8208 CHECK(LDKParseError_InvalidSliceLength_meth != NULL);
8209 LDKParseError_Skip_class =
8210 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Skip"));
8211 CHECK(LDKParseError_Skip_class != NULL);
8212 LDKParseError_Skip_meth = (*env)->GetMethodID(env, LDKParseError_Skip_class, "<init>", "()V");
8213 CHECK(LDKParseError_Skip_meth != NULL);
8215 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
8216 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
8218 case LDKParseError_Bech32Error: {
8219 int64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
8220 return (*env)->NewObject(env, LDKParseError_Bech32Error_class, LDKParseError_Bech32Error_meth, bech32_error_ref);
8222 case LDKParseError_ParseAmountError: {
8223 /*obj->parse_amount_error*/
8224 return (*env)->NewObject(env, LDKParseError_ParseAmountError_class, LDKParseError_ParseAmountError_meth, 0);
8226 case LDKParseError_MalformedSignature: {
8227 jclass malformed_signature_conv = LDKSecp256k1Error_to_java(env, obj->malformed_signature);
8228 return (*env)->NewObject(env, LDKParseError_MalformedSignature_class, LDKParseError_MalformedSignature_meth, malformed_signature_conv);
8230 case LDKParseError_BadPrefix: {
8231 return (*env)->NewObject(env, LDKParseError_BadPrefix_class, LDKParseError_BadPrefix_meth);
8233 case LDKParseError_UnknownCurrency: {
8234 return (*env)->NewObject(env, LDKParseError_UnknownCurrency_class, LDKParseError_UnknownCurrency_meth);
8236 case LDKParseError_UnknownSiPrefix: {
8237 return (*env)->NewObject(env, LDKParseError_UnknownSiPrefix_class, LDKParseError_UnknownSiPrefix_meth);
8239 case LDKParseError_MalformedHRP: {
8240 return (*env)->NewObject(env, LDKParseError_MalformedHRP_class, LDKParseError_MalformedHRP_meth);
8242 case LDKParseError_TooShortDataPart: {
8243 return (*env)->NewObject(env, LDKParseError_TooShortDataPart_class, LDKParseError_TooShortDataPart_meth);
8245 case LDKParseError_UnexpectedEndOfTaggedFields: {
8246 return (*env)->NewObject(env, LDKParseError_UnexpectedEndOfTaggedFields_class, LDKParseError_UnexpectedEndOfTaggedFields_meth);
8248 case LDKParseError_DescriptionDecodeError: {
8249 /*obj->description_decode_error*/
8250 return (*env)->NewObject(env, LDKParseError_DescriptionDecodeError_class, LDKParseError_DescriptionDecodeError_meth, 0);
8252 case LDKParseError_PaddingError: {
8253 return (*env)->NewObject(env, LDKParseError_PaddingError_class, LDKParseError_PaddingError_meth);
8255 case LDKParseError_IntegerOverflowError: {
8256 return (*env)->NewObject(env, LDKParseError_IntegerOverflowError_class, LDKParseError_IntegerOverflowError_meth);
8258 case LDKParseError_InvalidSegWitProgramLength: {
8259 return (*env)->NewObject(env, LDKParseError_InvalidSegWitProgramLength_class, LDKParseError_InvalidSegWitProgramLength_meth);
8261 case LDKParseError_InvalidPubKeyHashLength: {
8262 return (*env)->NewObject(env, LDKParseError_InvalidPubKeyHashLength_class, LDKParseError_InvalidPubKeyHashLength_meth);
8264 case LDKParseError_InvalidScriptHashLength: {
8265 return (*env)->NewObject(env, LDKParseError_InvalidScriptHashLength_class, LDKParseError_InvalidScriptHashLength_meth);
8267 case LDKParseError_InvalidRecoveryId: {
8268 return (*env)->NewObject(env, LDKParseError_InvalidRecoveryId_class, LDKParseError_InvalidRecoveryId_meth);
8270 case LDKParseError_InvalidSliceLength: {
8271 LDKStr invalid_slice_length_str = obj->invalid_slice_length;
8272 jstring invalid_slice_length_conv = str_ref_to_java(env, invalid_slice_length_str.chars, invalid_slice_length_str.len);
8273 return (*env)->NewObject(env, LDKParseError_InvalidSliceLength_class, LDKParseError_InvalidSliceLength_meth, invalid_slice_length_conv);
8275 case LDKParseError_Skip: {
8276 return (*env)->NewObject(env, LDKParseError_Skip_class, LDKParseError_Skip_meth);
8281 static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
8282 CHECK(owner->result_ok);
8283 return SiPrefix_clone(&*owner->contents.result);
8285 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8286 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
8287 jclass ret_conv = LDKSiPrefix_to_java(env, CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
8291 static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
8292 CHECK(!owner->result_ok);
8293 return ParseError_clone(&*owner->contents.err);
8295 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8296 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
8297 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
8298 *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
8299 int64_t ret_ref = tag_ptr(ret_copy, true);
8303 static jclass LDKParseOrSemanticError_ParseError_class = NULL;
8304 static jmethodID LDKParseOrSemanticError_ParseError_meth = NULL;
8305 static jclass LDKParseOrSemanticError_SemanticError_class = NULL;
8306 static jmethodID LDKParseOrSemanticError_SemanticError_meth = NULL;
8307 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseOrSemanticError_init (JNIEnv *env, jclass clz) {
8308 LDKParseOrSemanticError_ParseError_class =
8309 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$ParseError"));
8310 CHECK(LDKParseOrSemanticError_ParseError_class != NULL);
8311 LDKParseOrSemanticError_ParseError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_ParseError_class, "<init>", "(J)V");
8312 CHECK(LDKParseOrSemanticError_ParseError_meth != NULL);
8313 LDKParseOrSemanticError_SemanticError_class =
8314 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$SemanticError"));
8315 CHECK(LDKParseOrSemanticError_SemanticError_class != NULL);
8316 LDKParseOrSemanticError_SemanticError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_SemanticError_class, "<init>", "(Lorg/ldk/enums/SemanticError;)V");
8317 CHECK(LDKParseOrSemanticError_SemanticError_meth != NULL);
8319 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
8320 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
8322 case LDKParseOrSemanticError_ParseError: {
8323 int64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
8324 return (*env)->NewObject(env, LDKParseOrSemanticError_ParseError_class, LDKParseOrSemanticError_ParseError_meth, parse_error_ref);
8326 case LDKParseOrSemanticError_SemanticError: {
8327 jclass semantic_error_conv = LDKSemanticError_to_java(env, obj->semantic_error);
8328 return (*env)->NewObject(env, LDKParseOrSemanticError_SemanticError_class, LDKParseOrSemanticError_SemanticError_meth, semantic_error_conv);
8333 static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
8334 LDKInvoice ret = *owner->contents.result;
8335 ret.is_owned = false;
8338 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8339 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
8340 LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
8341 int64_t ret_ref = 0;
8342 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8343 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8347 static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
8348 CHECK(!owner->result_ok);
8349 return ParseOrSemanticError_clone(&*owner->contents.err);
8351 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8352 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
8353 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
8354 *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
8355 int64_t ret_ref = tag_ptr(ret_copy, true);
8359 static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
8360 LDKSignedRawInvoice ret = *owner->contents.result;
8361 ret.is_owned = false;
8364 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8365 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
8366 LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
8367 int64_t ret_ref = 0;
8368 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8369 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8373 static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
8374 CHECK(!owner->result_ok);
8375 return ParseError_clone(&*owner->contents.err);
8377 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8378 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
8379 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
8380 *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
8381 int64_t ret_ref = tag_ptr(ret_copy, true);
8385 static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
8386 LDKRawInvoice ret = owner->a;
8387 ret.is_owned = false;
8390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
8391 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
8392 LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
8393 int64_t ret_ref = 0;
8394 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8395 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8399 static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
8400 return ThirtyTwoBytes_clone(&owner->b);
8402 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
8403 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
8404 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
8405 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data);
8409 static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
8410 LDKInvoiceSignature ret = owner->c;
8411 ret.is_owned = false;
8414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
8415 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
8416 LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
8417 int64_t ret_ref = 0;
8418 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8419 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8423 static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
8424 LDKPayeePubKey ret = *owner->contents.result;
8425 ret.is_owned = false;
8428 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8429 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
8430 LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
8431 int64_t ret_ref = 0;
8432 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8433 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8437 static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
8438 CHECK(!owner->result_ok);
8439 return *owner->contents.err;
8441 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8442 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
8443 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PayeePubKeyErrorZ_get_err(owner_conv));
8447 static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
8448 LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
8449 for (size_t i = 0; i < ret.datalen; i++) {
8450 ret.data[i] = PrivateRoute_clone(&orig->data[i]);
8454 static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
8455 LDKPositiveTimestamp ret = *owner->contents.result;
8456 ret.is_owned = false;
8459 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8460 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
8461 LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
8462 int64_t ret_ref = 0;
8463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8468 static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
8469 CHECK(!owner->result_ok);
8470 return CreationError_clone(&*owner->contents.err);
8472 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8473 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
8474 jclass ret_conv = LDKCreationError_to_java(env, CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
8478 static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
8479 CHECK(owner->result_ok);
8480 return *owner->contents.result;
8482 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8483 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
8484 CResult_NoneSemanticErrorZ_get_ok(owner_conv);
8487 static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
8488 CHECK(!owner->result_ok);
8489 return SemanticError_clone(&*owner->contents.err);
8491 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8492 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
8493 jclass ret_conv = LDKSemanticError_to_java(env, CResult_NoneSemanticErrorZ_get_err(owner_conv));
8497 static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
8498 LDKInvoice ret = *owner->contents.result;
8499 ret.is_owned = false;
8502 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8503 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
8504 LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
8505 int64_t ret_ref = 0;
8506 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8507 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8511 static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
8512 CHECK(!owner->result_ok);
8513 return SemanticError_clone(&*owner->contents.err);
8515 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8516 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
8517 jclass ret_conv = LDKSemanticError_to_java(env, CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
8521 static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
8522 LDKDescription ret = *owner->contents.result;
8523 ret.is_owned = false;
8526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8527 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
8528 LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
8529 int64_t ret_ref = 0;
8530 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8531 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8535 static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
8536 CHECK(!owner->result_ok);
8537 return CreationError_clone(&*owner->contents.err);
8539 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8540 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
8541 jclass ret_conv = LDKCreationError_to_java(env, CResult_DescriptionCreationErrorZ_get_err(owner_conv));
8545 static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
8546 LDKPrivateRoute ret = *owner->contents.result;
8547 ret.is_owned = false;
8550 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8551 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
8552 LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
8553 int64_t ret_ref = 0;
8554 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8555 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8559 static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
8560 CHECK(!owner->result_ok);
8561 return CreationError_clone(&*owner->contents.err);
8563 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8564 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
8565 jclass ret_conv = LDKCreationError_to_java(env, CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
8569 static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
8570 CHECK(owner->result_ok);
8571 return *owner->contents.result;
8573 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8574 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
8575 LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
8576 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
8580 static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
8581 CHECK(!owner->result_ok);
8582 return *owner->contents.err;
8584 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8585 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
8586 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_StringErrorZ_get_err(owner_conv));
8590 static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
8591 LDKChannelMonitorUpdate ret = *owner->contents.result;
8592 ret.is_owned = false;
8595 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8596 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
8597 LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
8598 int64_t ret_ref = 0;
8599 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8600 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8604 static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
8605 CHECK(!owner->result_ok);
8606 return DecodeError_clone(&*owner->contents.err);
8608 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8609 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
8610 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8611 *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
8612 int64_t ret_ref = tag_ptr(ret_copy, true);
8616 static jclass LDKCOption_MonitorEventZ_Some_class = NULL;
8617 static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL;
8618 static jclass LDKCOption_MonitorEventZ_None_class = NULL;
8619 static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL;
8620 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) {
8621 LDKCOption_MonitorEventZ_Some_class =
8622 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some"));
8623 CHECK(LDKCOption_MonitorEventZ_Some_class != NULL);
8624 LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "<init>", "(J)V");
8625 CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL);
8626 LDKCOption_MonitorEventZ_None_class =
8627 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$None"));
8628 CHECK(LDKCOption_MonitorEventZ_None_class != NULL);
8629 LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "<init>", "()V");
8630 CHECK(LDKCOption_MonitorEventZ_None_meth != NULL);
8632 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
8633 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
8635 case LDKCOption_MonitorEventZ_Some: {
8636 int64_t some_ref = tag_ptr(&obj->some, false);
8637 return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref);
8639 case LDKCOption_MonitorEventZ_None: {
8640 return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth);
8645 static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
8646 CHECK(owner->result_ok);
8647 return COption_MonitorEventZ_clone(&*owner->contents.result);
8649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8650 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
8651 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
8652 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
8653 int64_t ret_ref = tag_ptr(ret_copy, true);
8657 static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
8658 CHECK(!owner->result_ok);
8659 return DecodeError_clone(&*owner->contents.err);
8661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8662 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
8663 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8664 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
8665 int64_t ret_ref = tag_ptr(ret_copy, true);
8669 static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
8670 LDKHTLCUpdate ret = *owner->contents.result;
8671 ret.is_owned = false;
8674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8675 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
8676 LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
8677 int64_t ret_ref = 0;
8678 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8679 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8683 static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
8684 CHECK(!owner->result_ok);
8685 return DecodeError_clone(&*owner->contents.err);
8687 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8688 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
8689 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8690 *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
8691 int64_t ret_ref = tag_ptr(ret_copy, true);
8695 static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
8696 LDKOutPoint ret = owner->a;
8697 ret.is_owned = false;
8700 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
8701 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
8702 LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
8703 int64_t ret_ref = 0;
8704 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8705 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8709 static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
8710 return CVec_u8Z_clone(&owner->b);
8712 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
8713 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
8714 LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
8715 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
8716 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
8717 CVec_u8Z_free(ret_var);
8721 static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
8724 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
8725 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
8726 int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
8730 static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
8731 return CVec_u8Z_clone(&owner->b);
8733 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
8734 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
8735 LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv);
8736 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
8737 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
8738 CVec_u8Z_free(ret_var);
8742 static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) {
8743 LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen };
8744 for (size_t i = 0; i < ret.datalen; i++) {
8745 ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]);
8749 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
8750 return ThirtyTwoBytes_clone(&owner->a);
8752 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
8753 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
8754 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
8755 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data);
8759 static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
8760 return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b);
8762 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
8763 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
8764 LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv);
8765 int64_tArray ret_arr = NULL;
8766 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
8767 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
8768 for (size_t v = 0; v < ret_var.datalen; v++) {
8769 LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
8770 *ret_conv_21_conv = ret_var.data[v];
8771 ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true);
8773 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
8778 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) {
8779 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen };
8780 for (size_t i = 0; i < ret.datalen; i++) {
8781 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]);
8785 static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) {
8786 LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen };
8787 for (size_t i = 0; i < ret.datalen; i++) {
8788 ret.data[i] = Event_clone(&orig->data[i]);
8792 static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
8795 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
8796 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
8797 int32_t ret_conv = C2Tuple_u32TxOutZ_get_a(owner_conv);
8801 static inline struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
8802 return TxOut_clone(&owner->b);
8804 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
8805 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
8806 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
8807 *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv);
8808 return tag_ptr(ret_ref, true);
8811 static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) {
8812 LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen };
8813 for (size_t i = 0; i < ret.datalen; i++) {
8814 ret.data[i] = C2Tuple_u32TxOutZ_clone(&orig->data[i]);
8818 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
8819 return ThirtyTwoBytes_clone(&owner->a);
8821 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
8822 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
8823 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
8824 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data);
8828 static inline struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
8829 return CVec_C2Tuple_u32TxOutZZ_clone(&owner->b);
8831 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
8832 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
8833 LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv);
8834 int64_tArray ret_arr = NULL;
8835 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
8836 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
8837 for (size_t u = 0; u < ret_var.datalen; u++) {
8838 LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
8839 *ret_conv_20_conv = ret_var.data[u];
8840 ret_arr_ptr[u] = tag_ptr(ret_conv_20_conv, true);
8842 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
8847 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) {
8848 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ clone bytes"), .datalen = orig->datalen };
8849 for (size_t i = 0; i < ret.datalen; i++) {
8850 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(&orig->data[i]);
8854 static jclass LDKBalance_ClaimableOnChannelClose_class = NULL;
8855 static jmethodID LDKBalance_ClaimableOnChannelClose_meth = NULL;
8856 static jclass LDKBalance_ClaimableAwaitingConfirmations_class = NULL;
8857 static jmethodID LDKBalance_ClaimableAwaitingConfirmations_meth = NULL;
8858 static jclass LDKBalance_ContentiousClaimable_class = NULL;
8859 static jmethodID LDKBalance_ContentiousClaimable_meth = NULL;
8860 static jclass LDKBalance_MaybeTimeoutClaimableHTLC_class = NULL;
8861 static jmethodID LDKBalance_MaybeTimeoutClaimableHTLC_meth = NULL;
8862 static jclass LDKBalance_MaybePreimageClaimableHTLC_class = NULL;
8863 static jmethodID LDKBalance_MaybePreimageClaimableHTLC_meth = NULL;
8864 static jclass LDKBalance_CounterpartyRevokedOutputClaimable_class = NULL;
8865 static jmethodID LDKBalance_CounterpartyRevokedOutputClaimable_meth = NULL;
8866 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBalance_init (JNIEnv *env, jclass clz) {
8867 LDKBalance_ClaimableOnChannelClose_class =
8868 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableOnChannelClose"));
8869 CHECK(LDKBalance_ClaimableOnChannelClose_class != NULL);
8870 LDKBalance_ClaimableOnChannelClose_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableOnChannelClose_class, "<init>", "(J)V");
8871 CHECK(LDKBalance_ClaimableOnChannelClose_meth != NULL);
8872 LDKBalance_ClaimableAwaitingConfirmations_class =
8873 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableAwaitingConfirmations"));
8874 CHECK(LDKBalance_ClaimableAwaitingConfirmations_class != NULL);
8875 LDKBalance_ClaimableAwaitingConfirmations_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableAwaitingConfirmations_class, "<init>", "(JI)V");
8876 CHECK(LDKBalance_ClaimableAwaitingConfirmations_meth != NULL);
8877 LDKBalance_ContentiousClaimable_class =
8878 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ContentiousClaimable"));
8879 CHECK(LDKBalance_ContentiousClaimable_class != NULL);
8880 LDKBalance_ContentiousClaimable_meth = (*env)->GetMethodID(env, LDKBalance_ContentiousClaimable_class, "<init>", "(JI)V");
8881 CHECK(LDKBalance_ContentiousClaimable_meth != NULL);
8882 LDKBalance_MaybeTimeoutClaimableHTLC_class =
8883 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybeTimeoutClaimableHTLC"));
8884 CHECK(LDKBalance_MaybeTimeoutClaimableHTLC_class != NULL);
8885 LDKBalance_MaybeTimeoutClaimableHTLC_meth = (*env)->GetMethodID(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, "<init>", "(JI)V");
8886 CHECK(LDKBalance_MaybeTimeoutClaimableHTLC_meth != NULL);
8887 LDKBalance_MaybePreimageClaimableHTLC_class =
8888 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybePreimageClaimableHTLC"));
8889 CHECK(LDKBalance_MaybePreimageClaimableHTLC_class != NULL);
8890 LDKBalance_MaybePreimageClaimableHTLC_meth = (*env)->GetMethodID(env, LDKBalance_MaybePreimageClaimableHTLC_class, "<init>", "(JI)V");
8891 CHECK(LDKBalance_MaybePreimageClaimableHTLC_meth != NULL);
8892 LDKBalance_CounterpartyRevokedOutputClaimable_class =
8893 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$CounterpartyRevokedOutputClaimable"));
8894 CHECK(LDKBalance_CounterpartyRevokedOutputClaimable_class != NULL);
8895 LDKBalance_CounterpartyRevokedOutputClaimable_meth = (*env)->GetMethodID(env, LDKBalance_CounterpartyRevokedOutputClaimable_class, "<init>", "(J)V");
8896 CHECK(LDKBalance_CounterpartyRevokedOutputClaimable_meth != NULL);
8898 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
8899 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
8901 case LDKBalance_ClaimableOnChannelClose: {
8902 int64_t claimable_amount_satoshis_conv = obj->claimable_on_channel_close.claimable_amount_satoshis;
8903 return (*env)->NewObject(env, LDKBalance_ClaimableOnChannelClose_class, LDKBalance_ClaimableOnChannelClose_meth, claimable_amount_satoshis_conv);
8905 case LDKBalance_ClaimableAwaitingConfirmations: {
8906 int64_t claimable_amount_satoshis_conv = obj->claimable_awaiting_confirmations.claimable_amount_satoshis;
8907 int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height;
8908 return (*env)->NewObject(env, LDKBalance_ClaimableAwaitingConfirmations_class, LDKBalance_ClaimableAwaitingConfirmations_meth, claimable_amount_satoshis_conv, confirmation_height_conv);
8910 case LDKBalance_ContentiousClaimable: {
8911 int64_t claimable_amount_satoshis_conv = obj->contentious_claimable.claimable_amount_satoshis;
8912 int32_t timeout_height_conv = obj->contentious_claimable.timeout_height;
8913 return (*env)->NewObject(env, LDKBalance_ContentiousClaimable_class, LDKBalance_ContentiousClaimable_meth, claimable_amount_satoshis_conv, timeout_height_conv);
8915 case LDKBalance_MaybeTimeoutClaimableHTLC: {
8916 int64_t claimable_amount_satoshis_conv = obj->maybe_timeout_claimable_htlc.claimable_amount_satoshis;
8917 int32_t claimable_height_conv = obj->maybe_timeout_claimable_htlc.claimable_height;
8918 return (*env)->NewObject(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, LDKBalance_MaybeTimeoutClaimableHTLC_meth, claimable_amount_satoshis_conv, claimable_height_conv);
8920 case LDKBalance_MaybePreimageClaimableHTLC: {
8921 int64_t claimable_amount_satoshis_conv = obj->maybe_preimage_claimable_htlc.claimable_amount_satoshis;
8922 int32_t expiry_height_conv = obj->maybe_preimage_claimable_htlc.expiry_height;
8923 return (*env)->NewObject(env, LDKBalance_MaybePreimageClaimableHTLC_class, LDKBalance_MaybePreimageClaimableHTLC_meth, claimable_amount_satoshis_conv, expiry_height_conv);
8925 case LDKBalance_CounterpartyRevokedOutputClaimable: {
8926 int64_t claimable_amount_satoshis_conv = obj->counterparty_revoked_output_claimable.claimable_amount_satoshis;
8927 return (*env)->NewObject(env, LDKBalance_CounterpartyRevokedOutputClaimable_class, LDKBalance_CounterpartyRevokedOutputClaimable_meth, claimable_amount_satoshis_conv);
8932 static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
8933 LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
8934 for (size_t i = 0; i < ret.datalen; i++) {
8935 ret.data[i] = Balance_clone(&orig->data[i]);
8939 static inline struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
8940 CHECK(owner->result_ok);
8941 return C2Tuple_BlockHashChannelMonitorZ_clone(&*owner->contents.result);
8943 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8944 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
8945 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
8946 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv);
8947 return tag_ptr(ret_conv, true);
8950 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
8951 CHECK(!owner->result_ok);
8952 return DecodeError_clone(&*owner->contents.err);
8954 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8955 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
8956 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8957 *ret_copy = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
8958 int64_t ret_ref = tag_ptr(ret_copy, true);
8962 static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
8965 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
8966 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
8967 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
8968 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form);
8972 static inline struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
8973 return Type_clone(&owner->b);
8975 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
8976 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
8977 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
8978 *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv);
8979 return tag_ptr(ret_ret, true);
8982 static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) {
8983 LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen };
8984 for (size_t i = 0; i < ret.datalen; i++) {
8985 ret.data[i] = C2Tuple_PublicKeyTypeZ_clone(&orig->data[i]);
8989 typedef struct LDKCustomOnionMessageContents_JCalls {
8990 atomic_size_t refcnt;
8993 jmethodID tlv_type_meth;
8994 jmethodID write_meth;
8995 } LDKCustomOnionMessageContents_JCalls;
8996 static void LDKCustomOnionMessageContents_JCalls_free(void* this_arg) {
8997 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
8998 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9000 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9001 if (get_jenv_res == JNI_EDETACHED) {
9002 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9004 DO_ASSERT(get_jenv_res == JNI_OK);
9006 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
9007 if (get_jenv_res == JNI_EDETACHED) {
9008 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9013 uint64_t tlv_type_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
9014 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
9016 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9017 if (get_jenv_res == JNI_EDETACHED) {
9018 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9020 DO_ASSERT(get_jenv_res == JNI_OK);
9022 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9024 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->tlv_type_meth);
9025 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9026 (*env)->ExceptionDescribe(env);
9027 (*env)->FatalError(env, "A call to tlv_type in LDKCustomOnionMessageContents from rust threw an exception.");
9029 if (get_jenv_res == JNI_EDETACHED) {
9030 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9034 LDKCVec_u8Z write_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
9035 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
9037 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9038 if (get_jenv_res == JNI_EDETACHED) {
9039 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9041 DO_ASSERT(get_jenv_res == JNI_OK);
9043 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9045 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
9046 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9047 (*env)->ExceptionDescribe(env);
9048 (*env)->FatalError(env, "A call to write in LDKCustomOnionMessageContents from rust threw an exception.");
9050 LDKCVec_u8Z ret_ref;
9051 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
9052 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
9053 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
9054 if (get_jenv_res == JNI_EDETACHED) {
9055 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9059 static void LDKCustomOnionMessageContents_JCalls_cloned(LDKCustomOnionMessageContents* new_obj) {
9060 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) new_obj->this_arg;
9061 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9063 static inline LDKCustomOnionMessageContents LDKCustomOnionMessageContents_init (JNIEnv *env, jclass clz, jobject o) {
9064 jclass c = (*env)->GetObjectClass(env, o);
9066 LDKCustomOnionMessageContents_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageContents_JCalls), "LDKCustomOnionMessageContents_JCalls");
9067 atomic_init(&calls->refcnt, 1);
9068 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
9069 calls->o = (*env)->NewWeakGlobalRef(env, o);
9070 calls->tlv_type_meth = (*env)->GetMethodID(env, c, "tlv_type", "()J");
9071 CHECK(calls->tlv_type_meth != NULL);
9072 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
9073 CHECK(calls->write_meth != NULL);
9075 LDKCustomOnionMessageContents ret = {
9076 .this_arg = (void*) calls,
9077 .tlv_type = tlv_type_LDKCustomOnionMessageContents_jcall,
9078 .write = write_LDKCustomOnionMessageContents_jcall,
9079 .cloned = LDKCustomOnionMessageContents_JCalls_cloned,
9080 .free = LDKCustomOnionMessageContents_JCalls_free,
9084 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageContents_1new(JNIEnv *env, jclass clz, jobject o) {
9085 LDKCustomOnionMessageContents *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
9086 *res_ptr = LDKCustomOnionMessageContents_init(env, clz, o);
9087 return tag_ptr(res_ptr, true);
9089 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1tlv_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
9090 void* this_arg_ptr = untag_ptr(this_arg);
9091 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9092 LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
9093 int64_t ret_conv = (this_arg_conv->tlv_type)(this_arg_conv->this_arg);
9097 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
9098 void* this_arg_ptr = untag_ptr(this_arg);
9099 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9100 LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
9101 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
9102 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9103 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9104 CVec_u8Z_free(ret_var);
9108 static jclass LDKCOption_CustomOnionMessageContentsZ_Some_class = NULL;
9109 static jmethodID LDKCOption_CustomOnionMessageContentsZ_Some_meth = NULL;
9110 static jclass LDKCOption_CustomOnionMessageContentsZ_None_class = NULL;
9111 static jmethodID LDKCOption_CustomOnionMessageContentsZ_None_meth = NULL;
9112 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CustomOnionMessageContentsZ_init (JNIEnv *env, jclass clz) {
9113 LDKCOption_CustomOnionMessageContentsZ_Some_class =
9114 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CustomOnionMessageContentsZ$Some"));
9115 CHECK(LDKCOption_CustomOnionMessageContentsZ_Some_class != NULL);
9116 LDKCOption_CustomOnionMessageContentsZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CustomOnionMessageContentsZ_Some_class, "<init>", "(J)V");
9117 CHECK(LDKCOption_CustomOnionMessageContentsZ_Some_meth != NULL);
9118 LDKCOption_CustomOnionMessageContentsZ_None_class =
9119 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CustomOnionMessageContentsZ$None"));
9120 CHECK(LDKCOption_CustomOnionMessageContentsZ_None_class != NULL);
9121 LDKCOption_CustomOnionMessageContentsZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CustomOnionMessageContentsZ_None_class, "<init>", "()V");
9122 CHECK(LDKCOption_CustomOnionMessageContentsZ_None_meth != NULL);
9124 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CustomOnionMessageContentsZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9125 LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr);
9127 case LDKCOption_CustomOnionMessageContentsZ_Some: {
9128 LDKCustomOnionMessageContents* some_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
9129 *some_ret = CustomOnionMessageContents_clone(&obj->some);
9130 return (*env)->NewObject(env, LDKCOption_CustomOnionMessageContentsZ_Some_class, LDKCOption_CustomOnionMessageContentsZ_Some_meth, tag_ptr(some_ret, true));
9132 case LDKCOption_CustomOnionMessageContentsZ_None: {
9133 return (*env)->NewObject(env, LDKCOption_CustomOnionMessageContentsZ_None_class, LDKCOption_CustomOnionMessageContentsZ_None_meth);
9138 static inline struct LDKCOption_CustomOnionMessageContentsZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
9139 CHECK(owner->result_ok);
9140 return COption_CustomOnionMessageContentsZ_clone(&*owner->contents.result);
9142 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9143 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
9144 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
9145 *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(owner_conv);
9146 int64_t ret_ref = tag_ptr(ret_copy, true);
9150 static inline struct LDKDecodeError CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
9151 CHECK(!owner->result_ok);
9152 return DecodeError_clone(&*owner->contents.err);
9154 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9155 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
9156 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9157 *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(owner_conv);
9158 int64_t ret_ref = tag_ptr(ret_copy, true);
9162 static jclass LDKCOption_NetAddressZ_Some_class = NULL;
9163 static jmethodID LDKCOption_NetAddressZ_Some_meth = NULL;
9164 static jclass LDKCOption_NetAddressZ_None_class = NULL;
9165 static jmethodID LDKCOption_NetAddressZ_None_meth = NULL;
9166 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetAddressZ_init (JNIEnv *env, jclass clz) {
9167 LDKCOption_NetAddressZ_Some_class =
9168 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetAddressZ$Some"));
9169 CHECK(LDKCOption_NetAddressZ_Some_class != NULL);
9170 LDKCOption_NetAddressZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NetAddressZ_Some_class, "<init>", "(J)V");
9171 CHECK(LDKCOption_NetAddressZ_Some_meth != NULL);
9172 LDKCOption_NetAddressZ_None_class =
9173 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetAddressZ$None"));
9174 CHECK(LDKCOption_NetAddressZ_None_class != NULL);
9175 LDKCOption_NetAddressZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NetAddressZ_None_class, "<init>", "()V");
9176 CHECK(LDKCOption_NetAddressZ_None_meth != NULL);
9178 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetAddressZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9179 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
9181 case LDKCOption_NetAddressZ_Some: {
9182 int64_t some_ref = tag_ptr(&obj->some, false);
9183 return (*env)->NewObject(env, LDKCOption_NetAddressZ_Some_class, LDKCOption_NetAddressZ_Some_meth, some_ref);
9185 case LDKCOption_NetAddressZ_None: {
9186 return (*env)->NewObject(env, LDKCOption_NetAddressZ_None_class, LDKCOption_NetAddressZ_None_meth);
9191 static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
9192 CHECK(owner->result_ok);
9193 return CVec_u8Z_clone(&*owner->contents.result);
9195 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9196 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
9197 LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv);
9198 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9199 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9200 CVec_u8Z_free(ret_var);
9204 static inline struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
9205 LDKPeerHandleError ret = *owner->contents.err;
9206 ret.is_owned = false;
9209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9210 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
9211 LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv);
9212 int64_t ret_ref = 0;
9213 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9214 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9218 static inline void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
9219 CHECK(owner->result_ok);
9220 return *owner->contents.result;
9222 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9223 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
9224 CResult_NonePeerHandleErrorZ_get_ok(owner_conv);
9227 static inline struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
9228 LDKPeerHandleError ret = *owner->contents.err;
9229 ret.is_owned = false;
9232 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9233 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
9234 LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv);
9235 int64_t ret_ref = 0;
9236 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9237 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9241 static inline bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
9242 CHECK(owner->result_ok);
9243 return *owner->contents.result;
9245 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9246 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
9247 jboolean ret_conv = CResult_boolPeerHandleErrorZ_get_ok(owner_conv);
9251 static inline struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
9252 LDKPeerHandleError ret = *owner->contents.err;
9253 ret.is_owned = false;
9256 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9257 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
9258 LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv);
9259 int64_t ret_ref = 0;
9260 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9261 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9265 static jclass LDKSendError_Secp256k1_class = NULL;
9266 static jmethodID LDKSendError_Secp256k1_meth = NULL;
9267 static jclass LDKSendError_TooBigPacket_class = NULL;
9268 static jmethodID LDKSendError_TooBigPacket_meth = NULL;
9269 static jclass LDKSendError_TooFewBlindedHops_class = NULL;
9270 static jmethodID LDKSendError_TooFewBlindedHops_meth = NULL;
9271 static jclass LDKSendError_InvalidFirstHop_class = NULL;
9272 static jmethodID LDKSendError_InvalidFirstHop_meth = NULL;
9273 static jclass LDKSendError_InvalidMessage_class = NULL;
9274 static jmethodID LDKSendError_InvalidMessage_meth = NULL;
9275 static jclass LDKSendError_BufferFull_class = NULL;
9276 static jmethodID LDKSendError_BufferFull_meth = NULL;
9277 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSendError_init (JNIEnv *env, jclass clz) {
9278 LDKSendError_Secp256k1_class =
9279 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$Secp256k1"));
9280 CHECK(LDKSendError_Secp256k1_class != NULL);
9281 LDKSendError_Secp256k1_meth = (*env)->GetMethodID(env, LDKSendError_Secp256k1_class, "<init>", "(Lorg/ldk/enums/Secp256k1Error;)V");
9282 CHECK(LDKSendError_Secp256k1_meth != NULL);
9283 LDKSendError_TooBigPacket_class =
9284 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$TooBigPacket"));
9285 CHECK(LDKSendError_TooBigPacket_class != NULL);
9286 LDKSendError_TooBigPacket_meth = (*env)->GetMethodID(env, LDKSendError_TooBigPacket_class, "<init>", "()V");
9287 CHECK(LDKSendError_TooBigPacket_meth != NULL);
9288 LDKSendError_TooFewBlindedHops_class =
9289 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$TooFewBlindedHops"));
9290 CHECK(LDKSendError_TooFewBlindedHops_class != NULL);
9291 LDKSendError_TooFewBlindedHops_meth = (*env)->GetMethodID(env, LDKSendError_TooFewBlindedHops_class, "<init>", "()V");
9292 CHECK(LDKSendError_TooFewBlindedHops_meth != NULL);
9293 LDKSendError_InvalidFirstHop_class =
9294 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$InvalidFirstHop"));
9295 CHECK(LDKSendError_InvalidFirstHop_class != NULL);
9296 LDKSendError_InvalidFirstHop_meth = (*env)->GetMethodID(env, LDKSendError_InvalidFirstHop_class, "<init>", "()V");
9297 CHECK(LDKSendError_InvalidFirstHop_meth != NULL);
9298 LDKSendError_InvalidMessage_class =
9299 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$InvalidMessage"));
9300 CHECK(LDKSendError_InvalidMessage_class != NULL);
9301 LDKSendError_InvalidMessage_meth = (*env)->GetMethodID(env, LDKSendError_InvalidMessage_class, "<init>", "()V");
9302 CHECK(LDKSendError_InvalidMessage_meth != NULL);
9303 LDKSendError_BufferFull_class =
9304 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$BufferFull"));
9305 CHECK(LDKSendError_BufferFull_class != NULL);
9306 LDKSendError_BufferFull_meth = (*env)->GetMethodID(env, LDKSendError_BufferFull_class, "<init>", "()V");
9307 CHECK(LDKSendError_BufferFull_meth != NULL);
9309 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSendError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9310 LDKSendError *obj = (LDKSendError*)untag_ptr(ptr);
9312 case LDKSendError_Secp256k1: {
9313 jclass secp256k1_conv = LDKSecp256k1Error_to_java(env, obj->secp256k1);
9314 return (*env)->NewObject(env, LDKSendError_Secp256k1_class, LDKSendError_Secp256k1_meth, secp256k1_conv);
9316 case LDKSendError_TooBigPacket: {
9317 return (*env)->NewObject(env, LDKSendError_TooBigPacket_class, LDKSendError_TooBigPacket_meth);
9319 case LDKSendError_TooFewBlindedHops: {
9320 return (*env)->NewObject(env, LDKSendError_TooFewBlindedHops_class, LDKSendError_TooFewBlindedHops_meth);
9322 case LDKSendError_InvalidFirstHop: {
9323 return (*env)->NewObject(env, LDKSendError_InvalidFirstHop_class, LDKSendError_InvalidFirstHop_meth);
9325 case LDKSendError_InvalidMessage: {
9326 return (*env)->NewObject(env, LDKSendError_InvalidMessage_class, LDKSendError_InvalidMessage_meth);
9328 case LDKSendError_BufferFull: {
9329 return (*env)->NewObject(env, LDKSendError_BufferFull_class, LDKSendError_BufferFull_meth);
9334 static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
9335 CHECK(owner->result_ok);
9336 return *owner->contents.result;
9338 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9339 LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
9340 CResult_NoneSendErrorZ_get_ok(owner_conv);
9343 static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
9344 CHECK(!owner->result_ok);
9345 return SendError_clone(&*owner->contents.err);
9347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9348 LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
9349 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
9350 *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv);
9351 int64_t ret_ref = tag_ptr(ret_copy, true);
9355 static jclass LDKGraphSyncError_DecodeError_class = NULL;
9356 static jmethodID LDKGraphSyncError_DecodeError_meth = NULL;
9357 static jclass LDKGraphSyncError_LightningError_class = NULL;
9358 static jmethodID LDKGraphSyncError_LightningError_meth = NULL;
9359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGraphSyncError_init (JNIEnv *env, jclass clz) {
9360 LDKGraphSyncError_DecodeError_class =
9361 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$DecodeError"));
9362 CHECK(LDKGraphSyncError_DecodeError_class != NULL);
9363 LDKGraphSyncError_DecodeError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_DecodeError_class, "<init>", "(J)V");
9364 CHECK(LDKGraphSyncError_DecodeError_meth != NULL);
9365 LDKGraphSyncError_LightningError_class =
9366 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$LightningError"));
9367 CHECK(LDKGraphSyncError_LightningError_class != NULL);
9368 LDKGraphSyncError_LightningError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_LightningError_class, "<init>", "(J)V");
9369 CHECK(LDKGraphSyncError_LightningError_meth != NULL);
9371 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9372 LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
9374 case LDKGraphSyncError_DecodeError: {
9375 int64_t decode_error_ref = tag_ptr(&obj->decode_error, false);
9376 return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref);
9378 case LDKGraphSyncError_LightningError: {
9379 LDKLightningError lightning_error_var = obj->lightning_error;
9380 int64_t lightning_error_ref = 0;
9381 CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var);
9382 lightning_error_ref = tag_ptr(lightning_error_var.inner, false);
9383 return (*env)->NewObject(env, LDKGraphSyncError_LightningError_class, LDKGraphSyncError_LightningError_meth, lightning_error_ref);
9388 static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
9389 CHECK(owner->result_ok);
9390 return *owner->contents.result;
9392 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9393 LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
9394 int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv);
9398 static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
9399 CHECK(!owner->result_ok);
9400 return GraphSyncError_clone(&*owner->contents.err);
9402 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9403 LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
9404 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
9405 *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv);
9406 int64_t ret_ref = tag_ptr(ret_copy, true);
9410 static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
9411 CHECK(owner->result_ok);
9412 return NetAddress_clone(&*owner->contents.result);
9414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9415 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
9416 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
9417 *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
9418 int64_t ret_ref = tag_ptr(ret_copy, true);
9422 static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
9423 CHECK(!owner->result_ok);
9424 return DecodeError_clone(&*owner->contents.err);
9426 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9427 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
9428 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9429 *ret_copy = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
9430 int64_t ret_ref = tag_ptr(ret_copy, true);
9434 static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
9435 LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
9436 for (size_t i = 0; i < ret.datalen; i++) {
9437 ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
9441 static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
9442 LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
9443 for (size_t i = 0; i < ret.datalen; i++) {
9444 ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
9448 static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
9449 LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
9450 for (size_t i = 0; i < ret.datalen; i++) {
9451 ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
9455 static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
9456 LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
9457 for (size_t i = 0; i < ret.datalen; i++) {
9458 ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
9462 static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
9463 LDKAcceptChannel ret = *owner->contents.result;
9464 ret.is_owned = false;
9467 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9468 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
9469 LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv);
9470 int64_t ret_ref = 0;
9471 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9472 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9476 static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
9477 CHECK(!owner->result_ok);
9478 return DecodeError_clone(&*owner->contents.err);
9480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9481 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
9482 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9483 *ret_copy = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
9484 int64_t ret_ref = tag_ptr(ret_copy, true);
9488 static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
9489 LDKAnnouncementSignatures ret = *owner->contents.result;
9490 ret.is_owned = false;
9493 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9494 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
9495 LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
9496 int64_t ret_ref = 0;
9497 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9498 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9502 static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
9503 CHECK(!owner->result_ok);
9504 return DecodeError_clone(&*owner->contents.err);
9506 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9507 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
9508 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9509 *ret_copy = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
9510 int64_t ret_ref = tag_ptr(ret_copy, true);
9514 static inline struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
9515 LDKChannelReestablish ret = *owner->contents.result;
9516 ret.is_owned = false;
9519 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9520 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
9521 LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv);
9522 int64_t ret_ref = 0;
9523 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9524 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9528 static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
9529 CHECK(!owner->result_ok);
9530 return DecodeError_clone(&*owner->contents.err);
9532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9533 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
9534 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9535 *ret_copy = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
9536 int64_t ret_ref = tag_ptr(ret_copy, true);
9540 static inline struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
9541 LDKClosingSigned ret = *owner->contents.result;
9542 ret.is_owned = false;
9545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9546 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
9547 LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv);
9548 int64_t ret_ref = 0;
9549 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9550 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9554 static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
9555 CHECK(!owner->result_ok);
9556 return DecodeError_clone(&*owner->contents.err);
9558 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9559 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
9560 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9561 *ret_copy = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
9562 int64_t ret_ref = tag_ptr(ret_copy, true);
9566 static inline struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
9567 LDKClosingSignedFeeRange ret = *owner->contents.result;
9568 ret.is_owned = false;
9571 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9572 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
9573 LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv);
9574 int64_t ret_ref = 0;
9575 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9576 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9580 static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
9581 CHECK(!owner->result_ok);
9582 return DecodeError_clone(&*owner->contents.err);
9584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9585 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
9586 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9587 *ret_copy = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
9588 int64_t ret_ref = tag_ptr(ret_copy, true);
9592 static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
9593 LDKCommitmentSigned ret = *owner->contents.result;
9594 ret.is_owned = false;
9597 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9598 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
9599 LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv);
9600 int64_t ret_ref = 0;
9601 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9602 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9606 static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
9607 CHECK(!owner->result_ok);
9608 return DecodeError_clone(&*owner->contents.err);
9610 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9611 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
9612 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9613 *ret_copy = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
9614 int64_t ret_ref = tag_ptr(ret_copy, true);
9618 static inline struct LDKFundingCreated CResult_FundingCreatedDecodeErrorZ_get_ok(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
9619 LDKFundingCreated ret = *owner->contents.result;
9620 ret.is_owned = false;
9623 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9624 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
9625 LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv);
9626 int64_t ret_ref = 0;
9627 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9628 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9632 static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
9633 CHECK(!owner->result_ok);
9634 return DecodeError_clone(&*owner->contents.err);
9636 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9637 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
9638 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9639 *ret_copy = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
9640 int64_t ret_ref = tag_ptr(ret_copy, true);
9644 static inline struct LDKFundingSigned CResult_FundingSignedDecodeErrorZ_get_ok(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
9645 LDKFundingSigned ret = *owner->contents.result;
9646 ret.is_owned = false;
9649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9650 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
9651 LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv);
9652 int64_t ret_ref = 0;
9653 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9654 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9658 static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
9659 CHECK(!owner->result_ok);
9660 return DecodeError_clone(&*owner->contents.err);
9662 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9663 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
9664 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9665 *ret_copy = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
9666 int64_t ret_ref = tag_ptr(ret_copy, true);
9670 static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
9671 LDKChannelReady ret = *owner->contents.result;
9672 ret.is_owned = false;
9675 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9676 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
9677 LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv);
9678 int64_t ret_ref = 0;
9679 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9680 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9684 static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
9685 CHECK(!owner->result_ok);
9686 return DecodeError_clone(&*owner->contents.err);
9688 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9689 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
9690 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9691 *ret_copy = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
9692 int64_t ret_ref = tag_ptr(ret_copy, true);
9696 static inline struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
9697 LDKInit ret = *owner->contents.result;
9698 ret.is_owned = false;
9701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9702 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
9703 LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv);
9704 int64_t ret_ref = 0;
9705 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9706 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9710 static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
9711 CHECK(!owner->result_ok);
9712 return DecodeError_clone(&*owner->contents.err);
9714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9715 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
9716 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9717 *ret_copy = CResult_InitDecodeErrorZ_get_err(owner_conv);
9718 int64_t ret_ref = tag_ptr(ret_copy, true);
9722 static inline struct LDKOpenChannel CResult_OpenChannelDecodeErrorZ_get_ok(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
9723 LDKOpenChannel ret = *owner->contents.result;
9724 ret.is_owned = false;
9727 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9728 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
9729 LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_get_ok(owner_conv);
9730 int64_t ret_ref = 0;
9731 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9732 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9736 static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
9737 CHECK(!owner->result_ok);
9738 return DecodeError_clone(&*owner->contents.err);
9740 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9741 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
9742 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9743 *ret_copy = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
9744 int64_t ret_ref = tag_ptr(ret_copy, true);
9748 static inline struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
9749 LDKRevokeAndACK ret = *owner->contents.result;
9750 ret.is_owned = false;
9753 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9754 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
9755 LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_get_ok(owner_conv);
9756 int64_t ret_ref = 0;
9757 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9758 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9762 static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
9763 CHECK(!owner->result_ok);
9764 return DecodeError_clone(&*owner->contents.err);
9766 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9767 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
9768 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9769 *ret_copy = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
9770 int64_t ret_ref = tag_ptr(ret_copy, true);
9774 static inline struct LDKShutdown CResult_ShutdownDecodeErrorZ_get_ok(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
9775 LDKShutdown ret = *owner->contents.result;
9776 ret.is_owned = false;
9779 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9780 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
9781 LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv);
9782 int64_t ret_ref = 0;
9783 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9784 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9788 static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
9789 CHECK(!owner->result_ok);
9790 return DecodeError_clone(&*owner->contents.err);
9792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9793 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
9794 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9795 *ret_copy = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
9796 int64_t ret_ref = tag_ptr(ret_copy, true);
9800 static inline struct LDKUpdateFailHTLC CResult_UpdateFailHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
9801 LDKUpdateFailHTLC ret = *owner->contents.result;
9802 ret.is_owned = false;
9805 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9806 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
9807 LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv);
9808 int64_t ret_ref = 0;
9809 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9810 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9814 static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
9815 CHECK(!owner->result_ok);
9816 return DecodeError_clone(&*owner->contents.err);
9818 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9819 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
9820 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9821 *ret_copy = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
9822 int64_t ret_ref = tag_ptr(ret_copy, true);
9826 static inline struct LDKUpdateFailMalformedHTLC CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
9827 LDKUpdateFailMalformedHTLC ret = *owner->contents.result;
9828 ret.is_owned = false;
9831 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9832 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
9833 LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv);
9834 int64_t ret_ref = 0;
9835 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9836 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9840 static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
9841 CHECK(!owner->result_ok);
9842 return DecodeError_clone(&*owner->contents.err);
9844 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9845 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
9846 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9847 *ret_copy = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
9848 int64_t ret_ref = tag_ptr(ret_copy, true);
9852 static inline struct LDKUpdateFee CResult_UpdateFeeDecodeErrorZ_get_ok(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
9853 LDKUpdateFee ret = *owner->contents.result;
9854 ret.is_owned = false;
9857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9858 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
9859 LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv);
9860 int64_t ret_ref = 0;
9861 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9862 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9866 static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
9867 CHECK(!owner->result_ok);
9868 return DecodeError_clone(&*owner->contents.err);
9870 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9871 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
9872 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9873 *ret_copy = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
9874 int64_t ret_ref = tag_ptr(ret_copy, true);
9878 static inline struct LDKUpdateFulfillHTLC CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
9879 LDKUpdateFulfillHTLC ret = *owner->contents.result;
9880 ret.is_owned = false;
9883 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9884 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
9885 LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv);
9886 int64_t ret_ref = 0;
9887 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9888 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9892 static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
9893 CHECK(!owner->result_ok);
9894 return DecodeError_clone(&*owner->contents.err);
9896 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9897 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
9898 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9899 *ret_copy = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
9900 int64_t ret_ref = tag_ptr(ret_copy, true);
9904 static inline struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
9905 LDKUpdateAddHTLC ret = *owner->contents.result;
9906 ret.is_owned = false;
9909 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9910 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
9911 LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner_conv);
9912 int64_t ret_ref = 0;
9913 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9914 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9918 static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
9919 CHECK(!owner->result_ok);
9920 return DecodeError_clone(&*owner->contents.err);
9922 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9923 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
9924 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9925 *ret_copy = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
9926 int64_t ret_ref = tag_ptr(ret_copy, true);
9930 static inline struct LDKOnionMessage CResult_OnionMessageDecodeErrorZ_get_ok(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
9931 LDKOnionMessage ret = *owner->contents.result;
9932 ret.is_owned = false;
9935 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9936 LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
9937 LDKOnionMessage ret_var = CResult_OnionMessageDecodeErrorZ_get_ok(owner_conv);
9938 int64_t ret_ref = 0;
9939 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9940 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9944 static inline struct LDKDecodeError CResult_OnionMessageDecodeErrorZ_get_err(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
9945 CHECK(!owner->result_ok);
9946 return DecodeError_clone(&*owner->contents.err);
9948 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9949 LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
9950 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9951 *ret_copy = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv);
9952 int64_t ret_ref = tag_ptr(ret_copy, true);
9956 static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
9957 LDKPing ret = *owner->contents.result;
9958 ret.is_owned = false;
9961 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9962 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
9963 LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv);
9964 int64_t ret_ref = 0;
9965 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9966 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9970 static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
9971 CHECK(!owner->result_ok);
9972 return DecodeError_clone(&*owner->contents.err);
9974 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9975 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
9976 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9977 *ret_copy = CResult_PingDecodeErrorZ_get_err(owner_conv);
9978 int64_t ret_ref = tag_ptr(ret_copy, true);
9982 static inline struct LDKPong CResult_PongDecodeErrorZ_get_ok(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
9983 LDKPong ret = *owner->contents.result;
9984 ret.is_owned = false;
9987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9988 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
9989 LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv);
9990 int64_t ret_ref = 0;
9991 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9992 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9996 static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
9997 CHECK(!owner->result_ok);
9998 return DecodeError_clone(&*owner->contents.err);
10000 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10001 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
10002 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10003 *ret_copy = CResult_PongDecodeErrorZ_get_err(owner_conv);
10004 int64_t ret_ref = tag_ptr(ret_copy, true);
10008 static inline struct LDKUnsignedChannelAnnouncement CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
10009 LDKUnsignedChannelAnnouncement ret = *owner->contents.result;
10010 ret.is_owned = false;
10013 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10014 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
10015 LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
10016 int64_t ret_ref = 0;
10017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10018 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10022 static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
10023 CHECK(!owner->result_ok);
10024 return DecodeError_clone(&*owner->contents.err);
10026 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10027 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
10028 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10029 *ret_copy = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
10030 int64_t ret_ref = tag_ptr(ret_copy, true);
10034 static inline struct LDKChannelAnnouncement CResult_ChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
10035 LDKChannelAnnouncement ret = *owner->contents.result;
10036 ret.is_owned = false;
10039 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10040 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
10041 LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
10042 int64_t ret_ref = 0;
10043 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10044 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10048 static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
10049 CHECK(!owner->result_ok);
10050 return DecodeError_clone(&*owner->contents.err);
10052 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10053 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
10054 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10055 *ret_copy = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
10056 int64_t ret_ref = tag_ptr(ret_copy, true);
10060 static inline struct LDKUnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
10061 LDKUnsignedChannelUpdate ret = *owner->contents.result;
10062 ret.is_owned = false;
10065 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10066 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
10067 LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv);
10068 int64_t ret_ref = 0;
10069 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10070 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10074 static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
10075 CHECK(!owner->result_ok);
10076 return DecodeError_clone(&*owner->contents.err);
10078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10079 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
10080 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10081 *ret_copy = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
10082 int64_t ret_ref = tag_ptr(ret_copy, true);
10086 static inline struct LDKChannelUpdate CResult_ChannelUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
10087 LDKChannelUpdate ret = *owner->contents.result;
10088 ret.is_owned = false;
10091 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10092 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
10093 LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_get_ok(owner_conv);
10094 int64_t ret_ref = 0;
10095 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10096 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10100 static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
10101 CHECK(!owner->result_ok);
10102 return DecodeError_clone(&*owner->contents.err);
10104 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10105 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
10106 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10107 *ret_copy = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
10108 int64_t ret_ref = tag_ptr(ret_copy, true);
10112 static inline struct LDKErrorMessage CResult_ErrorMessageDecodeErrorZ_get_ok(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
10113 LDKErrorMessage ret = *owner->contents.result;
10114 ret.is_owned = false;
10117 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10118 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
10119 LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(owner_conv);
10120 int64_t ret_ref = 0;
10121 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10122 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10126 static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
10127 CHECK(!owner->result_ok);
10128 return DecodeError_clone(&*owner->contents.err);
10130 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10131 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
10132 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10133 *ret_copy = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
10134 int64_t ret_ref = tag_ptr(ret_copy, true);
10138 static inline struct LDKWarningMessage CResult_WarningMessageDecodeErrorZ_get_ok(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
10139 LDKWarningMessage ret = *owner->contents.result;
10140 ret.is_owned = false;
10143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10144 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
10145 LDKWarningMessage ret_var = CResult_WarningMessageDecodeErrorZ_get_ok(owner_conv);
10146 int64_t ret_ref = 0;
10147 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10148 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10152 static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
10153 CHECK(!owner->result_ok);
10154 return DecodeError_clone(&*owner->contents.err);
10156 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10157 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
10158 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10159 *ret_copy = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
10160 int64_t ret_ref = tag_ptr(ret_copy, true);
10164 static inline struct LDKUnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
10165 LDKUnsignedNodeAnnouncement ret = *owner->contents.result;
10166 ret.is_owned = false;
10169 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10170 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
10171 LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
10172 int64_t ret_ref = 0;
10173 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10174 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10178 static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
10179 CHECK(!owner->result_ok);
10180 return DecodeError_clone(&*owner->contents.err);
10182 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10183 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
10184 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10185 *ret_copy = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
10186 int64_t ret_ref = tag_ptr(ret_copy, true);
10190 static inline struct LDKNodeAnnouncement CResult_NodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
10191 LDKNodeAnnouncement ret = *owner->contents.result;
10192 ret.is_owned = false;
10195 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10196 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
10197 LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
10198 int64_t ret_ref = 0;
10199 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10200 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10204 static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
10205 CHECK(!owner->result_ok);
10206 return DecodeError_clone(&*owner->contents.err);
10208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10209 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
10210 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10211 *ret_copy = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
10212 int64_t ret_ref = tag_ptr(ret_copy, true);
10216 static inline struct LDKQueryShortChannelIds CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
10217 LDKQueryShortChannelIds ret = *owner->contents.result;
10218 ret.is_owned = false;
10221 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10222 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
10223 LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv);
10224 int64_t ret_ref = 0;
10225 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10226 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10230 static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
10231 CHECK(!owner->result_ok);
10232 return DecodeError_clone(&*owner->contents.err);
10234 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10235 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
10236 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10237 *ret_copy = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
10238 int64_t ret_ref = tag_ptr(ret_copy, true);
10242 static inline struct LDKReplyShortChannelIdsEnd CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
10243 LDKReplyShortChannelIdsEnd ret = *owner->contents.result;
10244 ret.is_owned = false;
10247 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10248 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
10249 LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv);
10250 int64_t ret_ref = 0;
10251 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10252 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10256 static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
10257 CHECK(!owner->result_ok);
10258 return DecodeError_clone(&*owner->contents.err);
10260 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10261 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
10262 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10263 *ret_copy = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
10264 int64_t ret_ref = tag_ptr(ret_copy, true);
10268 static inline struct LDKQueryChannelRange CResult_QueryChannelRangeDecodeErrorZ_get_ok(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
10269 LDKQueryChannelRange ret = *owner->contents.result;
10270 ret.is_owned = false;
10273 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10274 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
10275 LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv);
10276 int64_t ret_ref = 0;
10277 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10278 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10282 static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
10283 CHECK(!owner->result_ok);
10284 return DecodeError_clone(&*owner->contents.err);
10286 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10287 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
10288 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10289 *ret_copy = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
10290 int64_t ret_ref = tag_ptr(ret_copy, true);
10294 static inline struct LDKReplyChannelRange CResult_ReplyChannelRangeDecodeErrorZ_get_ok(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
10295 LDKReplyChannelRange ret = *owner->contents.result;
10296 ret.is_owned = false;
10299 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10300 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
10301 LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner_conv);
10302 int64_t ret_ref = 0;
10303 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10304 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10308 static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
10309 CHECK(!owner->result_ok);
10310 return DecodeError_clone(&*owner->contents.err);
10312 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10313 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
10314 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10315 *ret_copy = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
10316 int64_t ret_ref = tag_ptr(ret_copy, true);
10320 static inline struct LDKGossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_get_ok(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
10321 LDKGossipTimestampFilter ret = *owner->contents.result;
10322 ret.is_owned = false;
10325 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10326 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
10327 LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv);
10328 int64_t ret_ref = 0;
10329 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10330 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10334 static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
10335 CHECK(!owner->result_ok);
10336 return DecodeError_clone(&*owner->contents.err);
10338 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10339 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
10340 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10341 *ret_copy = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
10342 int64_t ret_ref = tag_ptr(ret_copy, true);
10346 static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) {
10347 LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen };
10348 for (size_t i = 0; i < ret.datalen; i++) {
10349 ret.data[i] = PhantomRouteHints_clone(&orig->data[i]);
10353 static jclass LDKSignOrCreationError_SignError_class = NULL;
10354 static jmethodID LDKSignOrCreationError_SignError_meth = NULL;
10355 static jclass LDKSignOrCreationError_CreationError_class = NULL;
10356 static jmethodID LDKSignOrCreationError_CreationError_meth = NULL;
10357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSignOrCreationError_init (JNIEnv *env, jclass clz) {
10358 LDKSignOrCreationError_SignError_class =
10359 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$SignError"));
10360 CHECK(LDKSignOrCreationError_SignError_class != NULL);
10361 LDKSignOrCreationError_SignError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_SignError_class, "<init>", "()V");
10362 CHECK(LDKSignOrCreationError_SignError_meth != NULL);
10363 LDKSignOrCreationError_CreationError_class =
10364 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$CreationError"));
10365 CHECK(LDKSignOrCreationError_CreationError_class != NULL);
10366 LDKSignOrCreationError_CreationError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_CreationError_class, "<init>", "(Lorg/ldk/enums/CreationError;)V");
10367 CHECK(LDKSignOrCreationError_CreationError_meth != NULL);
10369 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
10370 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
10372 case LDKSignOrCreationError_SignError: {
10373 return (*env)->NewObject(env, LDKSignOrCreationError_SignError_class, LDKSignOrCreationError_SignError_meth);
10375 case LDKSignOrCreationError_CreationError: {
10376 jclass creation_error_conv = LDKCreationError_to_java(env, obj->creation_error);
10377 return (*env)->NewObject(env, LDKSignOrCreationError_CreationError_class, LDKSignOrCreationError_CreationError_meth, creation_error_conv);
10382 static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
10383 LDKInvoice ret = *owner->contents.result;
10384 ret.is_owned = false;
10387 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10388 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
10389 LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_get_ok(owner_conv);
10390 int64_t ret_ref = 0;
10391 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10392 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10396 static inline struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
10397 CHECK(!owner->result_ok);
10398 return SignOrCreationError_clone(&*owner->contents.err);
10400 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10401 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
10402 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
10403 *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv);
10404 int64_t ret_ref = tag_ptr(ret_copy, true);
10408 typedef struct LDKFilter_JCalls {
10409 atomic_size_t refcnt;
10412 jmethodID register_tx_meth;
10413 jmethodID register_output_meth;
10414 } LDKFilter_JCalls;
10415 static void LDKFilter_JCalls_free(void* this_arg) {
10416 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
10417 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10419 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10420 if (get_jenv_res == JNI_EDETACHED) {
10421 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10423 DO_ASSERT(get_jenv_res == JNI_OK);
10425 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
10426 if (get_jenv_res == JNI_EDETACHED) {
10427 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10432 void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
10433 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
10435 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10436 if (get_jenv_res == JNI_EDETACHED) {
10437 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10439 DO_ASSERT(get_jenv_res == JNI_OK);
10441 int8_tArray txid_arr = (*env)->NewByteArray(env, 32);
10442 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
10443 LDKu8slice script_pubkey_var = script_pubkey;
10444 int8_tArray script_pubkey_arr = (*env)->NewByteArray(env, script_pubkey_var.datalen);
10445 (*env)->SetByteArrayRegion(env, script_pubkey_arr, 0, script_pubkey_var.datalen, script_pubkey_var.data);
10446 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10447 CHECK(obj != NULL);
10448 (*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr);
10449 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10450 (*env)->ExceptionDescribe(env);
10451 (*env)->FatalError(env, "A call to register_tx in LDKFilter from rust threw an exception.");
10453 if (get_jenv_res == JNI_EDETACHED) {
10454 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10457 void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
10458 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
10460 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10461 if (get_jenv_res == JNI_EDETACHED) {
10462 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10464 DO_ASSERT(get_jenv_res == JNI_OK);
10466 LDKWatchedOutput output_var = output;
10467 int64_t output_ref = 0;
10468 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
10469 output_ref = tag_ptr(output_var.inner, output_var.is_owned);
10470 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10471 CHECK(obj != NULL);
10472 (*env)->CallVoidMethod(env, obj, j_calls->register_output_meth, output_ref);
10473 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10474 (*env)->ExceptionDescribe(env);
10475 (*env)->FatalError(env, "A call to register_output in LDKFilter from rust threw an exception.");
10477 if (get_jenv_res == JNI_EDETACHED) {
10478 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10481 static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
10482 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
10483 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10485 static inline LDKFilter LDKFilter_init (JNIEnv *env, jclass clz, jobject o) {
10486 jclass c = (*env)->GetObjectClass(env, o);
10488 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
10489 atomic_init(&calls->refcnt, 1);
10490 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
10491 calls->o = (*env)->NewWeakGlobalRef(env, o);
10492 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([B[B)V");
10493 CHECK(calls->register_tx_meth != NULL);
10494 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(J)V");
10495 CHECK(calls->register_output_meth != NULL);
10498 .this_arg = (void*) calls,
10499 .register_tx = register_tx_LDKFilter_jcall,
10500 .register_output = register_output_LDKFilter_jcall,
10501 .free = LDKFilter_JCalls_free,
10505 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new(JNIEnv *env, jclass clz, jobject o) {
10506 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
10507 *res_ptr = LDKFilter_init(env, clz, o);
10508 return tag_ptr(res_ptr, true);
10510 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid, int8_tArray script_pubkey) {
10511 void* this_arg_ptr = untag_ptr(this_arg);
10512 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10513 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
10514 unsigned char txid_arr[32];
10515 CHECK((*env)->GetArrayLength(env, txid) == 32);
10516 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
10517 unsigned char (*txid_ref)[32] = &txid_arr;
10518 LDKu8slice script_pubkey_ref;
10519 script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
10520 script_pubkey_ref.data = (*env)->GetByteArrayElements (env, script_pubkey, NULL);
10521 (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
10522 (*env)->ReleaseByteArrayElements(env, script_pubkey, (int8_t*)script_pubkey_ref.data, 0);
10525 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEnv *env, jclass clz, int64_t this_arg, int64_t output) {
10526 void* this_arg_ptr = untag_ptr(this_arg);
10527 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10528 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
10529 LDKWatchedOutput output_conv;
10530 output_conv.inner = untag_ptr(output);
10531 output_conv.is_owned = ptr_is_owned(output);
10532 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
10533 output_conv = WatchedOutput_clone(&output_conv);
10534 (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
10537 static jclass LDKCOption_FilterZ_Some_class = NULL;
10538 static jmethodID LDKCOption_FilterZ_Some_meth = NULL;
10539 static jclass LDKCOption_FilterZ_None_class = NULL;
10540 static jmethodID LDKCOption_FilterZ_None_meth = NULL;
10541 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1FilterZ_init (JNIEnv *env, jclass clz) {
10542 LDKCOption_FilterZ_Some_class =
10543 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$Some"));
10544 CHECK(LDKCOption_FilterZ_Some_class != NULL);
10545 LDKCOption_FilterZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_Some_class, "<init>", "(J)V");
10546 CHECK(LDKCOption_FilterZ_Some_meth != NULL);
10547 LDKCOption_FilterZ_None_class =
10548 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$None"));
10549 CHECK(LDKCOption_FilterZ_None_class != NULL);
10550 LDKCOption_FilterZ_None_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_None_class, "<init>", "()V");
10551 CHECK(LDKCOption_FilterZ_None_meth != NULL);
10553 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1FilterZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
10554 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
10556 case LDKCOption_FilterZ_Some: {
10557 LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
10558 *some_ret = obj->some;
10559 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
10560 if ((*some_ret).free == LDKFilter_JCalls_free) {
10561 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
10562 LDKFilter_JCalls_cloned(&(*some_ret));
10564 return (*env)->NewObject(env, LDKCOption_FilterZ_Some_class, LDKCOption_FilterZ_Some_meth, tag_ptr(some_ret, true));
10566 case LDKCOption_FilterZ_None: {
10567 return (*env)->NewObject(env, LDKCOption_FilterZ_None_class, LDKCOption_FilterZ_None_meth);
10572 static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
10573 LDKLockedChannelMonitor ret = *owner->contents.result;
10574 ret.is_owned = false;
10577 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10578 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
10579 LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv);
10580 int64_t ret_ref = 0;
10581 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10582 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10586 static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
10587 CHECK(!owner->result_ok);
10588 return *owner->contents.err;
10590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10591 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
10592 CResult_LockedChannelMonitorNoneZ_get_err(owner_conv);
10595 static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) {
10596 LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen };
10597 for (size_t i = 0; i < ret.datalen; i++) {
10598 ret.data[i] = OutPoint_clone(&orig->data[i]);
10602 typedef struct LDKMessageSendEventsProvider_JCalls {
10603 atomic_size_t refcnt;
10606 jmethodID get_and_clear_pending_msg_events_meth;
10607 } LDKMessageSendEventsProvider_JCalls;
10608 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
10609 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
10610 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10612 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10613 if (get_jenv_res == JNI_EDETACHED) {
10614 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10616 DO_ASSERT(get_jenv_res == JNI_OK);
10618 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
10619 if (get_jenv_res == JNI_EDETACHED) {
10620 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10625 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
10626 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
10628 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10629 if (get_jenv_res == JNI_EDETACHED) {
10630 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10632 DO_ASSERT(get_jenv_res == JNI_OK);
10634 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10635 CHECK(obj != NULL);
10636 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth);
10637 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10638 (*env)->ExceptionDescribe(env);
10639 (*env)->FatalError(env, "A call to get_and_clear_pending_msg_events in LDKMessageSendEventsProvider from rust threw an exception.");
10641 LDKCVec_MessageSendEventZ ret_constr;
10642 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
10643 if (ret_constr.datalen > 0)
10644 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
10646 ret_constr.data = NULL;
10647 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
10648 for (size_t s = 0; s < ret_constr.datalen; s++) {
10649 int64_t ret_conv_18 = ret_vals[s];
10650 void* ret_conv_18_ptr = untag_ptr(ret_conv_18);
10651 CHECK_ACCESS(ret_conv_18_ptr);
10652 LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
10653 FREE(untag_ptr(ret_conv_18));
10654 ret_constr.data[s] = ret_conv_18_conv;
10656 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
10657 if (get_jenv_res == JNI_EDETACHED) {
10658 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10662 static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
10663 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
10664 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10666 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
10667 jclass c = (*env)->GetObjectClass(env, o);
10669 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
10670 atomic_init(&calls->refcnt, 1);
10671 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
10672 calls->o = (*env)->NewWeakGlobalRef(env, o);
10673 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()[J");
10674 CHECK(calls->get_and_clear_pending_msg_events_meth != NULL);
10676 LDKMessageSendEventsProvider ret = {
10677 .this_arg = (void*) calls,
10678 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
10679 .free = LDKMessageSendEventsProvider_JCalls_free,
10683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new(JNIEnv *env, jclass clz, jobject o) {
10684 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
10685 *res_ptr = LDKMessageSendEventsProvider_init(env, clz, o);
10686 return tag_ptr(res_ptr, true);
10688 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
10689 void* this_arg_ptr = untag_ptr(this_arg);
10690 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10691 LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
10692 LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
10693 int64_tArray ret_arr = NULL;
10694 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
10695 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
10696 for (size_t s = 0; s < ret_var.datalen; s++) {
10697 LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
10698 *ret_conv_18_copy = ret_var.data[s];
10699 int64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true);
10700 ret_arr_ptr[s] = ret_conv_18_ref;
10702 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
10703 FREE(ret_var.data);
10707 typedef struct LDKOnionMessageProvider_JCalls {
10708 atomic_size_t refcnt;
10711 jmethodID next_onion_message_for_peer_meth;
10712 } LDKOnionMessageProvider_JCalls;
10713 static void LDKOnionMessageProvider_JCalls_free(void* this_arg) {
10714 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
10715 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10717 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10718 if (get_jenv_res == JNI_EDETACHED) {
10719 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10721 DO_ASSERT(get_jenv_res == JNI_OK);
10723 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
10724 if (get_jenv_res == JNI_EDETACHED) {
10725 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10730 LDKOnionMessage next_onion_message_for_peer_LDKOnionMessageProvider_jcall(const void* this_arg, LDKPublicKey peer_node_id) {
10731 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
10733 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10734 if (get_jenv_res == JNI_EDETACHED) {
10735 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10737 DO_ASSERT(get_jenv_res == JNI_OK);
10739 int8_tArray peer_node_id_arr = (*env)->NewByteArray(env, 33);
10740 (*env)->SetByteArrayRegion(env, peer_node_id_arr, 0, 33, peer_node_id.compressed_form);
10741 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10742 CHECK(obj != NULL);
10743 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->next_onion_message_for_peer_meth, peer_node_id_arr);
10744 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10745 (*env)->ExceptionDescribe(env);
10746 (*env)->FatalError(env, "A call to next_onion_message_for_peer in LDKOnionMessageProvider from rust threw an exception.");
10748 LDKOnionMessage ret_conv;
10749 ret_conv.inner = untag_ptr(ret);
10750 ret_conv.is_owned = ptr_is_owned(ret);
10751 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
10752 if (get_jenv_res == JNI_EDETACHED) {
10753 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10757 static void LDKOnionMessageProvider_JCalls_cloned(LDKOnionMessageProvider* new_obj) {
10758 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) new_obj->this_arg;
10759 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10761 static inline LDKOnionMessageProvider LDKOnionMessageProvider_init (JNIEnv *env, jclass clz, jobject o) {
10762 jclass c = (*env)->GetObjectClass(env, o);
10764 LDKOnionMessageProvider_JCalls *calls = MALLOC(sizeof(LDKOnionMessageProvider_JCalls), "LDKOnionMessageProvider_JCalls");
10765 atomic_init(&calls->refcnt, 1);
10766 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
10767 calls->o = (*env)->NewWeakGlobalRef(env, o);
10768 calls->next_onion_message_for_peer_meth = (*env)->GetMethodID(env, c, "next_onion_message_for_peer", "([B)J");
10769 CHECK(calls->next_onion_message_for_peer_meth != NULL);
10771 LDKOnionMessageProvider ret = {
10772 .this_arg = (void*) calls,
10773 .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageProvider_jcall,
10774 .free = LDKOnionMessageProvider_JCalls_free,
10778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageProvider_1new(JNIEnv *env, jclass clz, jobject o) {
10779 LDKOnionMessageProvider *res_ptr = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
10780 *res_ptr = LDKOnionMessageProvider_init(env, clz, o);
10781 return tag_ptr(res_ptr, true);
10783 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageProvider_1next_1onion_1message_1for_1peer(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray peer_node_id) {
10784 void* this_arg_ptr = untag_ptr(this_arg);
10785 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10786 LDKOnionMessageProvider* this_arg_conv = (LDKOnionMessageProvider*)this_arg_ptr;
10787 LDKPublicKey peer_node_id_ref;
10788 CHECK((*env)->GetArrayLength(env, peer_node_id) == 33);
10789 (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form);
10790 LDKOnionMessage ret_var = (this_arg_conv->next_onion_message_for_peer)(this_arg_conv->this_arg, peer_node_id_ref);
10791 int64_t ret_ref = 0;
10792 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10793 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10797 typedef struct LDKEventHandler_JCalls {
10798 atomic_size_t refcnt;
10801 jmethodID handle_event_meth;
10802 } LDKEventHandler_JCalls;
10803 static void LDKEventHandler_JCalls_free(void* this_arg) {
10804 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
10805 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10807 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10808 if (get_jenv_res == JNI_EDETACHED) {
10809 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10811 DO_ASSERT(get_jenv_res == JNI_OK);
10813 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
10814 if (get_jenv_res == JNI_EDETACHED) {
10815 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10820 void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * event) {
10821 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
10823 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10824 if (get_jenv_res == JNI_EDETACHED) {
10825 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10827 DO_ASSERT(get_jenv_res == JNI_OK);
10829 LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion");
10830 *ret_event = Event_clone(event);
10831 int64_t ref_event = tag_ptr(ret_event, true);
10832 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10833 CHECK(obj != NULL);
10834 (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, ref_event);
10835 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10836 (*env)->ExceptionDescribe(env);
10837 (*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception.");
10839 if (get_jenv_res == JNI_EDETACHED) {
10840 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10843 static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
10844 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
10845 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10847 static inline LDKEventHandler LDKEventHandler_init (JNIEnv *env, jclass clz, jobject o) {
10848 jclass c = (*env)->GetObjectClass(env, o);
10850 LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
10851 atomic_init(&calls->refcnt, 1);
10852 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
10853 calls->o = (*env)->NewWeakGlobalRef(env, o);
10854 calls->handle_event_meth = (*env)->GetMethodID(env, c, "handle_event", "(J)V");
10855 CHECK(calls->handle_event_meth != NULL);
10857 LDKEventHandler ret = {
10858 .this_arg = (void*) calls,
10859 .handle_event = handle_event_LDKEventHandler_jcall,
10860 .free = LDKEventHandler_JCalls_free,
10864 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventHandler_1new(JNIEnv *env, jclass clz, jobject o) {
10865 LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
10866 *res_ptr = LDKEventHandler_init(env, clz, o);
10867 return tag_ptr(res_ptr, true);
10869 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) {
10870 void* this_arg_ptr = untag_ptr(this_arg);
10871 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10872 LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
10873 LDKEvent* event_conv = (LDKEvent*)untag_ptr(event);
10874 (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
10877 typedef struct LDKEventsProvider_JCalls {
10878 atomic_size_t refcnt;
10881 jmethodID process_pending_events_meth;
10882 } LDKEventsProvider_JCalls;
10883 static void LDKEventsProvider_JCalls_free(void* this_arg) {
10884 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
10885 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10887 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10888 if (get_jenv_res == JNI_EDETACHED) {
10889 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10891 DO_ASSERT(get_jenv_res == JNI_OK);
10893 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
10894 if (get_jenv_res == JNI_EDETACHED) {
10895 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10900 void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
10901 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
10903 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10904 if (get_jenv_res == JNI_EDETACHED) {
10905 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10907 DO_ASSERT(get_jenv_res == JNI_OK);
10909 LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
10910 *handler_ret = handler;
10911 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10912 CHECK(obj != NULL);
10913 (*env)->CallVoidMethod(env, obj, j_calls->process_pending_events_meth, tag_ptr(handler_ret, true));
10914 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10915 (*env)->ExceptionDescribe(env);
10916 (*env)->FatalError(env, "A call to process_pending_events in LDKEventsProvider from rust threw an exception.");
10918 if (get_jenv_res == JNI_EDETACHED) {
10919 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10922 static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
10923 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
10924 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10926 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
10927 jclass c = (*env)->GetObjectClass(env, o);
10929 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
10930 atomic_init(&calls->refcnt, 1);
10931 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
10932 calls->o = (*env)->NewWeakGlobalRef(env, o);
10933 calls->process_pending_events_meth = (*env)->GetMethodID(env, c, "process_pending_events", "(J)V");
10934 CHECK(calls->process_pending_events_meth != NULL);
10936 LDKEventsProvider ret = {
10937 .this_arg = (void*) calls,
10938 .process_pending_events = process_pending_events_LDKEventsProvider_jcall,
10939 .free = LDKEventsProvider_JCalls_free,
10943 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new(JNIEnv *env, jclass clz, jobject o) {
10944 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
10945 *res_ptr = LDKEventsProvider_init(env, clz, o);
10946 return tag_ptr(res_ptr, true);
10948 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg, int64_t handler) {
10949 void* this_arg_ptr = untag_ptr(this_arg);
10950 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10951 LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
10952 void* handler_ptr = untag_ptr(handler);
10953 CHECK_ACCESS(handler_ptr);
10954 LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
10955 if (handler_conv.free == LDKEventHandler_JCalls_free) {
10956 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
10957 LDKEventHandler_JCalls_cloned(&handler_conv);
10959 (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
10962 typedef struct LDKPersister_JCalls {
10963 atomic_size_t refcnt;
10966 jmethodID persist_manager_meth;
10967 jmethodID persist_graph_meth;
10968 jmethodID persist_scorer_meth;
10969 } LDKPersister_JCalls;
10970 static void LDKPersister_JCalls_free(void* this_arg) {
10971 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
10972 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10974 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10975 if (get_jenv_res == JNI_EDETACHED) {
10976 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10978 DO_ASSERT(get_jenv_res == JNI_OK);
10980 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
10981 if (get_jenv_res == JNI_EDETACHED) {
10982 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10987 LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
10988 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
10990 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10991 if (get_jenv_res == JNI_EDETACHED) {
10992 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10994 DO_ASSERT(get_jenv_res == JNI_OK);
10996 LDKChannelManager channel_manager_var = *channel_manager;
10997 int64_t channel_manager_ref = 0;
10998 // WARNING: we may need a move here but no clone is available for LDKChannelManager
10999 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
11000 channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned);
11001 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11002 CHECK(obj != NULL);
11003 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref);
11004 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11005 (*env)->ExceptionDescribe(env);
11006 (*env)->FatalError(env, "A call to persist_manager in LDKPersister from rust threw an exception.");
11008 void* ret_ptr = untag_ptr(ret);
11009 CHECK_ACCESS(ret_ptr);
11010 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
11011 FREE(untag_ptr(ret));
11012 if (get_jenv_res == JNI_EDETACHED) {
11013 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11017 LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) {
11018 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
11020 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11021 if (get_jenv_res == JNI_EDETACHED) {
11022 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11024 DO_ASSERT(get_jenv_res == JNI_OK);
11026 LDKNetworkGraph network_graph_var = *network_graph;
11027 int64_t network_graph_ref = 0;
11028 // WARNING: we may need a move here but no clone is available for LDKNetworkGraph
11029 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var);
11030 network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned);
11031 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11032 CHECK(obj != NULL);
11033 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_graph_meth, network_graph_ref);
11034 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11035 (*env)->ExceptionDescribe(env);
11036 (*env)->FatalError(env, "A call to persist_graph in LDKPersister from rust threw an exception.");
11038 void* ret_ptr = untag_ptr(ret);
11039 CHECK_ACCESS(ret_ptr);
11040 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
11041 FREE(untag_ptr(ret));
11042 if (get_jenv_res == JNI_EDETACHED) {
11043 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11047 LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKWriteableScore * scorer) {
11048 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
11050 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11051 if (get_jenv_res == JNI_EDETACHED) {
11052 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11054 DO_ASSERT(get_jenv_res == JNI_OK);
11056 // WARNING: This object doesn't live past this scope, needs clone!
11057 int64_t ret_scorer = tag_ptr(scorer, false);
11058 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11059 CHECK(obj != NULL);
11060 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_scorer_meth, ret_scorer);
11061 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11062 (*env)->ExceptionDescribe(env);
11063 (*env)->FatalError(env, "A call to persist_scorer in LDKPersister from rust threw an exception.");
11065 void* ret_ptr = untag_ptr(ret);
11066 CHECK_ACCESS(ret_ptr);
11067 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
11068 FREE(untag_ptr(ret));
11069 if (get_jenv_res == JNI_EDETACHED) {
11070 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11074 static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) {
11075 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg;
11076 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11078 static inline LDKPersister LDKPersister_init (JNIEnv *env, jclass clz, jobject o) {
11079 jclass c = (*env)->GetObjectClass(env, o);
11081 LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls");
11082 atomic_init(&calls->refcnt, 1);
11083 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11084 calls->o = (*env)->NewWeakGlobalRef(env, o);
11085 calls->persist_manager_meth = (*env)->GetMethodID(env, c, "persist_manager", "(J)J");
11086 CHECK(calls->persist_manager_meth != NULL);
11087 calls->persist_graph_meth = (*env)->GetMethodID(env, c, "persist_graph", "(J)J");
11088 CHECK(calls->persist_graph_meth != NULL);
11089 calls->persist_scorer_meth = (*env)->GetMethodID(env, c, "persist_scorer", "(J)J");
11090 CHECK(calls->persist_scorer_meth != NULL);
11092 LDKPersister ret = {
11093 .this_arg = (void*) calls,
11094 .persist_manager = persist_manager_LDKPersister_jcall,
11095 .persist_graph = persist_graph_LDKPersister_jcall,
11096 .persist_scorer = persist_scorer_LDKPersister_jcall,
11097 .free = LDKPersister_JCalls_free,
11101 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersister_1new(JNIEnv *env, jclass clz, jobject o) {
11102 LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister");
11103 *res_ptr = LDKPersister_init(env, clz, o);
11104 return tag_ptr(res_ptr, true);
11106 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1manager(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_manager) {
11107 void* this_arg_ptr = untag_ptr(this_arg);
11108 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11109 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
11110 LDKChannelManager channel_manager_conv;
11111 channel_manager_conv.inner = untag_ptr(channel_manager);
11112 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
11113 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
11114 channel_manager_conv.is_owned = false;
11115 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
11116 *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv);
11117 return tag_ptr(ret_conv, true);
11120 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) {
11121 void* this_arg_ptr = untag_ptr(this_arg);
11122 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11123 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
11124 LDKNetworkGraph network_graph_conv;
11125 network_graph_conv.inner = untag_ptr(network_graph);
11126 network_graph_conv.is_owned = ptr_is_owned(network_graph);
11127 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
11128 network_graph_conv.is_owned = false;
11129 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
11130 *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv);
11131 return tag_ptr(ret_conv, true);
11134 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1scorer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scorer) {
11135 void* this_arg_ptr = untag_ptr(this_arg);
11136 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11137 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
11138 void* scorer_ptr = untag_ptr(scorer);
11139 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
11140 LDKWriteableScore* scorer_conv = (LDKWriteableScore*)scorer_ptr;
11141 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
11142 *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, scorer_conv);
11143 return tag_ptr(ret_conv, true);
11146 typedef struct LDKFutureCallback_JCalls {
11147 atomic_size_t refcnt;
11150 jmethodID call_meth;
11151 } LDKFutureCallback_JCalls;
11152 static void LDKFutureCallback_JCalls_free(void* this_arg) {
11153 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
11154 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11156 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11157 if (get_jenv_res == JNI_EDETACHED) {
11158 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11160 DO_ASSERT(get_jenv_res == JNI_OK);
11162 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11163 if (get_jenv_res == JNI_EDETACHED) {
11164 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11169 void call_LDKFutureCallback_jcall(const void* this_arg) {
11170 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
11172 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11173 if (get_jenv_res == JNI_EDETACHED) {
11174 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11176 DO_ASSERT(get_jenv_res == JNI_OK);
11178 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11179 CHECK(obj != NULL);
11180 (*env)->CallVoidMethod(env, obj, j_calls->call_meth);
11181 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11182 (*env)->ExceptionDescribe(env);
11183 (*env)->FatalError(env, "A call to call in LDKFutureCallback from rust threw an exception.");
11185 if (get_jenv_res == JNI_EDETACHED) {
11186 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11189 static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) {
11190 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg;
11191 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11193 static inline LDKFutureCallback LDKFutureCallback_init (JNIEnv *env, jclass clz, jobject o) {
11194 jclass c = (*env)->GetObjectClass(env, o);
11196 LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls");
11197 atomic_init(&calls->refcnt, 1);
11198 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11199 calls->o = (*env)->NewWeakGlobalRef(env, o);
11200 calls->call_meth = (*env)->GetMethodID(env, c, "call", "()V");
11201 CHECK(calls->call_meth != NULL);
11203 LDKFutureCallback ret = {
11204 .this_arg = (void*) calls,
11205 .call = call_LDKFutureCallback_jcall,
11206 .free = LDKFutureCallback_JCalls_free,
11210 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFutureCallback_1new(JNIEnv *env, jclass clz, jobject o) {
11211 LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback");
11212 *res_ptr = LDKFutureCallback_init(env, clz, o);
11213 return tag_ptr(res_ptr, true);
11215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FutureCallback_1call(JNIEnv *env, jclass clz, int64_t this_arg) {
11216 void* this_arg_ptr = untag_ptr(this_arg);
11217 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11218 LDKFutureCallback* this_arg_conv = (LDKFutureCallback*)this_arg_ptr;
11219 (this_arg_conv->call)(this_arg_conv->this_arg);
11222 typedef struct LDKListen_JCalls {
11223 atomic_size_t refcnt;
11226 jmethodID filtered_block_connected_meth;
11227 jmethodID block_connected_meth;
11228 jmethodID block_disconnected_meth;
11229 } LDKListen_JCalls;
11230 static void LDKListen_JCalls_free(void* this_arg) {
11231 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
11232 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11234 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11235 if (get_jenv_res == JNI_EDETACHED) {
11236 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11238 DO_ASSERT(get_jenv_res == JNI_OK);
11240 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11241 if (get_jenv_res == JNI_EDETACHED) {
11242 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11247 void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
11248 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
11250 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11251 if (get_jenv_res == JNI_EDETACHED) {
11252 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11254 DO_ASSERT(get_jenv_res == JNI_OK);
11256 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
11257 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
11258 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
11259 int64_tArray txdata_arr = NULL;
11260 txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
11261 int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL);
11262 for (size_t c = 0; c < txdata_var.datalen; c++) {
11263 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
11264 *txdata_conv_28_conv = txdata_var.data[c];
11265 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
11267 (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0);
11268 FREE(txdata_var.data);
11269 int32_t height_conv = height;
11270 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11271 CHECK(obj != NULL);
11272 (*env)->CallVoidMethod(env, obj, j_calls->filtered_block_connected_meth, header_arr, txdata_arr, height_conv);
11273 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11274 (*env)->ExceptionDescribe(env);
11275 (*env)->FatalError(env, "A call to filtered_block_connected in LDKListen from rust threw an exception.");
11277 if (get_jenv_res == JNI_EDETACHED) {
11278 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11281 void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
11282 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
11284 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11285 if (get_jenv_res == JNI_EDETACHED) {
11286 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11288 DO_ASSERT(get_jenv_res == JNI_OK);
11290 LDKu8slice block_var = block;
11291 int8_tArray block_arr = (*env)->NewByteArray(env, block_var.datalen);
11292 (*env)->SetByteArrayRegion(env, block_arr, 0, block_var.datalen, block_var.data);
11293 int32_t height_conv = height;
11294 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11295 CHECK(obj != NULL);
11296 (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height_conv);
11297 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11298 (*env)->ExceptionDescribe(env);
11299 (*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception.");
11301 if (get_jenv_res == JNI_EDETACHED) {
11302 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11305 void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
11306 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
11308 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11309 if (get_jenv_res == JNI_EDETACHED) {
11310 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11312 DO_ASSERT(get_jenv_res == JNI_OK);
11314 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
11315 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
11316 int32_t height_conv = height;
11317 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11318 CHECK(obj != NULL);
11319 (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height_conv);
11320 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11321 (*env)->ExceptionDescribe(env);
11322 (*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception.");
11324 if (get_jenv_res == JNI_EDETACHED) {
11325 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11328 static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
11329 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
11330 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11332 static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) {
11333 jclass c = (*env)->GetObjectClass(env, o);
11335 LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
11336 atomic_init(&calls->refcnt, 1);
11337 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11338 calls->o = (*env)->NewWeakGlobalRef(env, o);
11339 calls->filtered_block_connected_meth = (*env)->GetMethodID(env, c, "filtered_block_connected", "([B[JI)V");
11340 CHECK(calls->filtered_block_connected_meth != NULL);
11341 calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BI)V");
11342 CHECK(calls->block_connected_meth != NULL);
11343 calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V");
11344 CHECK(calls->block_disconnected_meth != NULL);
11347 .this_arg = (void*) calls,
11348 .filtered_block_connected = filtered_block_connected_LDKListen_jcall,
11349 .block_connected = block_connected_LDKListen_jcall,
11350 .block_disconnected = block_disconnected_LDKListen_jcall,
11351 .free = LDKListen_JCalls_free,
11355 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKListen_1new(JNIEnv *env, jclass clz, jobject o) {
11356 LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
11357 *res_ptr = LDKListen_init(env, clz, o);
11358 return tag_ptr(res_ptr, true);
11360 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1filtered_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) {
11361 void* this_arg_ptr = untag_ptr(this_arg);
11362 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11363 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
11364 unsigned char header_arr[80];
11365 CHECK((*env)->GetArrayLength(env, header) == 80);
11366 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
11367 unsigned char (*header_ref)[80] = &header_arr;
11368 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
11369 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
11370 if (txdata_constr.datalen > 0)
11371 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
11373 txdata_constr.data = NULL;
11374 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
11375 for (size_t c = 0; c < txdata_constr.datalen; c++) {
11376 int64_t txdata_conv_28 = txdata_vals[c];
11377 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
11378 CHECK_ACCESS(txdata_conv_28_ptr);
11379 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
11380 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
11381 txdata_constr.data[c] = txdata_conv_28_conv;
11383 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
11384 (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
11387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray block, int32_t height) {
11388 void* this_arg_ptr = untag_ptr(this_arg);
11389 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11390 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
11391 LDKu8slice block_ref;
11392 block_ref.datalen = (*env)->GetArrayLength(env, block);
11393 block_ref.data = (*env)->GetByteArrayElements (env, block, NULL);
11394 (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
11395 (*env)->ReleaseByteArrayElements(env, block, (int8_t*)block_ref.data, 0);
11398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) {
11399 void* this_arg_ptr = untag_ptr(this_arg);
11400 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11401 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
11402 unsigned char header_arr[80];
11403 CHECK((*env)->GetArrayLength(env, header) == 80);
11404 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
11405 unsigned char (*header_ref)[80] = &header_arr;
11406 (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
11409 typedef struct LDKConfirm_JCalls {
11410 atomic_size_t refcnt;
11413 jmethodID transactions_confirmed_meth;
11414 jmethodID transaction_unconfirmed_meth;
11415 jmethodID best_block_updated_meth;
11416 jmethodID get_relevant_txids_meth;
11417 } LDKConfirm_JCalls;
11418 static void LDKConfirm_JCalls_free(void* this_arg) {
11419 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
11420 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11422 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11423 if (get_jenv_res == JNI_EDETACHED) {
11424 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11426 DO_ASSERT(get_jenv_res == JNI_OK);
11428 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11429 if (get_jenv_res == JNI_EDETACHED) {
11430 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11435 void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
11436 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
11438 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11439 if (get_jenv_res == JNI_EDETACHED) {
11440 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11442 DO_ASSERT(get_jenv_res == JNI_OK);
11444 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
11445 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
11446 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
11447 int64_tArray txdata_arr = NULL;
11448 txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
11449 int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL);
11450 for (size_t c = 0; c < txdata_var.datalen; c++) {
11451 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
11452 *txdata_conv_28_conv = txdata_var.data[c];
11453 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
11455 (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0);
11456 FREE(txdata_var.data);
11457 int32_t height_conv = height;
11458 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11459 CHECK(obj != NULL);
11460 (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height_conv);
11461 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11462 (*env)->ExceptionDescribe(env);
11463 (*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception.");
11465 if (get_jenv_res == JNI_EDETACHED) {
11466 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11469 void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
11470 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
11472 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11473 if (get_jenv_res == JNI_EDETACHED) {
11474 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11476 DO_ASSERT(get_jenv_res == JNI_OK);
11478 int8_tArray txid_arr = (*env)->NewByteArray(env, 32);
11479 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
11480 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11481 CHECK(obj != NULL);
11482 (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr);
11483 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11484 (*env)->ExceptionDescribe(env);
11485 (*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception.");
11487 if (get_jenv_res == JNI_EDETACHED) {
11488 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11491 void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
11492 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
11494 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11495 if (get_jenv_res == JNI_EDETACHED) {
11496 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11498 DO_ASSERT(get_jenv_res == JNI_OK);
11500 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
11501 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
11502 int32_t height_conv = height;
11503 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11504 CHECK(obj != NULL);
11505 (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height_conv);
11506 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11507 (*env)->ExceptionDescribe(env);
11508 (*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception.");
11510 if (get_jenv_res == JNI_EDETACHED) {
11511 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11514 LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
11515 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
11517 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11518 if (get_jenv_res == JNI_EDETACHED) {
11519 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11521 DO_ASSERT(get_jenv_res == JNI_OK);
11523 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11524 CHECK(obj != NULL);
11525 jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth);
11526 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11527 (*env)->ExceptionDescribe(env);
11528 (*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception.");
11530 LDKCVec_TxidZ ret_constr;
11531 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
11532 if (ret_constr.datalen > 0)
11533 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
11535 ret_constr.data = NULL;
11536 for (size_t i = 0; i < ret_constr.datalen; i++) {
11537 int8_tArray ret_conv_8 = (*env)->GetObjectArrayElement(env, ret, i);
11538 LDKThirtyTwoBytes ret_conv_8_ref;
11539 CHECK((*env)->GetArrayLength(env, ret_conv_8) == 32);
11540 (*env)->GetByteArrayRegion(env, ret_conv_8, 0, 32, ret_conv_8_ref.data);
11541 ret_constr.data[i] = ret_conv_8_ref;
11543 if (get_jenv_res == JNI_EDETACHED) {
11544 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11548 static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
11549 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
11550 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11552 static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) {
11553 jclass c = (*env)->GetObjectClass(env, o);
11555 LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
11556 atomic_init(&calls->refcnt, 1);
11557 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11558 calls->o = (*env)->NewWeakGlobalRef(env, o);
11559 calls->transactions_confirmed_meth = (*env)->GetMethodID(env, c, "transactions_confirmed", "([B[JI)V");
11560 CHECK(calls->transactions_confirmed_meth != NULL);
11561 calls->transaction_unconfirmed_meth = (*env)->GetMethodID(env, c, "transaction_unconfirmed", "([B)V");
11562 CHECK(calls->transaction_unconfirmed_meth != NULL);
11563 calls->best_block_updated_meth = (*env)->GetMethodID(env, c, "best_block_updated", "([BI)V");
11564 CHECK(calls->best_block_updated_meth != NULL);
11565 calls->get_relevant_txids_meth = (*env)->GetMethodID(env, c, "get_relevant_txids", "()[[B");
11566 CHECK(calls->get_relevant_txids_meth != NULL);
11569 .this_arg = (void*) calls,
11570 .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall,
11571 .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall,
11572 .best_block_updated = best_block_updated_LDKConfirm_jcall,
11573 .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall,
11574 .free = LDKConfirm_JCalls_free,
11578 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKConfirm_1new(JNIEnv *env, jclass clz, jobject o) {
11579 LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
11580 *res_ptr = LDKConfirm_init(env, clz, o);
11581 return tag_ptr(res_ptr, true);
11583 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) {
11584 void* this_arg_ptr = untag_ptr(this_arg);
11585 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11586 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
11587 unsigned char header_arr[80];
11588 CHECK((*env)->GetArrayLength(env, header) == 80);
11589 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
11590 unsigned char (*header_ref)[80] = &header_arr;
11591 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
11592 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
11593 if (txdata_constr.datalen > 0)
11594 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
11596 txdata_constr.data = NULL;
11597 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
11598 for (size_t c = 0; c < txdata_constr.datalen; c++) {
11599 int64_t txdata_conv_28 = txdata_vals[c];
11600 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
11601 CHECK_ACCESS(txdata_conv_28_ptr);
11602 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
11603 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
11604 txdata_constr.data[c] = txdata_conv_28_conv;
11606 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
11607 (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
11610 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid) {
11611 void* this_arg_ptr = untag_ptr(this_arg);
11612 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11613 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
11614 unsigned char txid_arr[32];
11615 CHECK((*env)->GetArrayLength(env, txid) == 32);
11616 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
11617 unsigned char (*txid_ref)[32] = &txid_arr;
11618 (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref);
11621 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) {
11622 void* this_arg_ptr = untag_ptr(this_arg);
11623 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11624 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
11625 unsigned char header_arr[80];
11626 CHECK((*env)->GetArrayLength(env, header) == 80);
11627 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
11628 unsigned char (*header_ref)[80] = &header_arr;
11629 (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height);
11632 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) {
11633 void* this_arg_ptr = untag_ptr(this_arg);
11634 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11635 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
11636 LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
11637 jobjectArray ret_arr = NULL;
11638 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
11640 for (size_t i = 0; i < ret_var.datalen; i++) {
11641 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32);
11642 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data);
11643 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
11646 FREE(ret_var.data);
11650 typedef struct LDKPersist_JCalls {
11651 atomic_size_t refcnt;
11654 jmethodID persist_new_channel_meth;
11655 jmethodID update_persisted_channel_meth;
11656 } LDKPersist_JCalls;
11657 static void LDKPersist_JCalls_free(void* this_arg) {
11658 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
11659 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11661 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11662 if (get_jenv_res == JNI_EDETACHED) {
11663 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11665 DO_ASSERT(get_jenv_res == JNI_OK);
11667 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11668 if (get_jenv_res == JNI_EDETACHED) {
11669 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11674 LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
11675 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
11677 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11678 if (get_jenv_res == JNI_EDETACHED) {
11679 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11681 DO_ASSERT(get_jenv_res == JNI_OK);
11683 LDKOutPoint channel_id_var = channel_id;
11684 int64_t channel_id_ref = 0;
11685 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
11686 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
11687 LDKChannelMonitor data_var = *data;
11688 int64_t data_ref = 0;
11689 data_var = ChannelMonitor_clone(&data_var);
11690 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
11691 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
11692 LDKMonitorUpdateId update_id_var = update_id;
11693 int64_t update_id_ref = 0;
11694 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
11695 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
11696 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11697 CHECK(obj != NULL);
11698 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
11699 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11700 (*env)->ExceptionDescribe(env);
11701 (*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
11703 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
11704 if (get_jenv_res == JNI_EDETACHED) {
11705 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11709 LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
11710 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
11712 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11713 if (get_jenv_res == JNI_EDETACHED) {
11714 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11716 DO_ASSERT(get_jenv_res == JNI_OK);
11718 LDKOutPoint channel_id_var = channel_id;
11719 int64_t channel_id_ref = 0;
11720 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
11721 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
11722 LDKChannelMonitorUpdate update_var = *update;
11723 int64_t update_ref = 0;
11724 update_var = ChannelMonitorUpdate_clone(&update_var);
11725 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
11726 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
11727 LDKChannelMonitor data_var = *data;
11728 int64_t data_ref = 0;
11729 data_var = ChannelMonitor_clone(&data_var);
11730 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
11731 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
11732 LDKMonitorUpdateId update_id_var = update_id;
11733 int64_t update_id_ref = 0;
11734 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
11735 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
11736 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11737 CHECK(obj != NULL);
11738 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
11739 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11740 (*env)->ExceptionDescribe(env);
11741 (*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception.");
11743 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
11744 if (get_jenv_res == JNI_EDETACHED) {
11745 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11749 static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
11750 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
11751 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11753 static inline LDKPersist LDKPersist_init (JNIEnv *env, jclass clz, jobject o) {
11754 jclass c = (*env)->GetObjectClass(env, o);
11756 LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
11757 atomic_init(&calls->refcnt, 1);
11758 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11759 calls->o = (*env)->NewWeakGlobalRef(env, o);
11760 calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
11761 CHECK(calls->persist_new_channel_meth != NULL);
11762 calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
11763 CHECK(calls->update_persisted_channel_meth != NULL);
11766 .this_arg = (void*) calls,
11767 .persist_new_channel = persist_new_channel_LDKPersist_jcall,
11768 .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
11769 .free = LDKPersist_JCalls_free,
11773 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new(JNIEnv *env, jclass clz, jobject o) {
11774 LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist");
11775 *res_ptr = LDKPersist_init(env, clz, o);
11776 return tag_ptr(res_ptr, true);
11778 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t data, int64_t update_id) {
11779 void* this_arg_ptr = untag_ptr(this_arg);
11780 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11781 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
11782 LDKOutPoint channel_id_conv;
11783 channel_id_conv.inner = untag_ptr(channel_id);
11784 channel_id_conv.is_owned = ptr_is_owned(channel_id);
11785 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
11786 channel_id_conv = OutPoint_clone(&channel_id_conv);
11787 LDKChannelMonitor data_conv;
11788 data_conv.inner = untag_ptr(data);
11789 data_conv.is_owned = ptr_is_owned(data);
11790 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
11791 data_conv.is_owned = false;
11792 LDKMonitorUpdateId update_id_conv;
11793 update_id_conv.inner = untag_ptr(update_id);
11794 update_id_conv.is_owned = ptr_is_owned(update_id);
11795 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
11796 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
11797 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv));
11801 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_t update_id) {
11802 void* this_arg_ptr = untag_ptr(this_arg);
11803 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11804 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
11805 LDKOutPoint channel_id_conv;
11806 channel_id_conv.inner = untag_ptr(channel_id);
11807 channel_id_conv.is_owned = ptr_is_owned(channel_id);
11808 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
11809 channel_id_conv = OutPoint_clone(&channel_id_conv);
11810 LDKChannelMonitorUpdate update_conv;
11811 update_conv.inner = untag_ptr(update);
11812 update_conv.is_owned = ptr_is_owned(update);
11813 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
11814 update_conv.is_owned = false;
11815 LDKChannelMonitor data_conv;
11816 data_conv.inner = untag_ptr(data);
11817 data_conv.is_owned = ptr_is_owned(data);
11818 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
11819 data_conv.is_owned = false;
11820 LDKMonitorUpdateId update_id_conv;
11821 update_id_conv.inner = untag_ptr(update_id);
11822 update_id_conv.is_owned = ptr_is_owned(update_id);
11823 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
11824 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
11825 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv));
11829 typedef struct LDKChannelMessageHandler_JCalls {
11830 atomic_size_t refcnt;
11833 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
11834 jmethodID handle_open_channel_meth;
11835 jmethodID handle_accept_channel_meth;
11836 jmethodID handle_funding_created_meth;
11837 jmethodID handle_funding_signed_meth;
11838 jmethodID handle_channel_ready_meth;
11839 jmethodID handle_shutdown_meth;
11840 jmethodID handle_closing_signed_meth;
11841 jmethodID handle_update_add_htlc_meth;
11842 jmethodID handle_update_fulfill_htlc_meth;
11843 jmethodID handle_update_fail_htlc_meth;
11844 jmethodID handle_update_fail_malformed_htlc_meth;
11845 jmethodID handle_commitment_signed_meth;
11846 jmethodID handle_revoke_and_ack_meth;
11847 jmethodID handle_update_fee_meth;
11848 jmethodID handle_announcement_signatures_meth;
11849 jmethodID peer_disconnected_meth;
11850 jmethodID peer_connected_meth;
11851 jmethodID handle_channel_reestablish_meth;
11852 jmethodID handle_channel_update_meth;
11853 jmethodID handle_error_meth;
11854 jmethodID provided_node_features_meth;
11855 jmethodID provided_init_features_meth;
11856 } LDKChannelMessageHandler_JCalls;
11857 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
11858 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11859 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11861 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11862 if (get_jenv_res == JNI_EDETACHED) {
11863 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11865 DO_ASSERT(get_jenv_res == JNI_OK);
11867 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11868 if (get_jenv_res == JNI_EDETACHED) {
11869 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11874 void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
11875 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11877 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11878 if (get_jenv_res == JNI_EDETACHED) {
11879 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11881 DO_ASSERT(get_jenv_res == JNI_OK);
11883 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11884 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11885 LDKInitFeatures their_features_var = their_features;
11886 int64_t their_features_ref = 0;
11887 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
11888 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
11889 LDKOpenChannel msg_var = *msg;
11890 int64_t msg_ref = 0;
11891 msg_var = OpenChannel_clone(&msg_var);
11892 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11893 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11894 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11895 CHECK(obj != NULL);
11896 (*env)->CallVoidMethod(env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
11897 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11898 (*env)->ExceptionDescribe(env);
11899 (*env)->FatalError(env, "A call to handle_open_channel in LDKChannelMessageHandler from rust threw an exception.");
11901 if (get_jenv_res == JNI_EDETACHED) {
11902 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11905 void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
11906 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11908 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11909 if (get_jenv_res == JNI_EDETACHED) {
11910 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11912 DO_ASSERT(get_jenv_res == JNI_OK);
11914 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11915 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11916 LDKInitFeatures their_features_var = their_features;
11917 int64_t their_features_ref = 0;
11918 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
11919 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
11920 LDKAcceptChannel msg_var = *msg;
11921 int64_t msg_ref = 0;
11922 msg_var = AcceptChannel_clone(&msg_var);
11923 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11924 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11925 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11926 CHECK(obj != NULL);
11927 (*env)->CallVoidMethod(env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
11928 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11929 (*env)->ExceptionDescribe(env);
11930 (*env)->FatalError(env, "A call to handle_accept_channel in LDKChannelMessageHandler from rust threw an exception.");
11932 if (get_jenv_res == JNI_EDETACHED) {
11933 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11936 void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
11937 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11939 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11940 if (get_jenv_res == JNI_EDETACHED) {
11941 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11943 DO_ASSERT(get_jenv_res == JNI_OK);
11945 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11946 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11947 LDKFundingCreated msg_var = *msg;
11948 int64_t msg_ref = 0;
11949 msg_var = FundingCreated_clone(&msg_var);
11950 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11951 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11952 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11953 CHECK(obj != NULL);
11954 (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref);
11955 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11956 (*env)->ExceptionDescribe(env);
11957 (*env)->FatalError(env, "A call to handle_funding_created in LDKChannelMessageHandler from rust threw an exception.");
11959 if (get_jenv_res == JNI_EDETACHED) {
11960 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11963 void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
11964 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11966 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11967 if (get_jenv_res == JNI_EDETACHED) {
11968 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11970 DO_ASSERT(get_jenv_res == JNI_OK);
11972 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11973 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11974 LDKFundingSigned msg_var = *msg;
11975 int64_t msg_ref = 0;
11976 msg_var = FundingSigned_clone(&msg_var);
11977 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11978 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11979 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11980 CHECK(obj != NULL);
11981 (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref);
11982 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11983 (*env)->ExceptionDescribe(env);
11984 (*env)->FatalError(env, "A call to handle_funding_signed in LDKChannelMessageHandler from rust threw an exception.");
11986 if (get_jenv_res == JNI_EDETACHED) {
11987 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11990 void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
11991 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11993 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11994 if (get_jenv_res == JNI_EDETACHED) {
11995 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11997 DO_ASSERT(get_jenv_res == JNI_OK);
11999 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12000 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12001 LDKChannelReady msg_var = *msg;
12002 int64_t msg_ref = 0;
12003 msg_var = ChannelReady_clone(&msg_var);
12004 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12005 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12006 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12007 CHECK(obj != NULL);
12008 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_ready_meth, their_node_id_arr, msg_ref);
12009 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12010 (*env)->ExceptionDescribe(env);
12011 (*env)->FatalError(env, "A call to handle_channel_ready in LDKChannelMessageHandler from rust threw an exception.");
12013 if (get_jenv_res == JNI_EDETACHED) {
12014 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12017 void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
12018 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12020 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12021 if (get_jenv_res == JNI_EDETACHED) {
12022 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12024 DO_ASSERT(get_jenv_res == JNI_OK);
12026 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12027 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12028 LDKInitFeatures their_features_var = *their_features;
12029 int64_t their_features_ref = 0;
12030 their_features_var = InitFeatures_clone(&their_features_var);
12031 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
12032 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
12033 LDKShutdown msg_var = *msg;
12034 int64_t msg_ref = 0;
12035 msg_var = Shutdown_clone(&msg_var);
12036 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12037 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12038 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12039 CHECK(obj != NULL);
12040 (*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, their_features_ref, msg_ref);
12041 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12042 (*env)->ExceptionDescribe(env);
12043 (*env)->FatalError(env, "A call to handle_shutdown in LDKChannelMessageHandler from rust threw an exception.");
12045 if (get_jenv_res == JNI_EDETACHED) {
12046 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12049 void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
12050 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12052 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12053 if (get_jenv_res == JNI_EDETACHED) {
12054 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12056 DO_ASSERT(get_jenv_res == JNI_OK);
12058 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12059 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12060 LDKClosingSigned msg_var = *msg;
12061 int64_t msg_ref = 0;
12062 msg_var = ClosingSigned_clone(&msg_var);
12063 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12064 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12065 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12066 CHECK(obj != NULL);
12067 (*env)->CallVoidMethod(env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref);
12068 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12069 (*env)->ExceptionDescribe(env);
12070 (*env)->FatalError(env, "A call to handle_closing_signed in LDKChannelMessageHandler from rust threw an exception.");
12072 if (get_jenv_res == JNI_EDETACHED) {
12073 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12076 void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
12077 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12079 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12080 if (get_jenv_res == JNI_EDETACHED) {
12081 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12083 DO_ASSERT(get_jenv_res == JNI_OK);
12085 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12086 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12087 LDKUpdateAddHTLC msg_var = *msg;
12088 int64_t msg_ref = 0;
12089 msg_var = UpdateAddHTLC_clone(&msg_var);
12090 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12091 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12092 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12093 CHECK(obj != NULL);
12094 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref);
12095 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12096 (*env)->ExceptionDescribe(env);
12097 (*env)->FatalError(env, "A call to handle_update_add_htlc in LDKChannelMessageHandler from rust threw an exception.");
12099 if (get_jenv_res == JNI_EDETACHED) {
12100 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12103 void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
12104 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12106 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12107 if (get_jenv_res == JNI_EDETACHED) {
12108 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12110 DO_ASSERT(get_jenv_res == JNI_OK);
12112 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12113 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12114 LDKUpdateFulfillHTLC msg_var = *msg;
12115 int64_t msg_ref = 0;
12116 msg_var = UpdateFulfillHTLC_clone(&msg_var);
12117 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12118 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12119 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12120 CHECK(obj != NULL);
12121 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref);
12122 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12123 (*env)->ExceptionDescribe(env);
12124 (*env)->FatalError(env, "A call to handle_update_fulfill_htlc in LDKChannelMessageHandler from rust threw an exception.");
12126 if (get_jenv_res == JNI_EDETACHED) {
12127 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12130 void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
12131 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12133 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12134 if (get_jenv_res == JNI_EDETACHED) {
12135 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12137 DO_ASSERT(get_jenv_res == JNI_OK);
12139 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12140 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12141 LDKUpdateFailHTLC msg_var = *msg;
12142 int64_t msg_ref = 0;
12143 msg_var = UpdateFailHTLC_clone(&msg_var);
12144 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12145 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12146 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12147 CHECK(obj != NULL);
12148 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref);
12149 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12150 (*env)->ExceptionDescribe(env);
12151 (*env)->FatalError(env, "A call to handle_update_fail_htlc in LDKChannelMessageHandler from rust threw an exception.");
12153 if (get_jenv_res == JNI_EDETACHED) {
12154 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12157 void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
12158 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12160 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12161 if (get_jenv_res == JNI_EDETACHED) {
12162 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12164 DO_ASSERT(get_jenv_res == JNI_OK);
12166 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12167 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12168 LDKUpdateFailMalformedHTLC msg_var = *msg;
12169 int64_t msg_ref = 0;
12170 msg_var = UpdateFailMalformedHTLC_clone(&msg_var);
12171 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12172 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12173 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12174 CHECK(obj != NULL);
12175 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref);
12176 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12177 (*env)->ExceptionDescribe(env);
12178 (*env)->FatalError(env, "A call to handle_update_fail_malformed_htlc in LDKChannelMessageHandler from rust threw an exception.");
12180 if (get_jenv_res == JNI_EDETACHED) {
12181 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12184 void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
12185 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12187 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12188 if (get_jenv_res == JNI_EDETACHED) {
12189 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12191 DO_ASSERT(get_jenv_res == JNI_OK);
12193 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12194 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12195 LDKCommitmentSigned msg_var = *msg;
12196 int64_t msg_ref = 0;
12197 msg_var = CommitmentSigned_clone(&msg_var);
12198 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12199 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12200 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12201 CHECK(obj != NULL);
12202 (*env)->CallVoidMethod(env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref);
12203 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12204 (*env)->ExceptionDescribe(env);
12205 (*env)->FatalError(env, "A call to handle_commitment_signed in LDKChannelMessageHandler from rust threw an exception.");
12207 if (get_jenv_res == JNI_EDETACHED) {
12208 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12211 void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
12212 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12214 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12215 if (get_jenv_res == JNI_EDETACHED) {
12216 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12218 DO_ASSERT(get_jenv_res == JNI_OK);
12220 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12221 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12222 LDKRevokeAndACK msg_var = *msg;
12223 int64_t msg_ref = 0;
12224 msg_var = RevokeAndACK_clone(&msg_var);
12225 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12226 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12227 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12228 CHECK(obj != NULL);
12229 (*env)->CallVoidMethod(env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref);
12230 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12231 (*env)->ExceptionDescribe(env);
12232 (*env)->FatalError(env, "A call to handle_revoke_and_ack in LDKChannelMessageHandler from rust threw an exception.");
12234 if (get_jenv_res == JNI_EDETACHED) {
12235 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12238 void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
12239 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12241 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12242 if (get_jenv_res == JNI_EDETACHED) {
12243 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12245 DO_ASSERT(get_jenv_res == JNI_OK);
12247 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12248 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12249 LDKUpdateFee msg_var = *msg;
12250 int64_t msg_ref = 0;
12251 msg_var = UpdateFee_clone(&msg_var);
12252 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12253 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12254 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12255 CHECK(obj != NULL);
12256 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref);
12257 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12258 (*env)->ExceptionDescribe(env);
12259 (*env)->FatalError(env, "A call to handle_update_fee in LDKChannelMessageHandler from rust threw an exception.");
12261 if (get_jenv_res == JNI_EDETACHED) {
12262 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12265 void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
12266 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12268 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12269 if (get_jenv_res == JNI_EDETACHED) {
12270 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12272 DO_ASSERT(get_jenv_res == JNI_OK);
12274 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12275 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12276 LDKAnnouncementSignatures msg_var = *msg;
12277 int64_t msg_ref = 0;
12278 msg_var = AnnouncementSignatures_clone(&msg_var);
12279 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12280 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12281 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12282 CHECK(obj != NULL);
12283 (*env)->CallVoidMethod(env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref);
12284 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12285 (*env)->ExceptionDescribe(env);
12286 (*env)->FatalError(env, "A call to handle_announcement_signatures in LDKChannelMessageHandler from rust threw an exception.");
12288 if (get_jenv_res == JNI_EDETACHED) {
12289 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12292 void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
12293 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12295 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12296 if (get_jenv_res == JNI_EDETACHED) {
12297 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12299 DO_ASSERT(get_jenv_res == JNI_OK);
12301 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12302 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12303 jboolean no_connection_possible_conv = no_connection_possible;
12304 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12305 CHECK(obj != NULL);
12306 (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible_conv);
12307 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12308 (*env)->ExceptionDescribe(env);
12309 (*env)->FatalError(env, "A call to peer_disconnected in LDKChannelMessageHandler from rust threw an exception.");
12311 if (get_jenv_res == JNI_EDETACHED) {
12312 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12315 LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
12316 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12318 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12319 if (get_jenv_res == JNI_EDETACHED) {
12320 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12322 DO_ASSERT(get_jenv_res == JNI_OK);
12324 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12325 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12326 LDKInit msg_var = *msg;
12327 int64_t msg_ref = 0;
12328 msg_var = Init_clone(&msg_var);
12329 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12330 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12331 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12332 CHECK(obj != NULL);
12333 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
12334 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12335 (*env)->ExceptionDescribe(env);
12336 (*env)->FatalError(env, "A call to peer_connected in LDKChannelMessageHandler from rust threw an exception.");
12338 void* ret_ptr = untag_ptr(ret);
12339 CHECK_ACCESS(ret_ptr);
12340 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
12341 FREE(untag_ptr(ret));
12342 if (get_jenv_res == JNI_EDETACHED) {
12343 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12347 void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
12348 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12350 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12351 if (get_jenv_res == JNI_EDETACHED) {
12352 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12354 DO_ASSERT(get_jenv_res == JNI_OK);
12356 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12357 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12358 LDKChannelReestablish msg_var = *msg;
12359 int64_t msg_ref = 0;
12360 msg_var = ChannelReestablish_clone(&msg_var);
12361 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12362 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12363 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12364 CHECK(obj != NULL);
12365 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref);
12366 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12367 (*env)->ExceptionDescribe(env);
12368 (*env)->FatalError(env, "A call to handle_channel_reestablish in LDKChannelMessageHandler from rust threw an exception.");
12370 if (get_jenv_res == JNI_EDETACHED) {
12371 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12374 void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
12375 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12377 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12378 if (get_jenv_res == JNI_EDETACHED) {
12379 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12381 DO_ASSERT(get_jenv_res == JNI_OK);
12383 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12384 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12385 LDKChannelUpdate msg_var = *msg;
12386 int64_t msg_ref = 0;
12387 msg_var = ChannelUpdate_clone(&msg_var);
12388 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12389 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12390 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12391 CHECK(obj != NULL);
12392 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref);
12393 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12394 (*env)->ExceptionDescribe(env);
12395 (*env)->FatalError(env, "A call to handle_channel_update in LDKChannelMessageHandler from rust threw an exception.");
12397 if (get_jenv_res == JNI_EDETACHED) {
12398 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12401 void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
12402 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12404 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12405 if (get_jenv_res == JNI_EDETACHED) {
12406 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12408 DO_ASSERT(get_jenv_res == JNI_OK);
12410 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12411 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12412 LDKErrorMessage msg_var = *msg;
12413 int64_t msg_ref = 0;
12414 msg_var = ErrorMessage_clone(&msg_var);
12415 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12416 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12417 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12418 CHECK(obj != NULL);
12419 (*env)->CallVoidMethod(env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref);
12420 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12421 (*env)->ExceptionDescribe(env);
12422 (*env)->FatalError(env, "A call to handle_error in LDKChannelMessageHandler from rust threw an exception.");
12424 if (get_jenv_res == JNI_EDETACHED) {
12425 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12428 LDKNodeFeatures provided_node_features_LDKChannelMessageHandler_jcall(const void* this_arg) {
12429 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12431 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12432 if (get_jenv_res == JNI_EDETACHED) {
12433 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12435 DO_ASSERT(get_jenv_res == JNI_OK);
12437 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12438 CHECK(obj != NULL);
12439 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth);
12440 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12441 (*env)->ExceptionDescribe(env);
12442 (*env)->FatalError(env, "A call to provided_node_features in LDKChannelMessageHandler from rust threw an exception.");
12444 LDKNodeFeatures ret_conv;
12445 ret_conv.inner = untag_ptr(ret);
12446 ret_conv.is_owned = ptr_is_owned(ret);
12447 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
12448 if (get_jenv_res == JNI_EDETACHED) {
12449 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12453 LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
12454 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12456 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12457 if (get_jenv_res == JNI_EDETACHED) {
12458 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12460 DO_ASSERT(get_jenv_res == JNI_OK);
12462 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12463 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12464 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12465 CHECK(obj != NULL);
12466 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_init_features_meth, their_node_id_arr);
12467 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12468 (*env)->ExceptionDescribe(env);
12469 (*env)->FatalError(env, "A call to provided_init_features in LDKChannelMessageHandler from rust threw an exception.");
12471 LDKInitFeatures ret_conv;
12472 ret_conv.inner = untag_ptr(ret);
12473 ret_conv.is_owned = ptr_is_owned(ret);
12474 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
12475 if (get_jenv_res == JNI_EDETACHED) {
12476 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12480 static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
12481 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
12482 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12483 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
12485 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
12486 jclass c = (*env)->GetObjectClass(env, o);
12488 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
12489 atomic_init(&calls->refcnt, 1);
12490 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12491 calls->o = (*env)->NewWeakGlobalRef(env, o);
12492 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "([BJJ)V");
12493 CHECK(calls->handle_open_channel_meth != NULL);
12494 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "([BJJ)V");
12495 CHECK(calls->handle_accept_channel_meth != NULL);
12496 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "([BJ)V");
12497 CHECK(calls->handle_funding_created_meth != NULL);
12498 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "([BJ)V");
12499 CHECK(calls->handle_funding_signed_meth != NULL);
12500 calls->handle_channel_ready_meth = (*env)->GetMethodID(env, c, "handle_channel_ready", "([BJ)V");
12501 CHECK(calls->handle_channel_ready_meth != NULL);
12502 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "([BJJ)V");
12503 CHECK(calls->handle_shutdown_meth != NULL);
12504 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "([BJ)V");
12505 CHECK(calls->handle_closing_signed_meth != NULL);
12506 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "([BJ)V");
12507 CHECK(calls->handle_update_add_htlc_meth != NULL);
12508 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "([BJ)V");
12509 CHECK(calls->handle_update_fulfill_htlc_meth != NULL);
12510 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "([BJ)V");
12511 CHECK(calls->handle_update_fail_htlc_meth != NULL);
12512 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "([BJ)V");
12513 CHECK(calls->handle_update_fail_malformed_htlc_meth != NULL);
12514 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "([BJ)V");
12515 CHECK(calls->handle_commitment_signed_meth != NULL);
12516 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "([BJ)V");
12517 CHECK(calls->handle_revoke_and_ack_meth != NULL);
12518 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "([BJ)V");
12519 CHECK(calls->handle_update_fee_meth != NULL);
12520 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "([BJ)V");
12521 CHECK(calls->handle_announcement_signatures_meth != NULL);
12522 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([BZ)V");
12523 CHECK(calls->peer_disconnected_meth != NULL);
12524 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)J");
12525 CHECK(calls->peer_connected_meth != NULL);
12526 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "([BJ)V");
12527 CHECK(calls->handle_channel_reestablish_meth != NULL);
12528 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "([BJ)V");
12529 CHECK(calls->handle_channel_update_meth != NULL);
12530 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "([BJ)V");
12531 CHECK(calls->handle_error_meth != NULL);
12532 calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J");
12533 CHECK(calls->provided_node_features_meth != NULL);
12534 calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J");
12535 CHECK(calls->provided_init_features_meth != NULL);
12537 LDKChannelMessageHandler ret = {
12538 .this_arg = (void*) calls,
12539 .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
12540 .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
12541 .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
12542 .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
12543 .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall,
12544 .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
12545 .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
12546 .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
12547 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
12548 .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
12549 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
12550 .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
12551 .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
12552 .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
12553 .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
12554 .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
12555 .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
12556 .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
12557 .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
12558 .handle_error = handle_error_LDKChannelMessageHandler_jcall,
12559 .provided_node_features = provided_node_features_LDKChannelMessageHandler_jcall,
12560 .provided_init_features = provided_init_features_LDKChannelMessageHandler_jcall,
12561 .free = LDKChannelMessageHandler_JCalls_free,
12562 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider),
12564 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
12567 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
12568 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
12569 *res_ptr = LDKChannelMessageHandler_init(env, clz, o, MessageSendEventsProvider);
12570 return tag_ptr(res_ptr, true);
12572 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
12573 LDKChannelMessageHandler *inp = (LDKChannelMessageHandler *)untag_ptr(arg);
12574 return tag_ptr(&inp->MessageSendEventsProvider, false);
12576 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1open_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
12577 void* this_arg_ptr = untag_ptr(this_arg);
12578 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12579 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12580 LDKPublicKey their_node_id_ref;
12581 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12582 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12583 LDKInitFeatures their_features_conv;
12584 their_features_conv.inner = untag_ptr(their_features);
12585 their_features_conv.is_owned = ptr_is_owned(their_features);
12586 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
12587 their_features_conv = InitFeatures_clone(&their_features_conv);
12588 LDKOpenChannel msg_conv;
12589 msg_conv.inner = untag_ptr(msg);
12590 msg_conv.is_owned = ptr_is_owned(msg);
12591 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12592 msg_conv.is_owned = false;
12593 (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
12596 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1accept_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
12597 void* this_arg_ptr = untag_ptr(this_arg);
12598 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12599 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12600 LDKPublicKey their_node_id_ref;
12601 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12602 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12603 LDKInitFeatures their_features_conv;
12604 their_features_conv.inner = untag_ptr(their_features);
12605 their_features_conv.is_owned = ptr_is_owned(their_features);
12606 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
12607 their_features_conv = InitFeatures_clone(&their_features_conv);
12608 LDKAcceptChannel msg_conv;
12609 msg_conv.inner = untag_ptr(msg);
12610 msg_conv.is_owned = ptr_is_owned(msg);
12611 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12612 msg_conv.is_owned = false;
12613 (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
12616 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1created(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12617 void* this_arg_ptr = untag_ptr(this_arg);
12618 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12619 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12620 LDKPublicKey their_node_id_ref;
12621 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12622 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12623 LDKFundingCreated msg_conv;
12624 msg_conv.inner = untag_ptr(msg);
12625 msg_conv.is_owned = ptr_is_owned(msg);
12626 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12627 msg_conv.is_owned = false;
12628 (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12631 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12632 void* this_arg_ptr = untag_ptr(this_arg);
12633 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12634 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12635 LDKPublicKey their_node_id_ref;
12636 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12637 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12638 LDKFundingSigned msg_conv;
12639 msg_conv.inner = untag_ptr(msg);
12640 msg_conv.is_owned = ptr_is_owned(msg);
12641 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12642 msg_conv.is_owned = false;
12643 (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12646 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12647 void* this_arg_ptr = untag_ptr(this_arg);
12648 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12649 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12650 LDKPublicKey their_node_id_ref;
12651 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12652 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12653 LDKChannelReady msg_conv;
12654 msg_conv.inner = untag_ptr(msg);
12655 msg_conv.is_owned = ptr_is_owned(msg);
12656 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12657 msg_conv.is_owned = false;
12658 (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12661 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
12662 void* this_arg_ptr = untag_ptr(this_arg);
12663 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12664 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12665 LDKPublicKey their_node_id_ref;
12666 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12667 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12668 LDKInitFeatures their_features_conv;
12669 their_features_conv.inner = untag_ptr(their_features);
12670 their_features_conv.is_owned = ptr_is_owned(their_features);
12671 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
12672 their_features_conv.is_owned = false;
12673 LDKShutdown msg_conv;
12674 msg_conv.inner = untag_ptr(msg);
12675 msg_conv.is_owned = ptr_is_owned(msg);
12676 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12677 msg_conv.is_owned = false;
12678 (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
12681 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1closing_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12682 void* this_arg_ptr = untag_ptr(this_arg);
12683 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12684 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12685 LDKPublicKey their_node_id_ref;
12686 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12687 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12688 LDKClosingSigned msg_conv;
12689 msg_conv.inner = untag_ptr(msg);
12690 msg_conv.is_owned = ptr_is_owned(msg);
12691 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12692 msg_conv.is_owned = false;
12693 (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1add_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12697 void* this_arg_ptr = untag_ptr(this_arg);
12698 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12699 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12700 LDKPublicKey their_node_id_ref;
12701 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12702 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12703 LDKUpdateAddHTLC msg_conv;
12704 msg_conv.inner = untag_ptr(msg);
12705 msg_conv.is_owned = ptr_is_owned(msg);
12706 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12707 msg_conv.is_owned = false;
12708 (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12711 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fulfill_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12712 void* this_arg_ptr = untag_ptr(this_arg);
12713 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12714 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12715 LDKPublicKey their_node_id_ref;
12716 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12717 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12718 LDKUpdateFulfillHTLC msg_conv;
12719 msg_conv.inner = untag_ptr(msg);
12720 msg_conv.is_owned = ptr_is_owned(msg);
12721 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12722 msg_conv.is_owned = false;
12723 (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12726 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12727 void* this_arg_ptr = untag_ptr(this_arg);
12728 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12729 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12730 LDKPublicKey their_node_id_ref;
12731 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12732 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12733 LDKUpdateFailHTLC msg_conv;
12734 msg_conv.inner = untag_ptr(msg);
12735 msg_conv.is_owned = ptr_is_owned(msg);
12736 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12737 msg_conv.is_owned = false;
12738 (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1malformed_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12742 void* this_arg_ptr = untag_ptr(this_arg);
12743 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12744 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12745 LDKPublicKey their_node_id_ref;
12746 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12747 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12748 LDKUpdateFailMalformedHTLC msg_conv;
12749 msg_conv.inner = untag_ptr(msg);
12750 msg_conv.is_owned = ptr_is_owned(msg);
12751 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12752 msg_conv.is_owned = false;
12753 (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12756 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12757 void* this_arg_ptr = untag_ptr(this_arg);
12758 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12759 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12760 LDKPublicKey their_node_id_ref;
12761 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12762 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12763 LDKCommitmentSigned msg_conv;
12764 msg_conv.inner = untag_ptr(msg);
12765 msg_conv.is_owned = ptr_is_owned(msg);
12766 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12767 msg_conv.is_owned = false;
12768 (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12771 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1revoke_1and_1ack(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12772 void* this_arg_ptr = untag_ptr(this_arg);
12773 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12774 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12775 LDKPublicKey their_node_id_ref;
12776 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12777 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12778 LDKRevokeAndACK msg_conv;
12779 msg_conv.inner = untag_ptr(msg);
12780 msg_conv.is_owned = ptr_is_owned(msg);
12781 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12782 msg_conv.is_owned = false;
12783 (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fee(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12787 void* this_arg_ptr = untag_ptr(this_arg);
12788 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12789 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12790 LDKPublicKey their_node_id_ref;
12791 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12792 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12793 LDKUpdateFee msg_conv;
12794 msg_conv.inner = untag_ptr(msg);
12795 msg_conv.is_owned = ptr_is_owned(msg);
12796 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12797 msg_conv.is_owned = false;
12798 (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12801 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1announcement_1signatures(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12802 void* this_arg_ptr = untag_ptr(this_arg);
12803 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12804 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12805 LDKPublicKey their_node_id_ref;
12806 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12807 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12808 LDKAnnouncementSignatures msg_conv;
12809 msg_conv.inner = untag_ptr(msg);
12810 msg_conv.is_owned = ptr_is_owned(msg);
12811 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12812 msg_conv.is_owned = false;
12813 (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
12817 void* this_arg_ptr = untag_ptr(this_arg);
12818 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12819 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12820 LDKPublicKey their_node_id_ref;
12821 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12822 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12823 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
12826 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12827 void* this_arg_ptr = untag_ptr(this_arg);
12828 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12829 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12830 LDKPublicKey their_node_id_ref;
12831 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12832 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12834 msg_conv.inner = untag_ptr(msg);
12835 msg_conv.is_owned = ptr_is_owned(msg);
12836 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12837 msg_conv.is_owned = false;
12838 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
12839 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12840 return tag_ptr(ret_conv, true);
12843 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12844 void* this_arg_ptr = untag_ptr(this_arg);
12845 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12846 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12847 LDKPublicKey their_node_id_ref;
12848 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12849 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12850 LDKChannelReestablish msg_conv;
12851 msg_conv.inner = untag_ptr(msg);
12852 msg_conv.is_owned = ptr_is_owned(msg);
12853 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12854 msg_conv.is_owned = false;
12855 (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12858 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12859 void* this_arg_ptr = untag_ptr(this_arg);
12860 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12861 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12862 LDKPublicKey their_node_id_ref;
12863 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12864 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12865 LDKChannelUpdate msg_conv;
12866 msg_conv.inner = untag_ptr(msg);
12867 msg_conv.is_owned = ptr_is_owned(msg);
12868 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12869 msg_conv.is_owned = false;
12870 (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12873 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1error(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
12874 void* this_arg_ptr = untag_ptr(this_arg);
12875 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12876 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12877 LDKPublicKey their_node_id_ref;
12878 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12879 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12880 LDKErrorMessage msg_conv;
12881 msg_conv.inner = untag_ptr(msg);
12882 msg_conv.is_owned = ptr_is_owned(msg);
12883 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12884 msg_conv.is_owned = false;
12885 (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
12888 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
12889 void* this_arg_ptr = untag_ptr(this_arg);
12890 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12891 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12892 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
12893 int64_t ret_ref = 0;
12894 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
12895 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
12899 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1provided_1init_1features(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) {
12900 void* this_arg_ptr = untag_ptr(this_arg);
12901 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12902 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
12903 LDKPublicKey their_node_id_ref;
12904 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12905 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12906 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
12907 int64_t ret_ref = 0;
12908 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
12909 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
12913 typedef struct LDKRoutingMessageHandler_JCalls {
12914 atomic_size_t refcnt;
12917 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
12918 jmethodID handle_node_announcement_meth;
12919 jmethodID handle_channel_announcement_meth;
12920 jmethodID handle_channel_update_meth;
12921 jmethodID get_next_channel_announcement_meth;
12922 jmethodID get_next_node_announcement_meth;
12923 jmethodID peer_connected_meth;
12924 jmethodID handle_reply_channel_range_meth;
12925 jmethodID handle_reply_short_channel_ids_end_meth;
12926 jmethodID handle_query_channel_range_meth;
12927 jmethodID handle_query_short_channel_ids_meth;
12928 jmethodID provided_node_features_meth;
12929 jmethodID provided_init_features_meth;
12930 } LDKRoutingMessageHandler_JCalls;
12931 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
12932 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
12933 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12935 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12936 if (get_jenv_res == JNI_EDETACHED) {
12937 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12939 DO_ASSERT(get_jenv_res == JNI_OK);
12941 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12942 if (get_jenv_res == JNI_EDETACHED) {
12943 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12948 LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
12949 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
12951 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12952 if (get_jenv_res == JNI_EDETACHED) {
12953 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12955 DO_ASSERT(get_jenv_res == JNI_OK);
12957 LDKNodeAnnouncement msg_var = *msg;
12958 int64_t msg_ref = 0;
12959 msg_var = NodeAnnouncement_clone(&msg_var);
12960 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12961 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12962 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12963 CHECK(obj != NULL);
12964 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref);
12965 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12966 (*env)->ExceptionDescribe(env);
12967 (*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
12969 void* ret_ptr = untag_ptr(ret);
12970 CHECK_ACCESS(ret_ptr);
12971 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
12972 FREE(untag_ptr(ret));
12973 if (get_jenv_res == JNI_EDETACHED) {
12974 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12978 LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
12979 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
12981 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12982 if (get_jenv_res == JNI_EDETACHED) {
12983 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12985 DO_ASSERT(get_jenv_res == JNI_OK);
12987 LDKChannelAnnouncement msg_var = *msg;
12988 int64_t msg_ref = 0;
12989 msg_var = ChannelAnnouncement_clone(&msg_var);
12990 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12991 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12992 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12993 CHECK(obj != NULL);
12994 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref);
12995 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12996 (*env)->ExceptionDescribe(env);
12997 (*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
12999 void* ret_ptr = untag_ptr(ret);
13000 CHECK_ACCESS(ret_ptr);
13001 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
13002 FREE(untag_ptr(ret));
13003 if (get_jenv_res == JNI_EDETACHED) {
13004 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13008 LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
13009 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
13011 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13012 if (get_jenv_res == JNI_EDETACHED) {
13013 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13015 DO_ASSERT(get_jenv_res == JNI_OK);
13017 LDKChannelUpdate msg_var = *msg;
13018 int64_t msg_ref = 0;
13019 msg_var = ChannelUpdate_clone(&msg_var);
13020 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13021 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13022 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13023 CHECK(obj != NULL);
13024 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref);
13025 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13026 (*env)->ExceptionDescribe(env);
13027 (*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception.");
13029 void* ret_ptr = untag_ptr(ret);
13030 CHECK_ACCESS(ret_ptr);
13031 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
13032 FREE(untag_ptr(ret));
13033 if (get_jenv_res == JNI_EDETACHED) {
13034 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13038 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point) {
13039 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
13041 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13042 if (get_jenv_res == JNI_EDETACHED) {
13043 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13045 DO_ASSERT(get_jenv_res == JNI_OK);
13047 int64_t starting_point_conv = starting_point;
13048 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13049 CHECK(obj != NULL);
13050 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_next_channel_announcement_meth, starting_point_conv);
13051 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13052 (*env)->ExceptionDescribe(env);
13053 (*env)->FatalError(env, "A call to get_next_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
13055 void* ret_ptr = untag_ptr(ret);
13056 CHECK_ACCESS(ret_ptr);
13057 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr);
13058 FREE(untag_ptr(ret));
13059 if (get_jenv_res == JNI_EDETACHED) {
13060 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13064 LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point) {
13065 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
13067 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13068 if (get_jenv_res == JNI_EDETACHED) {
13069 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13071 DO_ASSERT(get_jenv_res == JNI_OK);
13073 int8_tArray starting_point_arr = (*env)->NewByteArray(env, 33);
13074 (*env)->SetByteArrayRegion(env, starting_point_arr, 0, 33, starting_point.compressed_form);
13075 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13076 CHECK(obj != NULL);
13077 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_next_node_announcement_meth, starting_point_arr);
13078 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13079 (*env)->ExceptionDescribe(env);
13080 (*env)->FatalError(env, "A call to get_next_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
13082 LDKNodeAnnouncement ret_conv;
13083 ret_conv.inner = untag_ptr(ret);
13084 ret_conv.is_owned = ptr_is_owned(ret);
13085 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
13086 if (get_jenv_res == JNI_EDETACHED) {
13087 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13091 LDKCResult_NoneNoneZ peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
13092 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
13094 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13095 if (get_jenv_res == JNI_EDETACHED) {
13096 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13098 DO_ASSERT(get_jenv_res == JNI_OK);
13100 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13101 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13102 LDKInit init_var = *init;
13103 int64_t init_ref = 0;
13104 init_var = Init_clone(&init_var);
13105 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
13106 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
13107 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13108 CHECK(obj != NULL);
13109 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
13110 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13111 (*env)->ExceptionDescribe(env);
13112 (*env)->FatalError(env, "A call to peer_connected in LDKRoutingMessageHandler from rust threw an exception.");
13114 void* ret_ptr = untag_ptr(ret);
13115 CHECK_ACCESS(ret_ptr);
13116 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
13117 FREE(untag_ptr(ret));
13118 if (get_jenv_res == JNI_EDETACHED) {
13119 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13123 LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
13124 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
13126 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13127 if (get_jenv_res == JNI_EDETACHED) {
13128 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13130 DO_ASSERT(get_jenv_res == JNI_OK);
13132 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13133 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13134 LDKReplyChannelRange msg_var = msg;
13135 int64_t msg_ref = 0;
13136 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13137 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13138 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13139 CHECK(obj != NULL);
13140 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref);
13141 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13142 (*env)->ExceptionDescribe(env);
13143 (*env)->FatalError(env, "A call to handle_reply_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
13145 void* ret_ptr = untag_ptr(ret);
13146 CHECK_ACCESS(ret_ptr);
13147 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
13148 FREE(untag_ptr(ret));
13149 if (get_jenv_res == JNI_EDETACHED) {
13150 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13154 LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
13155 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
13157 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13158 if (get_jenv_res == JNI_EDETACHED) {
13159 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13161 DO_ASSERT(get_jenv_res == JNI_OK);
13163 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13164 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13165 LDKReplyShortChannelIdsEnd msg_var = msg;
13166 int64_t msg_ref = 0;
13167 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13168 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13169 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13170 CHECK(obj != NULL);
13171 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref);
13172 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13173 (*env)->ExceptionDescribe(env);
13174 (*env)->FatalError(env, "A call to handle_reply_short_channel_ids_end in LDKRoutingMessageHandler from rust threw an exception.");
13176 void* ret_ptr = untag_ptr(ret);
13177 CHECK_ACCESS(ret_ptr);
13178 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
13179 FREE(untag_ptr(ret));
13180 if (get_jenv_res == JNI_EDETACHED) {
13181 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13185 LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
13186 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
13188 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13189 if (get_jenv_res == JNI_EDETACHED) {
13190 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13192 DO_ASSERT(get_jenv_res == JNI_OK);
13194 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13195 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13196 LDKQueryChannelRange msg_var = msg;
13197 int64_t msg_ref = 0;
13198 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13199 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13200 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13201 CHECK(obj != NULL);
13202 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref);
13203 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13204 (*env)->ExceptionDescribe(env);
13205 (*env)->FatalError(env, "A call to handle_query_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
13207 void* ret_ptr = untag_ptr(ret);
13208 CHECK_ACCESS(ret_ptr);
13209 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
13210 FREE(untag_ptr(ret));
13211 if (get_jenv_res == JNI_EDETACHED) {
13212 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13216 LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
13217 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
13219 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13220 if (get_jenv_res == JNI_EDETACHED) {
13221 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13223 DO_ASSERT(get_jenv_res == JNI_OK);
13225 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13226 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13227 LDKQueryShortChannelIds msg_var = msg;
13228 int64_t msg_ref = 0;
13229 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13230 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13231 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13232 CHECK(obj != NULL);
13233 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref);
13234 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13235 (*env)->ExceptionDescribe(env);
13236 (*env)->FatalError(env, "A call to handle_query_short_channel_ids in LDKRoutingMessageHandler from rust threw an exception.");
13238 void* ret_ptr = untag_ptr(ret);
13239 CHECK_ACCESS(ret_ptr);
13240 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
13241 FREE(untag_ptr(ret));
13242 if (get_jenv_res == JNI_EDETACHED) {
13243 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13247 LDKNodeFeatures provided_node_features_LDKRoutingMessageHandler_jcall(const void* this_arg) {
13248 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
13250 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13251 if (get_jenv_res == JNI_EDETACHED) {
13252 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13254 DO_ASSERT(get_jenv_res == JNI_OK);
13256 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13257 CHECK(obj != NULL);
13258 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth);
13259 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13260 (*env)->ExceptionDescribe(env);
13261 (*env)->FatalError(env, "A call to provided_node_features in LDKRoutingMessageHandler from rust threw an exception.");
13263 LDKNodeFeatures ret_conv;
13264 ret_conv.inner = untag_ptr(ret);
13265 ret_conv.is_owned = ptr_is_owned(ret);
13266 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
13267 if (get_jenv_res == JNI_EDETACHED) {
13268 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13272 LDKInitFeatures provided_init_features_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
13273 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
13275 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13276 if (get_jenv_res == JNI_EDETACHED) {
13277 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13279 DO_ASSERT(get_jenv_res == JNI_OK);
13281 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13282 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13283 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13284 CHECK(obj != NULL);
13285 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_init_features_meth, their_node_id_arr);
13286 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13287 (*env)->ExceptionDescribe(env);
13288 (*env)->FatalError(env, "A call to provided_init_features in LDKRoutingMessageHandler from rust threw an exception.");
13290 LDKInitFeatures ret_conv;
13291 ret_conv.inner = untag_ptr(ret);
13292 ret_conv.is_owned = ptr_is_owned(ret);
13293 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
13294 if (get_jenv_res == JNI_EDETACHED) {
13295 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13299 static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
13300 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
13301 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
13302 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
13304 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
13305 jclass c = (*env)->GetObjectClass(env, o);
13307 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
13308 atomic_init(&calls->refcnt, 1);
13309 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
13310 calls->o = (*env)->NewWeakGlobalRef(env, o);
13311 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
13312 CHECK(calls->handle_node_announcement_meth != NULL);
13313 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
13314 CHECK(calls->handle_channel_announcement_meth != NULL);
13315 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
13316 CHECK(calls->handle_channel_update_meth != NULL);
13317 calls->get_next_channel_announcement_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcement", "(J)J");
13318 CHECK(calls->get_next_channel_announcement_meth != NULL);
13319 calls->get_next_node_announcement_meth = (*env)->GetMethodID(env, c, "get_next_node_announcement", "([B)J");
13320 CHECK(calls->get_next_node_announcement_meth != NULL);
13321 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)J");
13322 CHECK(calls->peer_connected_meth != NULL);
13323 calls->handle_reply_channel_range_meth = (*env)->GetMethodID(env, c, "handle_reply_channel_range", "([BJ)J");
13324 CHECK(calls->handle_reply_channel_range_meth != NULL);
13325 calls->handle_reply_short_channel_ids_end_meth = (*env)->GetMethodID(env, c, "handle_reply_short_channel_ids_end", "([BJ)J");
13326 CHECK(calls->handle_reply_short_channel_ids_end_meth != NULL);
13327 calls->handle_query_channel_range_meth = (*env)->GetMethodID(env, c, "handle_query_channel_range", "([BJ)J");
13328 CHECK(calls->handle_query_channel_range_meth != NULL);
13329 calls->handle_query_short_channel_ids_meth = (*env)->GetMethodID(env, c, "handle_query_short_channel_ids", "([BJ)J");
13330 CHECK(calls->handle_query_short_channel_ids_meth != NULL);
13331 calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J");
13332 CHECK(calls->provided_node_features_meth != NULL);
13333 calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J");
13334 CHECK(calls->provided_init_features_meth != NULL);
13336 LDKRoutingMessageHandler ret = {
13337 .this_arg = (void*) calls,
13338 .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
13339 .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
13340 .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
13341 .get_next_channel_announcement = get_next_channel_announcement_LDKRoutingMessageHandler_jcall,
13342 .get_next_node_announcement = get_next_node_announcement_LDKRoutingMessageHandler_jcall,
13343 .peer_connected = peer_connected_LDKRoutingMessageHandler_jcall,
13344 .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
13345 .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
13346 .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
13347 .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
13348 .provided_node_features = provided_node_features_LDKRoutingMessageHandler_jcall,
13349 .provided_init_features = provided_init_features_LDKRoutingMessageHandler_jcall,
13350 .free = LDKRoutingMessageHandler_JCalls_free,
13351 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider),
13353 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
13356 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
13357 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
13358 *res_ptr = LDKRoutingMessageHandler_init(env, clz, o, MessageSendEventsProvider);
13359 return tag_ptr(res_ptr, true);
13361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
13362 LDKRoutingMessageHandler *inp = (LDKRoutingMessageHandler *)untag_ptr(arg);
13363 return tag_ptr(&inp->MessageSendEventsProvider, false);
13365 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
13366 void* this_arg_ptr = untag_ptr(this_arg);
13367 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13368 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13369 LDKNodeAnnouncement msg_conv;
13370 msg_conv.inner = untag_ptr(msg);
13371 msg_conv.is_owned = ptr_is_owned(msg);
13372 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13373 msg_conv.is_owned = false;
13374 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13375 *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
13376 return tag_ptr(ret_conv, true);
13379 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
13380 void* this_arg_ptr = untag_ptr(this_arg);
13381 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13382 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13383 LDKChannelAnnouncement msg_conv;
13384 msg_conv.inner = untag_ptr(msg);
13385 msg_conv.is_owned = ptr_is_owned(msg);
13386 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13387 msg_conv.is_owned = false;
13388 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13389 *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
13390 return tag_ptr(ret_conv, true);
13393 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
13394 void* this_arg_ptr = untag_ptr(this_arg);
13395 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13396 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13397 LDKChannelUpdate msg_conv;
13398 msg_conv.inner = untag_ptr(msg);
13399 msg_conv.is_owned = ptr_is_owned(msg);
13400 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13401 msg_conv.is_owned = false;
13402 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13403 *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
13404 return tag_ptr(ret_conv, true);
13407 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t starting_point) {
13408 void* this_arg_ptr = untag_ptr(this_arg);
13409 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13410 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13411 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
13412 *ret_copy = (this_arg_conv->get_next_channel_announcement)(this_arg_conv->this_arg, starting_point);
13413 int64_t ret_ref = tag_ptr(ret_copy, true);
13417 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray starting_point) {
13418 void* this_arg_ptr = untag_ptr(this_arg);
13419 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13420 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13421 LDKPublicKey starting_point_ref;
13422 CHECK((*env)->GetArrayLength(env, starting_point) == 33);
13423 (*env)->GetByteArrayRegion(env, starting_point, 0, 33, starting_point_ref.compressed_form);
13424 LDKNodeAnnouncement ret_var = (this_arg_conv->get_next_node_announcement)(this_arg_conv->this_arg, starting_point_ref);
13425 int64_t ret_ref = 0;
13426 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
13427 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
13431 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
13432 void* this_arg_ptr = untag_ptr(this_arg);
13433 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13434 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13435 LDKPublicKey their_node_id_ref;
13436 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13437 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13439 init_conv.inner = untag_ptr(init);
13440 init_conv.is_owned = ptr_is_owned(init);
13441 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
13442 init_conv.is_owned = false;
13443 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
13444 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
13445 return tag_ptr(ret_conv, true);
13448 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1channel_1range(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
13449 void* this_arg_ptr = untag_ptr(this_arg);
13450 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13451 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13452 LDKPublicKey their_node_id_ref;
13453 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13454 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13455 LDKReplyChannelRange msg_conv;
13456 msg_conv.inner = untag_ptr(msg);
13457 msg_conv.is_owned = ptr_is_owned(msg);
13458 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13459 msg_conv = ReplyChannelRange_clone(&msg_conv);
13460 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13461 *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
13462 return tag_ptr(ret_conv, true);
13465 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1short_1channel_1ids_1end(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
13466 void* this_arg_ptr = untag_ptr(this_arg);
13467 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13468 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13469 LDKPublicKey their_node_id_ref;
13470 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13471 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13472 LDKReplyShortChannelIdsEnd msg_conv;
13473 msg_conv.inner = untag_ptr(msg);
13474 msg_conv.is_owned = ptr_is_owned(msg);
13475 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13476 msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv);
13477 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13478 *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
13479 return tag_ptr(ret_conv, true);
13482 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1channel_1range(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
13483 void* this_arg_ptr = untag_ptr(this_arg);
13484 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13485 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13486 LDKPublicKey their_node_id_ref;
13487 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13488 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13489 LDKQueryChannelRange msg_conv;
13490 msg_conv.inner = untag_ptr(msg);
13491 msg_conv.is_owned = ptr_is_owned(msg);
13492 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13493 msg_conv = QueryChannelRange_clone(&msg_conv);
13494 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13495 *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
13496 return tag_ptr(ret_conv, true);
13499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
13500 void* this_arg_ptr = untag_ptr(this_arg);
13501 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13502 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13503 LDKPublicKey their_node_id_ref;
13504 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13505 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13506 LDKQueryShortChannelIds msg_conv;
13507 msg_conv.inner = untag_ptr(msg);
13508 msg_conv.is_owned = ptr_is_owned(msg);
13509 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13510 msg_conv = QueryShortChannelIds_clone(&msg_conv);
13511 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13512 *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
13513 return tag_ptr(ret_conv, true);
13516 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
13517 void* this_arg_ptr = untag_ptr(this_arg);
13518 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13519 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13520 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
13521 int64_t ret_ref = 0;
13522 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
13523 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
13527 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1provided_1init_1features(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) {
13528 void* this_arg_ptr = untag_ptr(this_arg);
13529 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13530 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
13531 LDKPublicKey their_node_id_ref;
13532 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13533 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13534 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
13535 int64_t ret_ref = 0;
13536 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
13537 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
13541 typedef struct LDKOnionMessageHandler_JCalls {
13542 atomic_size_t refcnt;
13545 LDKOnionMessageProvider_JCalls* OnionMessageProvider;
13546 jmethodID handle_onion_message_meth;
13547 jmethodID peer_connected_meth;
13548 jmethodID peer_disconnected_meth;
13549 jmethodID provided_node_features_meth;
13550 jmethodID provided_init_features_meth;
13551 } LDKOnionMessageHandler_JCalls;
13552 static void LDKOnionMessageHandler_JCalls_free(void* this_arg) {
13553 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
13554 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
13556 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13557 if (get_jenv_res == JNI_EDETACHED) {
13558 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13560 DO_ASSERT(get_jenv_res == JNI_OK);
13562 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
13563 if (get_jenv_res == JNI_EDETACHED) {
13564 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13569 void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) {
13570 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
13572 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13573 if (get_jenv_res == JNI_EDETACHED) {
13574 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13576 DO_ASSERT(get_jenv_res == JNI_OK);
13578 int8_tArray peer_node_id_arr = (*env)->NewByteArray(env, 33);
13579 (*env)->SetByteArrayRegion(env, peer_node_id_arr, 0, 33, peer_node_id.compressed_form);
13580 LDKOnionMessage msg_var = *msg;
13581 int64_t msg_ref = 0;
13582 msg_var = OnionMessage_clone(&msg_var);
13583 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13584 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13585 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13586 CHECK(obj != NULL);
13587 (*env)->CallVoidMethod(env, obj, j_calls->handle_onion_message_meth, peer_node_id_arr, msg_ref);
13588 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13589 (*env)->ExceptionDescribe(env);
13590 (*env)->FatalError(env, "A call to handle_onion_message in LDKOnionMessageHandler from rust threw an exception.");
13592 if (get_jenv_res == JNI_EDETACHED) {
13593 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13596 LDKCResult_NoneNoneZ peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
13597 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
13599 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13600 if (get_jenv_res == JNI_EDETACHED) {
13601 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13603 DO_ASSERT(get_jenv_res == JNI_OK);
13605 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13606 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13607 LDKInit init_var = *init;
13608 int64_t init_ref = 0;
13609 init_var = Init_clone(&init_var);
13610 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
13611 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
13612 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13613 CHECK(obj != NULL);
13614 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
13615 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13616 (*env)->ExceptionDescribe(env);
13617 (*env)->FatalError(env, "A call to peer_connected in LDKOnionMessageHandler from rust threw an exception.");
13619 void* ret_ptr = untag_ptr(ret);
13620 CHECK_ACCESS(ret_ptr);
13621 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
13622 FREE(untag_ptr(ret));
13623 if (get_jenv_res == JNI_EDETACHED) {
13624 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13628 void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
13629 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
13631 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13632 if (get_jenv_res == JNI_EDETACHED) {
13633 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13635 DO_ASSERT(get_jenv_res == JNI_OK);
13637 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13638 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13639 jboolean no_connection_possible_conv = no_connection_possible;
13640 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13641 CHECK(obj != NULL);
13642 (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible_conv);
13643 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13644 (*env)->ExceptionDescribe(env);
13645 (*env)->FatalError(env, "A call to peer_disconnected in LDKOnionMessageHandler from rust threw an exception.");
13647 if (get_jenv_res == JNI_EDETACHED) {
13648 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13651 LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) {
13652 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
13654 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13655 if (get_jenv_res == JNI_EDETACHED) {
13656 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13658 DO_ASSERT(get_jenv_res == JNI_OK);
13660 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13661 CHECK(obj != NULL);
13662 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth);
13663 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13664 (*env)->ExceptionDescribe(env);
13665 (*env)->FatalError(env, "A call to provided_node_features in LDKOnionMessageHandler from rust threw an exception.");
13667 LDKNodeFeatures ret_conv;
13668 ret_conv.inner = untag_ptr(ret);
13669 ret_conv.is_owned = ptr_is_owned(ret);
13670 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
13671 if (get_jenv_res == JNI_EDETACHED) {
13672 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13676 LDKInitFeatures provided_init_features_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
13677 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
13679 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13680 if (get_jenv_res == JNI_EDETACHED) {
13681 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13683 DO_ASSERT(get_jenv_res == JNI_OK);
13685 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13686 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13687 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13688 CHECK(obj != NULL);
13689 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_init_features_meth, their_node_id_arr);
13690 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13691 (*env)->ExceptionDescribe(env);
13692 (*env)->FatalError(env, "A call to provided_init_features in LDKOnionMessageHandler from rust threw an exception.");
13694 LDKInitFeatures ret_conv;
13695 ret_conv.inner = untag_ptr(ret);
13696 ret_conv.is_owned = ptr_is_owned(ret);
13697 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
13698 if (get_jenv_res == JNI_EDETACHED) {
13699 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13703 static void LDKOnionMessageHandler_JCalls_cloned(LDKOnionMessageHandler* new_obj) {
13704 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) new_obj->this_arg;
13705 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
13706 atomic_fetch_add_explicit(&j_calls->OnionMessageProvider->refcnt, 1, memory_order_release);
13708 static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject OnionMessageProvider) {
13709 jclass c = (*env)->GetObjectClass(env, o);
13711 LDKOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKOnionMessageHandler_JCalls), "LDKOnionMessageHandler_JCalls");
13712 atomic_init(&calls->refcnt, 1);
13713 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
13714 calls->o = (*env)->NewWeakGlobalRef(env, o);
13715 calls->handle_onion_message_meth = (*env)->GetMethodID(env, c, "handle_onion_message", "([BJ)V");
13716 CHECK(calls->handle_onion_message_meth != NULL);
13717 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)J");
13718 CHECK(calls->peer_connected_meth != NULL);
13719 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([BZ)V");
13720 CHECK(calls->peer_disconnected_meth != NULL);
13721 calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J");
13722 CHECK(calls->provided_node_features_meth != NULL);
13723 calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J");
13724 CHECK(calls->provided_init_features_meth != NULL);
13726 LDKOnionMessageHandler ret = {
13727 .this_arg = (void*) calls,
13728 .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall,
13729 .peer_connected = peer_connected_LDKOnionMessageHandler_jcall,
13730 .peer_disconnected = peer_disconnected_LDKOnionMessageHandler_jcall,
13731 .provided_node_features = provided_node_features_LDKOnionMessageHandler_jcall,
13732 .provided_init_features = provided_init_features_LDKOnionMessageHandler_jcall,
13733 .free = LDKOnionMessageHandler_JCalls_free,
13734 .OnionMessageProvider = LDKOnionMessageProvider_init(env, clz, OnionMessageProvider),
13736 calls->OnionMessageProvider = ret.OnionMessageProvider.this_arg;
13739 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject OnionMessageProvider) {
13740 LDKOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
13741 *res_ptr = LDKOnionMessageHandler_init(env, clz, o, OnionMessageProvider);
13742 return tag_ptr(res_ptr, true);
13744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageHandler_1get_1OnionMessageProvider(JNIEnv *env, jclass clz, int64_t arg) {
13745 LDKOnionMessageHandler *inp = (LDKOnionMessageHandler *)untag_ptr(arg);
13746 return tag_ptr(&inp->OnionMessageProvider, false);
13748 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1handle_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray peer_node_id, int64_t msg) {
13749 void* this_arg_ptr = untag_ptr(this_arg);
13750 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13751 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
13752 LDKPublicKey peer_node_id_ref;
13753 CHECK((*env)->GetArrayLength(env, peer_node_id) == 33);
13754 (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form);
13755 LDKOnionMessage msg_conv;
13756 msg_conv.inner = untag_ptr(msg);
13757 msg_conv.is_owned = ptr_is_owned(msg);
13758 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13759 msg_conv.is_owned = false;
13760 (this_arg_conv->handle_onion_message)(this_arg_conv->this_arg, peer_node_id_ref, &msg_conv);
13763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
13764 void* this_arg_ptr = untag_ptr(this_arg);
13765 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13766 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
13767 LDKPublicKey their_node_id_ref;
13768 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13769 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13771 init_conv.inner = untag_ptr(init);
13772 init_conv.is_owned = ptr_is_owned(init);
13773 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
13774 init_conv.is_owned = false;
13775 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
13776 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
13777 return tag_ptr(ret_conv, true);
13780 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
13781 void* this_arg_ptr = untag_ptr(this_arg);
13782 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13783 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
13784 LDKPublicKey their_node_id_ref;
13785 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13786 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13787 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
13790 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
13791 void* this_arg_ptr = untag_ptr(this_arg);
13792 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13793 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
13794 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
13795 int64_t ret_ref = 0;
13796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
13797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
13801 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1provided_1init_1features(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) {
13802 void* this_arg_ptr = untag_ptr(this_arg);
13803 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13804 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
13805 LDKPublicKey their_node_id_ref;
13806 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13807 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13808 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
13809 int64_t ret_ref = 0;
13810 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
13811 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
13815 typedef struct LDKCustomMessageReader_JCalls {
13816 atomic_size_t refcnt;
13819 jmethodID read_meth;
13820 } LDKCustomMessageReader_JCalls;
13821 static void LDKCustomMessageReader_JCalls_free(void* this_arg) {
13822 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
13823 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
13825 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13826 if (get_jenv_res == JNI_EDETACHED) {
13827 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13829 DO_ASSERT(get_jenv_res == JNI_OK);
13831 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
13832 if (get_jenv_res == JNI_EDETACHED) {
13833 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13838 LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) {
13839 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
13841 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13842 if (get_jenv_res == JNI_EDETACHED) {
13843 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13845 DO_ASSERT(get_jenv_res == JNI_OK);
13847 int16_t message_type_conv = message_type;
13848 LDKu8slice buffer_var = buffer;
13849 int8_tArray buffer_arr = (*env)->NewByteArray(env, buffer_var.datalen);
13850 (*env)->SetByteArrayRegion(env, buffer_arr, 0, buffer_var.datalen, buffer_var.data);
13851 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13852 CHECK(obj != NULL);
13853 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_meth, message_type_conv, buffer_arr);
13854 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13855 (*env)->ExceptionDescribe(env);
13856 (*env)->FatalError(env, "A call to read in LDKCustomMessageReader from rust threw an exception.");
13858 void* ret_ptr = untag_ptr(ret);
13859 CHECK_ACCESS(ret_ptr);
13860 LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
13861 FREE(untag_ptr(ret));
13862 if (get_jenv_res == JNI_EDETACHED) {
13863 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13867 static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) {
13868 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) new_obj->this_arg;
13869 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
13871 static inline LDKCustomMessageReader LDKCustomMessageReader_init (JNIEnv *env, jclass clz, jobject o) {
13872 jclass c = (*env)->GetObjectClass(env, o);
13874 LDKCustomMessageReader_JCalls *calls = MALLOC(sizeof(LDKCustomMessageReader_JCalls), "LDKCustomMessageReader_JCalls");
13875 atomic_init(&calls->refcnt, 1);
13876 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
13877 calls->o = (*env)->NewWeakGlobalRef(env, o);
13878 calls->read_meth = (*env)->GetMethodID(env, c, "read", "(S[B)J");
13879 CHECK(calls->read_meth != NULL);
13881 LDKCustomMessageReader ret = {
13882 .this_arg = (void*) calls,
13883 .read = read_LDKCustomMessageReader_jcall,
13884 .free = LDKCustomMessageReader_JCalls_free,
13888 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageReader_1new(JNIEnv *env, jclass clz, jobject o) {
13889 LDKCustomMessageReader *res_ptr = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
13890 *res_ptr = LDKCustomMessageReader_init(env, clz, o);
13891 return tag_ptr(res_ptr, true);
13893 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1read(JNIEnv *env, jclass clz, int64_t this_arg, int16_t message_type, int8_tArray buffer) {
13894 void* this_arg_ptr = untag_ptr(this_arg);
13895 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13896 LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
13897 LDKu8slice buffer_ref;
13898 buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
13899 buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
13900 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
13901 *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
13902 (*env)->ReleaseByteArrayElements(env, buffer, (int8_t*)buffer_ref.data, 0);
13903 return tag_ptr(ret_conv, true);
13906 typedef struct LDKCustomMessageHandler_JCalls {
13907 atomic_size_t refcnt;
13910 LDKCustomMessageReader_JCalls* CustomMessageReader;
13911 jmethodID handle_custom_message_meth;
13912 jmethodID get_and_clear_pending_msg_meth;
13913 } LDKCustomMessageHandler_JCalls;
13914 static void LDKCustomMessageHandler_JCalls_free(void* this_arg) {
13915 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
13916 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
13918 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13919 if (get_jenv_res == JNI_EDETACHED) {
13920 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13922 DO_ASSERT(get_jenv_res == JNI_OK);
13924 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
13925 if (get_jenv_res == JNI_EDETACHED) {
13926 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13931 LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
13932 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
13934 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13935 if (get_jenv_res == JNI_EDETACHED) {
13936 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13938 DO_ASSERT(get_jenv_res == JNI_OK);
13940 LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
13942 int8_tArray sender_node_id_arr = (*env)->NewByteArray(env, 33);
13943 (*env)->SetByteArrayRegion(env, sender_node_id_arr, 0, 33, sender_node_id.compressed_form);
13944 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13945 CHECK(obj != NULL);
13946 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true), sender_node_id_arr);
13947 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13948 (*env)->ExceptionDescribe(env);
13949 (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomMessageHandler from rust threw an exception.");
13951 void* ret_ptr = untag_ptr(ret);
13952 CHECK_ACCESS(ret_ptr);
13953 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
13954 FREE(untag_ptr(ret));
13955 if (get_jenv_res == JNI_EDETACHED) {
13956 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13960 LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
13961 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
13963 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13964 if (get_jenv_res == JNI_EDETACHED) {
13965 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13967 DO_ASSERT(get_jenv_res == JNI_OK);
13969 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13970 CHECK(obj != NULL);
13971 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_meth);
13972 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13973 (*env)->ExceptionDescribe(env);
13974 (*env)->FatalError(env, "A call to get_and_clear_pending_msg in LDKCustomMessageHandler from rust threw an exception.");
13976 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
13977 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
13978 if (ret_constr.datalen > 0)
13979 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
13981 ret_constr.data = NULL;
13982 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
13983 for (size_t z = 0; z < ret_constr.datalen; z++) {
13984 int64_t ret_conv_25 = ret_vals[z];
13985 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
13986 CHECK_ACCESS(ret_conv_25_ptr);
13987 LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
13988 FREE(untag_ptr(ret_conv_25));
13989 ret_constr.data[z] = ret_conv_25_conv;
13991 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
13992 if (get_jenv_res == JNI_EDETACHED) {
13993 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13997 static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
13998 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) new_obj->this_arg;
13999 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
14000 atomic_fetch_add_explicit(&j_calls->CustomMessageReader->refcnt, 1, memory_order_release);
14002 static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject CustomMessageReader) {
14003 jclass c = (*env)->GetObjectClass(env, o);
14005 LDKCustomMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomMessageHandler_JCalls), "LDKCustomMessageHandler_JCalls");
14006 atomic_init(&calls->refcnt, 1);
14007 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
14008 calls->o = (*env)->NewWeakGlobalRef(env, o);
14009 calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J[B)J");
14010 CHECK(calls->handle_custom_message_meth != NULL);
14011 calls->get_and_clear_pending_msg_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg", "()[J");
14012 CHECK(calls->get_and_clear_pending_msg_meth != NULL);
14014 LDKCustomMessageHandler ret = {
14015 .this_arg = (void*) calls,
14016 .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall,
14017 .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall,
14018 .free = LDKCustomMessageHandler_JCalls_free,
14019 .CustomMessageReader = LDKCustomMessageReader_init(env, clz, CustomMessageReader),
14021 calls->CustomMessageReader = ret.CustomMessageReader.this_arg;
14024 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject CustomMessageReader) {
14025 LDKCustomMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
14026 *res_ptr = LDKCustomMessageHandler_init(env, clz, o, CustomMessageReader);
14027 return tag_ptr(res_ptr, true);
14029 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageHandler_1get_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t arg) {
14030 LDKCustomMessageHandler *inp = (LDKCustomMessageHandler *)untag_ptr(arg);
14031 return tag_ptr(&inp->CustomMessageReader, false);
14033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int8_tArray sender_node_id) {
14034 void* this_arg_ptr = untag_ptr(this_arg);
14035 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14036 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
14037 void* msg_ptr = untag_ptr(msg);
14038 CHECK_ACCESS(msg_ptr);
14039 LDKType msg_conv = *(LDKType*)(msg_ptr);
14040 if (msg_conv.free == LDKType_JCalls_free) {
14041 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
14042 LDKType_JCalls_cloned(&msg_conv);
14044 LDKPublicKey sender_node_id_ref;
14045 CHECK((*env)->GetArrayLength(env, sender_node_id) == 33);
14046 (*env)->GetByteArrayRegion(env, sender_node_id, 0, 33, sender_node_id_ref.compressed_form);
14047 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14048 *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref);
14049 return tag_ptr(ret_conv, true);
14052 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1get_1and_1clear_1pending_1msg(JNIEnv *env, jclass clz, int64_t this_arg) {
14053 void* this_arg_ptr = untag_ptr(this_arg);
14054 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14055 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
14056 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
14057 int64_tArray ret_arr = NULL;
14058 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
14059 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
14060 for (size_t z = 0; z < ret_var.datalen; z++) {
14061 LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
14062 *ret_conv_25_conv = ret_var.data[z];
14063 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
14065 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
14066 FREE(ret_var.data);
14070 typedef struct LDKCustomOnionMessageHandler_JCalls {
14071 atomic_size_t refcnt;
14074 jmethodID handle_custom_message_meth;
14075 jmethodID read_custom_message_meth;
14076 } LDKCustomOnionMessageHandler_JCalls;
14077 static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) {
14078 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
14079 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
14081 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14082 if (get_jenv_res == JNI_EDETACHED) {
14083 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14085 DO_ASSERT(get_jenv_res == JNI_OK);
14087 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
14088 if (get_jenv_res == JNI_EDETACHED) {
14089 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14094 void handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKCustomOnionMessageContents msg) {
14095 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
14097 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14098 if (get_jenv_res == JNI_EDETACHED) {
14099 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14101 DO_ASSERT(get_jenv_res == JNI_OK);
14103 LDKCustomOnionMessageContents* msg_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
14105 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14106 CHECK(obj != NULL);
14107 (*env)->CallVoidMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true));
14108 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14109 (*env)->ExceptionDescribe(env);
14110 (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomOnionMessageHandler from rust threw an exception.");
14112 if (get_jenv_res == JNI_EDETACHED) {
14113 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14116 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, uint64_t message_type, LDKu8slice buffer) {
14117 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
14119 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14120 if (get_jenv_res == JNI_EDETACHED) {
14121 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14123 DO_ASSERT(get_jenv_res == JNI_OK);
14125 int64_t message_type_conv = message_type;
14126 LDKu8slice buffer_var = buffer;
14127 int8_tArray buffer_arr = (*env)->NewByteArray(env, buffer_var.datalen);
14128 (*env)->SetByteArrayRegion(env, buffer_arr, 0, buffer_var.datalen, buffer_var.data);
14129 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14130 CHECK(obj != NULL);
14131 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_custom_message_meth, message_type_conv, buffer_arr);
14132 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14133 (*env)->ExceptionDescribe(env);
14134 (*env)->FatalError(env, "A call to read_custom_message in LDKCustomOnionMessageHandler from rust threw an exception.");
14136 void* ret_ptr = untag_ptr(ret);
14137 CHECK_ACCESS(ret_ptr);
14138 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(ret_ptr);
14139 FREE(untag_ptr(ret));
14140 if (get_jenv_res == JNI_EDETACHED) {
14141 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14145 static void LDKCustomOnionMessageHandler_JCalls_cloned(LDKCustomOnionMessageHandler* new_obj) {
14146 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) new_obj->this_arg;
14147 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
14149 static inline LDKCustomOnionMessageHandler LDKCustomOnionMessageHandler_init (JNIEnv *env, jclass clz, jobject o) {
14150 jclass c = (*env)->GetObjectClass(env, o);
14152 LDKCustomOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageHandler_JCalls), "LDKCustomOnionMessageHandler_JCalls");
14153 atomic_init(&calls->refcnt, 1);
14154 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
14155 calls->o = (*env)->NewWeakGlobalRef(env, o);
14156 calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J)V");
14157 CHECK(calls->handle_custom_message_meth != NULL);
14158 calls->read_custom_message_meth = (*env)->GetMethodID(env, c, "read_custom_message", "(J[B)J");
14159 CHECK(calls->read_custom_message_meth != NULL);
14161 LDKCustomOnionMessageHandler ret = {
14162 .this_arg = (void*) calls,
14163 .handle_custom_message = handle_custom_message_LDKCustomOnionMessageHandler_jcall,
14164 .read_custom_message = read_custom_message_LDKCustomOnionMessageHandler_jcall,
14165 .free = LDKCustomOnionMessageHandler_JCalls_free,
14169 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageHandler_1new(JNIEnv *env, jclass clz, jobject o) {
14170 LDKCustomOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
14171 *res_ptr = LDKCustomOnionMessageHandler_init(env, clz, o);
14172 return tag_ptr(res_ptr, true);
14174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
14175 void* this_arg_ptr = untag_ptr(this_arg);
14176 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14177 LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
14178 void* msg_ptr = untag_ptr(msg);
14179 CHECK_ACCESS(msg_ptr);
14180 LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
14181 if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
14182 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
14183 LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
14185 (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv);
14188 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1read_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message_type, int8_tArray buffer) {
14189 void* this_arg_ptr = untag_ptr(this_arg);
14190 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14191 LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
14192 LDKu8slice buffer_ref;
14193 buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
14194 buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
14195 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
14196 *ret_conv = (this_arg_conv->read_custom_message)(this_arg_conv->this_arg, message_type, buffer_ref);
14197 (*env)->ReleaseByteArrayElements(env, buffer, (int8_t*)buffer_ref.data, 0);
14198 return tag_ptr(ret_conv, true);
14201 typedef struct LDKSocketDescriptor_JCalls {
14202 atomic_size_t refcnt;
14205 jmethodID send_data_meth;
14206 jmethodID disconnect_socket_meth;
14208 jmethodID hash_meth;
14209 } LDKSocketDescriptor_JCalls;
14210 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
14211 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
14212 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
14214 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14215 if (get_jenv_res == JNI_EDETACHED) {
14216 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14218 DO_ASSERT(get_jenv_res == JNI_OK);
14220 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
14221 if (get_jenv_res == JNI_EDETACHED) {
14222 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14227 uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
14228 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
14230 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14231 if (get_jenv_res == JNI_EDETACHED) {
14232 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14234 DO_ASSERT(get_jenv_res == JNI_OK);
14236 LDKu8slice data_var = data;
14237 int8_tArray data_arr = (*env)->NewByteArray(env, data_var.datalen);
14238 (*env)->SetByteArrayRegion(env, data_arr, 0, data_var.datalen, data_var.data);
14239 jboolean resume_read_conv = resume_read;
14240 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14241 CHECK(obj != NULL);
14242 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_data_meth, data_arr, resume_read_conv);
14243 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14244 (*env)->ExceptionDescribe(env);
14245 (*env)->FatalError(env, "A call to send_data in LDKSocketDescriptor from rust threw an exception.");
14247 if (get_jenv_res == JNI_EDETACHED) {
14248 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14252 void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
14253 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
14255 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14256 if (get_jenv_res == JNI_EDETACHED) {
14257 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14259 DO_ASSERT(get_jenv_res == JNI_OK);
14261 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14262 CHECK(obj != NULL);
14263 (*env)->CallVoidMethod(env, obj, j_calls->disconnect_socket_meth);
14264 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14265 (*env)->ExceptionDescribe(env);
14266 (*env)->FatalError(env, "A call to disconnect_socket in LDKSocketDescriptor from rust threw an exception.");
14268 if (get_jenv_res == JNI_EDETACHED) {
14269 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14272 bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
14273 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
14275 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14276 if (get_jenv_res == JNI_EDETACHED) {
14277 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14279 DO_ASSERT(get_jenv_res == JNI_OK);
14281 LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
14282 *other_arg_clone = SocketDescriptor_clone(other_arg);
14283 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14284 CHECK(obj != NULL);
14285 jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->eq_meth, tag_ptr(other_arg_clone, true));
14286 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14287 (*env)->ExceptionDescribe(env);
14288 (*env)->FatalError(env, "A call to eq in LDKSocketDescriptor from rust threw an exception.");
14290 if (get_jenv_res == JNI_EDETACHED) {
14291 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14295 uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
14296 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
14298 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14299 if (get_jenv_res == JNI_EDETACHED) {
14300 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14302 DO_ASSERT(get_jenv_res == JNI_OK);
14304 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14305 CHECK(obj != NULL);
14306 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->hash_meth);
14307 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14308 (*env)->ExceptionDescribe(env);
14309 (*env)->FatalError(env, "A call to hash in LDKSocketDescriptor from rust threw an exception.");
14311 if (get_jenv_res == JNI_EDETACHED) {
14312 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14316 static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
14317 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
14318 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
14320 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv *env, jclass clz, jobject o) {
14321 jclass c = (*env)->GetObjectClass(env, o);
14323 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
14324 atomic_init(&calls->refcnt, 1);
14325 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
14326 calls->o = (*env)->NewWeakGlobalRef(env, o);
14327 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "([BZ)J");
14328 CHECK(calls->send_data_meth != NULL);
14329 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
14330 CHECK(calls->disconnect_socket_meth != NULL);
14331 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
14332 CHECK(calls->eq_meth != NULL);
14333 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
14334 CHECK(calls->hash_meth != NULL);
14336 LDKSocketDescriptor ret = {
14337 .this_arg = (void*) calls,
14338 .send_data = send_data_LDKSocketDescriptor_jcall,
14339 .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
14340 .eq = eq_LDKSocketDescriptor_jcall,
14341 .hash = hash_LDKSocketDescriptor_jcall,
14342 .cloned = LDKSocketDescriptor_JCalls_cloned,
14343 .free = LDKSocketDescriptor_JCalls_free,
14347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new(JNIEnv *env, jclass clz, jobject o) {
14348 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
14349 *res_ptr = LDKSocketDescriptor_init(env, clz, o);
14350 return tag_ptr(res_ptr, true);
14352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray data, jboolean resume_read) {
14353 void* this_arg_ptr = untag_ptr(this_arg);
14354 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14355 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
14356 LDKu8slice data_ref;
14357 data_ref.datalen = (*env)->GetArrayLength(env, data);
14358 data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
14359 int64_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
14360 (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0);
14364 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket(JNIEnv *env, jclass clz, int64_t this_arg) {
14365 void* this_arg_ptr = untag_ptr(this_arg);
14366 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14367 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
14368 (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
14371 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
14372 void* this_arg_ptr = untag_ptr(this_arg);
14373 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14374 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
14375 int64_t ret_conv = (this_arg_conv->hash)(this_arg_conv->this_arg);
14379 static jclass LDKEffectiveCapacity_ExactLiquidity_class = NULL;
14380 static jmethodID LDKEffectiveCapacity_ExactLiquidity_meth = NULL;
14381 static jclass LDKEffectiveCapacity_MaximumHTLC_class = NULL;
14382 static jmethodID LDKEffectiveCapacity_MaximumHTLC_meth = NULL;
14383 static jclass LDKEffectiveCapacity_Total_class = NULL;
14384 static jmethodID LDKEffectiveCapacity_Total_meth = NULL;
14385 static jclass LDKEffectiveCapacity_Infinite_class = NULL;
14386 static jmethodID LDKEffectiveCapacity_Infinite_meth = NULL;
14387 static jclass LDKEffectiveCapacity_Unknown_class = NULL;
14388 static jmethodID LDKEffectiveCapacity_Unknown_meth = NULL;
14389 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEffectiveCapacity_init (JNIEnv *env, jclass clz) {
14390 LDKEffectiveCapacity_ExactLiquidity_class =
14391 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$ExactLiquidity"));
14392 CHECK(LDKEffectiveCapacity_ExactLiquidity_class != NULL);
14393 LDKEffectiveCapacity_ExactLiquidity_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_ExactLiquidity_class, "<init>", "(J)V");
14394 CHECK(LDKEffectiveCapacity_ExactLiquidity_meth != NULL);
14395 LDKEffectiveCapacity_MaximumHTLC_class =
14396 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$MaximumHTLC"));
14397 CHECK(LDKEffectiveCapacity_MaximumHTLC_class != NULL);
14398 LDKEffectiveCapacity_MaximumHTLC_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_MaximumHTLC_class, "<init>", "(J)V");
14399 CHECK(LDKEffectiveCapacity_MaximumHTLC_meth != NULL);
14400 LDKEffectiveCapacity_Total_class =
14401 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Total"));
14402 CHECK(LDKEffectiveCapacity_Total_class != NULL);
14403 LDKEffectiveCapacity_Total_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Total_class, "<init>", "(JJ)V");
14404 CHECK(LDKEffectiveCapacity_Total_meth != NULL);
14405 LDKEffectiveCapacity_Infinite_class =
14406 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Infinite"));
14407 CHECK(LDKEffectiveCapacity_Infinite_class != NULL);
14408 LDKEffectiveCapacity_Infinite_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Infinite_class, "<init>", "()V");
14409 CHECK(LDKEffectiveCapacity_Infinite_meth != NULL);
14410 LDKEffectiveCapacity_Unknown_class =
14411 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Unknown"));
14412 CHECK(LDKEffectiveCapacity_Unknown_class != NULL);
14413 LDKEffectiveCapacity_Unknown_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Unknown_class, "<init>", "()V");
14414 CHECK(LDKEffectiveCapacity_Unknown_meth != NULL);
14416 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
14417 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
14419 case LDKEffectiveCapacity_ExactLiquidity: {
14420 int64_t liquidity_msat_conv = obj->exact_liquidity.liquidity_msat;
14421 return (*env)->NewObject(env, LDKEffectiveCapacity_ExactLiquidity_class, LDKEffectiveCapacity_ExactLiquidity_meth, liquidity_msat_conv);
14423 case LDKEffectiveCapacity_MaximumHTLC: {
14424 int64_t amount_msat_conv = obj->maximum_htlc.amount_msat;
14425 return (*env)->NewObject(env, LDKEffectiveCapacity_MaximumHTLC_class, LDKEffectiveCapacity_MaximumHTLC_meth, amount_msat_conv);
14427 case LDKEffectiveCapacity_Total: {
14428 int64_t capacity_msat_conv = obj->total.capacity_msat;
14429 int64_t htlc_maximum_msat_ref = tag_ptr(&obj->total.htlc_maximum_msat, false);
14430 return (*env)->NewObject(env, LDKEffectiveCapacity_Total_class, LDKEffectiveCapacity_Total_meth, capacity_msat_conv, htlc_maximum_msat_ref);
14432 case LDKEffectiveCapacity_Infinite: {
14433 return (*env)->NewObject(env, LDKEffectiveCapacity_Infinite_class, LDKEffectiveCapacity_Infinite_meth);
14435 case LDKEffectiveCapacity_Unknown: {
14436 return (*env)->NewObject(env, LDKEffectiveCapacity_Unknown_class, LDKEffectiveCapacity_Unknown_meth);
14441 static jclass LDKDestination_Node_class = NULL;
14442 static jmethodID LDKDestination_Node_meth = NULL;
14443 static jclass LDKDestination_BlindedRoute_class = NULL;
14444 static jmethodID LDKDestination_BlindedRoute_meth = NULL;
14445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) {
14446 LDKDestination_Node_class =
14447 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node"));
14448 CHECK(LDKDestination_Node_class != NULL);
14449 LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "<init>", "([B)V");
14450 CHECK(LDKDestination_Node_meth != NULL);
14451 LDKDestination_BlindedRoute_class =
14452 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedRoute"));
14453 CHECK(LDKDestination_BlindedRoute_class != NULL);
14454 LDKDestination_BlindedRoute_meth = (*env)->GetMethodID(env, LDKDestination_BlindedRoute_class, "<init>", "(J)V");
14455 CHECK(LDKDestination_BlindedRoute_meth != NULL);
14457 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
14458 LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
14460 case LDKDestination_Node: {
14461 int8_tArray node_arr = (*env)->NewByteArray(env, 33);
14462 (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form);
14463 return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr);
14465 case LDKDestination_BlindedRoute: {
14466 LDKBlindedRoute blinded_route_var = obj->blinded_route;
14467 int64_t blinded_route_ref = 0;
14468 CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_route_var);
14469 blinded_route_ref = tag_ptr(blinded_route_var.inner, false);
14470 return (*env)->NewObject(env, LDKDestination_BlindedRoute_class, LDKDestination_BlindedRoute_meth, blinded_route_ref);
14475 static jclass LDKGossipSync_P2P_class = NULL;
14476 static jmethodID LDKGossipSync_P2P_meth = NULL;
14477 static jclass LDKGossipSync_Rapid_class = NULL;
14478 static jmethodID LDKGossipSync_Rapid_meth = NULL;
14479 static jclass LDKGossipSync_None_class = NULL;
14480 static jmethodID LDKGossipSync_None_meth = NULL;
14481 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGossipSync_init (JNIEnv *env, jclass clz) {
14482 LDKGossipSync_P2P_class =
14483 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$P2P"));
14484 CHECK(LDKGossipSync_P2P_class != NULL);
14485 LDKGossipSync_P2P_meth = (*env)->GetMethodID(env, LDKGossipSync_P2P_class, "<init>", "(J)V");
14486 CHECK(LDKGossipSync_P2P_meth != NULL);
14487 LDKGossipSync_Rapid_class =
14488 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$Rapid"));
14489 CHECK(LDKGossipSync_Rapid_class != NULL);
14490 LDKGossipSync_Rapid_meth = (*env)->GetMethodID(env, LDKGossipSync_Rapid_class, "<init>", "(J)V");
14491 CHECK(LDKGossipSync_Rapid_meth != NULL);
14492 LDKGossipSync_None_class =
14493 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$None"));
14494 CHECK(LDKGossipSync_None_class != NULL);
14495 LDKGossipSync_None_meth = (*env)->GetMethodID(env, LDKGossipSync_None_class, "<init>", "()V");
14496 CHECK(LDKGossipSync_None_meth != NULL);
14498 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGossipSync_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
14499 LDKGossipSync *obj = (LDKGossipSync*)untag_ptr(ptr);
14501 case LDKGossipSync_P2P: {
14502 LDKP2PGossipSync p2p_var = obj->p2p;
14503 int64_t p2p_ref = 0;
14504 CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var);
14505 p2p_ref = tag_ptr(p2p_var.inner, false);
14506 return (*env)->NewObject(env, LDKGossipSync_P2P_class, LDKGossipSync_P2P_meth, p2p_ref);
14508 case LDKGossipSync_Rapid: {
14509 LDKRapidGossipSync rapid_var = obj->rapid;
14510 int64_t rapid_ref = 0;
14511 CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var);
14512 rapid_ref = tag_ptr(rapid_var.inner, false);
14513 return (*env)->NewObject(env, LDKGossipSync_Rapid_class, LDKGossipSync_Rapid_meth, rapid_ref);
14515 case LDKGossipSync_None: {
14516 return (*env)->NewObject(env, LDKGossipSync_None_class, LDKGossipSync_None_meth);
14521 static jclass LDKFallback_SegWitProgram_class = NULL;
14522 static jmethodID LDKFallback_SegWitProgram_meth = NULL;
14523 static jclass LDKFallback_PubKeyHash_class = NULL;
14524 static jmethodID LDKFallback_PubKeyHash_meth = NULL;
14525 static jclass LDKFallback_ScriptHash_class = NULL;
14526 static jmethodID LDKFallback_ScriptHash_meth = NULL;
14527 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFallback_init (JNIEnv *env, jclass clz) {
14528 LDKFallback_SegWitProgram_class =
14529 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$SegWitProgram"));
14530 CHECK(LDKFallback_SegWitProgram_class != NULL);
14531 LDKFallback_SegWitProgram_meth = (*env)->GetMethodID(env, LDKFallback_SegWitProgram_class, "<init>", "(B[B)V");
14532 CHECK(LDKFallback_SegWitProgram_meth != NULL);
14533 LDKFallback_PubKeyHash_class =
14534 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$PubKeyHash"));
14535 CHECK(LDKFallback_PubKeyHash_class != NULL);
14536 LDKFallback_PubKeyHash_meth = (*env)->GetMethodID(env, LDKFallback_PubKeyHash_class, "<init>", "([B)V");
14537 CHECK(LDKFallback_PubKeyHash_meth != NULL);
14538 LDKFallback_ScriptHash_class =
14539 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$ScriptHash"));
14540 CHECK(LDKFallback_ScriptHash_class != NULL);
14541 LDKFallback_ScriptHash_meth = (*env)->GetMethodID(env, LDKFallback_ScriptHash_class, "<init>", "([B)V");
14542 CHECK(LDKFallback_ScriptHash_meth != NULL);
14544 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFallback_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
14545 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
14547 case LDKFallback_SegWitProgram: {
14548 uint8_t version_val = obj->seg_wit_program.version._0;
14549 LDKCVec_u8Z program_var = obj->seg_wit_program.program;
14550 int8_tArray program_arr = (*env)->NewByteArray(env, program_var.datalen);
14551 (*env)->SetByteArrayRegion(env, program_arr, 0, program_var.datalen, program_var.data);
14552 return (*env)->NewObject(env, LDKFallback_SegWitProgram_class, LDKFallback_SegWitProgram_meth, version_val, program_arr);
14554 case LDKFallback_PubKeyHash: {
14555 int8_tArray pub_key_hash_arr = (*env)->NewByteArray(env, 20);
14556 (*env)->SetByteArrayRegion(env, pub_key_hash_arr, 0, 20, obj->pub_key_hash.data);
14557 return (*env)->NewObject(env, LDKFallback_PubKeyHash_class, LDKFallback_PubKeyHash_meth, pub_key_hash_arr);
14559 case LDKFallback_ScriptHash: {
14560 int8_tArray script_hash_arr = (*env)->NewByteArray(env, 20);
14561 (*env)->SetByteArrayRegion(env, script_hash_arr, 0, 20, obj->script_hash.data);
14562 return (*env)->NewObject(env, LDKFallback_ScriptHash_class, LDKFallback_ScriptHash_meth, script_hash_arr);
14567 typedef struct LDKPayer_JCalls {
14568 atomic_size_t refcnt;
14571 jmethodID node_id_meth;
14572 jmethodID first_hops_meth;
14573 jmethodID send_payment_meth;
14574 jmethodID send_spontaneous_payment_meth;
14575 jmethodID retry_payment_meth;
14576 jmethodID abandon_payment_meth;
14578 static void LDKPayer_JCalls_free(void* this_arg) {
14579 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
14580 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
14582 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14583 if (get_jenv_res == JNI_EDETACHED) {
14584 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14586 DO_ASSERT(get_jenv_res == JNI_OK);
14588 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
14589 if (get_jenv_res == JNI_EDETACHED) {
14590 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14595 LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
14596 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
14598 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14599 if (get_jenv_res == JNI_EDETACHED) {
14600 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14602 DO_ASSERT(get_jenv_res == JNI_OK);
14604 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14605 CHECK(obj != NULL);
14606 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->node_id_meth);
14607 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14608 (*env)->ExceptionDescribe(env);
14609 (*env)->FatalError(env, "A call to node_id in LDKPayer from rust threw an exception.");
14611 LDKPublicKey ret_ref;
14612 CHECK((*env)->GetArrayLength(env, ret) == 33);
14613 (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
14614 if (get_jenv_res == JNI_EDETACHED) {
14615 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14619 LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
14620 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
14622 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14623 if (get_jenv_res == JNI_EDETACHED) {
14624 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14626 DO_ASSERT(get_jenv_res == JNI_OK);
14628 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14629 CHECK(obj != NULL);
14630 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->first_hops_meth);
14631 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14632 (*env)->ExceptionDescribe(env);
14633 (*env)->FatalError(env, "A call to first_hops in LDKPayer from rust threw an exception.");
14635 LDKCVec_ChannelDetailsZ ret_constr;
14636 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
14637 if (ret_constr.datalen > 0)
14638 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
14640 ret_constr.data = NULL;
14641 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
14642 for (size_t q = 0; q < ret_constr.datalen; q++) {
14643 int64_t ret_conv_16 = ret_vals[q];
14644 LDKChannelDetails ret_conv_16_conv;
14645 ret_conv_16_conv.inner = untag_ptr(ret_conv_16);
14646 ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16);
14647 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
14648 ret_constr.data[q] = ret_conv_16_conv;
14650 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
14651 if (get_jenv_res == JNI_EDETACHED) {
14652 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14656 LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
14657 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
14659 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14660 if (get_jenv_res == JNI_EDETACHED) {
14661 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14663 DO_ASSERT(get_jenv_res == JNI_OK);
14665 LDKRoute route_var = *route;
14666 int64_t route_ref = 0;
14667 route_var = Route_clone(&route_var);
14668 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
14669 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
14670 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
14671 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, payment_hash.data);
14672 int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
14673 (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, payment_secret.data);
14674 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14675 CHECK(obj != NULL);
14676 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_payment_meth, route_ref, payment_hash_arr, payment_secret_arr);
14677 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14678 (*env)->ExceptionDescribe(env);
14679 (*env)->FatalError(env, "A call to send_payment in LDKPayer from rust threw an exception.");
14681 void* ret_ptr = untag_ptr(ret);
14682 CHECK_ACCESS(ret_ptr);
14683 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
14684 FREE(untag_ptr(ret));
14685 if (get_jenv_res == JNI_EDETACHED) {
14686 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14690 LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
14691 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
14693 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14694 if (get_jenv_res == JNI_EDETACHED) {
14695 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14697 DO_ASSERT(get_jenv_res == JNI_OK);
14699 LDKRoute route_var = *route;
14700 int64_t route_ref = 0;
14701 route_var = Route_clone(&route_var);
14702 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
14703 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
14704 int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
14705 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, payment_preimage.data);
14706 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14707 CHECK(obj != NULL);
14708 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_spontaneous_payment_meth, route_ref, payment_preimage_arr);
14709 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14710 (*env)->ExceptionDescribe(env);
14711 (*env)->FatalError(env, "A call to send_spontaneous_payment in LDKPayer from rust threw an exception.");
14713 void* ret_ptr = untag_ptr(ret);
14714 CHECK_ACCESS(ret_ptr);
14715 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
14716 FREE(untag_ptr(ret));
14717 if (get_jenv_res == JNI_EDETACHED) {
14718 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14722 LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
14723 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
14725 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14726 if (get_jenv_res == JNI_EDETACHED) {
14727 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14729 DO_ASSERT(get_jenv_res == JNI_OK);
14731 LDKRoute route_var = *route;
14732 int64_t route_ref = 0;
14733 route_var = Route_clone(&route_var);
14734 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
14735 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
14736 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
14737 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data);
14738 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14739 CHECK(obj != NULL);
14740 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->retry_payment_meth, route_ref, payment_id_arr);
14741 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14742 (*env)->ExceptionDescribe(env);
14743 (*env)->FatalError(env, "A call to retry_payment in LDKPayer from rust threw an exception.");
14745 void* ret_ptr = untag_ptr(ret);
14746 CHECK_ACCESS(ret_ptr);
14747 LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
14748 FREE(untag_ptr(ret));
14749 if (get_jenv_res == JNI_EDETACHED) {
14750 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14754 void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
14755 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
14757 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14758 if (get_jenv_res == JNI_EDETACHED) {
14759 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14761 DO_ASSERT(get_jenv_res == JNI_OK);
14763 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
14764 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data);
14765 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14766 CHECK(obj != NULL);
14767 (*env)->CallVoidMethod(env, obj, j_calls->abandon_payment_meth, payment_id_arr);
14768 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14769 (*env)->ExceptionDescribe(env);
14770 (*env)->FatalError(env, "A call to abandon_payment in LDKPayer from rust threw an exception.");
14772 if (get_jenv_res == JNI_EDETACHED) {
14773 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14776 static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
14777 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
14778 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
14780 static inline LDKPayer LDKPayer_init (JNIEnv *env, jclass clz, jobject o) {
14781 jclass c = (*env)->GetObjectClass(env, o);
14783 LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
14784 atomic_init(&calls->refcnt, 1);
14785 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
14786 calls->o = (*env)->NewWeakGlobalRef(env, o);
14787 calls->node_id_meth = (*env)->GetMethodID(env, c, "node_id", "()[B");
14788 CHECK(calls->node_id_meth != NULL);
14789 calls->first_hops_meth = (*env)->GetMethodID(env, c, "first_hops", "()[J");
14790 CHECK(calls->first_hops_meth != NULL);
14791 calls->send_payment_meth = (*env)->GetMethodID(env, c, "send_payment", "(J[B[B)J");
14792 CHECK(calls->send_payment_meth != NULL);
14793 calls->send_spontaneous_payment_meth = (*env)->GetMethodID(env, c, "send_spontaneous_payment", "(J[B)J");
14794 CHECK(calls->send_spontaneous_payment_meth != NULL);
14795 calls->retry_payment_meth = (*env)->GetMethodID(env, c, "retry_payment", "(J[B)J");
14796 CHECK(calls->retry_payment_meth != NULL);
14797 calls->abandon_payment_meth = (*env)->GetMethodID(env, c, "abandon_payment", "([B)V");
14798 CHECK(calls->abandon_payment_meth != NULL);
14801 .this_arg = (void*) calls,
14802 .node_id = node_id_LDKPayer_jcall,
14803 .first_hops = first_hops_LDKPayer_jcall,
14804 .send_payment = send_payment_LDKPayer_jcall,
14805 .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
14806 .retry_payment = retry_payment_LDKPayer_jcall,
14807 .abandon_payment = abandon_payment_LDKPayer_jcall,
14808 .free = LDKPayer_JCalls_free,
14812 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPayer_1new(JNIEnv *env, jclass clz, jobject o) {
14813 LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
14814 *res_ptr = LDKPayer_init(env, clz, o);
14815 return tag_ptr(res_ptr, true);
14817 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
14818 void* this_arg_ptr = untag_ptr(this_arg);
14819 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14820 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
14821 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
14822 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form);
14826 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(JNIEnv *env, jclass clz, int64_t this_arg) {
14827 void* this_arg_ptr = untag_ptr(this_arg);
14828 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14829 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
14830 LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
14831 int64_tArray ret_arr = NULL;
14832 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
14833 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
14834 for (size_t q = 0; q < ret_var.datalen; q++) {
14835 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
14836 int64_t ret_conv_16_ref = 0;
14837 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
14838 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
14839 ret_arr_ptr[q] = ret_conv_16_ref;
14841 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
14842 FREE(ret_var.data);
14846 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret) {
14847 void* this_arg_ptr = untag_ptr(this_arg);
14848 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14849 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
14850 LDKRoute route_conv;
14851 route_conv.inner = untag_ptr(route);
14852 route_conv.is_owned = ptr_is_owned(route);
14853 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
14854 route_conv.is_owned = false;
14855 LDKThirtyTwoBytes payment_hash_ref;
14856 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
14857 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
14858 LDKThirtyTwoBytes payment_secret_ref;
14859 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
14860 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
14861 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14862 *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref);
14863 return tag_ptr(ret_conv, true);
14866 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) {
14867 void* this_arg_ptr = untag_ptr(this_arg);
14868 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14869 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
14870 LDKRoute route_conv;
14871 route_conv.inner = untag_ptr(route);
14872 route_conv.is_owned = ptr_is_owned(route);
14873 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
14874 route_conv.is_owned = false;
14875 LDKThirtyTwoBytes payment_preimage_ref;
14876 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
14877 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
14878 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14879 *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
14880 return tag_ptr(ret_conv, true);
14883 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) {
14884 void* this_arg_ptr = untag_ptr(this_arg);
14885 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14886 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
14887 LDKRoute route_conv;
14888 route_conv.inner = untag_ptr(route);
14889 route_conv.is_owned = ptr_is_owned(route);
14890 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
14891 route_conv.is_owned = false;
14892 LDKThirtyTwoBytes payment_id_ref;
14893 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
14894 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
14895 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14896 *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
14897 return tag_ptr(ret_conv, true);
14900 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) {
14901 void* this_arg_ptr = untag_ptr(this_arg);
14902 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14903 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
14904 LDKThirtyTwoBytes payment_id_ref;
14905 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
14906 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
14907 (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
14910 typedef struct LDKRouter_JCalls {
14911 atomic_size_t refcnt;
14914 jmethodID find_route_meth;
14915 jmethodID notify_payment_path_failed_meth;
14916 jmethodID notify_payment_path_successful_meth;
14917 jmethodID notify_payment_probe_successful_meth;
14918 jmethodID notify_payment_probe_failed_meth;
14919 } LDKRouter_JCalls;
14920 static void LDKRouter_JCalls_free(void* this_arg) {
14921 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
14922 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
14924 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14925 if (get_jenv_res == JNI_EDETACHED) {
14926 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14928 DO_ASSERT(get_jenv_res == JNI_OK);
14930 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
14931 if (get_jenv_res == JNI_EDETACHED) {
14932 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14937 LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, const uint8_t (* payment_hash)[32], LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs) {
14938 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
14940 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14941 if (get_jenv_res == JNI_EDETACHED) {
14942 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14944 DO_ASSERT(get_jenv_res == JNI_OK);
14946 int8_tArray payer_arr = (*env)->NewByteArray(env, 33);
14947 (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form);
14948 LDKRouteParameters route_params_var = *route_params;
14949 int64_t route_params_ref = 0;
14950 route_params_var = RouteParameters_clone(&route_params_var);
14951 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
14952 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
14953 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
14954 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, *payment_hash);
14955 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
14956 int64_tArray first_hops_arr = NULL;
14957 if (first_hops != NULL) {
14958 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
14959 first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen);
14960 int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL);
14961 for (size_t q = 0; q < first_hops_var.datalen; q++) {
14962 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
14963 int64_t first_hops_conv_16_ref = 0;
14964 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
14965 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
14966 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
14968 (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0);
14970 LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs;
14971 int64_t inflight_htlcs_ref = 0;
14972 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var);
14973 inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned);
14974 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14975 CHECK(obj != NULL);
14976 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, payment_hash_arr, first_hops_arr, inflight_htlcs_ref);
14977 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14978 (*env)->ExceptionDescribe(env);
14979 (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception.");
14981 void* ret_ptr = untag_ptr(ret);
14982 CHECK_ACCESS(ret_ptr);
14983 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
14984 FREE(untag_ptr(ret));
14985 if (get_jenv_res == JNI_EDETACHED) {
14986 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14990 void notify_payment_path_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
14991 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
14993 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14994 if (get_jenv_res == JNI_EDETACHED) {
14995 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14997 DO_ASSERT(get_jenv_res == JNI_OK);
14999 LDKCVec_RouteHopZ path_var = path;
15000 int64_tArray path_arr = NULL;
15001 path_arr = (*env)->NewLongArray(env, path_var.datalen);
15002 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
15003 for (size_t k = 0; k < path_var.datalen; k++) {
15004 LDKRouteHop path_conv_10_var = path_var.data[k];
15005 int64_t path_conv_10_ref = 0;
15006 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
15007 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
15008 path_arr_ptr[k] = path_conv_10_ref;
15010 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
15011 FREE(path_var.data);
15012 int64_t short_channel_id_conv = short_channel_id;
15013 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15014 CHECK(obj != NULL);
15015 (*env)->CallVoidMethod(env, obj, j_calls->notify_payment_path_failed_meth, path_arr, short_channel_id_conv);
15016 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15017 (*env)->ExceptionDescribe(env);
15018 (*env)->FatalError(env, "A call to notify_payment_path_failed in LDKRouter from rust threw an exception.");
15020 if (get_jenv_res == JNI_EDETACHED) {
15021 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15024 void notify_payment_path_successful_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path) {
15025 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
15027 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15028 if (get_jenv_res == JNI_EDETACHED) {
15029 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15031 DO_ASSERT(get_jenv_res == JNI_OK);
15033 LDKCVec_RouteHopZ path_var = path;
15034 int64_tArray path_arr = NULL;
15035 path_arr = (*env)->NewLongArray(env, path_var.datalen);
15036 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
15037 for (size_t k = 0; k < path_var.datalen; k++) {
15038 LDKRouteHop path_conv_10_var = path_var.data[k];
15039 int64_t path_conv_10_ref = 0;
15040 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
15041 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
15042 path_arr_ptr[k] = path_conv_10_ref;
15044 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
15045 FREE(path_var.data);
15046 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15047 CHECK(obj != NULL);
15048 (*env)->CallVoidMethod(env, obj, j_calls->notify_payment_path_successful_meth, path_arr);
15049 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15050 (*env)->ExceptionDescribe(env);
15051 (*env)->FatalError(env, "A call to notify_payment_path_successful in LDKRouter from rust threw an exception.");
15053 if (get_jenv_res == JNI_EDETACHED) {
15054 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15057 void notify_payment_probe_successful_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path) {
15058 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
15060 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15061 if (get_jenv_res == JNI_EDETACHED) {
15062 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15064 DO_ASSERT(get_jenv_res == JNI_OK);
15066 LDKCVec_RouteHopZ path_var = path;
15067 int64_tArray path_arr = NULL;
15068 path_arr = (*env)->NewLongArray(env, path_var.datalen);
15069 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
15070 for (size_t k = 0; k < path_var.datalen; k++) {
15071 LDKRouteHop path_conv_10_var = path_var.data[k];
15072 int64_t path_conv_10_ref = 0;
15073 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
15074 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
15075 path_arr_ptr[k] = path_conv_10_ref;
15077 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
15078 FREE(path_var.data);
15079 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15080 CHECK(obj != NULL);
15081 (*env)->CallVoidMethod(env, obj, j_calls->notify_payment_probe_successful_meth, path_arr);
15082 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15083 (*env)->ExceptionDescribe(env);
15084 (*env)->FatalError(env, "A call to notify_payment_probe_successful in LDKRouter from rust threw an exception.");
15086 if (get_jenv_res == JNI_EDETACHED) {
15087 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15090 void notify_payment_probe_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
15091 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
15093 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15094 if (get_jenv_res == JNI_EDETACHED) {
15095 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15097 DO_ASSERT(get_jenv_res == JNI_OK);
15099 LDKCVec_RouteHopZ path_var = path;
15100 int64_tArray path_arr = NULL;
15101 path_arr = (*env)->NewLongArray(env, path_var.datalen);
15102 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
15103 for (size_t k = 0; k < path_var.datalen; k++) {
15104 LDKRouteHop path_conv_10_var = path_var.data[k];
15105 int64_t path_conv_10_ref = 0;
15106 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
15107 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
15108 path_arr_ptr[k] = path_conv_10_ref;
15110 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
15111 FREE(path_var.data);
15112 int64_t short_channel_id_conv = short_channel_id;
15113 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15114 CHECK(obj != NULL);
15115 (*env)->CallVoidMethod(env, obj, j_calls->notify_payment_probe_failed_meth, path_arr, short_channel_id_conv);
15116 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15117 (*env)->ExceptionDescribe(env);
15118 (*env)->FatalError(env, "A call to notify_payment_probe_failed in LDKRouter from rust threw an exception.");
15120 if (get_jenv_res == JNI_EDETACHED) {
15121 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15124 static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
15125 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
15126 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
15128 static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) {
15129 jclass c = (*env)->GetObjectClass(env, o);
15131 LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
15132 atomic_init(&calls->refcnt, 1);
15133 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
15134 calls->o = (*env)->NewWeakGlobalRef(env, o);
15135 calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[B[JJ)J");
15136 CHECK(calls->find_route_meth != NULL);
15137 calls->notify_payment_path_failed_meth = (*env)->GetMethodID(env, c, "notify_payment_path_failed", "([JJ)V");
15138 CHECK(calls->notify_payment_path_failed_meth != NULL);
15139 calls->notify_payment_path_successful_meth = (*env)->GetMethodID(env, c, "notify_payment_path_successful", "([J)V");
15140 CHECK(calls->notify_payment_path_successful_meth != NULL);
15141 calls->notify_payment_probe_successful_meth = (*env)->GetMethodID(env, c, "notify_payment_probe_successful", "([J)V");
15142 CHECK(calls->notify_payment_probe_successful_meth != NULL);
15143 calls->notify_payment_probe_failed_meth = (*env)->GetMethodID(env, c, "notify_payment_probe_failed", "([JJ)V");
15144 CHECK(calls->notify_payment_probe_failed_meth != NULL);
15147 .this_arg = (void*) calls,
15148 .find_route = find_route_LDKRouter_jcall,
15149 .notify_payment_path_failed = notify_payment_path_failed_LDKRouter_jcall,
15150 .notify_payment_path_successful = notify_payment_path_successful_LDKRouter_jcall,
15151 .notify_payment_probe_successful = notify_payment_probe_successful_LDKRouter_jcall,
15152 .notify_payment_probe_failed = notify_payment_probe_failed_LDKRouter_jcall,
15153 .free = LDKRouter_JCalls_free,
15157 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, jclass clz, jobject o) {
15158 LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
15159 *res_ptr = LDKRouter_init(env, clz, o);
15160 return tag_ptr(res_ptr, true);
15162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int8_tArray payment_hash, int64_tArray first_hops, int64_t inflight_htlcs) {
15163 void* this_arg_ptr = untag_ptr(this_arg);
15164 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15165 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
15166 LDKPublicKey payer_ref;
15167 CHECK((*env)->GetArrayLength(env, payer) == 33);
15168 (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_ref.compressed_form);
15169 LDKRouteParameters route_params_conv;
15170 route_params_conv.inner = untag_ptr(route_params);
15171 route_params_conv.is_owned = ptr_is_owned(route_params);
15172 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
15173 route_params_conv.is_owned = false;
15174 unsigned char payment_hash_arr[32];
15175 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
15176 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
15177 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
15178 LDKCVec_ChannelDetailsZ first_hops_constr;
15179 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
15180 if (first_hops != NULL) {
15181 first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
15182 if (first_hops_constr.datalen > 0)
15183 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
15185 first_hops_constr.data = NULL;
15186 int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
15187 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
15188 int64_t first_hops_conv_16 = first_hops_vals[q];
15189 LDKChannelDetails first_hops_conv_16_conv;
15190 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
15191 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
15192 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
15193 first_hops_conv_16_conv.is_owned = false;
15194 first_hops_constr.data[q] = first_hops_conv_16_conv;
15196 (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
15197 first_hops_ptr = &first_hops_constr;
15199 LDKInFlightHtlcs inflight_htlcs_conv;
15200 inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
15201 inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
15202 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
15203 // WARNING: we need a move here but no clone is available for LDKInFlightHtlcs
15205 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
15206 *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, payment_hash_ref, first_hops_ptr, inflight_htlcs_conv);
15207 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
15208 return tag_ptr(ret_conv, true);
15211 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path, int64_t short_channel_id) {
15212 void* this_arg_ptr = untag_ptr(this_arg);
15213 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15214 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
15215 LDKCVec_RouteHopZ path_constr;
15216 path_constr.datalen = (*env)->GetArrayLength(env, path);
15217 if (path_constr.datalen > 0)
15218 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
15220 path_constr.data = NULL;
15221 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
15222 for (size_t k = 0; k < path_constr.datalen; k++) {
15223 int64_t path_conv_10 = path_vals[k];
15224 LDKRouteHop path_conv_10_conv;
15225 path_conv_10_conv.inner = untag_ptr(path_conv_10);
15226 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
15227 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
15228 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
15229 path_constr.data[k] = path_conv_10_conv;
15231 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
15232 (this_arg_conv->notify_payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
15235 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) {
15236 void* this_arg_ptr = untag_ptr(this_arg);
15237 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15238 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
15239 LDKCVec_RouteHopZ path_constr;
15240 path_constr.datalen = (*env)->GetArrayLength(env, path);
15241 if (path_constr.datalen > 0)
15242 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
15244 path_constr.data = NULL;
15245 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
15246 for (size_t k = 0; k < path_constr.datalen; k++) {
15247 int64_t path_conv_10 = path_vals[k];
15248 LDKRouteHop path_conv_10_conv;
15249 path_conv_10_conv.inner = untag_ptr(path_conv_10);
15250 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
15251 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
15252 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
15253 path_constr.data[k] = path_conv_10_conv;
15255 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
15256 (this_arg_conv->notify_payment_path_successful)(this_arg_conv->this_arg, path_constr);
15259 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1probe_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) {
15260 void* this_arg_ptr = untag_ptr(this_arg);
15261 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15262 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
15263 LDKCVec_RouteHopZ path_constr;
15264 path_constr.datalen = (*env)->GetArrayLength(env, path);
15265 if (path_constr.datalen > 0)
15266 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
15268 path_constr.data = NULL;
15269 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
15270 for (size_t k = 0; k < path_constr.datalen; k++) {
15271 int64_t path_conv_10 = path_vals[k];
15272 LDKRouteHop path_conv_10_conv;
15273 path_conv_10_conv.inner = untag_ptr(path_conv_10);
15274 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
15275 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
15276 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
15277 path_constr.data[k] = path_conv_10_conv;
15279 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
15280 (this_arg_conv->notify_payment_probe_successful)(this_arg_conv->this_arg, path_constr);
15283 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1probe_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path, int64_t short_channel_id) {
15284 void* this_arg_ptr = untag_ptr(this_arg);
15285 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15286 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
15287 LDKCVec_RouteHopZ path_constr;
15288 path_constr.datalen = (*env)->GetArrayLength(env, path);
15289 if (path_constr.datalen > 0)
15290 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
15292 path_constr.data = NULL;
15293 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
15294 for (size_t k = 0; k < path_constr.datalen; k++) {
15295 int64_t path_conv_10 = path_vals[k];
15296 LDKRouteHop path_conv_10_conv;
15297 path_conv_10_conv.inner = untag_ptr(path_conv_10);
15298 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
15299 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
15300 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
15301 path_constr.data[k] = path_conv_10_conv;
15303 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
15304 (this_arg_conv->notify_payment_probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
15307 static jclass LDKRetry_Attempts_class = NULL;
15308 static jmethodID LDKRetry_Attempts_meth = NULL;
15309 static jclass LDKRetry_Timeout_class = NULL;
15310 static jmethodID LDKRetry_Timeout_meth = NULL;
15311 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init (JNIEnv *env, jclass clz) {
15312 LDKRetry_Attempts_class =
15313 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Attempts"));
15314 CHECK(LDKRetry_Attempts_class != NULL);
15315 LDKRetry_Attempts_meth = (*env)->GetMethodID(env, LDKRetry_Attempts_class, "<init>", "(J)V");
15316 CHECK(LDKRetry_Attempts_meth != NULL);
15317 LDKRetry_Timeout_class =
15318 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Timeout"));
15319 CHECK(LDKRetry_Timeout_class != NULL);
15320 LDKRetry_Timeout_meth = (*env)->GetMethodID(env, LDKRetry_Timeout_class, "<init>", "(J)V");
15321 CHECK(LDKRetry_Timeout_meth != NULL);
15323 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15324 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
15326 case LDKRetry_Attempts: {
15327 int64_t attempts_conv = obj->attempts;
15328 return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv);
15330 case LDKRetry_Timeout: {
15331 int64_t timeout_conv = obj->timeout;
15332 return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv);
15337 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version(JNIEnv *env, jclass clz) {
15338 LDKStr ret_str = _ldk_get_compiled_version();
15339 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
15344 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) {
15345 LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
15346 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
15351 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1new(JNIEnv *env, jclass clz, int8_tArray big_endian_bytes) {
15352 LDKThirtyTwoBytes big_endian_bytes_ref;
15353 CHECK((*env)->GetArrayLength(env, big_endian_bytes) == 32);
15354 (*env)->GetByteArrayRegion(env, big_endian_bytes, 0, 32, big_endian_bytes_ref.data);
15355 LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar");
15356 *ret_ref = BigEndianScalar_new(big_endian_bytes_ref);
15357 return tag_ptr(ret_ref, true);
15360 static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) {
15361 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
15362 *ret_copy = Bech32Error_clone(arg);
15363 int64_t ret_ref = tag_ptr(ret_copy, true);
15366 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15367 LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg);
15368 int64_t ret_conv = Bech32Error_clone_ptr(arg_conv);
15372 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15373 LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig);
15374 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
15375 *ret_copy = Bech32Error_clone(orig_conv);
15376 int64_t ret_ref = tag_ptr(ret_copy, true);
15380 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bech32Error_1free(JNIEnv *env, jclass clz, int64_t o) {
15381 if (!ptr_is_owned(o)) return;
15382 void* o_ptr = untag_ptr(o);
15383 CHECK_ACCESS(o_ptr);
15384 LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr);
15385 FREE(untag_ptr(o));
15386 Bech32Error_free(o_conv);
15389 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
15390 LDKTransaction _res_ref;
15391 _res_ref.datalen = (*env)->GetArrayLength(env, _res);
15392 _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
15393 (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
15394 _res_ref.data_is_owned = true;
15395 Transaction_free(_res_ref);
15398 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) {
15399 LDKCVec_u8Z script_pubkey_ref;
15400 script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
15401 script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
15402 (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data);
15403 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
15404 *ret_ref = TxOut_new(script_pubkey_ref, value);
15405 return tag_ptr(ret_ref, true);
15408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) {
15409 if (!ptr_is_owned(_res)) return;
15410 void* _res_ptr = untag_ptr(_res);
15411 CHECK_ACCESS(_res_ptr);
15412 LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
15413 FREE(untag_ptr(_res));
15414 TxOut_free(_res_conv);
15417 static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) {
15418 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
15419 *ret_ref = TxOut_clone(arg);
15420 return tag_ptr(ret_ref, true);
15422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15423 LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg);
15424 int64_t ret_conv = TxOut_clone_ptr(arg_conv);
15428 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15429 LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig);
15430 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
15431 *ret_ref = TxOut_clone(orig_conv);
15432 return tag_ptr(ret_ref, true);
15435 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) {
15436 LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
15440 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
15441 LDKCVec_PublicKeyZ _res_constr;
15442 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15443 if (_res_constr.datalen > 0)
15444 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
15446 _res_constr.data = NULL;
15447 for (size_t i = 0; i < _res_constr.datalen; i++) {
15448 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
15449 LDKPublicKey _res_conv_8_ref;
15450 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33);
15451 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form);
15452 _res_constr.data[i] = _res_conv_8_ref;
15454 CVec_PublicKeyZ_free(_res_constr);
15457 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15458 LDKBlindedRoute o_conv;
15459 o_conv.inner = untag_ptr(o);
15460 o_conv.is_owned = ptr_is_owned(o);
15461 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15462 // WARNING: we need a move here but no clone is available for LDKBlindedRoute
15464 LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ");
15465 *ret_conv = CResult_BlindedRouteNoneZ_ok(o_conv);
15466 return tag_ptr(ret_conv, true);
15469 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1err(JNIEnv *env, jclass clz) {
15470 LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ");
15471 *ret_conv = CResult_BlindedRouteNoneZ_err();
15472 return tag_ptr(ret_conv, true);
15475 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15476 LDKCResult_BlindedRouteNoneZ* o_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(o);
15477 jboolean ret_conv = CResult_BlindedRouteNoneZ_is_ok(o_conv);
15481 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15482 if (!ptr_is_owned(_res)) return;
15483 void* _res_ptr = untag_ptr(_res);
15484 CHECK_ACCESS(_res_ptr);
15485 LDKCResult_BlindedRouteNoneZ _res_conv = *(LDKCResult_BlindedRouteNoneZ*)(_res_ptr);
15486 FREE(untag_ptr(_res));
15487 CResult_BlindedRouteNoneZ_free(_res_conv);
15490 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15491 LDKBlindedRoute o_conv;
15492 o_conv.inner = untag_ptr(o);
15493 o_conv.is_owned = ptr_is_owned(o);
15494 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15495 // WARNING: we need a move here but no clone is available for LDKBlindedRoute
15497 LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
15498 *ret_conv = CResult_BlindedRouteDecodeErrorZ_ok(o_conv);
15499 return tag_ptr(ret_conv, true);
15502 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15503 void* e_ptr = untag_ptr(e);
15504 CHECK_ACCESS(e_ptr);
15505 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
15506 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
15507 LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
15508 *ret_conv = CResult_BlindedRouteDecodeErrorZ_err(e_conv);
15509 return tag_ptr(ret_conv, true);
15512 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15513 LDKCResult_BlindedRouteDecodeErrorZ* o_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(o);
15514 jboolean ret_conv = CResult_BlindedRouteDecodeErrorZ_is_ok(o_conv);
15518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15519 if (!ptr_is_owned(_res)) return;
15520 void* _res_ptr = untag_ptr(_res);
15521 CHECK_ACCESS(_res_ptr);
15522 LDKCResult_BlindedRouteDecodeErrorZ _res_conv = *(LDKCResult_BlindedRouteDecodeErrorZ*)(_res_ptr);
15523 FREE(untag_ptr(_res));
15524 CResult_BlindedRouteDecodeErrorZ_free(_res_conv);
15527 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15528 LDKBlindedHop o_conv;
15529 o_conv.inner = untag_ptr(o);
15530 o_conv.is_owned = ptr_is_owned(o);
15531 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15532 // WARNING: we need a move here but no clone is available for LDKBlindedHop
15534 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
15535 *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv);
15536 return tag_ptr(ret_conv, true);
15539 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15540 void* e_ptr = untag_ptr(e);
15541 CHECK_ACCESS(e_ptr);
15542 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
15543 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
15544 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
15545 *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv);
15546 return tag_ptr(ret_conv, true);
15549 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15550 LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o);
15551 jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv);
15555 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15556 if (!ptr_is_owned(_res)) return;
15557 void* _res_ptr = untag_ptr(_res);
15558 CHECK_ACCESS(_res_ptr);
15559 LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr);
15560 FREE(untag_ptr(_res));
15561 CResult_BlindedHopDecodeErrorZ_free(_res_conv);
15564 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok(JNIEnv *env, jclass clz) {
15565 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
15566 *ret_conv = CResult_NoneNoneZ_ok();
15567 return tag_ptr(ret_conv, true);
15570 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNIEnv *env, jclass clz) {
15571 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
15572 *ret_conv = CResult_NoneNoneZ_err();
15573 return tag_ptr(ret_conv, true);
15576 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15577 LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o);
15578 jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv);
15582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15583 if (!ptr_is_owned(_res)) return;
15584 void* _res_ptr = untag_ptr(_res);
15585 CHECK_ACCESS(_res_ptr);
15586 LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
15587 FREE(untag_ptr(_res));
15588 CResult_NoneNoneZ_free(_res_conv);
15591 static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) {
15592 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
15593 *ret_conv = CResult_NoneNoneZ_clone(arg);
15594 return tag_ptr(ret_conv, true);
15596 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15597 LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg);
15598 int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv);
15602 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15603 LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig);
15604 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
15605 *ret_conv = CResult_NoneNoneZ_clone(orig_conv);
15606 return tag_ptr(ret_conv, true);
15609 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15610 LDKCounterpartyCommitmentSecrets o_conv;
15611 o_conv.inner = untag_ptr(o);
15612 o_conv.is_owned = ptr_is_owned(o);
15613 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15614 o_conv = CounterpartyCommitmentSecrets_clone(&o_conv);
15615 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
15616 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv);
15617 return tag_ptr(ret_conv, true);
15620 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15621 void* e_ptr = untag_ptr(e);
15622 CHECK_ACCESS(e_ptr);
15623 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
15624 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
15625 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
15626 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
15627 return tag_ptr(ret_conv, true);
15630 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15631 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o);
15632 jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv);
15636 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15637 if (!ptr_is_owned(_res)) return;
15638 void* _res_ptr = untag_ptr(_res);
15639 CHECK_ACCESS(_res_ptr);
15640 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr);
15641 FREE(untag_ptr(_res));
15642 CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv);
15645 static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) {
15646 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
15647 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg);
15648 return tag_ptr(ret_conv, true);
15650 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15651 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg);
15652 int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv);
15656 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15657 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig);
15658 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
15659 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv);
15660 return tag_ptr(ret_conv, true);
15663 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
15664 LDKSecretKey o_ref;
15665 CHECK((*env)->GetArrayLength(env, o) == 32);
15666 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes);
15667 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
15668 *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
15669 return tag_ptr(ret_conv, true);
15672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
15673 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
15674 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
15675 *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
15676 return tag_ptr(ret_conv, true);
15679 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15680 LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(o);
15681 jboolean ret_conv = CResult_SecretKeyErrorZ_is_ok(o_conv);
15685 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15686 if (!ptr_is_owned(_res)) return;
15687 void* _res_ptr = untag_ptr(_res);
15688 CHECK_ACCESS(_res_ptr);
15689 LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
15690 FREE(untag_ptr(_res));
15691 CResult_SecretKeyErrorZ_free(_res_conv);
15694 static inline uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg) {
15695 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
15696 *ret_conv = CResult_SecretKeyErrorZ_clone(arg);
15697 return tag_ptr(ret_conv, true);
15699 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15700 LDKCResult_SecretKeyErrorZ* arg_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(arg);
15701 int64_t ret_conv = CResult_SecretKeyErrorZ_clone_ptr(arg_conv);
15705 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15706 LDKCResult_SecretKeyErrorZ* orig_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(orig);
15707 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
15708 *ret_conv = CResult_SecretKeyErrorZ_clone(orig_conv);
15709 return tag_ptr(ret_conv, true);
15712 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
15713 LDKPublicKey o_ref;
15714 CHECK((*env)->GetArrayLength(env, o) == 33);
15715 (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
15716 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
15717 *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
15718 return tag_ptr(ret_conv, true);
15721 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
15722 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
15723 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
15724 *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
15725 return tag_ptr(ret_conv, true);
15728 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15729 LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
15730 jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
15734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15735 if (!ptr_is_owned(_res)) return;
15736 void* _res_ptr = untag_ptr(_res);
15737 CHECK_ACCESS(_res_ptr);
15738 LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
15739 FREE(untag_ptr(_res));
15740 CResult_PublicKeyErrorZ_free(_res_conv);
15743 static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
15744 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
15745 *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
15746 return tag_ptr(ret_conv, true);
15748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15749 LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
15750 int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
15754 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15755 LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
15756 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
15757 *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
15758 return tag_ptr(ret_conv, true);
15761 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15762 LDKTxCreationKeys o_conv;
15763 o_conv.inner = untag_ptr(o);
15764 o_conv.is_owned = ptr_is_owned(o);
15765 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15766 o_conv = TxCreationKeys_clone(&o_conv);
15767 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
15768 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
15769 return tag_ptr(ret_conv, true);
15772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15773 void* e_ptr = untag_ptr(e);
15774 CHECK_ACCESS(e_ptr);
15775 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
15776 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
15777 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
15778 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
15779 return tag_ptr(ret_conv, true);
15782 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15783 LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
15784 jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
15788 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15789 if (!ptr_is_owned(_res)) return;
15790 void* _res_ptr = untag_ptr(_res);
15791 CHECK_ACCESS(_res_ptr);
15792 LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
15793 FREE(untag_ptr(_res));
15794 CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
15797 static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
15798 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
15799 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
15800 return tag_ptr(ret_conv, true);
15802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15803 LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
15804 int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
15808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15809 LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
15810 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
15811 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
15812 return tag_ptr(ret_conv, true);
15815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15816 LDKChannelPublicKeys o_conv;
15817 o_conv.inner = untag_ptr(o);
15818 o_conv.is_owned = ptr_is_owned(o);
15819 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15820 o_conv = ChannelPublicKeys_clone(&o_conv);
15821 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
15822 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
15823 return tag_ptr(ret_conv, true);
15826 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15827 void* e_ptr = untag_ptr(e);
15828 CHECK_ACCESS(e_ptr);
15829 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
15830 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
15831 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
15832 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
15833 return tag_ptr(ret_conv, true);
15836 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15837 LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o);
15838 jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv);
15842 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15843 if (!ptr_is_owned(_res)) return;
15844 void* _res_ptr = untag_ptr(_res);
15845 CHECK_ACCESS(_res_ptr);
15846 LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
15847 FREE(untag_ptr(_res));
15848 CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
15851 static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) {
15852 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
15853 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg);
15854 return tag_ptr(ret_conv, true);
15856 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15857 LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg);
15858 int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv);
15862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15863 LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig);
15864 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
15865 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv);
15866 return tag_ptr(ret_conv, true);
15869 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15870 LDKTxCreationKeys o_conv;
15871 o_conv.inner = untag_ptr(o);
15872 o_conv.is_owned = ptr_is_owned(o);
15873 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15874 o_conv = TxCreationKeys_clone(&o_conv);
15875 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
15876 *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv);
15877 return tag_ptr(ret_conv, true);
15880 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
15881 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
15882 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
15883 *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv);
15884 return tag_ptr(ret_conv, true);
15887 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15888 LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(o);
15889 jboolean ret_conv = CResult_TxCreationKeysErrorZ_is_ok(o_conv);
15893 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15894 if (!ptr_is_owned(_res)) return;
15895 void* _res_ptr = untag_ptr(_res);
15896 CHECK_ACCESS(_res_ptr);
15897 LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
15898 FREE(untag_ptr(_res));
15899 CResult_TxCreationKeysErrorZ_free(_res_conv);
15902 static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) {
15903 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
15904 *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg);
15905 return tag_ptr(ret_conv, true);
15907 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15908 LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(arg);
15909 int64_t ret_conv = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv);
15913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15914 LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(orig);
15915 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
15916 *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv);
15917 return tag_ptr(ret_conv, true);
15920 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1some(JNIEnv *env, jclass clz, int32_t o) {
15921 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
15922 *ret_copy = COption_u32Z_some(o);
15923 int64_t ret_ref = tag_ptr(ret_copy, true);
15927 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1none(JNIEnv *env, jclass clz) {
15928 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
15929 *ret_copy = COption_u32Z_none();
15930 int64_t ret_ref = tag_ptr(ret_copy, true);
15934 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
15935 if (!ptr_is_owned(_res)) return;
15936 void* _res_ptr = untag_ptr(_res);
15937 CHECK_ACCESS(_res_ptr);
15938 LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
15939 FREE(untag_ptr(_res));
15940 COption_u32Z_free(_res_conv);
15943 static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) {
15944 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
15945 *ret_copy = COption_u32Z_clone(arg);
15946 int64_t ret_ref = tag_ptr(ret_copy, true);
15949 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15950 LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)untag_ptr(arg);
15951 int64_t ret_conv = COption_u32Z_clone_ptr(arg_conv);
15955 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15956 LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)untag_ptr(orig);
15957 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
15958 *ret_copy = COption_u32Z_clone(orig_conv);
15959 int64_t ret_ref = tag_ptr(ret_copy, true);
15963 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15964 LDKHTLCOutputInCommitment o_conv;
15965 o_conv.inner = untag_ptr(o);
15966 o_conv.is_owned = ptr_is_owned(o);
15967 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15968 o_conv = HTLCOutputInCommitment_clone(&o_conv);
15969 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
15970 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv);
15971 return tag_ptr(ret_conv, true);
15974 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15975 void* e_ptr = untag_ptr(e);
15976 CHECK_ACCESS(e_ptr);
15977 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
15978 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
15979 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
15980 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
15981 return tag_ptr(ret_conv, true);
15984 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15985 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o);
15986 jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv);
15990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15991 if (!ptr_is_owned(_res)) return;
15992 void* _res_ptr = untag_ptr(_res);
15993 CHECK_ACCESS(_res_ptr);
15994 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
15995 FREE(untag_ptr(_res));
15996 CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
15999 static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) {
16000 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
16001 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg);
16002 return tag_ptr(ret_conv, true);
16004 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16005 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg);
16006 int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv);
16010 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16011 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig);
16012 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
16013 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv);
16014 return tag_ptr(ret_conv, true);
16017 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1some(JNIEnv *env, jclass clz) {
16018 jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_some());
16022 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1none(JNIEnv *env, jclass clz) {
16023 jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_none());
16027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1free(JNIEnv *env, jclass clz, jclass _res) {
16028 LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_java(env, _res);
16029 COption_NoneZ_free(_res_conv);
16032 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16033 LDKCounterpartyChannelTransactionParameters o_conv;
16034 o_conv.inner = untag_ptr(o);
16035 o_conv.is_owned = ptr_is_owned(o);
16036 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16037 o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv);
16038 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16039 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv);
16040 return tag_ptr(ret_conv, true);
16043 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16044 void* e_ptr = untag_ptr(e);
16045 CHECK_ACCESS(e_ptr);
16046 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16047 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16048 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16049 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
16050 return tag_ptr(ret_conv, true);
16053 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16054 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
16055 jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
16059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16060 if (!ptr_is_owned(_res)) return;
16061 void* _res_ptr = untag_ptr(_res);
16062 CHECK_ACCESS(_res_ptr);
16063 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
16064 FREE(untag_ptr(_res));
16065 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
16068 static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
16069 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16070 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg);
16071 return tag_ptr(ret_conv, true);
16073 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16074 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
16075 int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
16079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16080 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
16081 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16082 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
16083 return tag_ptr(ret_conv, true);
16086 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16087 LDKChannelTransactionParameters o_conv;
16088 o_conv.inner = untag_ptr(o);
16089 o_conv.is_owned = ptr_is_owned(o);
16090 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16091 o_conv = ChannelTransactionParameters_clone(&o_conv);
16092 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16093 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv);
16094 return tag_ptr(ret_conv, true);
16097 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16098 void* e_ptr = untag_ptr(e);
16099 CHECK_ACCESS(e_ptr);
16100 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16101 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16102 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16103 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
16104 return tag_ptr(ret_conv, true);
16107 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16108 LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
16109 jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
16113 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16114 if (!ptr_is_owned(_res)) return;
16115 void* _res_ptr = untag_ptr(_res);
16116 CHECK_ACCESS(_res_ptr);
16117 LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
16118 FREE(untag_ptr(_res));
16119 CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
16122 static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
16123 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16124 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg);
16125 return tag_ptr(ret_conv, true);
16127 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16128 LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
16129 int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
16133 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16134 LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
16135 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16136 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
16137 return tag_ptr(ret_conv, true);
16140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
16141 LDKCVec_SignatureZ _res_constr;
16142 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16143 if (_res_constr.datalen > 0)
16144 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
16146 _res_constr.data = NULL;
16147 for (size_t i = 0; i < _res_constr.datalen; i++) {
16148 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
16149 LDKSignature _res_conv_8_ref;
16150 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 64);
16151 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 64, _res_conv_8_ref.compact_form);
16152 _res_constr.data[i] = _res_conv_8_ref;
16154 CVec_SignatureZ_free(_res_constr);
16157 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16158 LDKHolderCommitmentTransaction o_conv;
16159 o_conv.inner = untag_ptr(o);
16160 o_conv.is_owned = ptr_is_owned(o);
16161 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16162 o_conv = HolderCommitmentTransaction_clone(&o_conv);
16163 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16164 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv);
16165 return tag_ptr(ret_conv, true);
16168 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16169 void* e_ptr = untag_ptr(e);
16170 CHECK_ACCESS(e_ptr);
16171 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16172 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16173 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16174 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
16175 return tag_ptr(ret_conv, true);
16178 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16179 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
16180 jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
16184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16185 if (!ptr_is_owned(_res)) return;
16186 void* _res_ptr = untag_ptr(_res);
16187 CHECK_ACCESS(_res_ptr);
16188 LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
16189 FREE(untag_ptr(_res));
16190 CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
16193 static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
16194 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16195 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg);
16196 return tag_ptr(ret_conv, true);
16198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16199 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
16200 int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
16204 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16205 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
16206 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16207 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv);
16208 return tag_ptr(ret_conv, true);
16211 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16212 LDKBuiltCommitmentTransaction o_conv;
16213 o_conv.inner = untag_ptr(o);
16214 o_conv.is_owned = ptr_is_owned(o);
16215 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16216 o_conv = BuiltCommitmentTransaction_clone(&o_conv);
16217 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
16218 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv);
16219 return tag_ptr(ret_conv, true);
16222 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16223 void* e_ptr = untag_ptr(e);
16224 CHECK_ACCESS(e_ptr);
16225 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16226 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16227 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
16228 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
16229 return tag_ptr(ret_conv, true);
16232 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16233 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
16234 jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
16238 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16239 if (!ptr_is_owned(_res)) return;
16240 void* _res_ptr = untag_ptr(_res);
16241 CHECK_ACCESS(_res_ptr);
16242 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
16243 FREE(untag_ptr(_res));
16244 CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
16247 static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
16248 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
16249 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg);
16250 return tag_ptr(ret_conv, true);
16252 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16253 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
16254 int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
16258 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16259 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
16260 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
16261 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv);
16262 return tag_ptr(ret_conv, true);
16265 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16266 LDKTrustedClosingTransaction o_conv;
16267 o_conv.inner = untag_ptr(o);
16268 o_conv.is_owned = ptr_is_owned(o);
16269 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16270 // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction
16272 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
16273 *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv);
16274 return tag_ptr(ret_conv, true);
16277 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1err(JNIEnv *env, jclass clz) {
16278 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
16279 *ret_conv = CResult_TrustedClosingTransactionNoneZ_err();
16280 return tag_ptr(ret_conv, true);
16283 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16284 LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o);
16285 jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv);
16289 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16290 if (!ptr_is_owned(_res)) return;
16291 void* _res_ptr = untag_ptr(_res);
16292 CHECK_ACCESS(_res_ptr);
16293 LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
16294 FREE(untag_ptr(_res));
16295 CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
16298 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16299 LDKCommitmentTransaction o_conv;
16300 o_conv.inner = untag_ptr(o);
16301 o_conv.is_owned = ptr_is_owned(o);
16302 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16303 o_conv = CommitmentTransaction_clone(&o_conv);
16304 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
16305 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv);
16306 return tag_ptr(ret_conv, true);
16309 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16310 void* e_ptr = untag_ptr(e);
16311 CHECK_ACCESS(e_ptr);
16312 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16313 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16314 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
16315 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
16316 return tag_ptr(ret_conv, true);
16319 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16320 LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o);
16321 jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv);
16325 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16326 if (!ptr_is_owned(_res)) return;
16327 void* _res_ptr = untag_ptr(_res);
16328 CHECK_ACCESS(_res_ptr);
16329 LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
16330 FREE(untag_ptr(_res));
16331 CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
16334 static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
16335 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
16336 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg);
16337 return tag_ptr(ret_conv, true);
16339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16340 LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
16341 int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
16345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16346 LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
16347 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
16348 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv);
16349 return tag_ptr(ret_conv, true);
16352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16353 LDKTrustedCommitmentTransaction o_conv;
16354 o_conv.inner = untag_ptr(o);
16355 o_conv.is_owned = ptr_is_owned(o);
16356 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16357 // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction
16359 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
16360 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv);
16361 return tag_ptr(ret_conv, true);
16364 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1err(JNIEnv *env, jclass clz) {
16365 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
16366 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err();
16367 return tag_ptr(ret_conv, true);
16370 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16371 LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o);
16372 jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv);
16376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16377 if (!ptr_is_owned(_res)) return;
16378 void* _res_ptr = untag_ptr(_res);
16379 CHECK_ACCESS(_res_ptr);
16380 LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
16381 FREE(untag_ptr(_res));
16382 CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
16385 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) {
16386 LDKCVec_SignatureZ o_constr;
16387 o_constr.datalen = (*env)->GetArrayLength(env, o);
16388 if (o_constr.datalen > 0)
16389 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
16391 o_constr.data = NULL;
16392 for (size_t i = 0; i < o_constr.datalen; i++) {
16393 int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
16394 LDKSignature o_conv_8_ref;
16395 CHECK((*env)->GetArrayLength(env, o_conv_8) == 64);
16396 (*env)->GetByteArrayRegion(env, o_conv_8, 0, 64, o_conv_8_ref.compact_form);
16397 o_constr.data[i] = o_conv_8_ref;
16399 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
16400 *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
16401 return tag_ptr(ret_conv, true);
16404 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv *env, jclass clz) {
16405 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
16406 *ret_conv = CResult_CVec_SignatureZNoneZ_err();
16407 return tag_ptr(ret_conv, true);
16410 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16411 LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(o);
16412 jboolean ret_conv = CResult_CVec_SignatureZNoneZ_is_ok(o_conv);
16416 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16417 if (!ptr_is_owned(_res)) return;
16418 void* _res_ptr = untag_ptr(_res);
16419 CHECK_ACCESS(_res_ptr);
16420 LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
16421 FREE(untag_ptr(_res));
16422 CResult_CVec_SignatureZNoneZ_free(_res_conv);
16425 static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) {
16426 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
16427 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg);
16428 return tag_ptr(ret_conv, true);
16430 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16431 LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(arg);
16432 int64_t ret_conv = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv);
16436 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16437 LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(orig);
16438 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
16439 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv);
16440 return tag_ptr(ret_conv, true);
16443 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16444 LDKShutdownScript o_conv;
16445 o_conv.inner = untag_ptr(o);
16446 o_conv.is_owned = ptr_is_owned(o);
16447 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16448 o_conv = ShutdownScript_clone(&o_conv);
16449 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
16450 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv);
16451 return tag_ptr(ret_conv, true);
16454 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16455 void* e_ptr = untag_ptr(e);
16456 CHECK_ACCESS(e_ptr);
16457 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16458 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16459 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
16460 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
16461 return tag_ptr(ret_conv, true);
16464 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16465 LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o);
16466 jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv);
16470 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16471 if (!ptr_is_owned(_res)) return;
16472 void* _res_ptr = untag_ptr(_res);
16473 CHECK_ACCESS(_res_ptr);
16474 LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
16475 FREE(untag_ptr(_res));
16476 CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
16479 static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) {
16480 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
16481 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg);
16482 return tag_ptr(ret_conv, true);
16484 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16485 LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg);
16486 int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv);
16490 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16491 LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig);
16492 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
16493 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv);
16494 return tag_ptr(ret_conv, true);
16497 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16498 LDKShutdownScript o_conv;
16499 o_conv.inner = untag_ptr(o);
16500 o_conv.is_owned = ptr_is_owned(o);
16501 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16502 o_conv = ShutdownScript_clone(&o_conv);
16503 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
16504 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv);
16505 return tag_ptr(ret_conv, true);
16508 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16509 LDKInvalidShutdownScript e_conv;
16510 e_conv.inner = untag_ptr(e);
16511 e_conv.is_owned = ptr_is_owned(e);
16512 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16513 e_conv = InvalidShutdownScript_clone(&e_conv);
16514 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
16515 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
16516 return tag_ptr(ret_conv, true);
16519 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16520 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o);
16521 jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv);
16525 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16526 if (!ptr_is_owned(_res)) return;
16527 void* _res_ptr = untag_ptr(_res);
16528 CHECK_ACCESS(_res_ptr);
16529 LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
16530 FREE(untag_ptr(_res));
16531 CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
16534 static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) {
16535 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
16536 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg);
16537 return tag_ptr(ret_conv, true);
16539 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16540 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg);
16541 int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv);
16545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16546 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig);
16547 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
16548 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
16549 return tag_ptr(ret_conv, true);
16552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1some(JNIEnv *env, jclass clz, int64_t o) {
16553 void* o_ptr = untag_ptr(o);
16554 CHECK_ACCESS(o_ptr);
16555 LDKWriteableScore o_conv = *(LDKWriteableScore*)(o_ptr);
16556 if (o_conv.free == LDKWriteableScore_JCalls_free) {
16557 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
16558 LDKWriteableScore_JCalls_cloned(&o_conv);
16560 LDKCOption_WriteableScoreZ *ret_copy = MALLOC(sizeof(LDKCOption_WriteableScoreZ), "LDKCOption_WriteableScoreZ");
16561 *ret_copy = COption_WriteableScoreZ_some(o_conv);
16562 int64_t ret_ref = tag_ptr(ret_copy, true);
16566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1none(JNIEnv *env, jclass clz) {
16567 LDKCOption_WriteableScoreZ *ret_copy = MALLOC(sizeof(LDKCOption_WriteableScoreZ), "LDKCOption_WriteableScoreZ");
16568 *ret_copy = COption_WriteableScoreZ_none();
16569 int64_t ret_ref = tag_ptr(ret_copy, true);
16573 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16574 if (!ptr_is_owned(_res)) return;
16575 void* _res_ptr = untag_ptr(_res);
16576 CHECK_ACCESS(_res_ptr);
16577 LDKCOption_WriteableScoreZ _res_conv = *(LDKCOption_WriteableScoreZ*)(_res_ptr);
16578 FREE(untag_ptr(_res));
16579 COption_WriteableScoreZ_free(_res_conv);
16582 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1ok(JNIEnv *env, jclass clz) {
16583 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
16584 *ret_conv = CResult_NoneErrorZ_ok();
16585 return tag_ptr(ret_conv, true);
16588 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
16589 LDKIOError e_conv = LDKIOError_from_java(env, e);
16590 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
16591 *ret_conv = CResult_NoneErrorZ_err(e_conv);
16592 return tag_ptr(ret_conv, true);
16595 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16596 LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o);
16597 jboolean ret_conv = CResult_NoneErrorZ_is_ok(o_conv);
16601 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16602 if (!ptr_is_owned(_res)) return;
16603 void* _res_ptr = untag_ptr(_res);
16604 CHECK_ACCESS(_res_ptr);
16605 LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
16606 FREE(untag_ptr(_res));
16607 CResult_NoneErrorZ_free(_res_conv);
16610 static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) {
16611 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
16612 *ret_conv = CResult_NoneErrorZ_clone(arg);
16613 return tag_ptr(ret_conv, true);
16615 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16616 LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg);
16617 int64_t ret_conv = CResult_NoneErrorZ_clone_ptr(arg_conv);
16621 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16622 LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig);
16623 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
16624 *ret_conv = CResult_NoneErrorZ_clone(orig_conv);
16625 return tag_ptr(ret_conv, true);
16628 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16629 LDKRouteHop o_conv;
16630 o_conv.inner = untag_ptr(o);
16631 o_conv.is_owned = ptr_is_owned(o);
16632 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16633 o_conv = RouteHop_clone(&o_conv);
16634 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
16635 *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
16636 return tag_ptr(ret_conv, true);
16639 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16640 void* e_ptr = untag_ptr(e);
16641 CHECK_ACCESS(e_ptr);
16642 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16643 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16644 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
16645 *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
16646 return tag_ptr(ret_conv, true);
16649 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16650 LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
16651 jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
16655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16656 if (!ptr_is_owned(_res)) return;
16657 void* _res_ptr = untag_ptr(_res);
16658 CHECK_ACCESS(_res_ptr);
16659 LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
16660 FREE(untag_ptr(_res));
16661 CResult_RouteHopDecodeErrorZ_free(_res_conv);
16664 static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
16665 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
16666 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
16667 return tag_ptr(ret_conv, true);
16669 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16670 LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
16671 int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
16675 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16676 LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
16677 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
16678 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
16679 return tag_ptr(ret_conv, true);
16682 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16683 LDKCVec_RouteHopZ _res_constr;
16684 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16685 if (_res_constr.datalen > 0)
16686 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
16688 _res_constr.data = NULL;
16689 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16690 for (size_t k = 0; k < _res_constr.datalen; k++) {
16691 int64_t _res_conv_10 = _res_vals[k];
16692 LDKRouteHop _res_conv_10_conv;
16693 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
16694 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
16695 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
16696 _res_constr.data[k] = _res_conv_10_conv;
16698 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16699 CVec_RouteHopZ_free(_res_constr);
16702 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
16703 LDKCVec_CVec_RouteHopZZ _res_constr;
16704 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16705 if (_res_constr.datalen > 0)
16706 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
16708 _res_constr.data = NULL;
16709 for (size_t m = 0; m < _res_constr.datalen; m++) {
16710 int64_tArray _res_conv_12 = (*env)->GetObjectArrayElement(env, _res, m);
16711 LDKCVec_RouteHopZ _res_conv_12_constr;
16712 _res_conv_12_constr.datalen = (*env)->GetArrayLength(env, _res_conv_12);
16713 if (_res_conv_12_constr.datalen > 0)
16714 _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
16716 _res_conv_12_constr.data = NULL;
16717 int64_t* _res_conv_12_vals = (*env)->GetLongArrayElements (env, _res_conv_12, NULL);
16718 for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
16719 int64_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
16720 LDKRouteHop _res_conv_12_conv_10_conv;
16721 _res_conv_12_conv_10_conv.inner = untag_ptr(_res_conv_12_conv_10);
16722 _res_conv_12_conv_10_conv.is_owned = ptr_is_owned(_res_conv_12_conv_10);
16723 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
16724 _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
16726 (*env)->ReleaseLongArrayElements(env, _res_conv_12, _res_conv_12_vals, 0);
16727 _res_constr.data[m] = _res_conv_12_constr;
16729 CVec_CVec_RouteHopZZ_free(_res_constr);
16732 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16734 o_conv.inner = untag_ptr(o);
16735 o_conv.is_owned = ptr_is_owned(o);
16736 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16737 o_conv = Route_clone(&o_conv);
16738 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
16739 *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv);
16740 return tag_ptr(ret_conv, true);
16743 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16744 void* e_ptr = untag_ptr(e);
16745 CHECK_ACCESS(e_ptr);
16746 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16747 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16748 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
16749 *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
16750 return tag_ptr(ret_conv, true);
16753 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16754 LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(o);
16755 jboolean ret_conv = CResult_RouteDecodeErrorZ_is_ok(o_conv);
16759 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16760 if (!ptr_is_owned(_res)) return;
16761 void* _res_ptr = untag_ptr(_res);
16762 CHECK_ACCESS(_res_ptr);
16763 LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
16764 FREE(untag_ptr(_res));
16765 CResult_RouteDecodeErrorZ_free(_res_conv);
16768 static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) {
16769 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
16770 *ret_conv = CResult_RouteDecodeErrorZ_clone(arg);
16771 return tag_ptr(ret_conv, true);
16773 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16774 LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(arg);
16775 int64_t ret_conv = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv);
16779 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16780 LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(orig);
16781 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
16782 *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv);
16783 return tag_ptr(ret_conv, true);
16786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16787 LDKRouteParameters o_conv;
16788 o_conv.inner = untag_ptr(o);
16789 o_conv.is_owned = ptr_is_owned(o);
16790 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16791 o_conv = RouteParameters_clone(&o_conv);
16792 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
16793 *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
16794 return tag_ptr(ret_conv, true);
16797 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16798 void* e_ptr = untag_ptr(e);
16799 CHECK_ACCESS(e_ptr);
16800 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16801 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16802 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
16803 *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
16804 return tag_ptr(ret_conv, true);
16807 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16808 LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(o);
16809 jboolean ret_conv = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv);
16813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16814 if (!ptr_is_owned(_res)) return;
16815 void* _res_ptr = untag_ptr(_res);
16816 CHECK_ACCESS(_res_ptr);
16817 LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
16818 FREE(untag_ptr(_res));
16819 CResult_RouteParametersDecodeErrorZ_free(_res_conv);
16822 static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) {
16823 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
16824 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg);
16825 return tag_ptr(ret_conv, true);
16827 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16828 LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(arg);
16829 int64_t ret_conv = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv);
16833 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16834 LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(orig);
16835 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
16836 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
16837 return tag_ptr(ret_conv, true);
16840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16841 LDKCVec_RouteHintZ _res_constr;
16842 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16843 if (_res_constr.datalen > 0)
16844 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
16846 _res_constr.data = NULL;
16847 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16848 for (size_t l = 0; l < _res_constr.datalen; l++) {
16849 int64_t _res_conv_11 = _res_vals[l];
16850 LDKRouteHint _res_conv_11_conv;
16851 _res_conv_11_conv.inner = untag_ptr(_res_conv_11);
16852 _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11);
16853 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
16854 _res_constr.data[l] = _res_conv_11_conv;
16856 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16857 CVec_RouteHintZ_free(_res_constr);
16860 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) {
16861 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
16862 *ret_copy = COption_u64Z_some(o);
16863 int64_t ret_ref = tag_ptr(ret_copy, true);
16867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) {
16868 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
16869 *ret_copy = COption_u64Z_none();
16870 int64_t ret_ref = tag_ptr(ret_copy, true);
16874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
16875 if (!ptr_is_owned(_res)) return;
16876 void* _res_ptr = untag_ptr(_res);
16877 CHECK_ACCESS(_res_ptr);
16878 LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
16879 FREE(untag_ptr(_res));
16880 COption_u64Z_free(_res_conv);
16883 static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
16884 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
16885 *ret_copy = COption_u64Z_clone(arg);
16886 int64_t ret_ref = tag_ptr(ret_copy, true);
16889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16890 LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
16891 int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
16895 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16896 LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
16897 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
16898 *ret_copy = COption_u64Z_clone(orig_conv);
16899 int64_t ret_ref = tag_ptr(ret_copy, true);
16903 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16904 LDKCVec_u64Z _res_constr;
16905 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16906 if (_res_constr.datalen > 0)
16907 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
16909 _res_constr.data = NULL;
16910 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16911 for (size_t g = 0; g < _res_constr.datalen; g++) {
16912 int64_t _res_conv_6 = _res_vals[g];
16913 _res_constr.data[g] = _res_conv_6;
16915 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16916 CVec_u64Z_free(_res_constr);
16919 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16920 LDKPaymentParameters o_conv;
16921 o_conv.inner = untag_ptr(o);
16922 o_conv.is_owned = ptr_is_owned(o);
16923 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16924 o_conv = PaymentParameters_clone(&o_conv);
16925 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
16926 *ret_conv = CResult_PaymentParametersDecodeErrorZ_ok(o_conv);
16927 return tag_ptr(ret_conv, true);
16930 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16931 void* e_ptr = untag_ptr(e);
16932 CHECK_ACCESS(e_ptr);
16933 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16934 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16935 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
16936 *ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
16937 return tag_ptr(ret_conv, true);
16940 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16941 LDKCResult_PaymentParametersDecodeErrorZ* o_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(o);
16942 jboolean ret_conv = CResult_PaymentParametersDecodeErrorZ_is_ok(o_conv);
16946 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16947 if (!ptr_is_owned(_res)) return;
16948 void* _res_ptr = untag_ptr(_res);
16949 CHECK_ACCESS(_res_ptr);
16950 LDKCResult_PaymentParametersDecodeErrorZ _res_conv = *(LDKCResult_PaymentParametersDecodeErrorZ*)(_res_ptr);
16951 FREE(untag_ptr(_res));
16952 CResult_PaymentParametersDecodeErrorZ_free(_res_conv);
16955 static inline uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg) {
16956 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
16957 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(arg);
16958 return tag_ptr(ret_conv, true);
16960 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16961 LDKCResult_PaymentParametersDecodeErrorZ* arg_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(arg);
16962 int64_t ret_conv = CResult_PaymentParametersDecodeErrorZ_clone_ptr(arg_conv);
16966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16967 LDKCResult_PaymentParametersDecodeErrorZ* orig_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(orig);
16968 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
16969 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(orig_conv);
16970 return tag_ptr(ret_conv, true);
16973 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16974 LDKCVec_RouteHintHopZ _res_constr;
16975 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16976 if (_res_constr.datalen > 0)
16977 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
16979 _res_constr.data = NULL;
16980 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16981 for (size_t o = 0; o < _res_constr.datalen; o++) {
16982 int64_t _res_conv_14 = _res_vals[o];
16983 LDKRouteHintHop _res_conv_14_conv;
16984 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
16985 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
16986 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
16987 _res_constr.data[o] = _res_conv_14_conv;
16989 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16990 CVec_RouteHintHopZ_free(_res_constr);
16993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16994 LDKRouteHint o_conv;
16995 o_conv.inner = untag_ptr(o);
16996 o_conv.is_owned = ptr_is_owned(o);
16997 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16998 o_conv = RouteHint_clone(&o_conv);
16999 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
17000 *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
17001 return tag_ptr(ret_conv, true);
17004 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17005 void* e_ptr = untag_ptr(e);
17006 CHECK_ACCESS(e_ptr);
17007 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17008 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17009 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
17010 *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
17011 return tag_ptr(ret_conv, true);
17014 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17015 LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(o);
17016 jboolean ret_conv = CResult_RouteHintDecodeErrorZ_is_ok(o_conv);
17020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17021 if (!ptr_is_owned(_res)) return;
17022 void* _res_ptr = untag_ptr(_res);
17023 CHECK_ACCESS(_res_ptr);
17024 LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
17025 FREE(untag_ptr(_res));
17026 CResult_RouteHintDecodeErrorZ_free(_res_conv);
17029 static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) {
17030 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
17031 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg);
17032 return tag_ptr(ret_conv, true);
17034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17035 LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(arg);
17036 int64_t ret_conv = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv);
17040 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17041 LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(orig);
17042 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
17043 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
17044 return tag_ptr(ret_conv, true);
17047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17048 LDKRouteHintHop o_conv;
17049 o_conv.inner = untag_ptr(o);
17050 o_conv.is_owned = ptr_is_owned(o);
17051 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17052 o_conv = RouteHintHop_clone(&o_conv);
17053 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
17054 *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
17055 return tag_ptr(ret_conv, true);
17058 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17059 void* e_ptr = untag_ptr(e);
17060 CHECK_ACCESS(e_ptr);
17061 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17062 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17063 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
17064 *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
17065 return tag_ptr(ret_conv, true);
17068 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17069 LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(o);
17070 jboolean ret_conv = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv);
17074 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17075 if (!ptr_is_owned(_res)) return;
17076 void* _res_ptr = untag_ptr(_res);
17077 CHECK_ACCESS(_res_ptr);
17078 LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
17079 FREE(untag_ptr(_res));
17080 CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
17083 static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) {
17084 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
17085 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg);
17086 return tag_ptr(ret_conv, true);
17088 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17089 LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(arg);
17090 int64_t ret_conv = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv);
17094 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17095 LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(orig);
17096 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
17097 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
17098 return tag_ptr(ret_conv, true);
17101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17102 LDKCVec_ChannelDetailsZ _res_constr;
17103 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17104 if (_res_constr.datalen > 0)
17105 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
17107 _res_constr.data = NULL;
17108 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17109 for (size_t q = 0; q < _res_constr.datalen; q++) {
17110 int64_t _res_conv_16 = _res_vals[q];
17111 LDKChannelDetails _res_conv_16_conv;
17112 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
17113 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
17114 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
17115 _res_constr.data[q] = _res_conv_16_conv;
17117 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17118 CVec_ChannelDetailsZ_free(_res_constr);
17121 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17123 o_conv.inner = untag_ptr(o);
17124 o_conv.is_owned = ptr_is_owned(o);
17125 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17126 o_conv = Route_clone(&o_conv);
17127 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17128 *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
17129 return tag_ptr(ret_conv, true);
17132 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17133 LDKLightningError e_conv;
17134 e_conv.inner = untag_ptr(e);
17135 e_conv.is_owned = ptr_is_owned(e);
17136 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17137 e_conv = LightningError_clone(&e_conv);
17138 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17139 *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
17140 return tag_ptr(ret_conv, true);
17143 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17144 LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
17145 jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
17149 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17150 if (!ptr_is_owned(_res)) return;
17151 void* _res_ptr = untag_ptr(_res);
17152 CHECK_ACCESS(_res_ptr);
17153 LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
17154 FREE(untag_ptr(_res));
17155 CResult_RouteLightningErrorZ_free(_res_conv);
17158 static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
17159 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17160 *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
17161 return tag_ptr(ret_conv, true);
17163 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17164 LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
17165 int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
17169 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17170 LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
17171 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17172 *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
17173 return tag_ptr(ret_conv, true);
17176 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17177 void* o_ptr = untag_ptr(o);
17178 CHECK_ACCESS(o_ptr);
17179 LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
17180 o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
17181 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
17182 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
17183 return tag_ptr(ret_conv, true);
17186 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17187 void* e_ptr = untag_ptr(e);
17188 CHECK_ACCESS(e_ptr);
17189 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17190 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17191 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
17192 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
17193 return tag_ptr(ret_conv, true);
17196 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17197 LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
17198 jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
17202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17203 if (!ptr_is_owned(_res)) return;
17204 void* _res_ptr = untag_ptr(_res);
17205 CHECK_ACCESS(_res_ptr);
17206 LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
17207 FREE(untag_ptr(_res));
17208 CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
17211 static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
17212 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
17213 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
17214 return tag_ptr(ret_conv, true);
17216 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17217 LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
17218 int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
17222 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17223 LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
17224 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
17225 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
17226 return tag_ptr(ret_conv, true);
17229 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some(JNIEnv *env, jclass clz, int64_t o) {
17230 void* o_ptr = untag_ptr(o);
17231 CHECK_ACCESS(o_ptr);
17232 LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr);
17233 o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o));
17234 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
17235 *ret_copy = COption_ClosureReasonZ_some(o_conv);
17236 int64_t ret_ref = tag_ptr(ret_copy, true);
17240 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none(JNIEnv *env, jclass clz) {
17241 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
17242 *ret_copy = COption_ClosureReasonZ_none();
17243 int64_t ret_ref = tag_ptr(ret_copy, true);
17247 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17248 if (!ptr_is_owned(_res)) return;
17249 void* _res_ptr = untag_ptr(_res);
17250 CHECK_ACCESS(_res_ptr);
17251 LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr);
17252 FREE(untag_ptr(_res));
17253 COption_ClosureReasonZ_free(_res_conv);
17256 static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) {
17257 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
17258 *ret_copy = COption_ClosureReasonZ_clone(arg);
17259 int64_t ret_ref = tag_ptr(ret_copy, true);
17262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17263 LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg);
17264 int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv);
17268 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17269 LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig);
17270 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
17271 *ret_copy = COption_ClosureReasonZ_clone(orig_conv);
17272 int64_t ret_ref = tag_ptr(ret_copy, true);
17276 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17277 void* o_ptr = untag_ptr(o);
17278 CHECK_ACCESS(o_ptr);
17279 LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr);
17280 o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o));
17281 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
17282 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv);
17283 return tag_ptr(ret_conv, true);
17286 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17287 void* e_ptr = untag_ptr(e);
17288 CHECK_ACCESS(e_ptr);
17289 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17290 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17291 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
17292 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
17293 return tag_ptr(ret_conv, true);
17296 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17297 LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o);
17298 jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv);
17302 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17303 if (!ptr_is_owned(_res)) return;
17304 void* _res_ptr = untag_ptr(_res);
17305 CHECK_ACCESS(_res_ptr);
17306 LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr);
17307 FREE(untag_ptr(_res));
17308 CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv);
17311 static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) {
17312 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
17313 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg);
17314 return tag_ptr(ret_conv, true);
17316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17317 LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg);
17318 int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv);
17322 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17323 LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig);
17324 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
17325 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv);
17326 return tag_ptr(ret_conv, true);
17329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1some(JNIEnv *env, jclass clz, int64_t o) {
17330 void* o_ptr = untag_ptr(o);
17331 CHECK_ACCESS(o_ptr);
17332 LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr);
17333 o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o));
17334 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
17335 *ret_copy = COption_HTLCDestinationZ_some(o_conv);
17336 int64_t ret_ref = tag_ptr(ret_copy, true);
17340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1none(JNIEnv *env, jclass clz) {
17341 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
17342 *ret_copy = COption_HTLCDestinationZ_none();
17343 int64_t ret_ref = tag_ptr(ret_copy, true);
17347 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17348 if (!ptr_is_owned(_res)) return;
17349 void* _res_ptr = untag_ptr(_res);
17350 CHECK_ACCESS(_res_ptr);
17351 LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr);
17352 FREE(untag_ptr(_res));
17353 COption_HTLCDestinationZ_free(_res_conv);
17356 static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) {
17357 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
17358 *ret_copy = COption_HTLCDestinationZ_clone(arg);
17359 int64_t ret_ref = tag_ptr(ret_copy, true);
17362 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17363 LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg);
17364 int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv);
17368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17369 LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig);
17370 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
17371 *ret_copy = COption_HTLCDestinationZ_clone(orig_conv);
17372 int64_t ret_ref = tag_ptr(ret_copy, true);
17376 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17377 void* o_ptr = untag_ptr(o);
17378 CHECK_ACCESS(o_ptr);
17379 LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr);
17380 o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o));
17381 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
17382 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv);
17383 return tag_ptr(ret_conv, true);
17386 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17387 void* e_ptr = untag_ptr(e);
17388 CHECK_ACCESS(e_ptr);
17389 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17390 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17391 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
17392 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
17393 return tag_ptr(ret_conv, true);
17396 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17397 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o);
17398 jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv);
17402 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17403 if (!ptr_is_owned(_res)) return;
17404 void* _res_ptr = untag_ptr(_res);
17405 CHECK_ACCESS(_res_ptr);
17406 LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr);
17407 FREE(untag_ptr(_res));
17408 CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv);
17411 static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) {
17412 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
17413 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg);
17414 return tag_ptr(ret_conv, true);
17416 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17417 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg);
17418 int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv);
17422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17423 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig);
17424 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
17425 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv);
17426 return tag_ptr(ret_conv, true);
17429 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) {
17430 void* o_ptr = untag_ptr(o);
17431 CHECK_ACCESS(o_ptr);
17432 LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
17433 o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
17434 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
17435 *ret_copy = COption_NetworkUpdateZ_some(o_conv);
17436 int64_t ret_ref = tag_ptr(ret_copy, true);
17440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1none(JNIEnv *env, jclass clz) {
17441 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
17442 *ret_copy = COption_NetworkUpdateZ_none();
17443 int64_t ret_ref = tag_ptr(ret_copy, true);
17447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17448 if (!ptr_is_owned(_res)) return;
17449 void* _res_ptr = untag_ptr(_res);
17450 CHECK_ACCESS(_res_ptr);
17451 LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
17452 FREE(untag_ptr(_res));
17453 COption_NetworkUpdateZ_free(_res_conv);
17456 static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
17457 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
17458 *ret_copy = COption_NetworkUpdateZ_clone(arg);
17459 int64_t ret_ref = tag_ptr(ret_copy, true);
17462 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17463 LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
17464 int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
17468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17469 LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
17470 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
17471 *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
17472 int64_t ret_ref = tag_ptr(ret_copy, true);
17476 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17477 LDKCVec_SpendableOutputDescriptorZ _res_constr;
17478 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17479 if (_res_constr.datalen > 0)
17480 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
17482 _res_constr.data = NULL;
17483 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17484 for (size_t b = 0; b < _res_constr.datalen; b++) {
17485 int64_t _res_conv_27 = _res_vals[b];
17486 void* _res_conv_27_ptr = untag_ptr(_res_conv_27);
17487 CHECK_ACCESS(_res_conv_27_ptr);
17488 LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
17489 FREE(untag_ptr(_res_conv_27));
17490 _res_constr.data[b] = _res_conv_27_conv;
17492 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17493 CVec_SpendableOutputDescriptorZ_free(_res_constr);
17496 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some(JNIEnv *env, jclass clz, int64_t o) {
17497 void* o_ptr = untag_ptr(o);
17498 CHECK_ACCESS(o_ptr);
17499 LDKEvent o_conv = *(LDKEvent*)(o_ptr);
17500 o_conv = Event_clone((LDKEvent*)untag_ptr(o));
17501 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
17502 *ret_copy = COption_EventZ_some(o_conv);
17503 int64_t ret_ref = tag_ptr(ret_copy, true);
17507 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none(JNIEnv *env, jclass clz) {
17508 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
17509 *ret_copy = COption_EventZ_none();
17510 int64_t ret_ref = tag_ptr(ret_copy, true);
17514 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17515 if (!ptr_is_owned(_res)) return;
17516 void* _res_ptr = untag_ptr(_res);
17517 CHECK_ACCESS(_res_ptr);
17518 LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr);
17519 FREE(untag_ptr(_res));
17520 COption_EventZ_free(_res_conv);
17523 static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) {
17524 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
17525 *ret_copy = COption_EventZ_clone(arg);
17526 int64_t ret_ref = tag_ptr(ret_copy, true);
17529 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17530 LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg);
17531 int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv);
17535 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17536 LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig);
17537 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
17538 *ret_copy = COption_EventZ_clone(orig_conv);
17539 int64_t ret_ref = tag_ptr(ret_copy, true);
17543 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17544 void* o_ptr = untag_ptr(o);
17545 CHECK_ACCESS(o_ptr);
17546 LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr);
17547 o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o));
17548 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
17549 *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv);
17550 return tag_ptr(ret_conv, true);
17553 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17554 void* e_ptr = untag_ptr(e);
17555 CHECK_ACCESS(e_ptr);
17556 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17557 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17558 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
17559 *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
17560 return tag_ptr(ret_conv, true);
17563 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17564 LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o);
17565 jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv);
17569 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17570 if (!ptr_is_owned(_res)) return;
17571 void* _res_ptr = untag_ptr(_res);
17572 CHECK_ACCESS(_res_ptr);
17573 LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr);
17574 FREE(untag_ptr(_res));
17575 CResult_COption_EventZDecodeErrorZ_free(_res_conv);
17578 static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) {
17579 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
17580 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg);
17581 return tag_ptr(ret_conv, true);
17583 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17584 LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg);
17585 int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv);
17589 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17590 LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig);
17591 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
17592 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv);
17593 return tag_ptr(ret_conv, true);
17596 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17597 LDKCVec_MessageSendEventZ _res_constr;
17598 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17599 if (_res_constr.datalen > 0)
17600 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
17602 _res_constr.data = NULL;
17603 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17604 for (size_t s = 0; s < _res_constr.datalen; s++) {
17605 int64_t _res_conv_18 = _res_vals[s];
17606 void* _res_conv_18_ptr = untag_ptr(_res_conv_18);
17607 CHECK_ACCESS(_res_conv_18_ptr);
17608 LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
17609 FREE(untag_ptr(_res_conv_18));
17610 _res_constr.data[s] = _res_conv_18_conv;
17612 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17613 CVec_MessageSendEventZ_free(_res_constr);
17616 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17617 void* o_ptr = untag_ptr(o);
17618 CHECK_ACCESS(o_ptr);
17619 LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
17620 o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
17621 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
17622 *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
17623 return tag_ptr(ret_conv, true);
17626 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
17627 LDKAccessError e_conv = LDKAccessError_from_java(env, e);
17628 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
17629 *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv);
17630 return tag_ptr(ret_conv, true);
17633 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17634 LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(o);
17635 jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv);
17639 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17640 if (!ptr_is_owned(_res)) return;
17641 void* _res_ptr = untag_ptr(_res);
17642 CHECK_ACCESS(_res_ptr);
17643 LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
17644 FREE(untag_ptr(_res));
17645 CResult_TxOutAccessErrorZ_free(_res_conv);
17648 static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) {
17649 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
17650 *ret_conv = CResult_TxOutAccessErrorZ_clone(arg);
17651 return tag_ptr(ret_conv, true);
17653 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17654 LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(arg);
17655 int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv);
17659 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17660 LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(orig);
17661 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
17662 *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv);
17663 return tag_ptr(ret_conv, true);
17666 static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
17667 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
17668 *ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
17669 return tag_ptr(ret_conv, true);
17671 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17672 LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg);
17673 int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv);
17677 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17678 LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig);
17679 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
17680 *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv);
17681 return tag_ptr(ret_conv, true);
17684 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
17685 LDKTransaction b_ref;
17686 b_ref.datalen = (*env)->GetArrayLength(env, b);
17687 b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
17688 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
17689 b_ref.data_is_owned = true;
17690 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
17691 *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref);
17692 return tag_ptr(ret_conv, true);
17695 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17696 if (!ptr_is_owned(_res)) return;
17697 void* _res_ptr = untag_ptr(_res);
17698 CHECK_ACCESS(_res_ptr);
17699 LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
17700 FREE(untag_ptr(_res));
17701 C2Tuple_usizeTransactionZ_free(_res_conv);
17704 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17705 LDKCVec_C2Tuple_usizeTransactionZZ _res_constr;
17706 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17707 if (_res_constr.datalen > 0)
17708 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
17710 _res_constr.data = NULL;
17711 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17712 for (size_t c = 0; c < _res_constr.datalen; c++) {
17713 int64_t _res_conv_28 = _res_vals[c];
17714 void* _res_conv_28_ptr = untag_ptr(_res_conv_28);
17715 CHECK_ACCESS(_res_conv_28_ptr);
17716 LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
17717 FREE(untag_ptr(_res_conv_28));
17718 _res_constr.data[c] = _res_conv_28_conv;
17720 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17721 CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
17724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxidZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
17725 LDKCVec_TxidZ _res_constr;
17726 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17727 if (_res_constr.datalen > 0)
17728 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
17730 _res_constr.data = NULL;
17731 for (size_t i = 0; i < _res_constr.datalen; i++) {
17732 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
17733 LDKThirtyTwoBytes _res_conv_8_ref;
17734 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
17735 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
17736 _res_constr.data[i] = _res_conv_8_ref;
17738 CVec_TxidZ_free(_res_constr);
17741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17742 LDKCVec_MonitorEventZ _res_constr;
17743 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17744 if (_res_constr.datalen > 0)
17745 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
17747 _res_constr.data = NULL;
17748 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17749 for (size_t o = 0; o < _res_constr.datalen; o++) {
17750 int64_t _res_conv_14 = _res_vals[o];
17751 void* _res_conv_14_ptr = untag_ptr(_res_conv_14);
17752 CHECK_ACCESS(_res_conv_14_ptr);
17753 LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
17754 FREE(untag_ptr(_res_conv_14));
17755 _res_constr.data[o] = _res_conv_14_conv;
17757 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17758 CVec_MonitorEventZ_free(_res_constr);
17761 static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) {
17762 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
17763 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg);
17764 return tag_ptr(ret_conv, true);
17766 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17767 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg);
17768 int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv);
17772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17773 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig);
17774 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
17775 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv);
17776 return tag_ptr(ret_conv, true);
17779 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b, int8_tArray c) {
17780 LDKOutPoint a_conv;
17781 a_conv.inner = untag_ptr(a);
17782 a_conv.is_owned = ptr_is_owned(a);
17783 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
17784 a_conv = OutPoint_clone(&a_conv);
17785 LDKCVec_MonitorEventZ b_constr;
17786 b_constr.datalen = (*env)->GetArrayLength(env, b);
17787 if (b_constr.datalen > 0)
17788 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
17790 b_constr.data = NULL;
17791 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
17792 for (size_t o = 0; o < b_constr.datalen; o++) {
17793 int64_t b_conv_14 = b_vals[o];
17794 void* b_conv_14_ptr = untag_ptr(b_conv_14);
17795 CHECK_ACCESS(b_conv_14_ptr);
17796 LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr);
17797 b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14));
17798 b_constr.data[o] = b_conv_14_conv;
17800 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
17801 LDKPublicKey c_ref;
17802 CHECK((*env)->GetArrayLength(env, c) == 33);
17803 (*env)->GetByteArrayRegion(env, c, 0, 33, c_ref.compressed_form);
17804 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
17805 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref);
17806 return tag_ptr(ret_conv, true);
17809 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17810 if (!ptr_is_owned(_res)) return;
17811 void* _res_ptr = untag_ptr(_res);
17812 CHECK_ACCESS(_res_ptr);
17813 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr);
17814 FREE(untag_ptr(_res));
17815 C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv);
17818 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17819 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr;
17820 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17821 if (_res_constr.datalen > 0)
17822 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
17824 _res_constr.data = NULL;
17825 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17826 for (size_t x = 0; x < _res_constr.datalen; x++) {
17827 int64_t _res_conv_49 = _res_vals[x];
17828 void* _res_conv_49_ptr = untag_ptr(_res_conv_49);
17829 CHECK_ACCESS(_res_conv_49_ptr);
17830 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr);
17831 FREE(untag_ptr(_res_conv_49));
17832 _res_constr.data[x] = _res_conv_49_conv;
17834 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17835 CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr);
17838 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17839 LDKFixedPenaltyScorer o_conv;
17840 o_conv.inner = untag_ptr(o);
17841 o_conv.is_owned = ptr_is_owned(o);
17842 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17843 o_conv = FixedPenaltyScorer_clone(&o_conv);
17844 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
17845 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv);
17846 return tag_ptr(ret_conv, true);
17849 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17850 void* e_ptr = untag_ptr(e);
17851 CHECK_ACCESS(e_ptr);
17852 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17853 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17854 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
17855 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
17856 return tag_ptr(ret_conv, true);
17859 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17860 LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o);
17861 jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv);
17865 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17866 if (!ptr_is_owned(_res)) return;
17867 void* _res_ptr = untag_ptr(_res);
17868 CHECK_ACCESS(_res_ptr);
17869 LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr);
17870 FREE(untag_ptr(_res));
17871 CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv);
17874 static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) {
17875 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
17876 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg);
17877 return tag_ptr(ret_conv, true);
17879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17880 LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg);
17881 int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv);
17885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17886 LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig);
17887 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
17888 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv);
17889 return tag_ptr(ret_conv, true);
17892 static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) {
17893 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
17894 *ret_conv = C2Tuple_u64u64Z_clone(arg);
17895 return tag_ptr(ret_conv, true);
17897 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17898 LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg);
17899 int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv);
17903 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17904 LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig);
17905 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
17906 *ret_conv = C2Tuple_u64u64Z_clone(orig_conv);
17907 return tag_ptr(ret_conv, true);
17910 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
17911 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
17912 *ret_conv = C2Tuple_u64u64Z_new(a, b);
17913 return tag_ptr(ret_conv, true);
17916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
17917 if (!ptr_is_owned(_res)) return;
17918 void* _res_ptr = untag_ptr(_res);
17919 CHECK_ACCESS(_res_ptr);
17920 LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr);
17921 FREE(untag_ptr(_res));
17922 C2Tuple_u64u64Z_free(_res_conv);
17925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
17926 void* o_ptr = untag_ptr(o);
17927 CHECK_ACCESS(o_ptr);
17928 LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr);
17929 o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o));
17930 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
17931 *ret_copy = COption_C2Tuple_u64u64ZZ_some(o_conv);
17932 int64_t ret_ref = tag_ptr(ret_copy, true);
17936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1none(JNIEnv *env, jclass clz) {
17937 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
17938 *ret_copy = COption_C2Tuple_u64u64ZZ_none();
17939 int64_t ret_ref = tag_ptr(ret_copy, true);
17943 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17944 if (!ptr_is_owned(_res)) return;
17945 void* _res_ptr = untag_ptr(_res);
17946 CHECK_ACCESS(_res_ptr);
17947 LDKCOption_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr);
17948 FREE(untag_ptr(_res));
17949 COption_C2Tuple_u64u64ZZ_free(_res_conv);
17952 static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) {
17953 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
17954 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg);
17955 int64_t ret_ref = tag_ptr(ret_copy, true);
17958 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17959 LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg);
17960 int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv);
17964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17965 LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig);
17966 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
17967 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_conv);
17968 int64_t ret_ref = tag_ptr(ret_copy, true);
17972 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeIdZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17973 LDKCVec_NodeIdZ _res_constr;
17974 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17975 if (_res_constr.datalen > 0)
17976 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
17978 _res_constr.data = NULL;
17979 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17980 for (size_t i = 0; i < _res_constr.datalen; i++) {
17981 int64_t _res_conv_8 = _res_vals[i];
17982 LDKNodeId _res_conv_8_conv;
17983 _res_conv_8_conv.inner = untag_ptr(_res_conv_8);
17984 _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8);
17985 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv);
17986 _res_constr.data[i] = _res_conv_8_conv;
17988 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17989 CVec_NodeIdZ_free(_res_constr);
17992 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17993 LDKProbabilisticScorer o_conv;
17994 o_conv.inner = untag_ptr(o);
17995 o_conv.is_owned = ptr_is_owned(o);
17996 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17997 // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer
17999 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
18000 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv);
18001 return tag_ptr(ret_conv, true);
18004 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18005 void* e_ptr = untag_ptr(e);
18006 CHECK_ACCESS(e_ptr);
18007 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18008 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18009 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
18010 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
18011 return tag_ptr(ret_conv, true);
18014 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18015 LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o);
18016 jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv);
18020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18021 if (!ptr_is_owned(_res)) return;
18022 void* _res_ptr = untag_ptr(_res);
18023 CHECK_ACCESS(_res_ptr);
18024 LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr);
18025 FREE(untag_ptr(_res));
18026 CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv);
18029 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18030 LDKInitFeatures o_conv;
18031 o_conv.inner = untag_ptr(o);
18032 o_conv.is_owned = ptr_is_owned(o);
18033 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18034 o_conv = InitFeatures_clone(&o_conv);
18035 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18036 *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
18037 return tag_ptr(ret_conv, true);
18040 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18041 void* e_ptr = untag_ptr(e);
18042 CHECK_ACCESS(e_ptr);
18043 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18044 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18045 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18046 *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
18047 return tag_ptr(ret_conv, true);
18050 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18051 LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o);
18052 jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
18056 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18057 if (!ptr_is_owned(_res)) return;
18058 void* _res_ptr = untag_ptr(_res);
18059 CHECK_ACCESS(_res_ptr);
18060 LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
18061 FREE(untag_ptr(_res));
18062 CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
18065 static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18066 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18067 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg);
18068 return tag_ptr(ret_conv, true);
18070 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18071 LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg);
18072 int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18076 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18077 LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig);
18078 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18079 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv);
18080 return tag_ptr(ret_conv, true);
18083 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18084 LDKChannelFeatures o_conv;
18085 o_conv.inner = untag_ptr(o);
18086 o_conv.is_owned = ptr_is_owned(o);
18087 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18088 o_conv = ChannelFeatures_clone(&o_conv);
18089 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18090 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv);
18091 return tag_ptr(ret_conv, true);
18094 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18095 void* e_ptr = untag_ptr(e);
18096 CHECK_ACCESS(e_ptr);
18097 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18098 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18099 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18100 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
18101 return tag_ptr(ret_conv, true);
18104 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18105 LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o);
18106 jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv);
18110 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18111 if (!ptr_is_owned(_res)) return;
18112 void* _res_ptr = untag_ptr(_res);
18113 CHECK_ACCESS(_res_ptr);
18114 LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
18115 FREE(untag_ptr(_res));
18116 CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
18119 static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18120 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18121 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg);
18122 return tag_ptr(ret_conv, true);
18124 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18125 LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg);
18126 int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18130 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18131 LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig);
18132 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18133 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv);
18134 return tag_ptr(ret_conv, true);
18137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18138 LDKNodeFeatures o_conv;
18139 o_conv.inner = untag_ptr(o);
18140 o_conv.is_owned = ptr_is_owned(o);
18141 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18142 o_conv = NodeFeatures_clone(&o_conv);
18143 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18144 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
18145 return tag_ptr(ret_conv, true);
18148 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18149 void* e_ptr = untag_ptr(e);
18150 CHECK_ACCESS(e_ptr);
18151 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18152 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18153 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18154 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
18155 return tag_ptr(ret_conv, true);
18158 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18159 LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o);
18160 jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
18164 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18165 if (!ptr_is_owned(_res)) return;
18166 void* _res_ptr = untag_ptr(_res);
18167 CHECK_ACCESS(_res_ptr);
18168 LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
18169 FREE(untag_ptr(_res));
18170 CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
18173 static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18174 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18175 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg);
18176 return tag_ptr(ret_conv, true);
18178 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18179 LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg);
18180 int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18184 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18185 LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig);
18186 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18187 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv);
18188 return tag_ptr(ret_conv, true);
18191 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18192 LDKInvoiceFeatures o_conv;
18193 o_conv.inner = untag_ptr(o);
18194 o_conv.is_owned = ptr_is_owned(o);
18195 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18196 o_conv = InvoiceFeatures_clone(&o_conv);
18197 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18198 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
18199 return tag_ptr(ret_conv, true);
18202 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18203 void* e_ptr = untag_ptr(e);
18204 CHECK_ACCESS(e_ptr);
18205 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18206 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18207 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18208 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
18209 return tag_ptr(ret_conv, true);
18212 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18213 LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o);
18214 jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
18218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18219 if (!ptr_is_owned(_res)) return;
18220 void* _res_ptr = untag_ptr(_res);
18221 CHECK_ACCESS(_res_ptr);
18222 LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
18223 FREE(untag_ptr(_res));
18224 CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
18227 static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18228 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18229 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg);
18230 return tag_ptr(ret_conv, true);
18232 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18233 LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg);
18234 int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18238 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18239 LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig);
18240 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18241 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv);
18242 return tag_ptr(ret_conv, true);
18245 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18246 LDKChannelTypeFeatures o_conv;
18247 o_conv.inner = untag_ptr(o);
18248 o_conv.is_owned = ptr_is_owned(o);
18249 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18250 o_conv = ChannelTypeFeatures_clone(&o_conv);
18251 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
18252 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
18253 return tag_ptr(ret_conv, true);
18256 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18257 void* e_ptr = untag_ptr(e);
18258 CHECK_ACCESS(e_ptr);
18259 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18260 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18261 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
18262 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
18263 return tag_ptr(ret_conv, true);
18266 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18267 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o);
18268 jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
18272 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18273 if (!ptr_is_owned(_res)) return;
18274 void* _res_ptr = untag_ptr(_res);
18275 CHECK_ACCESS(_res_ptr);
18276 LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
18277 FREE(untag_ptr(_res));
18278 CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
18281 static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18282 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
18283 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg);
18284 return tag_ptr(ret_conv, true);
18286 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18287 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg);
18288 int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18292 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18293 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig);
18294 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
18295 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv);
18296 return tag_ptr(ret_conv, true);
18299 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18301 o_conv.inner = untag_ptr(o);
18302 o_conv.is_owned = ptr_is_owned(o);
18303 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18304 o_conv = NodeId_clone(&o_conv);
18305 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
18306 *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv);
18307 return tag_ptr(ret_conv, true);
18310 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18311 void* e_ptr = untag_ptr(e);
18312 CHECK_ACCESS(e_ptr);
18313 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18314 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18315 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
18316 *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
18317 return tag_ptr(ret_conv, true);
18320 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18321 LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o);
18322 jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv);
18326 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18327 if (!ptr_is_owned(_res)) return;
18328 void* _res_ptr = untag_ptr(_res);
18329 CHECK_ACCESS(_res_ptr);
18330 LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
18331 FREE(untag_ptr(_res));
18332 CResult_NodeIdDecodeErrorZ_free(_res_conv);
18335 static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) {
18336 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
18337 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg);
18338 return tag_ptr(ret_conv, true);
18340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18341 LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg);
18342 int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv);
18346 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18347 LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(orig);
18348 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
18349 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv);
18350 return tag_ptr(ret_conv, true);
18353 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18354 void* o_ptr = untag_ptr(o);
18355 CHECK_ACCESS(o_ptr);
18356 LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr);
18357 o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(o));
18358 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
18359 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv);
18360 return tag_ptr(ret_conv, true);
18363 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18364 void* e_ptr = untag_ptr(e);
18365 CHECK_ACCESS(e_ptr);
18366 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18367 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18368 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
18369 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
18370 return tag_ptr(ret_conv, true);
18373 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18374 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(o);
18375 jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv);
18379 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18380 if (!ptr_is_owned(_res)) return;
18381 void* _res_ptr = untag_ptr(_res);
18382 CHECK_ACCESS(_res_ptr);
18383 LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr);
18384 FREE(untag_ptr(_res));
18385 CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv);
18388 static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) {
18389 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
18390 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg);
18391 return tag_ptr(ret_conv, true);
18393 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18394 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(arg);
18395 int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv);
18399 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18400 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(orig);
18401 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
18402 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv);
18403 return tag_ptr(ret_conv, true);
18406 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) {
18407 void* o_ptr = untag_ptr(o);
18408 CHECK_ACCESS(o_ptr);
18409 LDKAccess o_conv = *(LDKAccess*)(o_ptr);
18410 if (o_conv.free == LDKAccess_JCalls_free) {
18411 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
18412 LDKAccess_JCalls_cloned(&o_conv);
18414 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
18415 *ret_copy = COption_AccessZ_some(o_conv);
18416 int64_t ret_ref = tag_ptr(ret_copy, true);
18420 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1none(JNIEnv *env, jclass clz) {
18421 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
18422 *ret_copy = COption_AccessZ_none();
18423 int64_t ret_ref = tag_ptr(ret_copy, true);
18427 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18428 if (!ptr_is_owned(_res)) return;
18429 void* _res_ptr = untag_ptr(_res);
18430 CHECK_ACCESS(_res_ptr);
18431 LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
18432 FREE(untag_ptr(_res));
18433 COption_AccessZ_free(_res_conv);
18436 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) {
18437 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
18438 *ret_conv = CResult_boolLightningErrorZ_ok(o);
18439 return tag_ptr(ret_conv, true);
18442 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18443 LDKLightningError e_conv;
18444 e_conv.inner = untag_ptr(e);
18445 e_conv.is_owned = ptr_is_owned(e);
18446 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18447 e_conv = LightningError_clone(&e_conv);
18448 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
18449 *ret_conv = CResult_boolLightningErrorZ_err(e_conv);
18450 return tag_ptr(ret_conv, true);
18453 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18454 LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(o);
18455 jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv);
18459 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18460 if (!ptr_is_owned(_res)) return;
18461 void* _res_ptr = untag_ptr(_res);
18462 CHECK_ACCESS(_res_ptr);
18463 LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
18464 FREE(untag_ptr(_res));
18465 CResult_boolLightningErrorZ_free(_res_conv);
18468 static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) {
18469 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
18470 *ret_conv = CResult_boolLightningErrorZ_clone(arg);
18471 return tag_ptr(ret_conv, true);
18473 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18474 LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(arg);
18475 int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv);
18479 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18480 LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(orig);
18481 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
18482 *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv);
18483 return tag_ptr(ret_conv, true);
18486 static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) {
18487 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
18488 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg);
18489 return tag_ptr(ret_conv, true);
18491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18492 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(arg);
18493 int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv);
18497 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18498 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(orig);
18499 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
18500 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv);
18501 return tag_ptr(ret_conv, true);
18504 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) {
18505 LDKChannelAnnouncement a_conv;
18506 a_conv.inner = untag_ptr(a);
18507 a_conv.is_owned = ptr_is_owned(a);
18508 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
18509 a_conv = ChannelAnnouncement_clone(&a_conv);
18510 LDKChannelUpdate b_conv;
18511 b_conv.inner = untag_ptr(b);
18512 b_conv.is_owned = ptr_is_owned(b);
18513 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
18514 b_conv = ChannelUpdate_clone(&b_conv);
18515 LDKChannelUpdate c_conv;
18516 c_conv.inner = untag_ptr(c);
18517 c_conv.is_owned = ptr_is_owned(c);
18518 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
18519 c_conv = ChannelUpdate_clone(&c_conv);
18520 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
18521 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
18522 return tag_ptr(ret_conv, true);
18525 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18526 if (!ptr_is_owned(_res)) return;
18527 void* _res_ptr = untag_ptr(_res);
18528 CHECK_ACCESS(_res_ptr);
18529 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
18530 FREE(untag_ptr(_res));
18531 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
18534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
18535 void* o_ptr = untag_ptr(o);
18536 CHECK_ACCESS(o_ptr);
18537 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(o_ptr);
18538 o_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(o));
18539 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
18540 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(o_conv);
18541 int64_t ret_ref = tag_ptr(ret_copy, true);
18545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1none(JNIEnv *env, jclass clz) {
18546 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
18547 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none();
18548 int64_t ret_ref = tag_ptr(ret_copy, true);
18552 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18553 if (!ptr_is_owned(_res)) return;
18554 void* _res_ptr = untag_ptr(_res);
18555 CHECK_ACCESS(_res_ptr);
18556 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(_res_ptr);
18557 FREE(untag_ptr(_res));
18558 COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_conv);
18561 static inline uint64_t COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR arg) {
18562 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
18563 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(arg);
18564 int64_t ret_ref = tag_ptr(ret_copy, true);
18567 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18568 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* arg_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(arg);
18569 int64_t ret_conv = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(arg_conv);
18573 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18574 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* orig_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(orig);
18575 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
18576 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(orig_conv);
18577 int64_t ret_ref = tag_ptr(ret_copy, true);
18581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok(JNIEnv *env, jclass clz) {
18582 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
18583 *ret_conv = CResult_NoneLightningErrorZ_ok();
18584 return tag_ptr(ret_conv, true);
18587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18588 LDKLightningError e_conv;
18589 e_conv.inner = untag_ptr(e);
18590 e_conv.is_owned = ptr_is_owned(e);
18591 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18592 e_conv = LightningError_clone(&e_conv);
18593 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
18594 *ret_conv = CResult_NoneLightningErrorZ_err(e_conv);
18595 return tag_ptr(ret_conv, true);
18598 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18599 LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(o);
18600 jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv);
18604 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18605 if (!ptr_is_owned(_res)) return;
18606 void* _res_ptr = untag_ptr(_res);
18607 CHECK_ACCESS(_res_ptr);
18608 LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
18609 FREE(untag_ptr(_res));
18610 CResult_NoneLightningErrorZ_free(_res_conv);
18613 static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) {
18614 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
18615 *ret_conv = CResult_NoneLightningErrorZ_clone(arg);
18616 return tag_ptr(ret_conv, true);
18618 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18619 LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(arg);
18620 int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv);
18624 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18625 LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(orig);
18626 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
18627 *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv);
18628 return tag_ptr(ret_conv, true);
18631 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18632 LDKChannelUpdateInfo o_conv;
18633 o_conv.inner = untag_ptr(o);
18634 o_conv.is_owned = ptr_is_owned(o);
18635 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18636 o_conv = ChannelUpdateInfo_clone(&o_conv);
18637 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
18638 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv);
18639 return tag_ptr(ret_conv, true);
18642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18643 void* e_ptr = untag_ptr(e);
18644 CHECK_ACCESS(e_ptr);
18645 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18646 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18647 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
18648 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
18649 return tag_ptr(ret_conv, true);
18652 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18653 LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(o);
18654 jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv);
18658 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18659 if (!ptr_is_owned(_res)) return;
18660 void* _res_ptr = untag_ptr(_res);
18661 CHECK_ACCESS(_res_ptr);
18662 LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr);
18663 FREE(untag_ptr(_res));
18664 CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv);
18667 static inline uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) {
18668 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
18669 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg);
18670 return tag_ptr(ret_conv, true);
18672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18673 LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(arg);
18674 int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv);
18678 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18679 LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(orig);
18680 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
18681 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv);
18682 return tag_ptr(ret_conv, true);
18685 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18686 LDKChannelInfo o_conv;
18687 o_conv.inner = untag_ptr(o);
18688 o_conv.is_owned = ptr_is_owned(o);
18689 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18690 o_conv = ChannelInfo_clone(&o_conv);
18691 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
18692 *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
18693 return tag_ptr(ret_conv, true);
18696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18697 void* e_ptr = untag_ptr(e);
18698 CHECK_ACCESS(e_ptr);
18699 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18700 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18701 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
18702 *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
18703 return tag_ptr(ret_conv, true);
18706 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18707 LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(o);
18708 jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv);
18712 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18713 if (!ptr_is_owned(_res)) return;
18714 void* _res_ptr = untag_ptr(_res);
18715 CHECK_ACCESS(_res_ptr);
18716 LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
18717 FREE(untag_ptr(_res));
18718 CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
18721 static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
18722 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
18723 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg);
18724 return tag_ptr(ret_conv, true);
18726 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18727 LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(arg);
18728 int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
18732 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18733 LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(orig);
18734 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
18735 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
18736 return tag_ptr(ret_conv, true);
18739 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18740 LDKRoutingFees o_conv;
18741 o_conv.inner = untag_ptr(o);
18742 o_conv.is_owned = ptr_is_owned(o);
18743 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18744 o_conv = RoutingFees_clone(&o_conv);
18745 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
18746 *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv);
18747 return tag_ptr(ret_conv, true);
18750 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18751 void* e_ptr = untag_ptr(e);
18752 CHECK_ACCESS(e_ptr);
18753 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18754 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18755 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
18756 *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
18757 return tag_ptr(ret_conv, true);
18760 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18761 LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(o);
18762 jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv);
18766 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18767 if (!ptr_is_owned(_res)) return;
18768 void* _res_ptr = untag_ptr(_res);
18769 CHECK_ACCESS(_res_ptr);
18770 LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
18771 FREE(untag_ptr(_res));
18772 CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
18775 static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) {
18776 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
18777 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg);
18778 return tag_ptr(ret_conv, true);
18780 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18781 LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(arg);
18782 int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv);
18786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18787 LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(orig);
18788 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
18789 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv);
18790 return tag_ptr(ret_conv, true);
18793 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18794 LDKCVec_NetAddressZ _res_constr;
18795 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18796 if (_res_constr.datalen > 0)
18797 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
18799 _res_constr.data = NULL;
18800 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18801 for (size_t m = 0; m < _res_constr.datalen; m++) {
18802 int64_t _res_conv_12 = _res_vals[m];
18803 void* _res_conv_12_ptr = untag_ptr(_res_conv_12);
18804 CHECK_ACCESS(_res_conv_12_ptr);
18805 LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
18806 FREE(untag_ptr(_res_conv_12));
18807 _res_constr.data[m] = _res_conv_12_conv;
18809 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18810 CVec_NetAddressZ_free(_res_constr);
18813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18814 LDKNodeAnnouncementInfo o_conv;
18815 o_conv.inner = untag_ptr(o);
18816 o_conv.is_owned = ptr_is_owned(o);
18817 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18818 o_conv = NodeAnnouncementInfo_clone(&o_conv);
18819 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
18820 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv);
18821 return tag_ptr(ret_conv, true);
18824 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18825 void* e_ptr = untag_ptr(e);
18826 CHECK_ACCESS(e_ptr);
18827 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18828 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18829 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
18830 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
18831 return tag_ptr(ret_conv, true);
18834 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18835 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(o);
18836 jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv);
18840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18841 if (!ptr_is_owned(_res)) return;
18842 void* _res_ptr = untag_ptr(_res);
18843 CHECK_ACCESS(_res_ptr);
18844 LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
18845 FREE(untag_ptr(_res));
18846 CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
18849 static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) {
18850 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
18851 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg);
18852 return tag_ptr(ret_conv, true);
18854 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18855 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(arg);
18856 int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv);
18860 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18861 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(orig);
18862 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
18863 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv);
18864 return tag_ptr(ret_conv, true);
18867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18868 LDKNodeAlias o_conv;
18869 o_conv.inner = untag_ptr(o);
18870 o_conv.is_owned = ptr_is_owned(o);
18871 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18872 o_conv = NodeAlias_clone(&o_conv);
18873 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
18874 *ret_conv = CResult_NodeAliasDecodeErrorZ_ok(o_conv);
18875 return tag_ptr(ret_conv, true);
18878 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18879 void* e_ptr = untag_ptr(e);
18880 CHECK_ACCESS(e_ptr);
18881 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18882 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18883 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
18884 *ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
18885 return tag_ptr(ret_conv, true);
18888 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18889 LDKCResult_NodeAliasDecodeErrorZ* o_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(o);
18890 jboolean ret_conv = CResult_NodeAliasDecodeErrorZ_is_ok(o_conv);
18894 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18895 if (!ptr_is_owned(_res)) return;
18896 void* _res_ptr = untag_ptr(_res);
18897 CHECK_ACCESS(_res_ptr);
18898 LDKCResult_NodeAliasDecodeErrorZ _res_conv = *(LDKCResult_NodeAliasDecodeErrorZ*)(_res_ptr);
18899 FREE(untag_ptr(_res));
18900 CResult_NodeAliasDecodeErrorZ_free(_res_conv);
18903 static inline uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg) {
18904 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
18905 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(arg);
18906 return tag_ptr(ret_conv, true);
18908 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18909 LDKCResult_NodeAliasDecodeErrorZ* arg_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(arg);
18910 int64_t ret_conv = CResult_NodeAliasDecodeErrorZ_clone_ptr(arg_conv);
18914 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18915 LDKCResult_NodeAliasDecodeErrorZ* orig_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(orig);
18916 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
18917 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(orig_conv);
18918 return tag_ptr(ret_conv, true);
18921 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18922 LDKNodeInfo o_conv;
18923 o_conv.inner = untag_ptr(o);
18924 o_conv.is_owned = ptr_is_owned(o);
18925 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18926 o_conv = NodeInfo_clone(&o_conv);
18927 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
18928 *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv);
18929 return tag_ptr(ret_conv, true);
18932 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18933 void* e_ptr = untag_ptr(e);
18934 CHECK_ACCESS(e_ptr);
18935 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18936 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18937 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
18938 *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
18939 return tag_ptr(ret_conv, true);
18942 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18943 LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(o);
18944 jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv);
18948 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18949 if (!ptr_is_owned(_res)) return;
18950 void* _res_ptr = untag_ptr(_res);
18951 CHECK_ACCESS(_res_ptr);
18952 LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
18953 FREE(untag_ptr(_res));
18954 CResult_NodeInfoDecodeErrorZ_free(_res_conv);
18957 static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) {
18958 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
18959 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg);
18960 return tag_ptr(ret_conv, true);
18962 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18963 LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(arg);
18964 int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv);
18968 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18969 LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(orig);
18970 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
18971 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv);
18972 return tag_ptr(ret_conv, true);
18975 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18976 LDKNetworkGraph o_conv;
18977 o_conv.inner = untag_ptr(o);
18978 o_conv.is_owned = ptr_is_owned(o);
18979 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18980 // WARNING: we need a move here but no clone is available for LDKNetworkGraph
18982 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
18983 *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
18984 return tag_ptr(ret_conv, true);
18987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18988 void* e_ptr = untag_ptr(e);
18989 CHECK_ACCESS(e_ptr);
18990 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18991 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18992 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
18993 *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
18994 return tag_ptr(ret_conv, true);
18997 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18998 LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(o);
18999 jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv);
19003 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19004 if (!ptr_is_owned(_res)) return;
19005 void* _res_ptr = untag_ptr(_res);
19006 CHECK_ACCESS(_res_ptr);
19007 LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
19008 FREE(untag_ptr(_res));
19009 CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
19012 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1some(JNIEnv *env, jclass clz, int64_tArray o) {
19013 LDKCVec_NetAddressZ o_constr;
19014 o_constr.datalen = (*env)->GetArrayLength(env, o);
19015 if (o_constr.datalen > 0)
19016 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
19018 o_constr.data = NULL;
19019 int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
19020 for (size_t m = 0; m < o_constr.datalen; m++) {
19021 int64_t o_conv_12 = o_vals[m];
19022 void* o_conv_12_ptr = untag_ptr(o_conv_12);
19023 CHECK_ACCESS(o_conv_12_ptr);
19024 LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
19025 o_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o_conv_12));
19026 o_constr.data[m] = o_conv_12_conv;
19028 (*env)->ReleaseLongArrayElements(env, o, o_vals, 0);
19029 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
19030 *ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
19031 int64_t ret_ref = tag_ptr(ret_copy, true);
19035 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1none(JNIEnv *env, jclass clz) {
19036 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
19037 *ret_copy = COption_CVec_NetAddressZZ_none();
19038 int64_t ret_ref = tag_ptr(ret_copy, true);
19042 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19043 if (!ptr_is_owned(_res)) return;
19044 void* _res_ptr = untag_ptr(_res);
19045 CHECK_ACCESS(_res_ptr);
19046 LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
19047 FREE(untag_ptr(_res));
19048 COption_CVec_NetAddressZZ_free(_res_conv);
19051 static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) {
19052 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
19053 *ret_copy = COption_CVec_NetAddressZZ_clone(arg);
19054 int64_t ret_ref = tag_ptr(ret_copy, true);
19057 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19058 LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(arg);
19059 int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv);
19063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19064 LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(orig);
19065 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
19066 *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv);
19067 int64_t ret_ref = tag_ptr(ret_copy, true);
19071 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19072 LDKDelayedPaymentOutputDescriptor o_conv;
19073 o_conv.inner = untag_ptr(o);
19074 o_conv.is_owned = ptr_is_owned(o);
19075 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19076 o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv);
19077 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
19078 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
19079 return tag_ptr(ret_conv, true);
19082 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19083 void* e_ptr = untag_ptr(e);
19084 CHECK_ACCESS(e_ptr);
19085 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19086 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19087 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
19088 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
19089 return tag_ptr(ret_conv, true);
19092 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19093 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
19094 jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
19098 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19099 if (!ptr_is_owned(_res)) return;
19100 void* _res_ptr = untag_ptr(_res);
19101 CHECK_ACCESS(_res_ptr);
19102 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
19103 FREE(untag_ptr(_res));
19104 CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
19107 static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
19108 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
19109 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg);
19110 return tag_ptr(ret_conv, true);
19112 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19113 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
19114 int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
19118 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19119 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
19120 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
19121 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
19122 return tag_ptr(ret_conv, true);
19125 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19126 LDKStaticPaymentOutputDescriptor o_conv;
19127 o_conv.inner = untag_ptr(o);
19128 o_conv.is_owned = ptr_is_owned(o);
19129 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19130 o_conv = StaticPaymentOutputDescriptor_clone(&o_conv);
19131 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
19132 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
19133 return tag_ptr(ret_conv, true);
19136 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19137 void* e_ptr = untag_ptr(e);
19138 CHECK_ACCESS(e_ptr);
19139 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19140 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19141 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
19142 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
19143 return tag_ptr(ret_conv, true);
19146 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19147 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
19148 jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
19152 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19153 if (!ptr_is_owned(_res)) return;
19154 void* _res_ptr = untag_ptr(_res);
19155 CHECK_ACCESS(_res_ptr);
19156 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
19157 FREE(untag_ptr(_res));
19158 CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
19161 static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
19162 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
19163 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg);
19164 return tag_ptr(ret_conv, true);
19166 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19167 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
19168 int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
19172 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19173 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
19174 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
19175 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
19176 return tag_ptr(ret_conv, true);
19179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19180 void* o_ptr = untag_ptr(o);
19181 CHECK_ACCESS(o_ptr);
19182 LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
19183 o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(o));
19184 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
19185 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
19186 return tag_ptr(ret_conv, true);
19189 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19190 void* e_ptr = untag_ptr(e);
19191 CHECK_ACCESS(e_ptr);
19192 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19193 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19194 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
19195 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
19196 return tag_ptr(ret_conv, true);
19199 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19200 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(o);
19201 jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv);
19205 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19206 if (!ptr_is_owned(_res)) return;
19207 void* _res_ptr = untag_ptr(_res);
19208 CHECK_ACCESS(_res_ptr);
19209 LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
19210 FREE(untag_ptr(_res));
19211 CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
19214 static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
19215 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
19216 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg);
19217 return tag_ptr(ret_conv, true);
19219 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19220 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
19221 int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
19225 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19226 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
19227 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
19228 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv);
19229 return tag_ptr(ret_conv, true);
19232 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentPreimageZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
19233 LDKCVec_PaymentPreimageZ _res_constr;
19234 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
19235 if (_res_constr.datalen > 0)
19236 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
19238 _res_constr.data = NULL;
19239 for (size_t i = 0; i < _res_constr.datalen; i++) {
19240 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
19241 LDKThirtyTwoBytes _res_conv_8_ref;
19242 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
19243 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
19244 _res_constr.data[i] = _res_conv_8_ref;
19246 CVec_PaymentPreimageZ_free(_res_constr);
19249 static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) {
19250 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
19251 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg);
19252 return tag_ptr(ret_conv, true);
19254 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19255 LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(arg);
19256 int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv);
19260 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19261 LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(orig);
19262 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
19263 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv);
19264 return tag_ptr(ret_conv, true);
19267 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, jobjectArray b) {
19268 LDKSignature a_ref;
19269 CHECK((*env)->GetArrayLength(env, a) == 64);
19270 (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form);
19271 LDKCVec_SignatureZ b_constr;
19272 b_constr.datalen = (*env)->GetArrayLength(env, b);
19273 if (b_constr.datalen > 0)
19274 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
19276 b_constr.data = NULL;
19277 for (size_t i = 0; i < b_constr.datalen; i++) {
19278 int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i);
19279 LDKSignature b_conv_8_ref;
19280 CHECK((*env)->GetArrayLength(env, b_conv_8) == 64);
19281 (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form);
19282 b_constr.data[i] = b_conv_8_ref;
19284 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
19285 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
19286 return tag_ptr(ret_conv, true);
19289 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19290 if (!ptr_is_owned(_res)) return;
19291 void* _res_ptr = untag_ptr(_res);
19292 CHECK_ACCESS(_res_ptr);
19293 LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
19294 FREE(untag_ptr(_res));
19295 C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
19298 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19299 void* o_ptr = untag_ptr(o);
19300 CHECK_ACCESS(o_ptr);
19301 LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
19302 o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(o));
19303 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
19304 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
19305 return tag_ptr(ret_conv, true);
19308 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv *env, jclass clz) {
19309 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
19310 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
19311 return tag_ptr(ret_conv, true);
19314 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19315 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(o);
19316 jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv);
19320 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19321 if (!ptr_is_owned(_res)) return;
19322 void* _res_ptr = untag_ptr(_res);
19323 CHECK_ACCESS(_res_ptr);
19324 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
19325 FREE(untag_ptr(_res));
19326 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
19329 static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) {
19330 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
19331 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg);
19332 return tag_ptr(ret_conv, true);
19334 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19335 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(arg);
19336 int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv);
19340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19341 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(orig);
19342 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
19343 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv);
19344 return tag_ptr(ret_conv, true);
19347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
19348 LDKSignature o_ref;
19349 CHECK((*env)->GetArrayLength(env, o) == 64);
19350 (*env)->GetByteArrayRegion(env, o, 0, 64, o_ref.compact_form);
19351 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
19352 *ret_conv = CResult_SignatureNoneZ_ok(o_ref);
19353 return tag_ptr(ret_conv, true);
19356 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv *env, jclass clz) {
19357 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
19358 *ret_conv = CResult_SignatureNoneZ_err();
19359 return tag_ptr(ret_conv, true);
19362 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19363 LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(o);
19364 jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv);
19368 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19369 if (!ptr_is_owned(_res)) return;
19370 void* _res_ptr = untag_ptr(_res);
19371 CHECK_ACCESS(_res_ptr);
19372 LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
19373 FREE(untag_ptr(_res));
19374 CResult_SignatureNoneZ_free(_res_conv);
19377 static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) {
19378 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
19379 *ret_conv = CResult_SignatureNoneZ_clone(arg);
19380 return tag_ptr(ret_conv, true);
19382 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19383 LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(arg);
19384 int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv);
19388 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19389 LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(orig);
19390 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
19391 *ret_conv = CResult_SignatureNoneZ_clone(orig_conv);
19392 return tag_ptr(ret_conv, true);
19395 static inline uint64_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) {
19396 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
19397 *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg);
19398 return tag_ptr(ret_conv, true);
19400 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19401 LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(arg);
19402 int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv);
19406 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19407 LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(orig);
19408 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
19409 *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv);
19410 return tag_ptr(ret_conv, true);
19413 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
19414 LDKSignature a_ref;
19415 CHECK((*env)->GetArrayLength(env, a) == 64);
19416 (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form);
19417 LDKSignature b_ref;
19418 CHECK((*env)->GetArrayLength(env, b) == 64);
19419 (*env)->GetByteArrayRegion(env, b, 0, 64, b_ref.compact_form);
19420 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
19421 *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref);
19422 return tag_ptr(ret_conv, true);
19425 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19426 if (!ptr_is_owned(_res)) return;
19427 void* _res_ptr = untag_ptr(_res);
19428 CHECK_ACCESS(_res_ptr);
19429 LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr);
19430 FREE(untag_ptr(_res));
19431 C2Tuple_SignatureSignatureZ_free(_res_conv);
19434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19435 void* o_ptr = untag_ptr(o);
19436 CHECK_ACCESS(o_ptr);
19437 LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr);
19438 o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)untag_ptr(o));
19439 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
19440 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv);
19441 return tag_ptr(ret_conv, true);
19444 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1err(JNIEnv *env, jclass clz) {
19445 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
19446 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err();
19447 return tag_ptr(ret_conv, true);
19450 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19451 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(o);
19452 jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(o_conv);
19456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19457 if (!ptr_is_owned(_res)) return;
19458 void* _res_ptr = untag_ptr(_res);
19459 CHECK_ACCESS(_res_ptr);
19460 LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr);
19461 FREE(untag_ptr(_res));
19462 CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv);
19465 static inline uint64_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) {
19466 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
19467 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg);
19468 return tag_ptr(ret_conv, true);
19470 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19471 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(arg);
19472 int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(arg_conv);
19476 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19477 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(orig);
19478 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
19479 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv);
19480 return tag_ptr(ret_conv, true);
19483 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
19484 LDKSecretKey o_ref;
19485 CHECK((*env)->GetArrayLength(env, o) == 32);
19486 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes);
19487 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
19488 *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref);
19489 return tag_ptr(ret_conv, true);
19492 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1err(JNIEnv *env, jclass clz) {
19493 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
19494 *ret_conv = CResult_SecretKeyNoneZ_err();
19495 return tag_ptr(ret_conv, true);
19498 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19499 LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(o);
19500 jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv);
19504 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19505 if (!ptr_is_owned(_res)) return;
19506 void* _res_ptr = untag_ptr(_res);
19507 CHECK_ACCESS(_res_ptr);
19508 LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr);
19509 FREE(untag_ptr(_res));
19510 CResult_SecretKeyNoneZ_free(_res_conv);
19513 static inline uint64_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) {
19514 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
19515 *ret_conv = CResult_SecretKeyNoneZ_clone(arg);
19516 return tag_ptr(ret_conv, true);
19518 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19519 LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(arg);
19520 int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv);
19524 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19525 LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(orig);
19526 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
19527 *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv);
19528 return tag_ptr(ret_conv, true);
19531 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
19532 LDKPublicKey o_ref;
19533 CHECK((*env)->GetArrayLength(env, o) == 33);
19534 (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
19535 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
19536 *ret_conv = CResult_PublicKeyNoneZ_ok(o_ref);
19537 return tag_ptr(ret_conv, true);
19540 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1err(JNIEnv *env, jclass clz) {
19541 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
19542 *ret_conv = CResult_PublicKeyNoneZ_err();
19543 return tag_ptr(ret_conv, true);
19546 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19547 LDKCResult_PublicKeyNoneZ* o_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(o);
19548 jboolean ret_conv = CResult_PublicKeyNoneZ_is_ok(o_conv);
19552 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19553 if (!ptr_is_owned(_res)) return;
19554 void* _res_ptr = untag_ptr(_res);
19555 CHECK_ACCESS(_res_ptr);
19556 LDKCResult_PublicKeyNoneZ _res_conv = *(LDKCResult_PublicKeyNoneZ*)(_res_ptr);
19557 FREE(untag_ptr(_res));
19558 CResult_PublicKeyNoneZ_free(_res_conv);
19561 static inline uint64_t CResult_PublicKeyNoneZ_clone_ptr(LDKCResult_PublicKeyNoneZ *NONNULL_PTR arg) {
19562 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
19563 *ret_conv = CResult_PublicKeyNoneZ_clone(arg);
19564 return tag_ptr(ret_conv, true);
19566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19567 LDKCResult_PublicKeyNoneZ* arg_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(arg);
19568 int64_t ret_conv = CResult_PublicKeyNoneZ_clone_ptr(arg_conv);
19572 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19573 LDKCResult_PublicKeyNoneZ* orig_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(orig);
19574 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
19575 *ret_conv = CResult_PublicKeyNoneZ_clone(orig_conv);
19576 return tag_ptr(ret_conv, true);
19579 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19580 void* o_ptr = untag_ptr(o);
19581 CHECK_ACCESS(o_ptr);
19582 LDKBigEndianScalar o_conv = *(LDKBigEndianScalar*)(o_ptr);
19583 // WARNING: we may need a move here but no clone is available for LDKBigEndianScalar
19584 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
19585 *ret_copy = COption_ScalarZ_some(o_conv);
19586 int64_t ret_ref = tag_ptr(ret_copy, true);
19590 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1none(JNIEnv *env, jclass clz) {
19591 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
19592 *ret_copy = COption_ScalarZ_none();
19593 int64_t ret_ref = tag_ptr(ret_copy, true);
19597 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19598 if (!ptr_is_owned(_res)) return;
19599 void* _res_ptr = untag_ptr(_res);
19600 CHECK_ACCESS(_res_ptr);
19601 LDKCOption_ScalarZ _res_conv = *(LDKCOption_ScalarZ*)(_res_ptr);
19602 FREE(untag_ptr(_res));
19603 COption_ScalarZ_free(_res_conv);
19606 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
19607 LDKThirtyTwoBytes o_ref;
19608 CHECK((*env)->GetArrayLength(env, o) == 32);
19609 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
19610 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
19611 *ret_conv = CResult_SharedSecretNoneZ_ok(o_ref);
19612 return tag_ptr(ret_conv, true);
19615 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1err(JNIEnv *env, jclass clz) {
19616 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
19617 *ret_conv = CResult_SharedSecretNoneZ_err();
19618 return tag_ptr(ret_conv, true);
19621 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19622 LDKCResult_SharedSecretNoneZ* o_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(o);
19623 jboolean ret_conv = CResult_SharedSecretNoneZ_is_ok(o_conv);
19627 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19628 if (!ptr_is_owned(_res)) return;
19629 void* _res_ptr = untag_ptr(_res);
19630 CHECK_ACCESS(_res_ptr);
19631 LDKCResult_SharedSecretNoneZ _res_conv = *(LDKCResult_SharedSecretNoneZ*)(_res_ptr);
19632 FREE(untag_ptr(_res));
19633 CResult_SharedSecretNoneZ_free(_res_conv);
19636 static inline uint64_t CResult_SharedSecretNoneZ_clone_ptr(LDKCResult_SharedSecretNoneZ *NONNULL_PTR arg) {
19637 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
19638 *ret_conv = CResult_SharedSecretNoneZ_clone(arg);
19639 return tag_ptr(ret_conv, true);
19641 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19642 LDKCResult_SharedSecretNoneZ* arg_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(arg);
19643 int64_t ret_conv = CResult_SharedSecretNoneZ_clone_ptr(arg_conv);
19647 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19648 LDKCResult_SharedSecretNoneZ* orig_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(orig);
19649 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
19650 *ret_conv = CResult_SharedSecretNoneZ_clone(orig_conv);
19651 return tag_ptr(ret_conv, true);
19654 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19655 void* o_ptr = untag_ptr(o);
19656 CHECK_ACCESS(o_ptr);
19657 LDKSign o_conv = *(LDKSign*)(o_ptr);
19658 if (o_conv.free == LDKSign_JCalls_free) {
19659 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
19660 LDKSign_JCalls_cloned(&o_conv);
19662 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
19663 *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
19664 return tag_ptr(ret_conv, true);
19667 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19668 void* e_ptr = untag_ptr(e);
19669 CHECK_ACCESS(e_ptr);
19670 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19671 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19672 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
19673 *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
19674 return tag_ptr(ret_conv, true);
19677 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19678 LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(o);
19679 jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv);
19683 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19684 if (!ptr_is_owned(_res)) return;
19685 void* _res_ptr = untag_ptr(_res);
19686 CHECK_ACCESS(_res_ptr);
19687 LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
19688 FREE(untag_ptr(_res));
19689 CResult_SignDecodeErrorZ_free(_res_conv);
19692 static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) {
19693 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
19694 *ret_conv = CResult_SignDecodeErrorZ_clone(arg);
19695 return tag_ptr(ret_conv, true);
19697 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19698 LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(arg);
19699 int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv);
19703 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19704 LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(orig);
19705 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
19706 *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv);
19707 return tag_ptr(ret_conv, true);
19710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
19711 LDKCVec_u5Z _res_constr;
19712 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
19713 if (_res_constr.datalen > 0)
19714 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
19716 _res_constr.data = NULL;
19717 int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL);
19718 for (size_t h = 0; h < _res_constr.datalen; h++) {
19719 int8_t _res_conv_7 = _res_vals[h];
19721 _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 };
19723 (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0);
19724 CVec_u5Z_free(_res_constr);
19727 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
19728 LDKRecoverableSignature o_ref;
19729 CHECK((*env)->GetArrayLength(env, o) == 68);
19730 (*env)->GetByteArrayRegion(env, o, 0, 68, o_ref.serialized_form);
19731 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
19732 *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref);
19733 return tag_ptr(ret_conv, true);
19736 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err(JNIEnv *env, jclass clz) {
19737 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
19738 *ret_conv = CResult_RecoverableSignatureNoneZ_err();
19739 return tag_ptr(ret_conv, true);
19742 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19743 LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(o);
19744 jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv);
19748 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19749 if (!ptr_is_owned(_res)) return;
19750 void* _res_ptr = untag_ptr(_res);
19751 CHECK_ACCESS(_res_ptr);
19752 LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
19753 FREE(untag_ptr(_res));
19754 CResult_RecoverableSignatureNoneZ_free(_res_conv);
19757 static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) {
19758 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
19759 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg);
19760 return tag_ptr(ret_conv, true);
19762 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19763 LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(arg);
19764 int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv);
19768 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19769 LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(orig);
19770 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
19771 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv);
19772 return tag_ptr(ret_conv, true);
19775 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
19776 LDKCVec_u8Z _res_ref;
19777 _res_ref.datalen = (*env)->GetArrayLength(env, _res);
19778 _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes");
19779 (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
19780 CVec_u8Z_free(_res_ref);
19783 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
19784 LDKCVec_CVec_u8ZZ _res_constr;
19785 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
19786 if (_res_constr.datalen > 0)
19787 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
19789 _res_constr.data = NULL;
19790 for (size_t i = 0; i < _res_constr.datalen; i++) {
19791 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
19792 LDKCVec_u8Z _res_conv_8_ref;
19793 _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8);
19794 _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKCVec_u8Z Bytes");
19795 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data);
19796 _res_constr.data[i] = _res_conv_8_ref;
19798 CVec_CVec_u8ZZ_free(_res_constr);
19801 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) {
19802 LDKCVec_CVec_u8ZZ o_constr;
19803 o_constr.datalen = (*env)->GetArrayLength(env, o);
19804 if (o_constr.datalen > 0)
19805 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
19807 o_constr.data = NULL;
19808 for (size_t i = 0; i < o_constr.datalen; i++) {
19809 int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
19810 LDKCVec_u8Z o_conv_8_ref;
19811 o_conv_8_ref.datalen = (*env)->GetArrayLength(env, o_conv_8);
19812 o_conv_8_ref.data = MALLOC(o_conv_8_ref.datalen, "LDKCVec_u8Z Bytes");
19813 (*env)->GetByteArrayRegion(env, o_conv_8, 0, o_conv_8_ref.datalen, o_conv_8_ref.data);
19814 o_constr.data[i] = o_conv_8_ref;
19816 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
19817 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
19818 return tag_ptr(ret_conv, true);
19821 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err(JNIEnv *env, jclass clz) {
19822 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
19823 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
19824 return tag_ptr(ret_conv, true);
19827 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19828 LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(o);
19829 jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv);
19833 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19834 if (!ptr_is_owned(_res)) return;
19835 void* _res_ptr = untag_ptr(_res);
19836 CHECK_ACCESS(_res_ptr);
19837 LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
19838 FREE(untag_ptr(_res));
19839 CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
19842 static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) {
19843 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
19844 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg);
19845 return tag_ptr(ret_conv, true);
19847 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19848 LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(arg);
19849 int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv);
19853 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19854 LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(orig);
19855 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
19856 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
19857 return tag_ptr(ret_conv, true);
19860 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19861 LDKInMemorySigner o_conv;
19862 o_conv.inner = untag_ptr(o);
19863 o_conv.is_owned = ptr_is_owned(o);
19864 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19865 o_conv = InMemorySigner_clone(&o_conv);
19866 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
19867 *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
19868 return tag_ptr(ret_conv, true);
19871 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19872 void* e_ptr = untag_ptr(e);
19873 CHECK_ACCESS(e_ptr);
19874 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19875 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19876 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
19877 *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
19878 return tag_ptr(ret_conv, true);
19881 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19882 LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(o);
19883 jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv);
19887 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19888 if (!ptr_is_owned(_res)) return;
19889 void* _res_ptr = untag_ptr(_res);
19890 CHECK_ACCESS(_res_ptr);
19891 LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
19892 FREE(untag_ptr(_res));
19893 CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
19896 static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) {
19897 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
19898 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg);
19899 return tag_ptr(ret_conv, true);
19901 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19902 LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(arg);
19903 int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv);
19907 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19908 LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(orig);
19909 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
19910 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
19911 return tag_ptr(ret_conv, true);
19914 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
19915 LDKCVec_TxOutZ _res_constr;
19916 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
19917 if (_res_constr.datalen > 0)
19918 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
19920 _res_constr.data = NULL;
19921 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
19922 for (size_t h = 0; h < _res_constr.datalen; h++) {
19923 int64_t _res_conv_7 = _res_vals[h];
19924 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
19925 CHECK_ACCESS(_res_conv_7_ptr);
19926 LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
19927 FREE(untag_ptr(_res_conv_7));
19928 _res_constr.data[h] = _res_conv_7_conv;
19930 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
19931 CVec_TxOutZ_free(_res_constr);
19934 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
19935 LDKTransaction o_ref;
19936 o_ref.datalen = (*env)->GetArrayLength(env, o);
19937 o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
19938 (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data);
19939 o_ref.data_is_owned = true;
19940 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
19941 *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
19942 return tag_ptr(ret_conv, true);
19945 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err(JNIEnv *env, jclass clz) {
19946 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
19947 *ret_conv = CResult_TransactionNoneZ_err();
19948 return tag_ptr(ret_conv, true);
19951 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19952 LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o);
19953 jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv);
19957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19958 if (!ptr_is_owned(_res)) return;
19959 void* _res_ptr = untag_ptr(_res);
19960 CHECK_ACCESS(_res_ptr);
19961 LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
19962 FREE(untag_ptr(_res));
19963 CResult_TransactionNoneZ_free(_res_conv);
19966 static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) {
19967 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
19968 *ret_conv = CResult_TransactionNoneZ_clone(arg);
19969 return tag_ptr(ret_conv, true);
19971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19972 LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg);
19973 int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv);
19977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19978 LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig);
19979 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
19980 *ret_conv = CResult_TransactionNoneZ_clone(orig_conv);
19981 return tag_ptr(ret_conv, true);
19984 static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) {
19985 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
19986 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg);
19987 return tag_ptr(ret_conv, true);
19989 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19990 LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(arg);
19991 int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv);
19995 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19996 LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(orig);
19997 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
19998 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv);
19999 return tag_ptr(ret_conv, true);
20002 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
20003 LDKThirtyTwoBytes a_ref;
20004 CHECK((*env)->GetArrayLength(env, a) == 32);
20005 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
20006 LDKChannelMonitor b_conv;
20007 b_conv.inner = untag_ptr(b);
20008 b_conv.is_owned = ptr_is_owned(b);
20009 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
20010 b_conv = ChannelMonitor_clone(&b_conv);
20011 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
20012 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv);
20013 return tag_ptr(ret_conv, true);
20016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20017 if (!ptr_is_owned(_res)) return;
20018 void* _res_ptr = untag_ptr(_res);
20019 CHECK_ACCESS(_res_ptr);
20020 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
20021 FREE(untag_ptr(_res));
20022 C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
20025 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlockHashChannelMonitorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20026 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res_constr;
20027 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20028 if (_res_constr.datalen > 0)
20029 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements");
20031 _res_constr.data = NULL;
20032 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20033 for (size_t j = 0; j < _res_constr.datalen; j++) {
20034 int64_t _res_conv_35 = _res_vals[j];
20035 void* _res_conv_35_ptr = untag_ptr(_res_conv_35);
20036 CHECK_ACCESS(_res_conv_35_ptr);
20037 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr);
20038 FREE(untag_ptr(_res_conv_35));
20039 _res_constr.data[j] = _res_conv_35_conv;
20041 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20042 CVec_C2Tuple_BlockHashChannelMonitorZZ_free(_res_constr);
20045 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) {
20046 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o_constr;
20047 o_constr.datalen = (*env)->GetArrayLength(env, o);
20048 if (o_constr.datalen > 0)
20049 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements");
20051 o_constr.data = NULL;
20052 int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
20053 for (size_t j = 0; j < o_constr.datalen; j++) {
20054 int64_t o_conv_35 = o_vals[j];
20055 void* o_conv_35_ptr = untag_ptr(o_conv_35);
20056 CHECK_ACCESS(o_conv_35_ptr);
20057 LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr);
20058 o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o_conv_35));
20059 o_constr.data[j] = o_conv_35_conv;
20061 (*env)->ReleaseLongArrayElements(env, o, o_vals, 0);
20062 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
20063 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o_constr);
20064 return tag_ptr(ret_conv, true);
20067 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
20068 LDKIOError e_conv = LDKIOError_from_java(env, e);
20069 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
20070 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e_conv);
20071 return tag_ptr(ret_conv, true);
20074 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20075 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(o);
20076 jboolean ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv);
20080 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20081 if (!ptr_is_owned(_res)) return;
20082 void* _res_ptr = untag_ptr(_res);
20083 CHECK_ACCESS(_res_ptr);
20084 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr);
20085 FREE(untag_ptr(_res));
20086 CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv);
20089 static inline uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) {
20090 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
20091 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg);
20092 return tag_ptr(ret_conv, true);
20094 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20095 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(arg);
20096 int64_t ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv);
20100 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20101 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(orig);
20102 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
20103 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig_conv);
20104 return tag_ptr(ret_conv, true);
20107 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) {
20108 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
20109 *ret_copy = COption_u16Z_some(o);
20110 int64_t ret_ref = tag_ptr(ret_copy, true);
20114 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none(JNIEnv *env, jclass clz) {
20115 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
20116 *ret_copy = COption_u16Z_none();
20117 int64_t ret_ref = tag_ptr(ret_copy, true);
20121 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
20122 if (!ptr_is_owned(_res)) return;
20123 void* _res_ptr = untag_ptr(_res);
20124 CHECK_ACCESS(_res_ptr);
20125 LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
20126 FREE(untag_ptr(_res));
20127 COption_u16Z_free(_res_conv);
20130 static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) {
20131 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
20132 *ret_copy = COption_u16Z_clone(arg);
20133 int64_t ret_ref = tag_ptr(ret_copy, true);
20136 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20137 LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)untag_ptr(arg);
20138 int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv);
20142 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20143 LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)untag_ptr(orig);
20144 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
20145 *ret_copy = COption_u16Z_clone(orig_conv);
20146 int64_t ret_ref = tag_ptr(ret_copy, true);
20150 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv *env, jclass clz) {
20151 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
20152 *ret_conv = CResult_NoneAPIErrorZ_ok();
20153 return tag_ptr(ret_conv, true);
20156 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20157 void* e_ptr = untag_ptr(e);
20158 CHECK_ACCESS(e_ptr);
20159 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
20160 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
20161 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
20162 *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
20163 return tag_ptr(ret_conv, true);
20166 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20167 LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
20168 jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
20172 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20173 if (!ptr_is_owned(_res)) return;
20174 void* _res_ptr = untag_ptr(_res);
20175 CHECK_ACCESS(_res_ptr);
20176 LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
20177 FREE(untag_ptr(_res));
20178 CResult_NoneAPIErrorZ_free(_res_conv);
20181 static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
20182 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
20183 *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
20184 return tag_ptr(ret_conv, true);
20186 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20187 LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
20188 int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
20192 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20193 LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
20194 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
20195 *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
20196 return tag_ptr(ret_conv, true);
20199 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20200 LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
20201 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20202 if (_res_constr.datalen > 0)
20203 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
20205 _res_constr.data = NULL;
20206 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20207 for (size_t w = 0; w < _res_constr.datalen; w++) {
20208 int64_t _res_conv_22 = _res_vals[w];
20209 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
20210 CHECK_ACCESS(_res_conv_22_ptr);
20211 LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
20212 FREE(untag_ptr(_res_conv_22));
20213 _res_constr.data[w] = _res_conv_22_conv;
20215 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20216 CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
20219 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20220 LDKCVec_APIErrorZ _res_constr;
20221 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20222 if (_res_constr.datalen > 0)
20223 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
20225 _res_constr.data = NULL;
20226 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20227 for (size_t k = 0; k < _res_constr.datalen; k++) {
20228 int64_t _res_conv_10 = _res_vals[k];
20229 void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
20230 CHECK_ACCESS(_res_conv_10_ptr);
20231 LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
20232 FREE(untag_ptr(_res_conv_10));
20233 _res_constr.data[k] = _res_conv_10_conv;
20235 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20236 CVec_APIErrorZ_free(_res_constr);
20239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20240 LDKThirtyTwoBytes o_ref;
20241 CHECK((*env)->GetArrayLength(env, o) == 32);
20242 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
20243 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
20244 *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
20245 return tag_ptr(ret_conv, true);
20248 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20249 void* e_ptr = untag_ptr(e);
20250 CHECK_ACCESS(e_ptr);
20251 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
20252 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
20253 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
20254 *ret_conv = CResult__u832APIErrorZ_err(e_conv);
20255 return tag_ptr(ret_conv, true);
20258 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20259 LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
20260 jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
20264 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20265 if (!ptr_is_owned(_res)) return;
20266 void* _res_ptr = untag_ptr(_res);
20267 CHECK_ACCESS(_res_ptr);
20268 LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
20269 FREE(untag_ptr(_res));
20270 CResult__u832APIErrorZ_free(_res_conv);
20273 static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
20274 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
20275 *ret_conv = CResult__u832APIErrorZ_clone(arg);
20276 return tag_ptr(ret_conv, true);
20278 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20279 LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
20280 int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
20284 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20285 LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
20286 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
20287 *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
20288 return tag_ptr(ret_conv, true);
20291 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20292 LDKThirtyTwoBytes o_ref;
20293 CHECK((*env)->GetArrayLength(env, o) == 32);
20294 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
20295 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
20296 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
20297 return tag_ptr(ret_conv, true);
20300 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20301 void* e_ptr = untag_ptr(e);
20302 CHECK_ACCESS(e_ptr);
20303 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
20304 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
20305 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
20306 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
20307 return tag_ptr(ret_conv, true);
20310 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20311 LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(o);
20312 jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv);
20316 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20317 if (!ptr_is_owned(_res)) return;
20318 void* _res_ptr = untag_ptr(_res);
20319 CHECK_ACCESS(_res_ptr);
20320 LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
20321 FREE(untag_ptr(_res));
20322 CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
20325 static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) {
20326 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
20327 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg);
20328 return tag_ptr(ret_conv, true);
20330 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20331 LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(arg);
20332 int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv);
20336 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20337 LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(orig);
20338 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
20339 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv);
20340 return tag_ptr(ret_conv, true);
20343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv *env, jclass clz) {
20344 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
20345 *ret_conv = CResult_NonePaymentSendFailureZ_ok();
20346 return tag_ptr(ret_conv, true);
20349 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20350 void* e_ptr = untag_ptr(e);
20351 CHECK_ACCESS(e_ptr);
20352 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
20353 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
20354 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
20355 *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
20356 return tag_ptr(ret_conv, true);
20359 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20360 LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
20361 jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
20365 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20366 if (!ptr_is_owned(_res)) return;
20367 void* _res_ptr = untag_ptr(_res);
20368 CHECK_ACCESS(_res_ptr);
20369 LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
20370 FREE(untag_ptr(_res));
20371 CResult_NonePaymentSendFailureZ_free(_res_conv);
20374 static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
20375 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
20376 *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
20377 return tag_ptr(ret_conv, true);
20379 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20380 LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
20381 int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
20385 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20386 LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
20387 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
20388 *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
20389 return tag_ptr(ret_conv, true);
20392 static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) {
20393 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
20394 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg);
20395 return tag_ptr(ret_conv, true);
20397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20398 LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(arg);
20399 int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv);
20403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20404 LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(orig);
20405 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
20406 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv);
20407 return tag_ptr(ret_conv, true);
20410 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
20411 LDKThirtyTwoBytes a_ref;
20412 CHECK((*env)->GetArrayLength(env, a) == 32);
20413 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
20414 LDKThirtyTwoBytes b_ref;
20415 CHECK((*env)->GetArrayLength(env, b) == 32);
20416 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
20417 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
20418 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
20419 return tag_ptr(ret_conv, true);
20422 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20423 if (!ptr_is_owned(_res)) return;
20424 void* _res_ptr = untag_ptr(_res);
20425 CHECK_ACCESS(_res_ptr);
20426 LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
20427 FREE(untag_ptr(_res));
20428 C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
20431 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20432 void* o_ptr = untag_ptr(o);
20433 CHECK_ACCESS(o_ptr);
20434 LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
20435 o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(o));
20436 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
20437 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
20438 return tag_ptr(ret_conv, true);
20441 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20442 void* e_ptr = untag_ptr(e);
20443 CHECK_ACCESS(e_ptr);
20444 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
20445 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
20446 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
20447 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
20448 return tag_ptr(ret_conv, true);
20451 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20452 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(o);
20453 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv);
20457 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20458 if (!ptr_is_owned(_res)) return;
20459 void* _res_ptr = untag_ptr(_res);
20460 CHECK_ACCESS(_res_ptr);
20461 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
20462 FREE(untag_ptr(_res));
20463 CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
20466 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) {
20467 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
20468 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg);
20469 return tag_ptr(ret_conv, true);
20471 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20472 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(arg);
20473 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv);
20477 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20478 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(orig);
20479 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
20480 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv);
20481 return tag_ptr(ret_conv, true);
20484 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ThirtyTwoBytesZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
20485 LDKCVec_ThirtyTwoBytesZ _res_constr;
20486 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20487 if (_res_constr.datalen > 0)
20488 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
20490 _res_constr.data = NULL;
20491 for (size_t i = 0; i < _res_constr.datalen; i++) {
20492 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
20493 LDKThirtyTwoBytes _res_conv_8_ref;
20494 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
20495 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
20496 _res_constr.data[i] = _res_conv_8_ref;
20498 CVec_ThirtyTwoBytesZ_free(_res_constr);
20501 static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) {
20502 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
20503 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg);
20504 return tag_ptr(ret_conv, true);
20506 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20507 LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(arg);
20508 int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv);
20512 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20513 LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(orig);
20514 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
20515 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv);
20516 return tag_ptr(ret_conv, true);
20519 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
20520 LDKThirtyTwoBytes a_ref;
20521 CHECK((*env)->GetArrayLength(env, a) == 32);
20522 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
20523 LDKThirtyTwoBytes b_ref;
20524 CHECK((*env)->GetArrayLength(env, b) == 32);
20525 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
20526 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
20527 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref);
20528 return tag_ptr(ret_conv, true);
20531 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20532 if (!ptr_is_owned(_res)) return;
20533 void* _res_ptr = untag_ptr(_res);
20534 CHECK_ACCESS(_res_ptr);
20535 LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
20536 FREE(untag_ptr(_res));
20537 C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
20540 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20541 void* o_ptr = untag_ptr(o);
20542 CHECK_ACCESS(o_ptr);
20543 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
20544 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
20545 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
20546 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
20547 return tag_ptr(ret_conv, true);
20550 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err(JNIEnv *env, jclass clz) {
20551 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
20552 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
20553 return tag_ptr(ret_conv, true);
20556 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20557 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(o);
20558 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
20562 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20563 if (!ptr_is_owned(_res)) return;
20564 void* _res_ptr = untag_ptr(_res);
20565 CHECK_ACCESS(_res_ptr);
20566 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
20567 FREE(untag_ptr(_res));
20568 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
20571 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
20572 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
20573 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
20574 return tag_ptr(ret_conv, true);
20576 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20577 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(arg);
20578 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
20582 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20583 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(orig);
20584 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
20585 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
20586 return tag_ptr(ret_conv, true);
20589 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20590 void* o_ptr = untag_ptr(o);
20591 CHECK_ACCESS(o_ptr);
20592 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
20593 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
20594 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
20595 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
20596 return tag_ptr(ret_conv, true);
20599 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20600 void* e_ptr = untag_ptr(e);
20601 CHECK_ACCESS(e_ptr);
20602 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
20603 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
20604 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
20605 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
20606 return tag_ptr(ret_conv, true);
20609 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20610 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(o);
20611 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
20615 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20616 if (!ptr_is_owned(_res)) return;
20617 void* _res_ptr = untag_ptr(_res);
20618 CHECK_ACCESS(_res_ptr);
20619 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
20620 FREE(untag_ptr(_res));
20621 CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
20624 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
20625 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
20626 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
20627 return tag_ptr(ret_conv, true);
20629 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20630 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(arg);
20631 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
20635 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20636 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(orig);
20637 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
20638 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
20639 return tag_ptr(ret_conv, true);
20642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20643 LDKThirtyTwoBytes o_ref;
20644 CHECK((*env)->GetArrayLength(env, o) == 32);
20645 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
20646 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
20647 *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
20648 return tag_ptr(ret_conv, true);
20651 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err(JNIEnv *env, jclass clz) {
20652 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
20653 *ret_conv = CResult_PaymentSecretNoneZ_err();
20654 return tag_ptr(ret_conv, true);
20657 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20658 LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(o);
20659 jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv);
20663 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20664 if (!ptr_is_owned(_res)) return;
20665 void* _res_ptr = untag_ptr(_res);
20666 CHECK_ACCESS(_res_ptr);
20667 LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
20668 FREE(untag_ptr(_res));
20669 CResult_PaymentSecretNoneZ_free(_res_conv);
20672 static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
20673 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
20674 *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
20675 return tag_ptr(ret_conv, true);
20677 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20678 LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(arg);
20679 int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
20683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20684 LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(orig);
20685 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
20686 *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
20687 return tag_ptr(ret_conv, true);
20690 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20691 LDKThirtyTwoBytes o_ref;
20692 CHECK((*env)->GetArrayLength(env, o) == 32);
20693 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
20694 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
20695 *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref);
20696 return tag_ptr(ret_conv, true);
20699 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20700 void* e_ptr = untag_ptr(e);
20701 CHECK_ACCESS(e_ptr);
20702 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
20703 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
20704 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
20705 *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
20706 return tag_ptr(ret_conv, true);
20709 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20710 LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(o);
20711 jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv);
20715 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20716 if (!ptr_is_owned(_res)) return;
20717 void* _res_ptr = untag_ptr(_res);
20718 CHECK_ACCESS(_res_ptr);
20719 LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
20720 FREE(untag_ptr(_res));
20721 CResult_PaymentSecretAPIErrorZ_free(_res_conv);
20724 static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) {
20725 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
20726 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg);
20727 return tag_ptr(ret_conv, true);
20729 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20730 LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(arg);
20731 int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv);
20735 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20736 LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(orig);
20737 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
20738 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv);
20739 return tag_ptr(ret_conv, true);
20742 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20743 LDKThirtyTwoBytes o_ref;
20744 CHECK((*env)->GetArrayLength(env, o) == 32);
20745 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
20746 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
20747 *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
20748 return tag_ptr(ret_conv, true);
20751 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20752 void* e_ptr = untag_ptr(e);
20753 CHECK_ACCESS(e_ptr);
20754 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
20755 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
20756 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
20757 *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
20758 return tag_ptr(ret_conv, true);
20761 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20762 LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(o);
20763 jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
20767 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20768 if (!ptr_is_owned(_res)) return;
20769 void* _res_ptr = untag_ptr(_res);
20770 CHECK_ACCESS(_res_ptr);
20771 LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
20772 FREE(untag_ptr(_res));
20773 CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
20776 static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
20777 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
20778 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
20779 return tag_ptr(ret_conv, true);
20781 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20782 LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(arg);
20783 int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
20787 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20788 LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(orig);
20789 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
20790 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
20791 return tag_ptr(ret_conv, true);
20794 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20795 LDKCounterpartyForwardingInfo o_conv;
20796 o_conv.inner = untag_ptr(o);
20797 o_conv.is_owned = ptr_is_owned(o);
20798 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20799 o_conv = CounterpartyForwardingInfo_clone(&o_conv);
20800 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
20801 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv);
20802 return tag_ptr(ret_conv, true);
20805 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20806 void* e_ptr = untag_ptr(e);
20807 CHECK_ACCESS(e_ptr);
20808 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20809 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20810 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
20811 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
20812 return tag_ptr(ret_conv, true);
20815 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20816 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o);
20817 jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv);
20821 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20822 if (!ptr_is_owned(_res)) return;
20823 void* _res_ptr = untag_ptr(_res);
20824 CHECK_ACCESS(_res_ptr);
20825 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr);
20826 FREE(untag_ptr(_res));
20827 CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv);
20830 static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) {
20831 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
20832 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg);
20833 return tag_ptr(ret_conv, true);
20835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20836 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg);
20837 int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv);
20841 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20842 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig);
20843 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
20844 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv);
20845 return tag_ptr(ret_conv, true);
20848 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20849 LDKChannelCounterparty o_conv;
20850 o_conv.inner = untag_ptr(o);
20851 o_conv.is_owned = ptr_is_owned(o);
20852 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20853 o_conv = ChannelCounterparty_clone(&o_conv);
20854 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
20855 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv);
20856 return tag_ptr(ret_conv, true);
20859 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20860 void* e_ptr = untag_ptr(e);
20861 CHECK_ACCESS(e_ptr);
20862 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20863 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20864 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
20865 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
20866 return tag_ptr(ret_conv, true);
20869 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20870 LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o);
20871 jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv);
20875 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20876 if (!ptr_is_owned(_res)) return;
20877 void* _res_ptr = untag_ptr(_res);
20878 CHECK_ACCESS(_res_ptr);
20879 LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr);
20880 FREE(untag_ptr(_res));
20881 CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv);
20884 static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) {
20885 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
20886 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg);
20887 return tag_ptr(ret_conv, true);
20889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20890 LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg);
20891 int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv);
20895 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20896 LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig);
20897 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
20898 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv);
20899 return tag_ptr(ret_conv, true);
20902 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20903 LDKChannelDetails o_conv;
20904 o_conv.inner = untag_ptr(o);
20905 o_conv.is_owned = ptr_is_owned(o);
20906 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20907 o_conv = ChannelDetails_clone(&o_conv);
20908 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
20909 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv);
20910 return tag_ptr(ret_conv, true);
20913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20914 void* e_ptr = untag_ptr(e);
20915 CHECK_ACCESS(e_ptr);
20916 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20917 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20918 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
20919 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
20920 return tag_ptr(ret_conv, true);
20923 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20924 LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o);
20925 jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv);
20929 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20930 if (!ptr_is_owned(_res)) return;
20931 void* _res_ptr = untag_ptr(_res);
20932 CHECK_ACCESS(_res_ptr);
20933 LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr);
20934 FREE(untag_ptr(_res));
20935 CResult_ChannelDetailsDecodeErrorZ_free(_res_conv);
20938 static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) {
20939 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
20940 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg);
20941 return tag_ptr(ret_conv, true);
20943 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20944 LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg);
20945 int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv);
20949 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20950 LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig);
20951 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
20952 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv);
20953 return tag_ptr(ret_conv, true);
20956 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20957 LDKPhantomRouteHints o_conv;
20958 o_conv.inner = untag_ptr(o);
20959 o_conv.is_owned = ptr_is_owned(o);
20960 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20961 o_conv = PhantomRouteHints_clone(&o_conv);
20962 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
20963 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv);
20964 return tag_ptr(ret_conv, true);
20967 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20968 void* e_ptr = untag_ptr(e);
20969 CHECK_ACCESS(e_ptr);
20970 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20971 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20972 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
20973 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
20974 return tag_ptr(ret_conv, true);
20977 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20978 LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o);
20979 jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv);
20983 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20984 if (!ptr_is_owned(_res)) return;
20985 void* _res_ptr = untag_ptr(_res);
20986 CHECK_ACCESS(_res_ptr);
20987 LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr);
20988 FREE(untag_ptr(_res));
20989 CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv);
20992 static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) {
20993 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
20994 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg);
20995 return tag_ptr(ret_conv, true);
20997 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20998 LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg);
20999 int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv);
21003 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21004 LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig);
21005 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
21006 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv);
21007 return tag_ptr(ret_conv, true);
21010 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
21011 LDKCVec_ChannelMonitorZ _res_constr;
21012 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21013 if (_res_constr.datalen > 0)
21014 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
21016 _res_constr.data = NULL;
21017 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
21018 for (size_t q = 0; q < _res_constr.datalen; q++) {
21019 int64_t _res_conv_16 = _res_vals[q];
21020 LDKChannelMonitor _res_conv_16_conv;
21021 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
21022 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
21023 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
21024 _res_constr.data[q] = _res_conv_16_conv;
21026 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
21027 CVec_ChannelMonitorZ_free(_res_constr);
21030 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
21031 LDKThirtyTwoBytes a_ref;
21032 CHECK((*env)->GetArrayLength(env, a) == 32);
21033 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
21034 LDKChannelManager b_conv;
21035 b_conv.inner = untag_ptr(b);
21036 b_conv.is_owned = ptr_is_owned(b);
21037 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
21038 // WARNING: we need a move here but no clone is available for LDKChannelManager
21040 LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
21041 *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv);
21042 return tag_ptr(ret_conv, true);
21045 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21046 if (!ptr_is_owned(_res)) return;
21047 void* _res_ptr = untag_ptr(_res);
21048 CHECK_ACCESS(_res_ptr);
21049 LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
21050 FREE(untag_ptr(_res));
21051 C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
21054 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21055 void* o_ptr = untag_ptr(o);
21056 CHECK_ACCESS(o_ptr);
21057 LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
21058 // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
21059 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
21060 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
21061 return tag_ptr(ret_conv, true);
21064 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21065 void* e_ptr = untag_ptr(e);
21066 CHECK_ACCESS(e_ptr);
21067 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21068 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21069 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
21070 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
21071 return tag_ptr(ret_conv, true);
21074 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21075 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(o);
21076 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv);
21080 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21081 if (!ptr_is_owned(_res)) return;
21082 void* _res_ptr = untag_ptr(_res);
21083 CHECK_ACCESS(_res_ptr);
21084 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
21085 FREE(untag_ptr(_res));
21086 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
21089 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21090 LDKChannelConfig o_conv;
21091 o_conv.inner = untag_ptr(o);
21092 o_conv.is_owned = ptr_is_owned(o);
21093 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21094 o_conv = ChannelConfig_clone(&o_conv);
21095 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21096 *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv);
21097 return tag_ptr(ret_conv, true);
21100 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21101 void* e_ptr = untag_ptr(e);
21102 CHECK_ACCESS(e_ptr);
21103 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21104 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21105 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21106 *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
21107 return tag_ptr(ret_conv, true);
21110 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21111 LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(o);
21112 jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv);
21116 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21117 if (!ptr_is_owned(_res)) return;
21118 void* _res_ptr = untag_ptr(_res);
21119 CHECK_ACCESS(_res_ptr);
21120 LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
21121 FREE(untag_ptr(_res));
21122 CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
21125 static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) {
21126 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21127 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg);
21128 return tag_ptr(ret_conv, true);
21130 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21131 LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(arg);
21132 int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv);
21136 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21137 LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(orig);
21138 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21139 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv);
21140 return tag_ptr(ret_conv, true);
21143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21144 LDKOutPoint o_conv;
21145 o_conv.inner = untag_ptr(o);
21146 o_conv.is_owned = ptr_is_owned(o);
21147 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21148 o_conv = OutPoint_clone(&o_conv);
21149 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
21150 *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv);
21151 return tag_ptr(ret_conv, true);
21154 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21155 void* e_ptr = untag_ptr(e);
21156 CHECK_ACCESS(e_ptr);
21157 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21158 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21159 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
21160 *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
21161 return tag_ptr(ret_conv, true);
21164 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21165 LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o);
21166 jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv);
21170 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21171 if (!ptr_is_owned(_res)) return;
21172 void* _res_ptr = untag_ptr(_res);
21173 CHECK_ACCESS(_res_ptr);
21174 LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
21175 FREE(untag_ptr(_res));
21176 CResult_OutPointDecodeErrorZ_free(_res_conv);
21179 static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) {
21180 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
21181 *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg);
21182 return tag_ptr(ret_conv, true);
21184 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21185 LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg);
21186 int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv);
21190 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21191 LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig);
21192 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
21193 *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv);
21194 return tag_ptr(ret_conv, true);
21197 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) {
21198 void* o_ptr = untag_ptr(o);
21199 CHECK_ACCESS(o_ptr);
21200 LDKType o_conv = *(LDKType*)(o_ptr);
21201 if (o_conv.free == LDKType_JCalls_free) {
21202 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
21203 LDKType_JCalls_cloned(&o_conv);
21205 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
21206 *ret_copy = COption_TypeZ_some(o_conv);
21207 int64_t ret_ref = tag_ptr(ret_copy, true);
21211 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none(JNIEnv *env, jclass clz) {
21212 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
21213 *ret_copy = COption_TypeZ_none();
21214 int64_t ret_ref = tag_ptr(ret_copy, true);
21218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21219 if (!ptr_is_owned(_res)) return;
21220 void* _res_ptr = untag_ptr(_res);
21221 CHECK_ACCESS(_res_ptr);
21222 LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
21223 FREE(untag_ptr(_res));
21224 COption_TypeZ_free(_res_conv);
21227 static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) {
21228 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
21229 *ret_copy = COption_TypeZ_clone(arg);
21230 int64_t ret_ref = tag_ptr(ret_copy, true);
21233 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21234 LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)untag_ptr(arg);
21235 int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv);
21239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21240 LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)untag_ptr(orig);
21241 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
21242 *ret_copy = COption_TypeZ_clone(orig_conv);
21243 int64_t ret_ref = tag_ptr(ret_copy, true);
21247 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21248 void* o_ptr = untag_ptr(o);
21249 CHECK_ACCESS(o_ptr);
21250 LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
21251 o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)untag_ptr(o));
21252 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
21253 *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
21254 return tag_ptr(ret_conv, true);
21257 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21258 void* e_ptr = untag_ptr(e);
21259 CHECK_ACCESS(e_ptr);
21260 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21261 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21262 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
21263 *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
21264 return tag_ptr(ret_conv, true);
21267 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21268 LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(o);
21269 jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv);
21273 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21274 if (!ptr_is_owned(_res)) return;
21275 void* _res_ptr = untag_ptr(_res);
21276 CHECK_ACCESS(_res_ptr);
21277 LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
21278 FREE(untag_ptr(_res));
21279 CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
21282 static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) {
21283 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
21284 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg);
21285 return tag_ptr(ret_conv, true);
21287 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21288 LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(arg);
21289 int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv);
21293 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21294 LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(orig);
21295 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
21296 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv);
21297 return tag_ptr(ret_conv, true);
21300 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
21301 LDKThirtyTwoBytes o_ref;
21302 CHECK((*env)->GetArrayLength(env, o) == 32);
21303 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
21304 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
21305 *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
21306 return tag_ptr(ret_conv, true);
21309 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21310 void* e_ptr = untag_ptr(e);
21311 CHECK_ACCESS(e_ptr);
21312 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
21313 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
21314 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
21315 *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
21316 return tag_ptr(ret_conv, true);
21319 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21320 LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(o);
21321 jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv);
21325 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21326 if (!ptr_is_owned(_res)) return;
21327 void* _res_ptr = untag_ptr(_res);
21328 CHECK_ACCESS(_res_ptr);
21329 LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
21330 FREE(untag_ptr(_res));
21331 CResult_PaymentIdPaymentErrorZ_free(_res_conv);
21334 static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) {
21335 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
21336 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg);
21337 return tag_ptr(ret_conv, true);
21339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21340 LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(arg);
21341 int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv);
21345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21346 LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(orig);
21347 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
21348 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
21349 return tag_ptr(ret_conv, true);
21352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21353 LDKInFlightHtlcs o_conv;
21354 o_conv.inner = untag_ptr(o);
21355 o_conv.is_owned = ptr_is_owned(o);
21356 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21357 // WARNING: we need a move here but no clone is available for LDKInFlightHtlcs
21359 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
21360 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_ok(o_conv);
21361 return tag_ptr(ret_conv, true);
21364 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21365 void* e_ptr = untag_ptr(e);
21366 CHECK_ACCESS(e_ptr);
21367 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21368 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21369 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
21370 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv);
21371 return tag_ptr(ret_conv, true);
21374 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21375 LDKCResult_InFlightHtlcsDecodeErrorZ* o_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(o);
21376 jboolean ret_conv = CResult_InFlightHtlcsDecodeErrorZ_is_ok(o_conv);
21380 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21381 if (!ptr_is_owned(_res)) return;
21382 void* _res_ptr = untag_ptr(_res);
21383 CHECK_ACCESS(_res_ptr);
21384 LDKCResult_InFlightHtlcsDecodeErrorZ _res_conv = *(LDKCResult_InFlightHtlcsDecodeErrorZ*)(_res_ptr);
21385 FREE(untag_ptr(_res));
21386 CResult_InFlightHtlcsDecodeErrorZ_free(_res_conv);
21389 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) {
21390 LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o);
21391 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
21392 *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
21393 return tag_ptr(ret_conv, true);
21396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21397 void* e_ptr = untag_ptr(e);
21398 CHECK_ACCESS(e_ptr);
21399 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
21400 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
21401 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
21402 *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
21403 return tag_ptr(ret_conv, true);
21406 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21407 LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
21408 jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
21412 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21413 if (!ptr_is_owned(_res)) return;
21414 void* _res_ptr = untag_ptr(_res);
21415 CHECK_ACCESS(_res_ptr);
21416 LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
21417 FREE(untag_ptr(_res));
21418 CResult_SiPrefixParseErrorZ_free(_res_conv);
21421 static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
21422 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
21423 *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
21424 return tag_ptr(ret_conv, true);
21426 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21427 LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
21428 int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
21432 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21433 LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
21434 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
21435 *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
21436 return tag_ptr(ret_conv, true);
21439 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21441 o_conv.inner = untag_ptr(o);
21442 o_conv.is_owned = ptr_is_owned(o);
21443 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21444 o_conv = Invoice_clone(&o_conv);
21445 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
21446 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
21447 return tag_ptr(ret_conv, true);
21450 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21451 void* e_ptr = untag_ptr(e);
21452 CHECK_ACCESS(e_ptr);
21453 LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
21454 e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
21455 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
21456 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
21457 return tag_ptr(ret_conv, true);
21460 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21461 LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
21462 jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
21466 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21467 if (!ptr_is_owned(_res)) return;
21468 void* _res_ptr = untag_ptr(_res);
21469 CHECK_ACCESS(_res_ptr);
21470 LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
21471 FREE(untag_ptr(_res));
21472 CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
21475 static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
21476 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
21477 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
21478 return tag_ptr(ret_conv, true);
21480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21481 LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
21482 int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
21486 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21487 LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
21488 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
21489 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
21490 return tag_ptr(ret_conv, true);
21493 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21494 LDKSignedRawInvoice o_conv;
21495 o_conv.inner = untag_ptr(o);
21496 o_conv.is_owned = ptr_is_owned(o);
21497 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21498 o_conv = SignedRawInvoice_clone(&o_conv);
21499 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
21500 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
21501 return tag_ptr(ret_conv, true);
21504 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21505 void* e_ptr = untag_ptr(e);
21506 CHECK_ACCESS(e_ptr);
21507 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
21508 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
21509 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
21510 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
21511 return tag_ptr(ret_conv, true);
21514 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21515 LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
21516 jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
21520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21521 if (!ptr_is_owned(_res)) return;
21522 void* _res_ptr = untag_ptr(_res);
21523 CHECK_ACCESS(_res_ptr);
21524 LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
21525 FREE(untag_ptr(_res));
21526 CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
21529 static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
21530 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
21531 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
21532 return tag_ptr(ret_conv, true);
21534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21535 LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
21536 int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
21540 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21541 LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
21542 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
21543 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
21544 return tag_ptr(ret_conv, true);
21547 static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
21548 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
21549 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
21550 return tag_ptr(ret_conv, true);
21552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21553 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
21554 int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
21558 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21559 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
21560 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
21561 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
21562 return tag_ptr(ret_conv, true);
21565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b, int64_t c) {
21566 LDKRawInvoice a_conv;
21567 a_conv.inner = untag_ptr(a);
21568 a_conv.is_owned = ptr_is_owned(a);
21569 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
21570 a_conv = RawInvoice_clone(&a_conv);
21571 LDKThirtyTwoBytes b_ref;
21572 CHECK((*env)->GetArrayLength(env, b) == 32);
21573 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
21574 LDKInvoiceSignature c_conv;
21575 c_conv.inner = untag_ptr(c);
21576 c_conv.is_owned = ptr_is_owned(c);
21577 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
21578 c_conv = InvoiceSignature_clone(&c_conv);
21579 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
21580 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
21581 return tag_ptr(ret_conv, true);
21584 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21585 if (!ptr_is_owned(_res)) return;
21586 void* _res_ptr = untag_ptr(_res);
21587 CHECK_ACCESS(_res_ptr);
21588 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
21589 FREE(untag_ptr(_res));
21590 C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
21593 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21594 LDKPayeePubKey o_conv;
21595 o_conv.inner = untag_ptr(o);
21596 o_conv.is_owned = ptr_is_owned(o);
21597 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21598 o_conv = PayeePubKey_clone(&o_conv);
21599 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
21600 *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
21601 return tag_ptr(ret_conv, true);
21604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
21605 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
21606 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
21607 *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
21608 return tag_ptr(ret_conv, true);
21611 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21612 LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
21613 jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
21617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21618 if (!ptr_is_owned(_res)) return;
21619 void* _res_ptr = untag_ptr(_res);
21620 CHECK_ACCESS(_res_ptr);
21621 LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
21622 FREE(untag_ptr(_res));
21623 CResult_PayeePubKeyErrorZ_free(_res_conv);
21626 static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
21627 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
21628 *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
21629 return tag_ptr(ret_conv, true);
21631 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21632 LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
21633 int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
21637 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21638 LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
21639 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
21640 *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
21641 return tag_ptr(ret_conv, true);
21644 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
21645 LDKCVec_PrivateRouteZ _res_constr;
21646 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21647 if (_res_constr.datalen > 0)
21648 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
21650 _res_constr.data = NULL;
21651 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
21652 for (size_t o = 0; o < _res_constr.datalen; o++) {
21653 int64_t _res_conv_14 = _res_vals[o];
21654 LDKPrivateRoute _res_conv_14_conv;
21655 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
21656 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
21657 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
21658 _res_constr.data[o] = _res_conv_14_conv;
21660 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
21661 CVec_PrivateRouteZ_free(_res_constr);
21664 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21665 LDKPositiveTimestamp o_conv;
21666 o_conv.inner = untag_ptr(o);
21667 o_conv.is_owned = ptr_is_owned(o);
21668 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21669 o_conv = PositiveTimestamp_clone(&o_conv);
21670 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
21671 *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
21672 return tag_ptr(ret_conv, true);
21675 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
21676 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
21677 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
21678 *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
21679 return tag_ptr(ret_conv, true);
21682 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21683 LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
21684 jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
21688 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21689 if (!ptr_is_owned(_res)) return;
21690 void* _res_ptr = untag_ptr(_res);
21691 CHECK_ACCESS(_res_ptr);
21692 LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
21693 FREE(untag_ptr(_res));
21694 CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
21697 static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
21698 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
21699 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
21700 return tag_ptr(ret_conv, true);
21702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21703 LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
21704 int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
21708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21709 LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
21710 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
21711 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
21712 return tag_ptr(ret_conv, true);
21715 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok(JNIEnv *env, jclass clz) {
21716 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
21717 *ret_conv = CResult_NoneSemanticErrorZ_ok();
21718 return tag_ptr(ret_conv, true);
21721 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
21722 LDKSemanticError e_conv = LDKSemanticError_from_java(env, e);
21723 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
21724 *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
21725 return tag_ptr(ret_conv, true);
21728 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21729 LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
21730 jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
21734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21735 if (!ptr_is_owned(_res)) return;
21736 void* _res_ptr = untag_ptr(_res);
21737 CHECK_ACCESS(_res_ptr);
21738 LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
21739 FREE(untag_ptr(_res));
21740 CResult_NoneSemanticErrorZ_free(_res_conv);
21743 static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
21744 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
21745 *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
21746 return tag_ptr(ret_conv, true);
21748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21749 LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
21750 int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
21754 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21755 LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
21756 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
21757 *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
21758 return tag_ptr(ret_conv, true);
21761 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21763 o_conv.inner = untag_ptr(o);
21764 o_conv.is_owned = ptr_is_owned(o);
21765 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21766 o_conv = Invoice_clone(&o_conv);
21767 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
21768 *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
21769 return tag_ptr(ret_conv, true);
21772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
21773 LDKSemanticError e_conv = LDKSemanticError_from_java(env, e);
21774 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
21775 *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
21776 return tag_ptr(ret_conv, true);
21779 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21780 LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
21781 jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
21785 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21786 if (!ptr_is_owned(_res)) return;
21787 void* _res_ptr = untag_ptr(_res);
21788 CHECK_ACCESS(_res_ptr);
21789 LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
21790 FREE(untag_ptr(_res));
21791 CResult_InvoiceSemanticErrorZ_free(_res_conv);
21794 static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
21795 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
21796 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
21797 return tag_ptr(ret_conv, true);
21799 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21800 LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
21801 int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
21805 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21806 LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
21807 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
21808 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
21809 return tag_ptr(ret_conv, true);
21812 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21813 LDKDescription o_conv;
21814 o_conv.inner = untag_ptr(o);
21815 o_conv.is_owned = ptr_is_owned(o);
21816 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21817 o_conv = Description_clone(&o_conv);
21818 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
21819 *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
21820 return tag_ptr(ret_conv, true);
21823 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
21824 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
21825 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
21826 *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
21827 return tag_ptr(ret_conv, true);
21830 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21831 LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
21832 jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
21836 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21837 if (!ptr_is_owned(_res)) return;
21838 void* _res_ptr = untag_ptr(_res);
21839 CHECK_ACCESS(_res_ptr);
21840 LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
21841 FREE(untag_ptr(_res));
21842 CResult_DescriptionCreationErrorZ_free(_res_conv);
21845 static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
21846 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
21847 *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
21848 return tag_ptr(ret_conv, true);
21850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21851 LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
21852 int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
21856 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21857 LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
21858 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
21859 *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
21860 return tag_ptr(ret_conv, true);
21863 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21864 LDKPrivateRoute o_conv;
21865 o_conv.inner = untag_ptr(o);
21866 o_conv.is_owned = ptr_is_owned(o);
21867 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21868 o_conv = PrivateRoute_clone(&o_conv);
21869 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
21870 *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
21871 return tag_ptr(ret_conv, true);
21874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
21875 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
21876 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
21877 *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
21878 return tag_ptr(ret_conv, true);
21881 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21882 LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
21883 jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
21887 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21888 if (!ptr_is_owned(_res)) return;
21889 void* _res_ptr = untag_ptr(_res);
21890 CHECK_ACCESS(_res_ptr);
21891 LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
21892 FREE(untag_ptr(_res));
21893 CResult_PrivateRouteCreationErrorZ_free(_res_conv);
21896 static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
21897 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
21898 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
21899 return tag_ptr(ret_conv, true);
21901 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21902 LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
21903 int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
21907 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21908 LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
21909 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
21910 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
21911 return tag_ptr(ret_conv, true);
21914 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok(JNIEnv *env, jclass clz, jstring o) {
21915 LDKStr o_conv = java_to_owned_str(env, o);
21916 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
21917 *ret_conv = CResult_StringErrorZ_ok(o_conv);
21918 return tag_ptr(ret_conv, true);
21921 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
21922 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
21923 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
21924 *ret_conv = CResult_StringErrorZ_err(e_conv);
21925 return tag_ptr(ret_conv, true);
21928 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21929 LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
21930 jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
21934 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21935 if (!ptr_is_owned(_res)) return;
21936 void* _res_ptr = untag_ptr(_res);
21937 CHECK_ACCESS(_res_ptr);
21938 LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
21939 FREE(untag_ptr(_res));
21940 CResult_StringErrorZ_free(_res_conv);
21943 static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
21944 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
21945 *ret_conv = CResult_StringErrorZ_clone(arg);
21946 return tag_ptr(ret_conv, true);
21948 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21949 LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
21950 int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
21954 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21955 LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
21956 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
21957 *ret_conv = CResult_StringErrorZ_clone(orig_conv);
21958 return tag_ptr(ret_conv, true);
21961 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21962 LDKChannelMonitorUpdate o_conv;
21963 o_conv.inner = untag_ptr(o);
21964 o_conv.is_owned = ptr_is_owned(o);
21965 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21966 o_conv = ChannelMonitorUpdate_clone(&o_conv);
21967 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
21968 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
21969 return tag_ptr(ret_conv, true);
21972 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21973 void* e_ptr = untag_ptr(e);
21974 CHECK_ACCESS(e_ptr);
21975 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21976 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21977 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
21978 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
21979 return tag_ptr(ret_conv, true);
21982 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21983 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
21984 jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
21988 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21989 if (!ptr_is_owned(_res)) return;
21990 void* _res_ptr = untag_ptr(_res);
21991 CHECK_ACCESS(_res_ptr);
21992 LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
21993 FREE(untag_ptr(_res));
21994 CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
21997 static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
21998 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
21999 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
22000 return tag_ptr(ret_conv, true);
22002 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22003 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
22004 int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
22008 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22009 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
22010 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
22011 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
22012 return tag_ptr(ret_conv, true);
22015 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) {
22016 void* o_ptr = untag_ptr(o);
22017 CHECK_ACCESS(o_ptr);
22018 LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
22019 o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
22020 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
22021 *ret_copy = COption_MonitorEventZ_some(o_conv);
22022 int64_t ret_ref = tag_ptr(ret_copy, true);
22026 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) {
22027 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
22028 *ret_copy = COption_MonitorEventZ_none();
22029 int64_t ret_ref = tag_ptr(ret_copy, true);
22033 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22034 if (!ptr_is_owned(_res)) return;
22035 void* _res_ptr = untag_ptr(_res);
22036 CHECK_ACCESS(_res_ptr);
22037 LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
22038 FREE(untag_ptr(_res));
22039 COption_MonitorEventZ_free(_res_conv);
22042 static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
22043 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
22044 *ret_copy = COption_MonitorEventZ_clone(arg);
22045 int64_t ret_ref = tag_ptr(ret_copy, true);
22048 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22049 LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
22050 int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
22054 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22055 LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
22056 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
22057 *ret_copy = COption_MonitorEventZ_clone(orig_conv);
22058 int64_t ret_ref = tag_ptr(ret_copy, true);
22062 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22063 void* o_ptr = untag_ptr(o);
22064 CHECK_ACCESS(o_ptr);
22065 LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
22066 o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
22067 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22068 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
22069 return tag_ptr(ret_conv, true);
22072 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22073 void* e_ptr = untag_ptr(e);
22074 CHECK_ACCESS(e_ptr);
22075 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22076 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22077 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22078 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
22079 return tag_ptr(ret_conv, true);
22082 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22083 LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
22084 jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
22088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22089 if (!ptr_is_owned(_res)) return;
22090 void* _res_ptr = untag_ptr(_res);
22091 CHECK_ACCESS(_res_ptr);
22092 LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
22093 FREE(untag_ptr(_res));
22094 CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
22097 static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
22098 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22099 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
22100 return tag_ptr(ret_conv, true);
22102 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22103 LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
22104 int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
22108 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22109 LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
22110 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22111 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
22112 return tag_ptr(ret_conv, true);
22115 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22116 LDKHTLCUpdate o_conv;
22117 o_conv.inner = untag_ptr(o);
22118 o_conv.is_owned = ptr_is_owned(o);
22119 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22120 o_conv = HTLCUpdate_clone(&o_conv);
22121 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22122 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
22123 return tag_ptr(ret_conv, true);
22126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22127 void* e_ptr = untag_ptr(e);
22128 CHECK_ACCESS(e_ptr);
22129 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22130 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22131 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22132 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
22133 return tag_ptr(ret_conv, true);
22136 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22137 LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(o);
22138 jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv);
22142 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22143 if (!ptr_is_owned(_res)) return;
22144 void* _res_ptr = untag_ptr(_res);
22145 CHECK_ACCESS(_res_ptr);
22146 LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
22147 FREE(untag_ptr(_res));
22148 CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
22151 static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) {
22152 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22153 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg);
22154 return tag_ptr(ret_conv, true);
22156 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22157 LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(arg);
22158 int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv);
22162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22163 LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(orig);
22164 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22165 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv);
22166 return tag_ptr(ret_conv, true);
22169 static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
22170 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
22171 *ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
22172 return tag_ptr(ret_conv, true);
22174 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22175 LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(arg);
22176 int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv);
22180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22181 LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(orig);
22182 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
22183 *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv);
22184 return tag_ptr(ret_conv, true);
22187 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
22188 LDKOutPoint a_conv;
22189 a_conv.inner = untag_ptr(a);
22190 a_conv.is_owned = ptr_is_owned(a);
22191 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22192 a_conv = OutPoint_clone(&a_conv);
22194 b_ref.datalen = (*env)->GetArrayLength(env, b);
22195 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
22196 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
22197 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
22198 *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref);
22199 return tag_ptr(ret_conv, true);
22202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22203 if (!ptr_is_owned(_res)) return;
22204 void* _res_ptr = untag_ptr(_res);
22205 CHECK_ACCESS(_res_ptr);
22206 LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
22207 FREE(untag_ptr(_res));
22208 C2Tuple_OutPointScriptZ_free(_res_conv);
22211 static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) {
22212 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
22213 *ret_conv = C2Tuple_u32ScriptZ_clone(arg);
22214 return tag_ptr(ret_conv, true);
22216 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22217 LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(arg);
22218 int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv);
22222 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22223 LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(orig);
22224 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
22225 *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv);
22226 return tag_ptr(ret_conv, true);
22229 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_t a, int8_tArray b) {
22231 b_ref.datalen = (*env)->GetArrayLength(env, b);
22232 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
22233 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
22234 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
22235 *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref);
22236 return tag_ptr(ret_conv, true);
22239 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22240 if (!ptr_is_owned(_res)) return;
22241 void* _res_ptr = untag_ptr(_res);
22242 CHECK_ACCESS(_res_ptr);
22243 LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
22244 FREE(untag_ptr(_res));
22245 C2Tuple_u32ScriptZ_free(_res_conv);
22248 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22249 LDKCVec_C2Tuple_u32ScriptZZ _res_constr;
22250 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22251 if (_res_constr.datalen > 0)
22252 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
22254 _res_constr.data = NULL;
22255 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22256 for (size_t v = 0; v < _res_constr.datalen; v++) {
22257 int64_t _res_conv_21 = _res_vals[v];
22258 void* _res_conv_21_ptr = untag_ptr(_res_conv_21);
22259 CHECK_ACCESS(_res_conv_21_ptr);
22260 LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
22261 FREE(untag_ptr(_res_conv_21));
22262 _res_constr.data[v] = _res_conv_21_conv;
22264 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22265 CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
22268 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) {
22269 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
22270 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg);
22271 return tag_ptr(ret_conv, true);
22273 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22274 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(arg);
22275 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv);
22279 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22280 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(orig);
22281 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
22282 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv);
22283 return tag_ptr(ret_conv, true);
22286 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
22287 LDKThirtyTwoBytes a_ref;
22288 CHECK((*env)->GetArrayLength(env, a) == 32);
22289 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
22290 LDKCVec_C2Tuple_u32ScriptZZ b_constr;
22291 b_constr.datalen = (*env)->GetArrayLength(env, b);
22292 if (b_constr.datalen > 0)
22293 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
22295 b_constr.data = NULL;
22296 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
22297 for (size_t v = 0; v < b_constr.datalen; v++) {
22298 int64_t b_conv_21 = b_vals[v];
22299 void* b_conv_21_ptr = untag_ptr(b_conv_21);
22300 CHECK_ACCESS(b_conv_21_ptr);
22301 LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
22302 b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)untag_ptr(b_conv_21));
22303 b_constr.data[v] = b_conv_21_conv;
22305 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
22306 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
22307 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
22308 return tag_ptr(ret_conv, true);
22311 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22312 if (!ptr_is_owned(_res)) return;
22313 void* _res_ptr = untag_ptr(_res);
22314 CHECK_ACCESS(_res_ptr);
22315 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
22316 FREE(untag_ptr(_res));
22317 C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
22320 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22321 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr;
22322 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22323 if (_res_constr.datalen > 0)
22324 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
22326 _res_constr.data = NULL;
22327 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22328 for (size_t o = 0; o < _res_constr.datalen; o++) {
22329 int64_t _res_conv_40 = _res_vals[o];
22330 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
22331 CHECK_ACCESS(_res_conv_40_ptr);
22332 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
22333 FREE(untag_ptr(_res_conv_40));
22334 _res_constr.data[o] = _res_conv_40_conv;
22336 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22337 CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
22340 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22341 LDKCVec_EventZ _res_constr;
22342 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22343 if (_res_constr.datalen > 0)
22344 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
22346 _res_constr.data = NULL;
22347 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22348 for (size_t h = 0; h < _res_constr.datalen; h++) {
22349 int64_t _res_conv_7 = _res_vals[h];
22350 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
22351 CHECK_ACCESS(_res_conv_7_ptr);
22352 LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
22353 FREE(untag_ptr(_res_conv_7));
22354 _res_constr.data[h] = _res_conv_7_conv;
22356 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22357 CVec_EventZ_free(_res_constr);
22360 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
22361 LDKCVec_TransactionZ _res_constr;
22362 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22363 if (_res_constr.datalen > 0)
22364 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
22366 _res_constr.data = NULL;
22367 for (size_t i = 0; i < _res_constr.datalen; i++) {
22368 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
22369 LDKTransaction _res_conv_8_ref;
22370 _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8);
22371 _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes");
22372 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data);
22373 _res_conv_8_ref.data_is_owned = true;
22374 _res_constr.data[i] = _res_conv_8_ref;
22376 CVec_TransactionZ_free(_res_constr);
22379 static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) {
22380 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
22381 *ret_conv = C2Tuple_u32TxOutZ_clone(arg);
22382 return tag_ptr(ret_conv, true);
22384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22385 LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(arg);
22386 int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv);
22390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22391 LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(orig);
22392 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
22393 *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv);
22394 return tag_ptr(ret_conv, true);
22397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) {
22398 void* b_ptr = untag_ptr(b);
22399 CHECK_ACCESS(b_ptr);
22400 LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
22401 b_conv = TxOut_clone((LDKTxOut*)untag_ptr(b));
22402 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
22403 *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
22404 return tag_ptr(ret_conv, true);
22407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22408 if (!ptr_is_owned(_res)) return;
22409 void* _res_ptr = untag_ptr(_res);
22410 CHECK_ACCESS(_res_ptr);
22411 LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
22412 FREE(untag_ptr(_res));
22413 C2Tuple_u32TxOutZ_free(_res_conv);
22416 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22417 LDKCVec_C2Tuple_u32TxOutZZ _res_constr;
22418 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22419 if (_res_constr.datalen > 0)
22420 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
22422 _res_constr.data = NULL;
22423 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22424 for (size_t u = 0; u < _res_constr.datalen; u++) {
22425 int64_t _res_conv_20 = _res_vals[u];
22426 void* _res_conv_20_ptr = untag_ptr(_res_conv_20);
22427 CHECK_ACCESS(_res_conv_20_ptr);
22428 LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
22429 FREE(untag_ptr(_res_conv_20));
22430 _res_constr.data[u] = _res_conv_20_conv;
22432 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22433 CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
22436 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) {
22437 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22438 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg);
22439 return tag_ptr(ret_conv, true);
22441 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22442 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(arg);
22443 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv);
22447 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22448 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(orig);
22449 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22450 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv);
22451 return tag_ptr(ret_conv, true);
22454 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
22455 LDKThirtyTwoBytes a_ref;
22456 CHECK((*env)->GetArrayLength(env, a) == 32);
22457 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
22458 LDKCVec_C2Tuple_u32TxOutZZ b_constr;
22459 b_constr.datalen = (*env)->GetArrayLength(env, b);
22460 if (b_constr.datalen > 0)
22461 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
22463 b_constr.data = NULL;
22464 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
22465 for (size_t u = 0; u < b_constr.datalen; u++) {
22466 int64_t b_conv_20 = b_vals[u];
22467 void* b_conv_20_ptr = untag_ptr(b_conv_20);
22468 CHECK_ACCESS(b_conv_20_ptr);
22469 LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
22470 b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)untag_ptr(b_conv_20));
22471 b_constr.data[u] = b_conv_20_conv;
22473 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
22474 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22475 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
22476 return tag_ptr(ret_conv, true);
22479 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22480 if (!ptr_is_owned(_res)) return;
22481 void* _res_ptr = untag_ptr(_res);
22482 CHECK_ACCESS(_res_ptr);
22483 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
22484 FREE(untag_ptr(_res));
22485 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
22488 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22489 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr;
22490 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22491 if (_res_constr.datalen > 0)
22492 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
22494 _res_constr.data = NULL;
22495 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22496 for (size_t n = 0; n < _res_constr.datalen; n++) {
22497 int64_t _res_conv_39 = _res_vals[n];
22498 void* _res_conv_39_ptr = untag_ptr(_res_conv_39);
22499 CHECK_ACCESS(_res_conv_39_ptr);
22500 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
22501 FREE(untag_ptr(_res_conv_39));
22502 _res_constr.data[n] = _res_conv_39_conv;
22504 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22505 CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
22508 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BalanceZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22509 LDKCVec_BalanceZ _res_constr;
22510 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22511 if (_res_constr.datalen > 0)
22512 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements");
22514 _res_constr.data = NULL;
22515 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22516 for (size_t j = 0; j < _res_constr.datalen; j++) {
22517 int64_t _res_conv_9 = _res_vals[j];
22518 void* _res_conv_9_ptr = untag_ptr(_res_conv_9);
22519 CHECK_ACCESS(_res_conv_9_ptr);
22520 LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
22521 FREE(untag_ptr(_res_conv_9));
22522 _res_constr.data[j] = _res_conv_9_conv;
22524 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22525 CVec_BalanceZ_free(_res_constr);
22528 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22529 void* o_ptr = untag_ptr(o);
22530 CHECK_ACCESS(o_ptr);
22531 LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
22532 o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o));
22533 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
22534 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
22535 return tag_ptr(ret_conv, true);
22538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22539 void* e_ptr = untag_ptr(e);
22540 CHECK_ACCESS(e_ptr);
22541 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22542 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22543 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
22544 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
22545 return tag_ptr(ret_conv, true);
22548 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22549 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(o);
22550 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv);
22554 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22555 if (!ptr_is_owned(_res)) return;
22556 void* _res_ptr = untag_ptr(_res);
22557 CHECK_ACCESS(_res_ptr);
22558 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
22559 FREE(untag_ptr(_res));
22560 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
22563 static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) {
22564 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
22565 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg);
22566 return tag_ptr(ret_conv, true);
22568 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22569 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(arg);
22570 int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv);
22574 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22575 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(orig);
22576 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
22577 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv);
22578 return tag_ptr(ret_conv, true);
22581 static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) {
22582 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
22583 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg);
22584 return tag_ptr(ret_conv, true);
22586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22587 LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(arg);
22588 int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv);
22592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22593 LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
22594 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
22595 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
22596 return tag_ptr(ret_conv, true);
22599 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
22600 LDKPublicKey a_ref;
22601 CHECK((*env)->GetArrayLength(env, a) == 33);
22602 (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
22603 void* b_ptr = untag_ptr(b);
22604 CHECK_ACCESS(b_ptr);
22605 LDKType b_conv = *(LDKType*)(b_ptr);
22606 if (b_conv.free == LDKType_JCalls_free) {
22607 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22608 LDKType_JCalls_cloned(&b_conv);
22610 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
22611 *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
22612 return tag_ptr(ret_conv, true);
22615 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22616 if (!ptr_is_owned(_res)) return;
22617 void* _res_ptr = untag_ptr(_res);
22618 CHECK_ACCESS(_res_ptr);
22619 LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
22620 FREE(untag_ptr(_res));
22621 C2Tuple_PublicKeyTypeZ_free(_res_conv);
22624 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22625 LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
22626 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22627 if (_res_constr.datalen > 0)
22628 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
22630 _res_constr.data = NULL;
22631 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22632 for (size_t z = 0; z < _res_constr.datalen; z++) {
22633 int64_t _res_conv_25 = _res_vals[z];
22634 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
22635 CHECK_ACCESS(_res_conv_25_ptr);
22636 LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
22637 FREE(untag_ptr(_res_conv_25));
22638 _res_constr.data[z] = _res_conv_25_conv;
22640 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22641 CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
22644 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1some(JNIEnv *env, jclass clz, int64_t o) {
22645 void* o_ptr = untag_ptr(o);
22646 CHECK_ACCESS(o_ptr);
22647 LDKCustomOnionMessageContents o_conv = *(LDKCustomOnionMessageContents*)(o_ptr);
22648 if (o_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
22649 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22650 LDKCustomOnionMessageContents_JCalls_cloned(&o_conv);
22652 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
22653 *ret_copy = COption_CustomOnionMessageContentsZ_some(o_conv);
22654 int64_t ret_ref = tag_ptr(ret_copy, true);
22658 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none(JNIEnv *env, jclass clz) {
22659 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
22660 *ret_copy = COption_CustomOnionMessageContentsZ_none();
22661 int64_t ret_ref = tag_ptr(ret_copy, true);
22665 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22666 if (!ptr_is_owned(_res)) return;
22667 void* _res_ptr = untag_ptr(_res);
22668 CHECK_ACCESS(_res_ptr);
22669 LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr);
22670 FREE(untag_ptr(_res));
22671 COption_CustomOnionMessageContentsZ_free(_res_conv);
22674 static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) {
22675 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
22676 *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg);
22677 int64_t ret_ref = tag_ptr(ret_copy, true);
22680 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22681 LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg);
22682 int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv);
22686 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22687 LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig);
22688 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
22689 *ret_copy = COption_CustomOnionMessageContentsZ_clone(orig_conv);
22690 int64_t ret_ref = tag_ptr(ret_copy, true);
22694 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22695 void* o_ptr = untag_ptr(o);
22696 CHECK_ACCESS(o_ptr);
22697 LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr);
22698 o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o));
22699 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
22700 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_conv);
22701 return tag_ptr(ret_conv, true);
22704 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22705 void* e_ptr = untag_ptr(e);
22706 CHECK_ACCESS(e_ptr);
22707 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22708 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22709 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
22710 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_conv);
22711 return tag_ptr(ret_conv, true);
22714 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22715 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o);
22716 jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_conv);
22720 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22721 if (!ptr_is_owned(_res)) return;
22722 void* _res_ptr = untag_ptr(_res);
22723 CHECK_ACCESS(_res_ptr);
22724 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr);
22725 FREE(untag_ptr(_res));
22726 CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv);
22729 static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) {
22730 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
22731 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg);
22732 return tag_ptr(ret_conv, true);
22734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22735 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg);
22736 int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_conv);
22740 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22741 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig);
22742 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
22743 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_conv);
22744 return tag_ptr(ret_conv, true);
22747 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) {
22748 void* o_ptr = untag_ptr(o);
22749 CHECK_ACCESS(o_ptr);
22750 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
22751 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
22752 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
22753 *ret_copy = COption_NetAddressZ_some(o_conv);
22754 int64_t ret_ref = tag_ptr(ret_copy, true);
22758 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1none(JNIEnv *env, jclass clz) {
22759 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
22760 *ret_copy = COption_NetAddressZ_none();
22761 int64_t ret_ref = tag_ptr(ret_copy, true);
22765 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22766 if (!ptr_is_owned(_res)) return;
22767 void* _res_ptr = untag_ptr(_res);
22768 CHECK_ACCESS(_res_ptr);
22769 LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
22770 FREE(untag_ptr(_res));
22771 COption_NetAddressZ_free(_res_conv);
22774 static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
22775 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
22776 *ret_copy = COption_NetAddressZ_clone(arg);
22777 int64_t ret_ref = tag_ptr(ret_copy, true);
22780 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22781 LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
22782 int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
22786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22787 LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
22788 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
22789 *ret_copy = COption_NetAddressZ_clone(orig_conv);
22790 int64_t ret_ref = tag_ptr(ret_copy, true);
22794 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
22796 o_ref.datalen = (*env)->GetArrayLength(env, o);
22797 o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
22798 (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data);
22799 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
22800 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
22801 return tag_ptr(ret_conv, true);
22804 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22805 LDKPeerHandleError e_conv;
22806 e_conv.inner = untag_ptr(e);
22807 e_conv.is_owned = ptr_is_owned(e);
22808 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22809 e_conv = PeerHandleError_clone(&e_conv);
22810 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
22811 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
22812 return tag_ptr(ret_conv, true);
22815 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22816 LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
22817 jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
22821 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22822 if (!ptr_is_owned(_res)) return;
22823 void* _res_ptr = untag_ptr(_res);
22824 CHECK_ACCESS(_res_ptr);
22825 LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
22826 FREE(untag_ptr(_res));
22827 CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
22830 static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
22831 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
22832 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
22833 return tag_ptr(ret_conv, true);
22835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22836 LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
22837 int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
22841 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22842 LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
22843 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
22844 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
22845 return tag_ptr(ret_conv, true);
22848 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv *env, jclass clz) {
22849 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
22850 *ret_conv = CResult_NonePeerHandleErrorZ_ok();
22851 return tag_ptr(ret_conv, true);
22854 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22855 LDKPeerHandleError e_conv;
22856 e_conv.inner = untag_ptr(e);
22857 e_conv.is_owned = ptr_is_owned(e);
22858 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22859 e_conv = PeerHandleError_clone(&e_conv);
22860 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
22861 *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
22862 return tag_ptr(ret_conv, true);
22865 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22866 LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
22867 jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
22871 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22872 if (!ptr_is_owned(_res)) return;
22873 void* _res_ptr = untag_ptr(_res);
22874 CHECK_ACCESS(_res_ptr);
22875 LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
22876 FREE(untag_ptr(_res));
22877 CResult_NonePeerHandleErrorZ_free(_res_conv);
22880 static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
22881 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
22882 *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
22883 return tag_ptr(ret_conv, true);
22885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22886 LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
22887 int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
22891 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22892 LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
22893 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
22894 *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
22895 return tag_ptr(ret_conv, true);
22898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) {
22899 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
22900 *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
22901 return tag_ptr(ret_conv, true);
22904 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22905 LDKPeerHandleError e_conv;
22906 e_conv.inner = untag_ptr(e);
22907 e_conv.is_owned = ptr_is_owned(e);
22908 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22909 e_conv = PeerHandleError_clone(&e_conv);
22910 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
22911 *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
22912 return tag_ptr(ret_conv, true);
22915 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22916 LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
22917 jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
22921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22922 if (!ptr_is_owned(_res)) return;
22923 void* _res_ptr = untag_ptr(_res);
22924 CHECK_ACCESS(_res_ptr);
22925 LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
22926 FREE(untag_ptr(_res));
22927 CResult_boolPeerHandleErrorZ_free(_res_conv);
22930 static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
22931 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
22932 *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
22933 return tag_ptr(ret_conv, true);
22935 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22936 LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
22937 int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
22941 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22942 LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
22943 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
22944 *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
22945 return tag_ptr(ret_conv, true);
22948 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok(JNIEnv *env, jclass clz) {
22949 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
22950 *ret_conv = CResult_NoneSendErrorZ_ok();
22951 return tag_ptr(ret_conv, true);
22954 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22955 void* e_ptr = untag_ptr(e);
22956 CHECK_ACCESS(e_ptr);
22957 LDKSendError e_conv = *(LDKSendError*)(e_ptr);
22958 e_conv = SendError_clone((LDKSendError*)untag_ptr(e));
22959 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
22960 *ret_conv = CResult_NoneSendErrorZ_err(e_conv);
22961 return tag_ptr(ret_conv, true);
22964 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22965 LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o);
22966 jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv);
22970 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22971 if (!ptr_is_owned(_res)) return;
22972 void* _res_ptr = untag_ptr(_res);
22973 CHECK_ACCESS(_res_ptr);
22974 LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr);
22975 FREE(untag_ptr(_res));
22976 CResult_NoneSendErrorZ_free(_res_conv);
22979 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1ok(JNIEnv *env, jclass clz, int32_t o) {
22980 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
22981 *ret_conv = CResult_u32GraphSyncErrorZ_ok(o);
22982 return tag_ptr(ret_conv, true);
22985 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22986 void* e_ptr = untag_ptr(e);
22987 CHECK_ACCESS(e_ptr);
22988 LDKGraphSyncError e_conv = *(LDKGraphSyncError*)(e_ptr);
22989 e_conv = GraphSyncError_clone((LDKGraphSyncError*)untag_ptr(e));
22990 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
22991 *ret_conv = CResult_u32GraphSyncErrorZ_err(e_conv);
22992 return tag_ptr(ret_conv, true);
22995 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22996 LDKCResult_u32GraphSyncErrorZ* o_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(o);
22997 jboolean ret_conv = CResult_u32GraphSyncErrorZ_is_ok(o_conv);
23001 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23002 if (!ptr_is_owned(_res)) return;
23003 void* _res_ptr = untag_ptr(_res);
23004 CHECK_ACCESS(_res_ptr);
23005 LDKCResult_u32GraphSyncErrorZ _res_conv = *(LDKCResult_u32GraphSyncErrorZ*)(_res_ptr);
23006 FREE(untag_ptr(_res));
23007 CResult_u32GraphSyncErrorZ_free(_res_conv);
23010 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23011 void* o_ptr = untag_ptr(o);
23012 CHECK_ACCESS(o_ptr);
23013 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
23014 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
23015 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
23016 *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
23017 return tag_ptr(ret_conv, true);
23020 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23021 void* e_ptr = untag_ptr(e);
23022 CHECK_ACCESS(e_ptr);
23023 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23024 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23025 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
23026 *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
23027 return tag_ptr(ret_conv, true);
23030 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23031 LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o);
23032 jboolean ret_conv = CResult_NetAddressDecodeErrorZ_is_ok(o_conv);
23036 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23037 if (!ptr_is_owned(_res)) return;
23038 void* _res_ptr = untag_ptr(_res);
23039 CHECK_ACCESS(_res_ptr);
23040 LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
23041 FREE(untag_ptr(_res));
23042 CResult_NetAddressDecodeErrorZ_free(_res_conv);
23045 static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) {
23046 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
23047 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg);
23048 return tag_ptr(ret_conv, true);
23050 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23051 LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg);
23052 int64_t ret_conv = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv);
23056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23057 LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig);
23058 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
23059 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
23060 return tag_ptr(ret_conv, true);
23063 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23064 LDKCVec_UpdateAddHTLCZ _res_constr;
23065 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23066 if (_res_constr.datalen > 0)
23067 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
23069 _res_constr.data = NULL;
23070 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23071 for (size_t p = 0; p < _res_constr.datalen; p++) {
23072 int64_t _res_conv_15 = _res_vals[p];
23073 LDKUpdateAddHTLC _res_conv_15_conv;
23074 _res_conv_15_conv.inner = untag_ptr(_res_conv_15);
23075 _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15);
23076 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
23077 _res_constr.data[p] = _res_conv_15_conv;
23079 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23080 CVec_UpdateAddHTLCZ_free(_res_constr);
23083 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23084 LDKCVec_UpdateFulfillHTLCZ _res_constr;
23085 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23086 if (_res_constr.datalen > 0)
23087 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
23089 _res_constr.data = NULL;
23090 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23091 for (size_t t = 0; t < _res_constr.datalen; t++) {
23092 int64_t _res_conv_19 = _res_vals[t];
23093 LDKUpdateFulfillHTLC _res_conv_19_conv;
23094 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
23095 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
23096 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
23097 _res_constr.data[t] = _res_conv_19_conv;
23099 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23100 CVec_UpdateFulfillHTLCZ_free(_res_constr);
23103 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23104 LDKCVec_UpdateFailHTLCZ _res_constr;
23105 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23106 if (_res_constr.datalen > 0)
23107 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
23109 _res_constr.data = NULL;
23110 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23111 for (size_t q = 0; q < _res_constr.datalen; q++) {
23112 int64_t _res_conv_16 = _res_vals[q];
23113 LDKUpdateFailHTLC _res_conv_16_conv;
23114 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
23115 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
23116 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
23117 _res_constr.data[q] = _res_conv_16_conv;
23119 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23120 CVec_UpdateFailHTLCZ_free(_res_constr);
23123 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23124 LDKCVec_UpdateFailMalformedHTLCZ _res_constr;
23125 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23126 if (_res_constr.datalen > 0)
23127 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
23129 _res_constr.data = NULL;
23130 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23131 for (size_t z = 0; z < _res_constr.datalen; z++) {
23132 int64_t _res_conv_25 = _res_vals[z];
23133 LDKUpdateFailMalformedHTLC _res_conv_25_conv;
23134 _res_conv_25_conv.inner = untag_ptr(_res_conv_25);
23135 _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25);
23136 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
23137 _res_constr.data[z] = _res_conv_25_conv;
23139 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23140 CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
23143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23144 LDKAcceptChannel o_conv;
23145 o_conv.inner = untag_ptr(o);
23146 o_conv.is_owned = ptr_is_owned(o);
23147 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23148 o_conv = AcceptChannel_clone(&o_conv);
23149 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
23150 *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv);
23151 return tag_ptr(ret_conv, true);
23154 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23155 void* e_ptr = untag_ptr(e);
23156 CHECK_ACCESS(e_ptr);
23157 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23158 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23159 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
23160 *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
23161 return tag_ptr(ret_conv, true);
23164 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23165 LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o);
23166 jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv);
23170 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23171 if (!ptr_is_owned(_res)) return;
23172 void* _res_ptr = untag_ptr(_res);
23173 CHECK_ACCESS(_res_ptr);
23174 LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
23175 FREE(untag_ptr(_res));
23176 CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
23179 static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) {
23180 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
23181 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg);
23182 return tag_ptr(ret_conv, true);
23184 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23185 LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg);
23186 int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv);
23190 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23191 LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig);
23192 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
23193 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv);
23194 return tag_ptr(ret_conv, true);
23197 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23198 LDKAnnouncementSignatures o_conv;
23199 o_conv.inner = untag_ptr(o);
23200 o_conv.is_owned = ptr_is_owned(o);
23201 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23202 o_conv = AnnouncementSignatures_clone(&o_conv);
23203 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
23204 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv);
23205 return tag_ptr(ret_conv, true);
23208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23209 void* e_ptr = untag_ptr(e);
23210 CHECK_ACCESS(e_ptr);
23211 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23212 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23213 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
23214 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
23215 return tag_ptr(ret_conv, true);
23218 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23219 LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o);
23220 jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv);
23224 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23225 if (!ptr_is_owned(_res)) return;
23226 void* _res_ptr = untag_ptr(_res);
23227 CHECK_ACCESS(_res_ptr);
23228 LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
23229 FREE(untag_ptr(_res));
23230 CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
23233 static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) {
23234 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
23235 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg);
23236 return tag_ptr(ret_conv, true);
23238 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23239 LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg);
23240 int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv);
23244 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23245 LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig);
23246 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
23247 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv);
23248 return tag_ptr(ret_conv, true);
23251 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23252 LDKChannelReestablish o_conv;
23253 o_conv.inner = untag_ptr(o);
23254 o_conv.is_owned = ptr_is_owned(o);
23255 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23256 o_conv = ChannelReestablish_clone(&o_conv);
23257 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
23258 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv);
23259 return tag_ptr(ret_conv, true);
23262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23263 void* e_ptr = untag_ptr(e);
23264 CHECK_ACCESS(e_ptr);
23265 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23266 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23267 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
23268 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
23269 return tag_ptr(ret_conv, true);
23272 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23273 LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o);
23274 jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv);
23278 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23279 if (!ptr_is_owned(_res)) return;
23280 void* _res_ptr = untag_ptr(_res);
23281 CHECK_ACCESS(_res_ptr);
23282 LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
23283 FREE(untag_ptr(_res));
23284 CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
23287 static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) {
23288 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
23289 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg);
23290 return tag_ptr(ret_conv, true);
23292 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23293 LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg);
23294 int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv);
23298 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23299 LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig);
23300 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
23301 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv);
23302 return tag_ptr(ret_conv, true);
23305 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23306 LDKClosingSigned o_conv;
23307 o_conv.inner = untag_ptr(o);
23308 o_conv.is_owned = ptr_is_owned(o);
23309 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23310 o_conv = ClosingSigned_clone(&o_conv);
23311 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
23312 *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv);
23313 return tag_ptr(ret_conv, true);
23316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23317 void* e_ptr = untag_ptr(e);
23318 CHECK_ACCESS(e_ptr);
23319 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23320 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23321 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
23322 *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
23323 return tag_ptr(ret_conv, true);
23326 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23327 LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o);
23328 jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv);
23332 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23333 if (!ptr_is_owned(_res)) return;
23334 void* _res_ptr = untag_ptr(_res);
23335 CHECK_ACCESS(_res_ptr);
23336 LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
23337 FREE(untag_ptr(_res));
23338 CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
23341 static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) {
23342 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
23343 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg);
23344 return tag_ptr(ret_conv, true);
23346 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23347 LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg);
23348 int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv);
23352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23353 LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig);
23354 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
23355 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv);
23356 return tag_ptr(ret_conv, true);
23359 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23360 LDKClosingSignedFeeRange o_conv;
23361 o_conv.inner = untag_ptr(o);
23362 o_conv.is_owned = ptr_is_owned(o);
23363 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23364 o_conv = ClosingSignedFeeRange_clone(&o_conv);
23365 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
23366 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv);
23367 return tag_ptr(ret_conv, true);
23370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23371 void* e_ptr = untag_ptr(e);
23372 CHECK_ACCESS(e_ptr);
23373 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23374 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23375 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
23376 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
23377 return tag_ptr(ret_conv, true);
23380 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23381 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o);
23382 jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv);
23386 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23387 if (!ptr_is_owned(_res)) return;
23388 void* _res_ptr = untag_ptr(_res);
23389 CHECK_ACCESS(_res_ptr);
23390 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
23391 FREE(untag_ptr(_res));
23392 CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
23395 static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) {
23396 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
23397 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg);
23398 return tag_ptr(ret_conv, true);
23400 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23401 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg);
23402 int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv);
23406 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23407 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig);
23408 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
23409 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv);
23410 return tag_ptr(ret_conv, true);
23413 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23414 LDKCommitmentSigned o_conv;
23415 o_conv.inner = untag_ptr(o);
23416 o_conv.is_owned = ptr_is_owned(o);
23417 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23418 o_conv = CommitmentSigned_clone(&o_conv);
23419 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
23420 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv);
23421 return tag_ptr(ret_conv, true);
23424 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23425 void* e_ptr = untag_ptr(e);
23426 CHECK_ACCESS(e_ptr);
23427 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23428 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23429 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
23430 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
23431 return tag_ptr(ret_conv, true);
23434 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23435 LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o);
23436 jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv);
23440 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23441 if (!ptr_is_owned(_res)) return;
23442 void* _res_ptr = untag_ptr(_res);
23443 CHECK_ACCESS(_res_ptr);
23444 LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
23445 FREE(untag_ptr(_res));
23446 CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
23449 static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) {
23450 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
23451 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg);
23452 return tag_ptr(ret_conv, true);
23454 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23455 LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg);
23456 int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv);
23460 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23461 LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig);
23462 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
23463 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv);
23464 return tag_ptr(ret_conv, true);
23467 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23468 LDKFundingCreated o_conv;
23469 o_conv.inner = untag_ptr(o);
23470 o_conv.is_owned = ptr_is_owned(o);
23471 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23472 o_conv = FundingCreated_clone(&o_conv);
23473 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
23474 *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv);
23475 return tag_ptr(ret_conv, true);
23478 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23479 void* e_ptr = untag_ptr(e);
23480 CHECK_ACCESS(e_ptr);
23481 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23482 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23483 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
23484 *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
23485 return tag_ptr(ret_conv, true);
23488 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23489 LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o);
23490 jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv);
23494 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23495 if (!ptr_is_owned(_res)) return;
23496 void* _res_ptr = untag_ptr(_res);
23497 CHECK_ACCESS(_res_ptr);
23498 LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
23499 FREE(untag_ptr(_res));
23500 CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
23503 static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) {
23504 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
23505 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg);
23506 return tag_ptr(ret_conv, true);
23508 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23509 LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg);
23510 int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv);
23514 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23515 LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig);
23516 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
23517 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv);
23518 return tag_ptr(ret_conv, true);
23521 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23522 LDKFundingSigned o_conv;
23523 o_conv.inner = untag_ptr(o);
23524 o_conv.is_owned = ptr_is_owned(o);
23525 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23526 o_conv = FundingSigned_clone(&o_conv);
23527 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
23528 *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv);
23529 return tag_ptr(ret_conv, true);
23532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23533 void* e_ptr = untag_ptr(e);
23534 CHECK_ACCESS(e_ptr);
23535 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23536 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23537 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
23538 *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
23539 return tag_ptr(ret_conv, true);
23542 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23543 LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o);
23544 jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv);
23548 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23549 if (!ptr_is_owned(_res)) return;
23550 void* _res_ptr = untag_ptr(_res);
23551 CHECK_ACCESS(_res_ptr);
23552 LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
23553 FREE(untag_ptr(_res));
23554 CResult_FundingSignedDecodeErrorZ_free(_res_conv);
23557 static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) {
23558 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
23559 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg);
23560 return tag_ptr(ret_conv, true);
23562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23563 LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg);
23564 int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv);
23568 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23569 LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig);
23570 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
23571 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv);
23572 return tag_ptr(ret_conv, true);
23575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23576 LDKChannelReady o_conv;
23577 o_conv.inner = untag_ptr(o);
23578 o_conv.is_owned = ptr_is_owned(o);
23579 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23580 o_conv = ChannelReady_clone(&o_conv);
23581 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
23582 *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv);
23583 return tag_ptr(ret_conv, true);
23586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23587 void* e_ptr = untag_ptr(e);
23588 CHECK_ACCESS(e_ptr);
23589 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23590 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23591 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
23592 *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
23593 return tag_ptr(ret_conv, true);
23596 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23597 LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o);
23598 jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv);
23602 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23603 if (!ptr_is_owned(_res)) return;
23604 void* _res_ptr = untag_ptr(_res);
23605 CHECK_ACCESS(_res_ptr);
23606 LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr);
23607 FREE(untag_ptr(_res));
23608 CResult_ChannelReadyDecodeErrorZ_free(_res_conv);
23611 static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) {
23612 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
23613 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg);
23614 return tag_ptr(ret_conv, true);
23616 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23617 LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg);
23618 int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv);
23622 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23623 LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig);
23624 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
23625 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv);
23626 return tag_ptr(ret_conv, true);
23629 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23631 o_conv.inner = untag_ptr(o);
23632 o_conv.is_owned = ptr_is_owned(o);
23633 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23634 o_conv = Init_clone(&o_conv);
23635 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
23636 *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv);
23637 return tag_ptr(ret_conv, true);
23640 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23641 void* e_ptr = untag_ptr(e);
23642 CHECK_ACCESS(e_ptr);
23643 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23644 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23645 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
23646 *ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
23647 return tag_ptr(ret_conv, true);
23650 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23651 LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o);
23652 jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv);
23656 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23657 if (!ptr_is_owned(_res)) return;
23658 void* _res_ptr = untag_ptr(_res);
23659 CHECK_ACCESS(_res_ptr);
23660 LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
23661 FREE(untag_ptr(_res));
23662 CResult_InitDecodeErrorZ_free(_res_conv);
23665 static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) {
23666 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
23667 *ret_conv = CResult_InitDecodeErrorZ_clone(arg);
23668 return tag_ptr(ret_conv, true);
23670 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23671 LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg);
23672 int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv);
23676 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23677 LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig);
23678 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
23679 *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv);
23680 return tag_ptr(ret_conv, true);
23683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23684 LDKOpenChannel o_conv;
23685 o_conv.inner = untag_ptr(o);
23686 o_conv.is_owned = ptr_is_owned(o);
23687 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23688 o_conv = OpenChannel_clone(&o_conv);
23689 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
23690 *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv);
23691 return tag_ptr(ret_conv, true);
23694 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23695 void* e_ptr = untag_ptr(e);
23696 CHECK_ACCESS(e_ptr);
23697 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23698 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23699 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
23700 *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
23701 return tag_ptr(ret_conv, true);
23704 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23705 LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o);
23706 jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv);
23710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23711 if (!ptr_is_owned(_res)) return;
23712 void* _res_ptr = untag_ptr(_res);
23713 CHECK_ACCESS(_res_ptr);
23714 LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
23715 FREE(untag_ptr(_res));
23716 CResult_OpenChannelDecodeErrorZ_free(_res_conv);
23719 static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) {
23720 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
23721 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg);
23722 return tag_ptr(ret_conv, true);
23724 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23725 LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg);
23726 int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv);
23730 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23731 LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig);
23732 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
23733 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv);
23734 return tag_ptr(ret_conv, true);
23737 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23738 LDKRevokeAndACK o_conv;
23739 o_conv.inner = untag_ptr(o);
23740 o_conv.is_owned = ptr_is_owned(o);
23741 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23742 o_conv = RevokeAndACK_clone(&o_conv);
23743 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
23744 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv);
23745 return tag_ptr(ret_conv, true);
23748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23749 void* e_ptr = untag_ptr(e);
23750 CHECK_ACCESS(e_ptr);
23751 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23752 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23753 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
23754 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
23755 return tag_ptr(ret_conv, true);
23758 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23759 LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o);
23760 jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv);
23764 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23765 if (!ptr_is_owned(_res)) return;
23766 void* _res_ptr = untag_ptr(_res);
23767 CHECK_ACCESS(_res_ptr);
23768 LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
23769 FREE(untag_ptr(_res));
23770 CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
23773 static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) {
23774 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
23775 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg);
23776 return tag_ptr(ret_conv, true);
23778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23779 LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg);
23780 int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv);
23784 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23785 LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig);
23786 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
23787 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv);
23788 return tag_ptr(ret_conv, true);
23791 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23792 LDKShutdown o_conv;
23793 o_conv.inner = untag_ptr(o);
23794 o_conv.is_owned = ptr_is_owned(o);
23795 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23796 o_conv = Shutdown_clone(&o_conv);
23797 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
23798 *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv);
23799 return tag_ptr(ret_conv, true);
23802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23803 void* e_ptr = untag_ptr(e);
23804 CHECK_ACCESS(e_ptr);
23805 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23806 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23807 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
23808 *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
23809 return tag_ptr(ret_conv, true);
23812 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23813 LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o);
23814 jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv);
23818 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23819 if (!ptr_is_owned(_res)) return;
23820 void* _res_ptr = untag_ptr(_res);
23821 CHECK_ACCESS(_res_ptr);
23822 LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
23823 FREE(untag_ptr(_res));
23824 CResult_ShutdownDecodeErrorZ_free(_res_conv);
23827 static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) {
23828 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
23829 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg);
23830 return tag_ptr(ret_conv, true);
23832 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23833 LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg);
23834 int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv);
23838 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23839 LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig);
23840 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
23841 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv);
23842 return tag_ptr(ret_conv, true);
23845 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23846 LDKUpdateFailHTLC o_conv;
23847 o_conv.inner = untag_ptr(o);
23848 o_conv.is_owned = ptr_is_owned(o);
23849 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23850 o_conv = UpdateFailHTLC_clone(&o_conv);
23851 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
23852 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv);
23853 return tag_ptr(ret_conv, true);
23856 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23857 void* e_ptr = untag_ptr(e);
23858 CHECK_ACCESS(e_ptr);
23859 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23860 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23861 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
23862 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
23863 return tag_ptr(ret_conv, true);
23866 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23867 LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(o);
23868 jboolean ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv);
23872 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23873 if (!ptr_is_owned(_res)) return;
23874 void* _res_ptr = untag_ptr(_res);
23875 CHECK_ACCESS(_res_ptr);
23876 LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
23877 FREE(untag_ptr(_res));
23878 CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
23881 static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) {
23882 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
23883 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg);
23884 return tag_ptr(ret_conv, true);
23886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23887 LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(arg);
23888 int64_t ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv);
23892 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23893 LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(orig);
23894 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
23895 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv);
23896 return tag_ptr(ret_conv, true);
23899 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23900 LDKUpdateFailMalformedHTLC o_conv;
23901 o_conv.inner = untag_ptr(o);
23902 o_conv.is_owned = ptr_is_owned(o);
23903 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23904 o_conv = UpdateFailMalformedHTLC_clone(&o_conv);
23905 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
23906 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv);
23907 return tag_ptr(ret_conv, true);
23910 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23911 void* e_ptr = untag_ptr(e);
23912 CHECK_ACCESS(e_ptr);
23913 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23914 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23915 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
23916 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
23917 return tag_ptr(ret_conv, true);
23920 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23921 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(o);
23922 jboolean ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv);
23926 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23927 if (!ptr_is_owned(_res)) return;
23928 void* _res_ptr = untag_ptr(_res);
23929 CHECK_ACCESS(_res_ptr);
23930 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
23931 FREE(untag_ptr(_res));
23932 CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
23935 static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) {
23936 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
23937 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg);
23938 return tag_ptr(ret_conv, true);
23940 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23941 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(arg);
23942 int64_t ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv);
23946 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23947 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(orig);
23948 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
23949 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv);
23950 return tag_ptr(ret_conv, true);
23953 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23954 LDKUpdateFee o_conv;
23955 o_conv.inner = untag_ptr(o);
23956 o_conv.is_owned = ptr_is_owned(o);
23957 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23958 o_conv = UpdateFee_clone(&o_conv);
23959 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
23960 *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv);
23961 return tag_ptr(ret_conv, true);
23964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23965 void* e_ptr = untag_ptr(e);
23966 CHECK_ACCESS(e_ptr);
23967 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23968 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23969 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
23970 *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
23971 return tag_ptr(ret_conv, true);
23974 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23975 LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(o);
23976 jboolean ret_conv = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv);
23980 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23981 if (!ptr_is_owned(_res)) return;
23982 void* _res_ptr = untag_ptr(_res);
23983 CHECK_ACCESS(_res_ptr);
23984 LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
23985 FREE(untag_ptr(_res));
23986 CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
23989 static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) {
23990 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
23991 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg);
23992 return tag_ptr(ret_conv, true);
23994 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23995 LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(arg);
23996 int64_t ret_conv = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv);
24000 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24001 LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(orig);
24002 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
24003 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv);
24004 return tag_ptr(ret_conv, true);
24007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24008 LDKUpdateFulfillHTLC o_conv;
24009 o_conv.inner = untag_ptr(o);
24010 o_conv.is_owned = ptr_is_owned(o);
24011 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24012 o_conv = UpdateFulfillHTLC_clone(&o_conv);
24013 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
24014 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv);
24015 return tag_ptr(ret_conv, true);
24018 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24019 void* e_ptr = untag_ptr(e);
24020 CHECK_ACCESS(e_ptr);
24021 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24022 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24023 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
24024 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
24025 return tag_ptr(ret_conv, true);
24028 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24029 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(o);
24030 jboolean ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv);
24034 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24035 if (!ptr_is_owned(_res)) return;
24036 void* _res_ptr = untag_ptr(_res);
24037 CHECK_ACCESS(_res_ptr);
24038 LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
24039 FREE(untag_ptr(_res));
24040 CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
24043 static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) {
24044 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
24045 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg);
24046 return tag_ptr(ret_conv, true);
24048 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24049 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(arg);
24050 int64_t ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv);
24054 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24055 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(orig);
24056 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
24057 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv);
24058 return tag_ptr(ret_conv, true);
24061 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24062 LDKUpdateAddHTLC o_conv;
24063 o_conv.inner = untag_ptr(o);
24064 o_conv.is_owned = ptr_is_owned(o);
24065 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24066 o_conv = UpdateAddHTLC_clone(&o_conv);
24067 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
24068 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv);
24069 return tag_ptr(ret_conv, true);
24072 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24073 void* e_ptr = untag_ptr(e);
24074 CHECK_ACCESS(e_ptr);
24075 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24076 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24077 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
24078 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
24079 return tag_ptr(ret_conv, true);
24082 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24083 LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(o);
24084 jboolean ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv);
24088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24089 if (!ptr_is_owned(_res)) return;
24090 void* _res_ptr = untag_ptr(_res);
24091 CHECK_ACCESS(_res_ptr);
24092 LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
24093 FREE(untag_ptr(_res));
24094 CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
24097 static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) {
24098 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
24099 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg);
24100 return tag_ptr(ret_conv, true);
24102 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24103 LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(arg);
24104 int64_t ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv);
24108 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24109 LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(orig);
24110 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
24111 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv);
24112 return tag_ptr(ret_conv, true);
24115 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24116 LDKOnionMessage o_conv;
24117 o_conv.inner = untag_ptr(o);
24118 o_conv.is_owned = ptr_is_owned(o);
24119 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24120 o_conv = OnionMessage_clone(&o_conv);
24121 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
24122 *ret_conv = CResult_OnionMessageDecodeErrorZ_ok(o_conv);
24123 return tag_ptr(ret_conv, true);
24126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24127 void* e_ptr = untag_ptr(e);
24128 CHECK_ACCESS(e_ptr);
24129 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24130 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24131 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
24132 *ret_conv = CResult_OnionMessageDecodeErrorZ_err(e_conv);
24133 return tag_ptr(ret_conv, true);
24136 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24137 LDKCResult_OnionMessageDecodeErrorZ* o_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(o);
24138 jboolean ret_conv = CResult_OnionMessageDecodeErrorZ_is_ok(o_conv);
24142 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24143 if (!ptr_is_owned(_res)) return;
24144 void* _res_ptr = untag_ptr(_res);
24145 CHECK_ACCESS(_res_ptr);
24146 LDKCResult_OnionMessageDecodeErrorZ _res_conv = *(LDKCResult_OnionMessageDecodeErrorZ*)(_res_ptr);
24147 FREE(untag_ptr(_res));
24148 CResult_OnionMessageDecodeErrorZ_free(_res_conv);
24151 static inline uint64_t CResult_OnionMessageDecodeErrorZ_clone_ptr(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR arg) {
24152 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
24153 *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(arg);
24154 return tag_ptr(ret_conv, true);
24156 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24157 LDKCResult_OnionMessageDecodeErrorZ* arg_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(arg);
24158 int64_t ret_conv = CResult_OnionMessageDecodeErrorZ_clone_ptr(arg_conv);
24162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24163 LDKCResult_OnionMessageDecodeErrorZ* orig_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(orig);
24164 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
24165 *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(orig_conv);
24166 return tag_ptr(ret_conv, true);
24169 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24171 o_conv.inner = untag_ptr(o);
24172 o_conv.is_owned = ptr_is_owned(o);
24173 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24174 o_conv = Ping_clone(&o_conv);
24175 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
24176 *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv);
24177 return tag_ptr(ret_conv, true);
24180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24181 void* e_ptr = untag_ptr(e);
24182 CHECK_ACCESS(e_ptr);
24183 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24184 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24185 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
24186 *ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
24187 return tag_ptr(ret_conv, true);
24190 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24191 LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(o);
24192 jboolean ret_conv = CResult_PingDecodeErrorZ_is_ok(o_conv);
24196 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24197 if (!ptr_is_owned(_res)) return;
24198 void* _res_ptr = untag_ptr(_res);
24199 CHECK_ACCESS(_res_ptr);
24200 LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
24201 FREE(untag_ptr(_res));
24202 CResult_PingDecodeErrorZ_free(_res_conv);
24205 static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) {
24206 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
24207 *ret_conv = CResult_PingDecodeErrorZ_clone(arg);
24208 return tag_ptr(ret_conv, true);
24210 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24211 LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(arg);
24212 int64_t ret_conv = CResult_PingDecodeErrorZ_clone_ptr(arg_conv);
24216 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24217 LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(orig);
24218 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
24219 *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv);
24220 return tag_ptr(ret_conv, true);
24223 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24225 o_conv.inner = untag_ptr(o);
24226 o_conv.is_owned = ptr_is_owned(o);
24227 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24228 o_conv = Pong_clone(&o_conv);
24229 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
24230 *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv);
24231 return tag_ptr(ret_conv, true);
24234 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24235 void* e_ptr = untag_ptr(e);
24236 CHECK_ACCESS(e_ptr);
24237 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24238 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24239 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
24240 *ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
24241 return tag_ptr(ret_conv, true);
24244 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24245 LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(o);
24246 jboolean ret_conv = CResult_PongDecodeErrorZ_is_ok(o_conv);
24250 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24251 if (!ptr_is_owned(_res)) return;
24252 void* _res_ptr = untag_ptr(_res);
24253 CHECK_ACCESS(_res_ptr);
24254 LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
24255 FREE(untag_ptr(_res));
24256 CResult_PongDecodeErrorZ_free(_res_conv);
24259 static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) {
24260 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
24261 *ret_conv = CResult_PongDecodeErrorZ_clone(arg);
24262 return tag_ptr(ret_conv, true);
24264 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24265 LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(arg);
24266 int64_t ret_conv = CResult_PongDecodeErrorZ_clone_ptr(arg_conv);
24270 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24271 LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(orig);
24272 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
24273 *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv);
24274 return tag_ptr(ret_conv, true);
24277 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24278 LDKUnsignedChannelAnnouncement o_conv;
24279 o_conv.inner = untag_ptr(o);
24280 o_conv.is_owned = ptr_is_owned(o);
24281 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24282 o_conv = UnsignedChannelAnnouncement_clone(&o_conv);
24283 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
24284 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv);
24285 return tag_ptr(ret_conv, true);
24288 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24289 void* e_ptr = untag_ptr(e);
24290 CHECK_ACCESS(e_ptr);
24291 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24292 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24293 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
24294 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
24295 return tag_ptr(ret_conv, true);
24298 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24299 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
24300 jboolean ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
24304 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24305 if (!ptr_is_owned(_res)) return;
24306 void* _res_ptr = untag_ptr(_res);
24307 CHECK_ACCESS(_res_ptr);
24308 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
24309 FREE(untag_ptr(_res));
24310 CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
24313 static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
24314 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
24315 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg);
24316 return tag_ptr(ret_conv, true);
24318 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24319 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
24320 int64_t ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
24324 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24325 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
24326 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
24327 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv);
24328 return tag_ptr(ret_conv, true);
24331 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24332 LDKChannelAnnouncement o_conv;
24333 o_conv.inner = untag_ptr(o);
24334 o_conv.is_owned = ptr_is_owned(o);
24335 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24336 o_conv = ChannelAnnouncement_clone(&o_conv);
24337 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
24338 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv);
24339 return tag_ptr(ret_conv, true);
24342 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24343 void* e_ptr = untag_ptr(e);
24344 CHECK_ACCESS(e_ptr);
24345 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24346 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24347 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
24348 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
24349 return tag_ptr(ret_conv, true);
24352 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24353 LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
24354 jboolean ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
24358 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24359 if (!ptr_is_owned(_res)) return;
24360 void* _res_ptr = untag_ptr(_res);
24361 CHECK_ACCESS(_res_ptr);
24362 LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
24363 FREE(untag_ptr(_res));
24364 CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
24367 static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
24368 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
24369 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg);
24370 return tag_ptr(ret_conv, true);
24372 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24373 LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
24374 int64_t ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
24378 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24379 LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
24380 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
24381 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv);
24382 return tag_ptr(ret_conv, true);
24385 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24386 LDKUnsignedChannelUpdate o_conv;
24387 o_conv.inner = untag_ptr(o);
24388 o_conv.is_owned = ptr_is_owned(o);
24389 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24390 o_conv = UnsignedChannelUpdate_clone(&o_conv);
24391 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
24392 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv);
24393 return tag_ptr(ret_conv, true);
24396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24397 void* e_ptr = untag_ptr(e);
24398 CHECK_ACCESS(e_ptr);
24399 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24400 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24401 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
24402 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
24403 return tag_ptr(ret_conv, true);
24406 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24407 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(o);
24408 jboolean ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv);
24412 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24413 if (!ptr_is_owned(_res)) return;
24414 void* _res_ptr = untag_ptr(_res);
24415 CHECK_ACCESS(_res_ptr);
24416 LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
24417 FREE(untag_ptr(_res));
24418 CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
24421 static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
24422 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
24423 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg);
24424 return tag_ptr(ret_conv, true);
24426 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24427 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(arg);
24428 int64_t ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
24432 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24433 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(orig);
24434 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
24435 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv);
24436 return tag_ptr(ret_conv, true);
24439 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24440 LDKChannelUpdate o_conv;
24441 o_conv.inner = untag_ptr(o);
24442 o_conv.is_owned = ptr_is_owned(o);
24443 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24444 o_conv = ChannelUpdate_clone(&o_conv);
24445 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
24446 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv);
24447 return tag_ptr(ret_conv, true);
24450 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24451 void* e_ptr = untag_ptr(e);
24452 CHECK_ACCESS(e_ptr);
24453 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24454 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24455 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
24456 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
24457 return tag_ptr(ret_conv, true);
24460 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24461 LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(o);
24462 jboolean ret_conv = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv);
24466 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24467 if (!ptr_is_owned(_res)) return;
24468 void* _res_ptr = untag_ptr(_res);
24469 CHECK_ACCESS(_res_ptr);
24470 LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
24471 FREE(untag_ptr(_res));
24472 CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
24475 static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
24476 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
24477 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg);
24478 return tag_ptr(ret_conv, true);
24480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24481 LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(arg);
24482 int64_t ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
24486 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24487 LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(orig);
24488 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
24489 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv);
24490 return tag_ptr(ret_conv, true);
24493 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24494 LDKErrorMessage o_conv;
24495 o_conv.inner = untag_ptr(o);
24496 o_conv.is_owned = ptr_is_owned(o);
24497 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24498 o_conv = ErrorMessage_clone(&o_conv);
24499 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
24500 *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv);
24501 return tag_ptr(ret_conv, true);
24504 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24505 void* e_ptr = untag_ptr(e);
24506 CHECK_ACCESS(e_ptr);
24507 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24508 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24509 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
24510 *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
24511 return tag_ptr(ret_conv, true);
24514 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24515 LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(o);
24516 jboolean ret_conv = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv);
24520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24521 if (!ptr_is_owned(_res)) return;
24522 void* _res_ptr = untag_ptr(_res);
24523 CHECK_ACCESS(_res_ptr);
24524 LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
24525 FREE(untag_ptr(_res));
24526 CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
24529 static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) {
24530 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
24531 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg);
24532 return tag_ptr(ret_conv, true);
24534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24535 LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(arg);
24536 int64_t ret_conv = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv);
24540 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24541 LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(orig);
24542 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
24543 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv);
24544 return tag_ptr(ret_conv, true);
24547 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24548 LDKWarningMessage o_conv;
24549 o_conv.inner = untag_ptr(o);
24550 o_conv.is_owned = ptr_is_owned(o);
24551 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24552 o_conv = WarningMessage_clone(&o_conv);
24553 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
24554 *ret_conv = CResult_WarningMessageDecodeErrorZ_ok(o_conv);
24555 return tag_ptr(ret_conv, true);
24558 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24559 void* e_ptr = untag_ptr(e);
24560 CHECK_ACCESS(e_ptr);
24561 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24562 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24563 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
24564 *ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
24565 return tag_ptr(ret_conv, true);
24568 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24569 LDKCResult_WarningMessageDecodeErrorZ* o_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(o);
24570 jboolean ret_conv = CResult_WarningMessageDecodeErrorZ_is_ok(o_conv);
24574 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24575 if (!ptr_is_owned(_res)) return;
24576 void* _res_ptr = untag_ptr(_res);
24577 CHECK_ACCESS(_res_ptr);
24578 LDKCResult_WarningMessageDecodeErrorZ _res_conv = *(LDKCResult_WarningMessageDecodeErrorZ*)(_res_ptr);
24579 FREE(untag_ptr(_res));
24580 CResult_WarningMessageDecodeErrorZ_free(_res_conv);
24583 static inline uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg) {
24584 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
24585 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(arg);
24586 return tag_ptr(ret_conv, true);
24588 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24589 LDKCResult_WarningMessageDecodeErrorZ* arg_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(arg);
24590 int64_t ret_conv = CResult_WarningMessageDecodeErrorZ_clone_ptr(arg_conv);
24594 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24595 LDKCResult_WarningMessageDecodeErrorZ* orig_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(orig);
24596 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
24597 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(orig_conv);
24598 return tag_ptr(ret_conv, true);
24601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24602 LDKUnsignedNodeAnnouncement o_conv;
24603 o_conv.inner = untag_ptr(o);
24604 o_conv.is_owned = ptr_is_owned(o);
24605 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24606 o_conv = UnsignedNodeAnnouncement_clone(&o_conv);
24607 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
24608 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv);
24609 return tag_ptr(ret_conv, true);
24612 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24613 void* e_ptr = untag_ptr(e);
24614 CHECK_ACCESS(e_ptr);
24615 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24616 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24617 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
24618 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
24619 return tag_ptr(ret_conv, true);
24622 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24623 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(o);
24624 jboolean ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv);
24628 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24629 if (!ptr_is_owned(_res)) return;
24630 void* _res_ptr = untag_ptr(_res);
24631 CHECK_ACCESS(_res_ptr);
24632 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
24633 FREE(untag_ptr(_res));
24634 CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
24637 static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
24638 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
24639 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg);
24640 return tag_ptr(ret_conv, true);
24642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24643 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
24644 int64_t ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
24648 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24649 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
24650 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
24651 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv);
24652 return tag_ptr(ret_conv, true);
24655 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24656 LDKNodeAnnouncement o_conv;
24657 o_conv.inner = untag_ptr(o);
24658 o_conv.is_owned = ptr_is_owned(o);
24659 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24660 o_conv = NodeAnnouncement_clone(&o_conv);
24661 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
24662 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv);
24663 return tag_ptr(ret_conv, true);
24666 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24667 void* e_ptr = untag_ptr(e);
24668 CHECK_ACCESS(e_ptr);
24669 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24670 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24671 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
24672 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
24673 return tag_ptr(ret_conv, true);
24676 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24677 LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(o);
24678 jboolean ret_conv = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv);
24682 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24683 if (!ptr_is_owned(_res)) return;
24684 void* _res_ptr = untag_ptr(_res);
24685 CHECK_ACCESS(_res_ptr);
24686 LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
24687 FREE(untag_ptr(_res));
24688 CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
24691 static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
24692 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
24693 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg);
24694 return tag_ptr(ret_conv, true);
24696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24697 LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
24698 int64_t ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
24702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24703 LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
24704 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
24705 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv);
24706 return tag_ptr(ret_conv, true);
24709 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24710 LDKQueryShortChannelIds o_conv;
24711 o_conv.inner = untag_ptr(o);
24712 o_conv.is_owned = ptr_is_owned(o);
24713 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24714 o_conv = QueryShortChannelIds_clone(&o_conv);
24715 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
24716 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv);
24717 return tag_ptr(ret_conv, true);
24720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24721 void* e_ptr = untag_ptr(e);
24722 CHECK_ACCESS(e_ptr);
24723 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24724 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24725 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
24726 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
24727 return tag_ptr(ret_conv, true);
24730 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24731 LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(o);
24732 jboolean ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv);
24736 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24737 if (!ptr_is_owned(_res)) return;
24738 void* _res_ptr = untag_ptr(_res);
24739 CHECK_ACCESS(_res_ptr);
24740 LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
24741 FREE(untag_ptr(_res));
24742 CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
24745 static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) {
24746 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
24747 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg);
24748 return tag_ptr(ret_conv, true);
24750 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24751 LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(arg);
24752 int64_t ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv);
24756 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24757 LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(orig);
24758 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
24759 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv);
24760 return tag_ptr(ret_conv, true);
24763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24764 LDKReplyShortChannelIdsEnd o_conv;
24765 o_conv.inner = untag_ptr(o);
24766 o_conv.is_owned = ptr_is_owned(o);
24767 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24768 o_conv = ReplyShortChannelIdsEnd_clone(&o_conv);
24769 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
24770 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv);
24771 return tag_ptr(ret_conv, true);
24774 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24775 void* e_ptr = untag_ptr(e);
24776 CHECK_ACCESS(e_ptr);
24777 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24778 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24779 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
24780 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
24781 return tag_ptr(ret_conv, true);
24784 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24785 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(o);
24786 jboolean ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv);
24790 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24791 if (!ptr_is_owned(_res)) return;
24792 void* _res_ptr = untag_ptr(_res);
24793 CHECK_ACCESS(_res_ptr);
24794 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
24795 FREE(untag_ptr(_res));
24796 CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
24799 static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) {
24800 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
24801 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg);
24802 return tag_ptr(ret_conv, true);
24804 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24805 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(arg);
24806 int64_t ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv);
24810 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24811 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(orig);
24812 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
24813 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv);
24814 return tag_ptr(ret_conv, true);
24817 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24818 LDKQueryChannelRange o_conv;
24819 o_conv.inner = untag_ptr(o);
24820 o_conv.is_owned = ptr_is_owned(o);
24821 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24822 o_conv = QueryChannelRange_clone(&o_conv);
24823 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
24824 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv);
24825 return tag_ptr(ret_conv, true);
24828 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24829 void* e_ptr = untag_ptr(e);
24830 CHECK_ACCESS(e_ptr);
24831 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24832 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24833 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
24834 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
24835 return tag_ptr(ret_conv, true);
24838 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24839 LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(o);
24840 jboolean ret_conv = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv);
24844 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24845 if (!ptr_is_owned(_res)) return;
24846 void* _res_ptr = untag_ptr(_res);
24847 CHECK_ACCESS(_res_ptr);
24848 LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
24849 FREE(untag_ptr(_res));
24850 CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
24853 static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
24854 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
24855 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg);
24856 return tag_ptr(ret_conv, true);
24858 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24859 LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(arg);
24860 int64_t ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
24864 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24865 LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(orig);
24866 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
24867 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv);
24868 return tag_ptr(ret_conv, true);
24871 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24872 LDKReplyChannelRange o_conv;
24873 o_conv.inner = untag_ptr(o);
24874 o_conv.is_owned = ptr_is_owned(o);
24875 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24876 o_conv = ReplyChannelRange_clone(&o_conv);
24877 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
24878 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv);
24879 return tag_ptr(ret_conv, true);
24882 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24883 void* e_ptr = untag_ptr(e);
24884 CHECK_ACCESS(e_ptr);
24885 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24886 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24887 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
24888 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
24889 return tag_ptr(ret_conv, true);
24892 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24893 LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(o);
24894 jboolean ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv);
24898 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24899 if (!ptr_is_owned(_res)) return;
24900 void* _res_ptr = untag_ptr(_res);
24901 CHECK_ACCESS(_res_ptr);
24902 LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
24903 FREE(untag_ptr(_res));
24904 CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
24907 static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
24908 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
24909 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg);
24910 return tag_ptr(ret_conv, true);
24912 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24913 LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(arg);
24914 int64_t ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
24918 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24919 LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(orig);
24920 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
24921 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv);
24922 return tag_ptr(ret_conv, true);
24925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24926 LDKGossipTimestampFilter o_conv;
24927 o_conv.inner = untag_ptr(o);
24928 o_conv.is_owned = ptr_is_owned(o);
24929 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24930 o_conv = GossipTimestampFilter_clone(&o_conv);
24931 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
24932 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv);
24933 return tag_ptr(ret_conv, true);
24936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24937 void* e_ptr = untag_ptr(e);
24938 CHECK_ACCESS(e_ptr);
24939 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24940 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24941 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
24942 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
24943 return tag_ptr(ret_conv, true);
24946 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24947 LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(o);
24948 jboolean ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv);
24952 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24953 if (!ptr_is_owned(_res)) return;
24954 void* _res_ptr = untag_ptr(_res);
24955 CHECK_ACCESS(_res_ptr);
24956 LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
24957 FREE(untag_ptr(_res));
24958 CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
24961 static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) {
24962 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
24963 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg);
24964 return tag_ptr(ret_conv, true);
24966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24967 LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(arg);
24968 int64_t ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv);
24972 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24973 LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(orig);
24974 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
24975 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv);
24976 return tag_ptr(ret_conv, true);
24979 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
24980 LDKCVec_PhantomRouteHintsZ _res_constr;
24981 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24982 if (_res_constr.datalen > 0)
24983 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
24985 _res_constr.data = NULL;
24986 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
24987 for (size_t t = 0; t < _res_constr.datalen; t++) {
24988 int64_t _res_conv_19 = _res_vals[t];
24989 LDKPhantomRouteHints _res_conv_19_conv;
24990 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
24991 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
24992 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
24993 _res_constr.data[t] = _res_conv_19_conv;
24995 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
24996 CVec_PhantomRouteHintsZ_free(_res_constr);
24999 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25001 o_conv.inner = untag_ptr(o);
25002 o_conv.is_owned = ptr_is_owned(o);
25003 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25004 o_conv = Invoice_clone(&o_conv);
25005 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
25006 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv);
25007 return tag_ptr(ret_conv, true);
25010 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25011 void* e_ptr = untag_ptr(e);
25012 CHECK_ACCESS(e_ptr);
25013 LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
25014 e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e));
25015 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
25016 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
25017 return tag_ptr(ret_conv, true);
25020 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25021 LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o);
25022 jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv);
25026 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25027 if (!ptr_is_owned(_res)) return;
25028 void* _res_ptr = untag_ptr(_res);
25029 CHECK_ACCESS(_res_ptr);
25030 LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
25031 FREE(untag_ptr(_res));
25032 CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
25035 static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) {
25036 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
25037 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg);
25038 return tag_ptr(ret_conv, true);
25040 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25041 LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg);
25042 int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv);
25046 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25047 LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig);
25048 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
25049 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv);
25050 return tag_ptr(ret_conv, true);
25053 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1some(JNIEnv *env, jclass clz, int64_t o) {
25054 void* o_ptr = untag_ptr(o);
25055 CHECK_ACCESS(o_ptr);
25056 LDKFilter o_conv = *(LDKFilter*)(o_ptr);
25057 if (o_conv.free == LDKFilter_JCalls_free) {
25058 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25059 LDKFilter_JCalls_cloned(&o_conv);
25061 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
25062 *ret_copy = COption_FilterZ_some(o_conv);
25063 int64_t ret_ref = tag_ptr(ret_copy, true);
25067 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1none(JNIEnv *env, jclass clz) {
25068 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
25069 *ret_copy = COption_FilterZ_none();
25070 int64_t ret_ref = tag_ptr(ret_copy, true);
25074 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25075 if (!ptr_is_owned(_res)) return;
25076 void* _res_ptr = untag_ptr(_res);
25077 CHECK_ACCESS(_res_ptr);
25078 LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
25079 FREE(untag_ptr(_res));
25080 COption_FilterZ_free(_res_conv);
25083 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25084 LDKLockedChannelMonitor o_conv;
25085 o_conv.inner = untag_ptr(o);
25086 o_conv.is_owned = ptr_is_owned(o);
25087 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25088 // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor
25090 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
25091 *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv);
25092 return tag_ptr(ret_conv, true);
25095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1err(JNIEnv *env, jclass clz) {
25096 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
25097 *ret_conv = CResult_LockedChannelMonitorNoneZ_err();
25098 return tag_ptr(ret_conv, true);
25101 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25102 LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o);
25103 jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv);
25107 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25108 if (!ptr_is_owned(_res)) return;
25109 void* _res_ptr = untag_ptr(_res);
25110 CHECK_ACCESS(_res_ptr);
25111 LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
25112 FREE(untag_ptr(_res));
25113 CResult_LockedChannelMonitorNoneZ_free(_res_conv);
25116 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
25117 LDKCVec_OutPointZ _res_constr;
25118 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
25119 if (_res_constr.datalen > 0)
25120 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
25122 _res_constr.data = NULL;
25123 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
25124 for (size_t k = 0; k < _res_constr.datalen; k++) {
25125 int64_t _res_conv_10 = _res_vals[k];
25126 LDKOutPoint _res_conv_10_conv;
25127 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
25128 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
25129 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
25130 _res_constr.data[k] = _res_conv_10_conv;
25132 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
25133 CVec_OutPointZ_free(_res_constr);
25136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25137 if (!ptr_is_owned(this_ptr)) return;
25138 void* this_ptr_ptr = untag_ptr(this_ptr);
25139 CHECK_ACCESS(this_ptr_ptr);
25140 LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
25141 FREE(untag_ptr(this_ptr));
25142 PaymentPurpose_free(this_ptr_conv);
25145 static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) {
25146 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
25147 *ret_copy = PaymentPurpose_clone(arg);
25148 int64_t ret_ref = tag_ptr(ret_copy, true);
25151 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25152 LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg);
25153 int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv);
25157 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25158 LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig);
25159 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
25160 *ret_copy = PaymentPurpose_clone(orig_conv);
25161 int64_t ret_ref = tag_ptr(ret_copy, true);
25165 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1invoice_1payment(JNIEnv *env, jclass clz, int8_tArray payment_preimage, int8_tArray payment_secret) {
25166 LDKThirtyTwoBytes payment_preimage_ref;
25167 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
25168 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
25169 LDKThirtyTwoBytes payment_secret_ref;
25170 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
25171 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
25172 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
25173 *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
25174 int64_t ret_ref = tag_ptr(ret_copy, true);
25178 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment(JNIEnv *env, jclass clz, int8_tArray a) {
25179 LDKThirtyTwoBytes a_ref;
25180 CHECK((*env)->GetArrayLength(env, a) == 32);
25181 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
25182 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
25183 *ret_copy = PaymentPurpose_spontaneous_payment(a_ref);
25184 int64_t ret_ref = tag_ptr(ret_copy, true);
25188 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write(JNIEnv *env, jclass clz, int64_t obj) {
25189 LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj);
25190 LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv);
25191 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
25192 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
25193 CVec_u8Z_free(ret_var);
25197 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
25198 LDKu8slice ser_ref;
25199 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
25200 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
25201 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
25202 *ret_conv = PaymentPurpose_read(ser_ref);
25203 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
25204 return tag_ptr(ret_conv, true);
25207 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25208 if (!ptr_is_owned(this_ptr)) return;
25209 void* this_ptr_ptr = untag_ptr(this_ptr);
25210 CHECK_ACCESS(this_ptr_ptr);
25211 LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
25212 FREE(untag_ptr(this_ptr));
25213 ClosureReason_free(this_ptr_conv);
25216 static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) {
25217 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
25218 *ret_copy = ClosureReason_clone(arg);
25219 int64_t ret_ref = tag_ptr(ret_copy, true);
25222 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25223 LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg);
25224 int64_t ret_conv = ClosureReason_clone_ptr(arg_conv);
25228 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25229 LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig);
25230 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
25231 *ret_copy = ClosureReason_clone(orig_conv);
25232 int64_t ret_ref = tag_ptr(ret_copy, true);
25236 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1force_1closed(JNIEnv *env, jclass clz, jstring peer_msg) {
25237 LDKStr peer_msg_conv = java_to_owned_str(env, peer_msg);
25238 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
25239 *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv);
25240 int64_t ret_ref = tag_ptr(ret_copy, true);
25244 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1holder_1force_1closed(JNIEnv *env, jclass clz) {
25245 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
25246 *ret_copy = ClosureReason_holder_force_closed();
25247 int64_t ret_ref = tag_ptr(ret_copy, true);
25251 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1cooperative_1closure(JNIEnv *env, jclass clz) {
25252 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
25253 *ret_copy = ClosureReason_cooperative_closure();
25254 int64_t ret_ref = tag_ptr(ret_copy, true);
25258 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz) {
25259 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
25260 *ret_copy = ClosureReason_commitment_tx_confirmed();
25261 int64_t ret_ref = tag_ptr(ret_copy, true);
25265 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out(JNIEnv *env, jclass clz) {
25266 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
25267 *ret_copy = ClosureReason_funding_timed_out();
25268 int64_t ret_ref = tag_ptr(ret_copy, true);
25272 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error(JNIEnv *env, jclass clz, jstring err) {
25273 LDKStr err_conv = java_to_owned_str(env, err);
25274 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
25275 *ret_copy = ClosureReason_processing_error(err_conv);
25276 int64_t ret_ref = tag_ptr(ret_copy, true);
25280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1disconnected_1peer(JNIEnv *env, jclass clz) {
25281 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
25282 *ret_copy = ClosureReason_disconnected_peer();
25283 int64_t ret_ref = tag_ptr(ret_copy, true);
25287 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager(JNIEnv *env, jclass clz) {
25288 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
25289 *ret_copy = ClosureReason_outdated_channel_manager();
25290 int64_t ret_ref = tag_ptr(ret_copy, true);
25294 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
25295 LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a);
25296 LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b);
25297 jboolean ret_conv = ClosureReason_eq(a_conv, b_conv);
25301 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JNIEnv *env, jclass clz, int64_t obj) {
25302 LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
25303 LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
25304 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
25305 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
25306 CVec_u8Z_free(ret_var);
25310 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
25311 LDKu8slice ser_ref;
25312 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
25313 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
25314 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
25315 *ret_conv = ClosureReason_read(ser_ref);
25316 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
25317 return tag_ptr(ret_conv, true);
25320 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25321 if (!ptr_is_owned(this_ptr)) return;
25322 void* this_ptr_ptr = untag_ptr(this_ptr);
25323 CHECK_ACCESS(this_ptr_ptr);
25324 LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr);
25325 FREE(untag_ptr(this_ptr));
25326 HTLCDestination_free(this_ptr_conv);
25329 static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) {
25330 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
25331 *ret_copy = HTLCDestination_clone(arg);
25332 int64_t ret_ref = tag_ptr(ret_copy, true);
25335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25336 LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg);
25337 int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv);
25341 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25342 LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig);
25343 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
25344 *ret_copy = HTLCDestination_clone(orig_conv);
25345 int64_t ret_ref = tag_ptr(ret_copy, true);
25349 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1next_1hop_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int8_tArray channel_id) {
25350 LDKPublicKey node_id_ref;
25351 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25352 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25353 LDKThirtyTwoBytes channel_id_ref;
25354 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
25355 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
25356 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
25357 *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref);
25358 int64_t ret_ref = tag_ptr(ret_copy, true);
25362 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop(JNIEnv *env, jclass clz, int64_t requested_forward_scid) {
25363 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
25364 *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid);
25365 int64_t ret_ref = tag_ptr(ret_copy, true);
25369 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) {
25370 LDKThirtyTwoBytes payment_hash_ref;
25371 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
25372 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
25373 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
25374 *ret_copy = HTLCDestination_failed_payment(payment_hash_ref);
25375 int64_t ret_ref = tag_ptr(ret_copy, true);
25379 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
25380 LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a);
25381 LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b);
25382 jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv);
25386 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write(JNIEnv *env, jclass clz, int64_t obj) {
25387 LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
25388 LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
25389 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
25390 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
25391 CVec_u8Z_free(ret_var);
25395 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
25396 LDKu8slice ser_ref;
25397 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
25398 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
25399 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
25400 *ret_conv = HTLCDestination_read(ser_ref);
25401 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
25402 return tag_ptr(ret_conv, true);
25405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25406 if (!ptr_is_owned(this_ptr)) return;
25407 void* this_ptr_ptr = untag_ptr(this_ptr);
25408 CHECK_ACCESS(this_ptr_ptr);
25409 LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
25410 FREE(untag_ptr(this_ptr));
25411 Event_free(this_ptr_conv);
25414 static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) {
25415 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25416 *ret_copy = Event_clone(arg);
25417 int64_t ret_ref = tag_ptr(ret_copy, true);
25420 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25421 LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg);
25422 int64_t ret_conv = Event_clone_ptr(arg_conv);
25426 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25427 LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig);
25428 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25429 *ret_copy = Event_clone(orig_conv);
25430 int64_t ret_ref = tag_ptr(ret_copy, true);
25434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) {
25435 LDKThirtyTwoBytes temporary_channel_id_ref;
25436 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
25437 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data);
25438 LDKPublicKey counterparty_node_id_ref;
25439 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
25440 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
25441 LDKCVec_u8Z output_script_ref;
25442 output_script_ref.datalen = (*env)->GetArrayLength(env, output_script);
25443 output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
25444 (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data);
25445 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25446 *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
25447 int64_t ret_ref = tag_ptr(ret_copy, true);
25451 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) {
25452 LDKThirtyTwoBytes payment_hash_ref;
25453 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
25454 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
25455 void* purpose_ptr = untag_ptr(purpose);
25456 CHECK_ACCESS(purpose_ptr);
25457 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
25458 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
25459 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25460 *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv);
25461 int64_t ret_ref = tag_ptr(ret_copy, true);
25465 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) {
25466 LDKThirtyTwoBytes payment_hash_ref;
25467 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
25468 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
25469 void* purpose_ptr = untag_ptr(purpose);
25470 CHECK_ACCESS(purpose_ptr);
25471 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
25472 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
25473 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25474 *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv);
25475 int64_t ret_ref = tag_ptr(ret_copy, true);
25479 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) {
25480 LDKThirtyTwoBytes payment_id_ref;
25481 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
25482 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
25483 LDKThirtyTwoBytes payment_preimage_ref;
25484 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
25485 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
25486 LDKThirtyTwoBytes payment_hash_ref;
25487 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
25488 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
25489 void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat);
25490 CHECK_ACCESS(fee_paid_msat_ptr);
25491 LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
25492 fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat));
25493 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25494 *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
25495 int64_t ret_ref = tag_ptr(ret_copy, true);
25499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash) {
25500 LDKThirtyTwoBytes payment_id_ref;
25501 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
25502 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
25503 LDKThirtyTwoBytes payment_hash_ref;
25504 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
25505 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
25506 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25507 *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
25508 int64_t ret_ref = tag_ptr(ret_copy, true);
25512 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_tArray path) {
25513 LDKThirtyTwoBytes payment_id_ref;
25514 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
25515 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
25516 LDKThirtyTwoBytes payment_hash_ref;
25517 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
25518 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
25519 LDKCVec_RouteHopZ path_constr;
25520 path_constr.datalen = (*env)->GetArrayLength(env, path);
25521 if (path_constr.datalen > 0)
25522 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
25524 path_constr.data = NULL;
25525 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
25526 for (size_t k = 0; k < path_constr.datalen; k++) {
25527 int64_t path_conv_10 = path_vals[k];
25528 LDKRouteHop path_conv_10_conv;
25529 path_conv_10_conv.inner = untag_ptr(path_conv_10);
25530 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
25531 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
25532 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
25533 path_constr.data[k] = path_conv_10_conv;
25535 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
25536 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25537 *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
25538 int64_t ret_ref = tag_ptr(ret_copy, true);
25542 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, int64_t network_update, jboolean all_paths_failed, int64_tArray path, int64_t short_channel_id, int64_t retry) {
25543 LDKThirtyTwoBytes payment_id_ref;
25544 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
25545 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
25546 LDKThirtyTwoBytes payment_hash_ref;
25547 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
25548 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
25549 void* network_update_ptr = untag_ptr(network_update);
25550 CHECK_ACCESS(network_update_ptr);
25551 LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
25552 network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
25553 LDKCVec_RouteHopZ path_constr;
25554 path_constr.datalen = (*env)->GetArrayLength(env, path);
25555 if (path_constr.datalen > 0)
25556 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
25558 path_constr.data = NULL;
25559 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
25560 for (size_t k = 0; k < path_constr.datalen; k++) {
25561 int64_t path_conv_10 = path_vals[k];
25562 LDKRouteHop path_conv_10_conv;
25563 path_conv_10_conv.inner = untag_ptr(path_conv_10);
25564 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
25565 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
25566 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
25567 path_constr.data[k] = path_conv_10_conv;
25569 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
25570 void* short_channel_id_ptr = untag_ptr(short_channel_id);
25571 CHECK_ACCESS(short_channel_id_ptr);
25572 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
25573 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
25574 LDKRouteParameters retry_conv;
25575 retry_conv.inner = untag_ptr(retry);
25576 retry_conv.is_owned = ptr_is_owned(retry);
25577 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv);
25578 retry_conv = RouteParameters_clone(&retry_conv);
25579 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25580 *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, payment_failed_permanently, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv);
25581 int64_t ret_ref = tag_ptr(ret_copy, true);
25585 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1probe_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_tArray path) {
25586 LDKThirtyTwoBytes payment_id_ref;
25587 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
25588 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
25589 LDKThirtyTwoBytes payment_hash_ref;
25590 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
25591 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
25592 LDKCVec_RouteHopZ path_constr;
25593 path_constr.datalen = (*env)->GetArrayLength(env, path);
25594 if (path_constr.datalen > 0)
25595 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
25597 path_constr.data = NULL;
25598 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
25599 for (size_t k = 0; k < path_constr.datalen; k++) {
25600 int64_t path_conv_10 = path_vals[k];
25601 LDKRouteHop path_conv_10_conv;
25602 path_conv_10_conv.inner = untag_ptr(path_conv_10);
25603 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
25604 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
25605 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
25606 path_constr.data[k] = path_conv_10_conv;
25608 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
25609 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25610 *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_constr);
25611 int64_t ret_ref = tag_ptr(ret_copy, true);
25615 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1probe_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_tArray path, int64_t short_channel_id) {
25616 LDKThirtyTwoBytes payment_id_ref;
25617 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
25618 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
25619 LDKThirtyTwoBytes payment_hash_ref;
25620 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
25621 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
25622 LDKCVec_RouteHopZ path_constr;
25623 path_constr.datalen = (*env)->GetArrayLength(env, path);
25624 if (path_constr.datalen > 0)
25625 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
25627 path_constr.data = NULL;
25628 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
25629 for (size_t k = 0; k < path_constr.datalen; k++) {
25630 int64_t path_conv_10 = path_vals[k];
25631 LDKRouteHop path_conv_10_conv;
25632 path_conv_10_conv.inner = untag_ptr(path_conv_10);
25633 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
25634 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
25635 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
25636 path_constr.data[k] = path_conv_10_conv;
25638 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
25639 void* short_channel_id_ptr = untag_ptr(short_channel_id);
25640 CHECK_ACCESS(short_channel_id_ptr);
25641 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
25642 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
25643 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25644 *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_constr, short_channel_id_conv);
25645 int64_t ret_ref = tag_ptr(ret_copy, true);
25649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) {
25650 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25651 *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
25652 int64_t ret_ref = tag_ptr(ret_copy, true);
25656 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs) {
25657 LDKCVec_SpendableOutputDescriptorZ outputs_constr;
25658 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
25659 if (outputs_constr.datalen > 0)
25660 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
25662 outputs_constr.data = NULL;
25663 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
25664 for (size_t b = 0; b < outputs_constr.datalen; b++) {
25665 int64_t outputs_conv_27 = outputs_vals[b];
25666 void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27);
25667 CHECK_ACCESS(outputs_conv_27_ptr);
25668 LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
25669 outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27));
25670 outputs_constr.data[b] = outputs_conv_27_conv;
25672 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
25673 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25674 *ret_copy = Event_spendable_outputs(outputs_constr);
25675 int64_t ret_ref = tag_ptr(ret_copy, true);
25679 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(JNIEnv *env, jclass clz, int8_tArray prev_channel_id, int8_tArray next_channel_id, int64_t fee_earned_msat, jboolean claim_from_onchain_tx) {
25680 LDKThirtyTwoBytes prev_channel_id_ref;
25681 CHECK((*env)->GetArrayLength(env, prev_channel_id) == 32);
25682 (*env)->GetByteArrayRegion(env, prev_channel_id, 0, 32, prev_channel_id_ref.data);
25683 LDKThirtyTwoBytes next_channel_id_ref;
25684 CHECK((*env)->GetArrayLength(env, next_channel_id) == 32);
25685 (*env)->GetByteArrayRegion(env, next_channel_id, 0, 32, next_channel_id_ref.data);
25686 void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat);
25687 CHECK_ACCESS(fee_earned_msat_ptr);
25688 LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
25689 fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat));
25690 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25691 *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx);
25692 int64_t ret_ref = tag_ptr(ret_copy, true);
25696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIEnv *env, jclass clz, int8_tArray channel_id, int64_t user_channel_id, int64_t reason) {
25697 LDKThirtyTwoBytes channel_id_ref;
25698 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
25699 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
25700 void* reason_ptr = untag_ptr(reason);
25701 CHECK_ACCESS(reason_ptr);
25702 LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
25703 reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason));
25704 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25705 *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
25706 int64_t ret_ref = tag_ptr(ret_copy, true);
25710 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray transaction) {
25711 LDKThirtyTwoBytes channel_id_ref;
25712 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
25713 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
25714 LDKTransaction transaction_ref;
25715 transaction_ref.datalen = (*env)->GetArrayLength(env, transaction);
25716 transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes");
25717 (*env)->GetByteArrayRegion(env, transaction, 0, transaction_ref.datalen, transaction_ref.data);
25718 transaction_ref.data_is_owned = true;
25719 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25720 *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref);
25721 int64_t ret_ref = tag_ptr(ret_copy, true);
25725 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1request(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_t channel_type) {
25726 LDKThirtyTwoBytes temporary_channel_id_ref;
25727 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
25728 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data);
25729 LDKPublicKey counterparty_node_id_ref;
25730 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
25731 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
25732 LDKChannelTypeFeatures channel_type_conv;
25733 channel_type_conv.inner = untag_ptr(channel_type);
25734 channel_type_conv.is_owned = ptr_is_owned(channel_type);
25735 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
25736 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
25737 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25738 *ret_copy = Event_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv);
25739 int64_t ret_ref = tag_ptr(ret_copy, true);
25743 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlchandling_1failed(JNIEnv *env, jclass clz, int8_tArray prev_channel_id, int64_t failed_next_destination) {
25744 LDKThirtyTwoBytes prev_channel_id_ref;
25745 CHECK((*env)->GetArrayLength(env, prev_channel_id) == 32);
25746 (*env)->GetByteArrayRegion(env, prev_channel_id, 0, 32, prev_channel_id_ref.data);
25747 void* failed_next_destination_ptr = untag_ptr(failed_next_destination);
25748 CHECK_ACCESS(failed_next_destination_ptr);
25749 LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr);
25750 failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination));
25751 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
25752 *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv);
25753 int64_t ret_ref = tag_ptr(ret_copy, true);
25757 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) {
25758 LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj);
25759 LDKCVec_u8Z ret_var = Event_write(obj_conv);
25760 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
25761 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
25762 CVec_u8Z_free(ret_var);
25766 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
25767 LDKu8slice ser_ref;
25768 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
25769 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
25770 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
25771 *ret_conv = Event_read(ser_ref);
25772 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
25773 return tag_ptr(ret_conv, true);
25776 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25777 if (!ptr_is_owned(this_ptr)) return;
25778 void* this_ptr_ptr = untag_ptr(this_ptr);
25779 CHECK_ACCESS(this_ptr_ptr);
25780 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
25781 FREE(untag_ptr(this_ptr));
25782 MessageSendEvent_free(this_ptr_conv);
25785 static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) {
25786 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25787 *ret_copy = MessageSendEvent_clone(arg);
25788 int64_t ret_ref = tag_ptr(ret_copy, true);
25791 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25792 LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg);
25793 int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv);
25797 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25798 LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig);
25799 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25800 *ret_copy = MessageSendEvent_clone(orig_conv);
25801 int64_t ret_ref = tag_ptr(ret_copy, true);
25805 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
25806 LDKPublicKey node_id_ref;
25807 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25808 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25809 LDKAcceptChannel msg_conv;
25810 msg_conv.inner = untag_ptr(msg);
25811 msg_conv.is_owned = ptr_is_owned(msg);
25812 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25813 msg_conv = AcceptChannel_clone(&msg_conv);
25814 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25815 *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
25816 int64_t ret_ref = tag_ptr(ret_copy, true);
25820 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
25821 LDKPublicKey node_id_ref;
25822 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25823 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25824 LDKOpenChannel msg_conv;
25825 msg_conv.inner = untag_ptr(msg);
25826 msg_conv.is_owned = ptr_is_owned(msg);
25827 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25828 msg_conv = OpenChannel_clone(&msg_conv);
25829 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25830 *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
25831 int64_t ret_ref = tag_ptr(ret_copy, true);
25835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
25836 LDKPublicKey node_id_ref;
25837 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25838 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25839 LDKFundingCreated msg_conv;
25840 msg_conv.inner = untag_ptr(msg);
25841 msg_conv.is_owned = ptr_is_owned(msg);
25842 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25843 msg_conv = FundingCreated_clone(&msg_conv);
25844 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25845 *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
25846 int64_t ret_ref = tag_ptr(ret_copy, true);
25850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
25851 LDKPublicKey node_id_ref;
25852 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25853 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25854 LDKFundingSigned msg_conv;
25855 msg_conv.inner = untag_ptr(msg);
25856 msg_conv.is_owned = ptr_is_owned(msg);
25857 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25858 msg_conv = FundingSigned_clone(&msg_conv);
25859 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25860 *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
25861 int64_t ret_ref = tag_ptr(ret_copy, true);
25865 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
25866 LDKPublicKey node_id_ref;
25867 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25868 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25869 LDKChannelReady msg_conv;
25870 msg_conv.inner = untag_ptr(msg);
25871 msg_conv.is_owned = ptr_is_owned(msg);
25872 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25873 msg_conv = ChannelReady_clone(&msg_conv);
25874 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25875 *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv);
25876 int64_t ret_ref = tag_ptr(ret_copy, true);
25880 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
25881 LDKPublicKey node_id_ref;
25882 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25883 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25884 LDKAnnouncementSignatures msg_conv;
25885 msg_conv.inner = untag_ptr(msg);
25886 msg_conv.is_owned = ptr_is_owned(msg);
25887 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25888 msg_conv = AnnouncementSignatures_clone(&msg_conv);
25889 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25890 *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
25891 int64_t ret_ref = tag_ptr(ret_copy, true);
25895 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t updates) {
25896 LDKPublicKey node_id_ref;
25897 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25898 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25899 LDKCommitmentUpdate updates_conv;
25900 updates_conv.inner = untag_ptr(updates);
25901 updates_conv.is_owned = ptr_is_owned(updates);
25902 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
25903 updates_conv = CommitmentUpdate_clone(&updates_conv);
25904 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25905 *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
25906 int64_t ret_ref = tag_ptr(ret_copy, true);
25910 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1revoke_1and_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
25911 LDKPublicKey node_id_ref;
25912 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25913 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25914 LDKRevokeAndACK msg_conv;
25915 msg_conv.inner = untag_ptr(msg);
25916 msg_conv.is_owned = ptr_is_owned(msg);
25917 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25918 msg_conv = RevokeAndACK_clone(&msg_conv);
25919 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25920 *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
25921 int64_t ret_ref = tag_ptr(ret_copy, true);
25925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
25926 LDKPublicKey node_id_ref;
25927 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25928 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25929 LDKClosingSigned msg_conv;
25930 msg_conv.inner = untag_ptr(msg);
25931 msg_conv.is_owned = ptr_is_owned(msg);
25932 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25933 msg_conv = ClosingSigned_clone(&msg_conv);
25934 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25935 *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
25936 int64_t ret_ref = tag_ptr(ret_copy, true);
25940 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
25941 LDKPublicKey node_id_ref;
25942 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25943 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25944 LDKShutdown msg_conv;
25945 msg_conv.inner = untag_ptr(msg);
25946 msg_conv.is_owned = ptr_is_owned(msg);
25947 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25948 msg_conv = Shutdown_clone(&msg_conv);
25949 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25950 *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
25951 int64_t ret_ref = tag_ptr(ret_copy, true);
25955 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
25956 LDKPublicKey node_id_ref;
25957 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25958 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25959 LDKChannelReestablish msg_conv;
25960 msg_conv.inner = untag_ptr(msg);
25961 msg_conv.is_owned = ptr_is_owned(msg);
25962 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25963 msg_conv = ChannelReestablish_clone(&msg_conv);
25964 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25965 *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
25966 int64_t ret_ref = tag_ptr(ret_copy, true);
25970 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1announcement(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg, int64_t update_msg) {
25971 LDKPublicKey node_id_ref;
25972 CHECK((*env)->GetArrayLength(env, node_id) == 33);
25973 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
25974 LDKChannelAnnouncement msg_conv;
25975 msg_conv.inner = untag_ptr(msg);
25976 msg_conv.is_owned = ptr_is_owned(msg);
25977 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25978 msg_conv = ChannelAnnouncement_clone(&msg_conv);
25979 LDKChannelUpdate update_msg_conv;
25980 update_msg_conv.inner = untag_ptr(update_msg);
25981 update_msg_conv.is_owned = ptr_is_owned(update_msg);
25982 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
25983 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
25984 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
25985 *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv);
25986 int64_t ret_ref = tag_ptr(ret_copy, true);
25990 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg, int64_t update_msg) {
25991 LDKChannelAnnouncement msg_conv;
25992 msg_conv.inner = untag_ptr(msg);
25993 msg_conv.is_owned = ptr_is_owned(msg);
25994 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
25995 msg_conv = ChannelAnnouncement_clone(&msg_conv);
25996 LDKChannelUpdate update_msg_conv;
25997 update_msg_conv.inner = untag_ptr(update_msg);
25998 update_msg_conv.is_owned = ptr_is_owned(update_msg);
25999 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
26000 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
26001 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
26002 *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
26003 int64_t ret_ref = tag_ptr(ret_copy, true);
26007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update(JNIEnv *env, jclass clz, int64_t msg) {
26008 LDKChannelUpdate msg_conv;
26009 msg_conv.inner = untag_ptr(msg);
26010 msg_conv.is_owned = ptr_is_owned(msg);
26011 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
26012 msg_conv = ChannelUpdate_clone(&msg_conv);
26013 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
26014 *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
26015 int64_t ret_ref = tag_ptr(ret_copy, true);
26019 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
26020 LDKPublicKey node_id_ref;
26021 CHECK((*env)->GetArrayLength(env, node_id) == 33);
26022 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
26023 LDKChannelUpdate msg_conv;
26024 msg_conv.inner = untag_ptr(msg);
26025 msg_conv.is_owned = ptr_is_owned(msg);
26026 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
26027 msg_conv = ChannelUpdate_clone(&msg_conv);
26028 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
26029 *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
26030 int64_t ret_ref = tag_ptr(ret_copy, true);
26034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t action) {
26035 LDKPublicKey node_id_ref;
26036 CHECK((*env)->GetArrayLength(env, node_id) == 33);
26037 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
26038 void* action_ptr = untag_ptr(action);
26039 CHECK_ACCESS(action_ptr);
26040 LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
26041 action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action));
26042 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
26043 *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
26044 int64_t ret_ref = tag_ptr(ret_copy, true);
26048 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1range_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
26049 LDKPublicKey node_id_ref;
26050 CHECK((*env)->GetArrayLength(env, node_id) == 33);
26051 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
26052 LDKQueryChannelRange msg_conv;
26053 msg_conv.inner = untag_ptr(msg);
26054 msg_conv.is_owned = ptr_is_owned(msg);
26055 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
26056 msg_conv = QueryChannelRange_clone(&msg_conv);
26057 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
26058 *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
26059 int64_t ret_ref = tag_ptr(ret_copy, true);
26063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1short_1ids_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
26064 LDKPublicKey node_id_ref;
26065 CHECK((*env)->GetArrayLength(env, node_id) == 33);
26066 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
26067 LDKQueryShortChannelIds msg_conv;
26068 msg_conv.inner = untag_ptr(msg);
26069 msg_conv.is_owned = ptr_is_owned(msg);
26070 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
26071 msg_conv = QueryShortChannelIds_clone(&msg_conv);
26072 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
26073 *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
26074 int64_t ret_ref = tag_ptr(ret_copy, true);
26078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1reply_1channel_1range(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
26079 LDKPublicKey node_id_ref;
26080 CHECK((*env)->GetArrayLength(env, node_id) == 33);
26081 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
26082 LDKReplyChannelRange msg_conv;
26083 msg_conv.inner = untag_ptr(msg);
26084 msg_conv.is_owned = ptr_is_owned(msg);
26085 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
26086 msg_conv = ReplyChannelRange_clone(&msg_conv);
26087 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
26088 *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
26089 int64_t ret_ref = tag_ptr(ret_copy, true);
26093 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1gossip_1timestamp_1filter(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
26094 LDKPublicKey node_id_ref;
26095 CHECK((*env)->GetArrayLength(env, node_id) == 33);
26096 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
26097 LDKGossipTimestampFilter msg_conv;
26098 msg_conv.inner = untag_ptr(msg);
26099 msg_conv.is_owned = ptr_is_owned(msg);
26100 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
26101 msg_conv = GossipTimestampFilter_clone(&msg_conv);
26102 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
26103 *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv);
26104 int64_t ret_ref = tag_ptr(ret_copy, true);
26108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26109 if (!ptr_is_owned(this_ptr)) return;
26110 void* this_ptr_ptr = untag_ptr(this_ptr);
26111 CHECK_ACCESS(this_ptr_ptr);
26112 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
26113 FREE(untag_ptr(this_ptr));
26114 MessageSendEventsProvider_free(this_ptr_conv);
26117 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26118 if (!ptr_is_owned(this_ptr)) return;
26119 void* this_ptr_ptr = untag_ptr(this_ptr);
26120 CHECK_ACCESS(this_ptr_ptr);
26121 LDKOnionMessageProvider this_ptr_conv = *(LDKOnionMessageProvider*)(this_ptr_ptr);
26122 FREE(untag_ptr(this_ptr));
26123 OnionMessageProvider_free(this_ptr_conv);
26126 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26127 if (!ptr_is_owned(this_ptr)) return;
26128 void* this_ptr_ptr = untag_ptr(this_ptr);
26129 CHECK_ACCESS(this_ptr_ptr);
26130 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
26131 FREE(untag_ptr(this_ptr));
26132 EventsProvider_free(this_ptr_conv);
26135 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26136 if (!ptr_is_owned(this_ptr)) return;
26137 void* this_ptr_ptr = untag_ptr(this_ptr);
26138 CHECK_ACCESS(this_ptr_ptr);
26139 LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
26140 FREE(untag_ptr(this_ptr));
26141 EventHandler_free(this_ptr_conv);
26144 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26145 if (!ptr_is_owned(this_ptr)) return;
26146 void* this_ptr_ptr = untag_ptr(this_ptr);
26147 CHECK_ACCESS(this_ptr_ptr);
26148 LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
26149 FREE(untag_ptr(this_ptr));
26150 APIError_free(this_ptr_conv);
26153 static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) {
26154 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
26155 *ret_copy = APIError_clone(arg);
26156 int64_t ret_ref = tag_ptr(ret_copy, true);
26159 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26160 LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg);
26161 int64_t ret_conv = APIError_clone_ptr(arg_conv);
26165 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26166 LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig);
26167 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
26168 *ret_copy = APIError_clone(orig_conv);
26169 int64_t ret_ref = tag_ptr(ret_copy, true);
26173 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error(JNIEnv *env, jclass clz, jstring err) {
26174 LDKStr err_conv = java_to_owned_str(env, err);
26175 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
26176 *ret_copy = APIError_apimisuse_error(err_conv);
26177 int64_t ret_ref = tag_ptr(ret_copy, true);
26181 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high(JNIEnv *env, jclass clz, jstring err, int32_t feerate) {
26182 LDKStr err_conv = java_to_owned_str(env, err);
26183 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
26184 *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
26185 int64_t ret_ref = tag_ptr(ret_copy, true);
26189 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error(JNIEnv *env, jclass clz, jstring err) {
26190 LDKStr err_conv = java_to_owned_str(env, err);
26191 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
26192 *ret_copy = APIError_route_error(err_conv);
26193 int64_t ret_ref = tag_ptr(ret_copy, true);
26197 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable(JNIEnv *env, jclass clz, jstring err) {
26198 LDKStr err_conv = java_to_owned_str(env, err);
26199 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
26200 *ret_copy = APIError_channel_unavailable(err_conv);
26201 int64_t ret_ref = tag_ptr(ret_copy, true);
26205 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1in_1progress(JNIEnv *env, jclass clz) {
26206 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
26207 *ret_copy = APIError_monitor_update_in_progress();
26208 int64_t ret_ref = tag_ptr(ret_copy, true);
26212 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shutdown_1script(JNIEnv *env, jclass clz, int64_t script) {
26213 LDKShutdownScript script_conv;
26214 script_conv.inner = untag_ptr(script);
26215 script_conv.is_owned = ptr_is_owned(script);
26216 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv);
26217 script_conv = ShutdownScript_clone(&script_conv);
26218 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
26219 *ret_copy = APIError_incompatible_shutdown_script(script_conv);
26220 int64_t ret_ref = tag_ptr(ret_copy, true);
26224 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_APIError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
26225 LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a);
26226 LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b);
26227 jboolean ret_conv = APIError_eq(a_conv, b_conv);
26231 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
26232 LDKBigSize this_obj_conv;
26233 this_obj_conv.inner = untag_ptr(this_obj);
26234 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26236 BigSize_free(this_obj_conv);
26239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
26240 LDKBigSize this_ptr_conv;
26241 this_ptr_conv.inner = untag_ptr(this_ptr);
26242 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26244 this_ptr_conv.is_owned = false;
26245 int64_t ret_conv = BigSize_get_a(&this_ptr_conv);
26249 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
26250 LDKBigSize this_ptr_conv;
26251 this_ptr_conv.inner = untag_ptr(this_ptr);
26252 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26253 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26254 this_ptr_conv.is_owned = false;
26255 BigSize_set_a(&this_ptr_conv, val);
26258 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
26259 LDKBigSize ret_var = BigSize_new(a_arg);
26260 int64_t ret_ref = 0;
26261 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26262 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26266 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Hostname_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
26267 LDKHostname this_obj_conv;
26268 this_obj_conv.inner = untag_ptr(this_obj);
26269 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26270 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26271 Hostname_free(this_obj_conv);
26274 static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) {
26275 LDKHostname ret_var = Hostname_clone(arg);
26276 int64_t ret_ref = 0;
26277 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26278 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26281 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hostname_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26282 LDKHostname arg_conv;
26283 arg_conv.inner = untag_ptr(arg);
26284 arg_conv.is_owned = ptr_is_owned(arg);
26285 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26286 arg_conv.is_owned = false;
26287 int64_t ret_conv = Hostname_clone_ptr(&arg_conv);
26291 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hostname_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26292 LDKHostname orig_conv;
26293 orig_conv.inner = untag_ptr(orig);
26294 orig_conv.is_owned = ptr_is_owned(orig);
26295 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26296 orig_conv.is_owned = false;
26297 LDKHostname ret_var = Hostname_clone(&orig_conv);
26298 int64_t ret_ref = 0;
26299 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26300 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26304 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Hostname_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
26305 LDKHostname a_conv;
26306 a_conv.inner = untag_ptr(a);
26307 a_conv.is_owned = ptr_is_owned(a);
26308 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
26309 a_conv.is_owned = false;
26310 LDKHostname b_conv;
26311 b_conv.inner = untag_ptr(b);
26312 b_conv.is_owned = ptr_is_owned(b);
26313 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
26314 b_conv.is_owned = false;
26315 jboolean ret_conv = Hostname_eq(&a_conv, &b_conv);
26319 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_Hostname_1len(JNIEnv *env, jclass clz, int64_t this_arg) {
26320 LDKHostname this_arg_conv;
26321 this_arg_conv.inner = untag_ptr(this_arg);
26322 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26324 this_arg_conv.is_owned = false;
26325 int8_t ret_conv = Hostname_len(&this_arg_conv);
26329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) {
26330 LDKu8slice msg_ref;
26331 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
26332 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
26333 unsigned char sk_arr[32];
26334 CHECK((*env)->GetArrayLength(env, sk) == 32);
26335 (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr);
26336 unsigned char (*sk_ref)[32] = &sk_arr;
26337 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
26338 *ret_conv = sign(msg_ref, sk_ref);
26339 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
26340 return tag_ptr(ret_conv, true);
26343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_recover_1pk(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig) {
26344 LDKu8slice msg_ref;
26345 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
26346 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
26347 LDKStr sig_conv = java_to_owned_str(env, sig);
26348 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
26349 *ret_conv = recover_pk(msg_ref, sig_conv);
26350 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
26351 return tag_ptr(ret_conv, true);
26354 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig, int8_tArray pk) {
26355 LDKu8slice msg_ref;
26356 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
26357 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
26358 LDKStr sig_conv = java_to_owned_str(env, sig);
26359 LDKPublicKey pk_ref;
26360 CHECK((*env)->GetArrayLength(env, pk) == 33);
26361 (*env)->GetByteArrayRegion(env, pk, 0, 33, pk_ref.compressed_form);
26362 jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
26363 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
26367 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage(JNIEnv *env, jclass clz, int8_tArray hrp_bytes, jobjectArray data_without_signature) {
26368 LDKu8slice hrp_bytes_ref;
26369 hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes);
26370 hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL);
26371 LDKCVec_u5Z data_without_signature_constr;
26372 data_without_signature_constr.datalen = (*env)->GetArrayLength(env, data_without_signature);
26373 if (data_without_signature_constr.datalen > 0)
26374 data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
26376 data_without_signature_constr.data = NULL;
26377 int8_t* data_without_signature_vals = (*env)->GetByteArrayElements (env, data_without_signature, NULL);
26378 for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
26379 int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
26381 data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 };
26383 (*env)->ReleaseByteArrayElements(env, data_without_signature, data_without_signature_vals, 0);
26384 LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
26385 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
26386 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
26387 CVec_u8Z_free(ret_var);
26388 (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0);
26392 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26393 if (!ptr_is_owned(this_ptr)) return;
26394 void* this_ptr_ptr = untag_ptr(this_ptr);
26395 CHECK_ACCESS(this_ptr_ptr);
26396 LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr);
26397 FREE(untag_ptr(this_ptr));
26398 Persister_free(this_ptr_conv);
26401 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FutureCallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26402 if (!ptr_is_owned(this_ptr)) return;
26403 void* this_ptr_ptr = untag_ptr(this_ptr);
26404 CHECK_ACCESS(this_ptr_ptr);
26405 LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr);
26406 FREE(untag_ptr(this_ptr));
26407 FutureCallback_free(this_ptr_conv);
26410 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Future_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
26411 LDKFuture this_obj_conv;
26412 this_obj_conv.inner = untag_ptr(this_obj);
26413 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26415 Future_free(this_obj_conv);
26418 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Future_1register_1callback_1fn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t callback) {
26419 LDKFuture this_arg_conv;
26420 this_arg_conv.inner = untag_ptr(this_arg);
26421 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26423 this_arg_conv.is_owned = false;
26424 void* callback_ptr = untag_ptr(callback);
26425 CHECK_ACCESS(callback_ptr);
26426 LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr);
26427 if (callback_conv.free == LDKFutureCallback_JCalls_free) {
26428 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26429 LDKFutureCallback_JCalls_cloned(&callback_conv);
26431 Future_register_callback_fn(&this_arg_conv, callback_conv);
26434 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26435 LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig);
26436 jclass ret_conv = LDKLevel_to_java(env, Level_clone(orig_conv));
26440 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1gossip(JNIEnv *env, jclass clz) {
26441 jclass ret_conv = LDKLevel_to_java(env, Level_gossip());
26445 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) {
26446 jclass ret_conv = LDKLevel_to_java(env, Level_trace());
26450 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1debug(JNIEnv *env, jclass clz) {
26451 jclass ret_conv = LDKLevel_to_java(env, Level_debug());
26455 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1info(JNIEnv *env, jclass clz) {
26456 jclass ret_conv = LDKLevel_to_java(env, Level_info());
26460 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1warn(JNIEnv *env, jclass clz) {
26461 jclass ret_conv = LDKLevel_to_java(env, Level_warn());
26465 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1error(JNIEnv *env, jclass clz) {
26466 jclass ret_conv = LDKLevel_to_java(env, Level_error());
26470 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Level_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
26471 LDKLevel* a_conv = (LDKLevel*)untag_ptr(a);
26472 LDKLevel* b_conv = (LDKLevel*)untag_ptr(b);
26473 jboolean ret_conv = Level_eq(a_conv, b_conv);
26477 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Level_1hash(JNIEnv *env, jclass clz, int64_t o) {
26478 LDKLevel* o_conv = (LDKLevel*)untag_ptr(o);
26479 int64_t ret_conv = Level_hash(o_conv);
26483 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jclass clz) {
26484 jclass ret_conv = LDKLevel_to_java(env, Level_max());
26488 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
26489 LDKRecord this_obj_conv;
26490 this_obj_conv.inner = untag_ptr(this_obj);
26491 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26493 Record_free(this_obj_conv);
26496 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) {
26497 LDKRecord this_ptr_conv;
26498 this_ptr_conv.inner = untag_ptr(this_ptr);
26499 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26500 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26501 this_ptr_conv.is_owned = false;
26502 jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv));
26506 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
26507 LDKRecord this_ptr_conv;
26508 this_ptr_conv.inner = untag_ptr(this_ptr);
26509 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26510 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26511 this_ptr_conv.is_owned = false;
26512 LDKLevel val_conv = LDKLevel_from_java(env, val);
26513 Record_set_level(&this_ptr_conv, val_conv);
26516 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) {
26517 LDKRecord this_ptr_conv;
26518 this_ptr_conv.inner = untag_ptr(this_ptr);
26519 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26520 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26521 this_ptr_conv.is_owned = false;
26522 LDKStr ret_str = Record_get_args(&this_ptr_conv);
26523 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
26528 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
26529 LDKRecord this_ptr_conv;
26530 this_ptr_conv.inner = untag_ptr(this_ptr);
26531 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26533 this_ptr_conv.is_owned = false;
26534 LDKStr val_conv = java_to_owned_str(env, val);
26535 Record_set_args(&this_ptr_conv, val_conv);
26538 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) {
26539 LDKRecord this_ptr_conv;
26540 this_ptr_conv.inner = untag_ptr(this_ptr);
26541 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26543 this_ptr_conv.is_owned = false;
26544 LDKStr ret_str = Record_get_module_path(&this_ptr_conv);
26545 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
26550 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
26551 LDKRecord this_ptr_conv;
26552 this_ptr_conv.inner = untag_ptr(this_ptr);
26553 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26554 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26555 this_ptr_conv.is_owned = false;
26556 LDKStr val_conv = java_to_owned_str(env, val);
26557 Record_set_module_path(&this_ptr_conv, val_conv);
26560 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) {
26561 LDKRecord this_ptr_conv;
26562 this_ptr_conv.inner = untag_ptr(this_ptr);
26563 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26564 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26565 this_ptr_conv.is_owned = false;
26566 LDKStr ret_str = Record_get_file(&this_ptr_conv);
26567 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
26572 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
26573 LDKRecord this_ptr_conv;
26574 this_ptr_conv.inner = untag_ptr(this_ptr);
26575 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26577 this_ptr_conv.is_owned = false;
26578 LDKStr val_conv = java_to_owned_str(env, val);
26579 Record_set_file(&this_ptr_conv, val_conv);
26582 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) {
26583 LDKRecord this_ptr_conv;
26584 this_ptr_conv.inner = untag_ptr(this_ptr);
26585 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26587 this_ptr_conv.is_owned = false;
26588 int32_t ret_conv = Record_get_line(&this_ptr_conv);
26592 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
26593 LDKRecord this_ptr_conv;
26594 this_ptr_conv.inner = untag_ptr(this_ptr);
26595 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26596 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26597 this_ptr_conv.is_owned = false;
26598 Record_set_line(&this_ptr_conv, val);
26601 static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) {
26602 LDKRecord ret_var = Record_clone(arg);
26603 int64_t ret_ref = 0;
26604 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26605 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26608 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26609 LDKRecord arg_conv;
26610 arg_conv.inner = untag_ptr(arg);
26611 arg_conv.is_owned = ptr_is_owned(arg);
26612 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26613 arg_conv.is_owned = false;
26614 int64_t ret_conv = Record_clone_ptr(&arg_conv);
26618 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26619 LDKRecord orig_conv;
26620 orig_conv.inner = untag_ptr(orig);
26621 orig_conv.is_owned = ptr_is_owned(orig);
26622 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26623 orig_conv.is_owned = false;
26624 LDKRecord ret_var = Record_clone(&orig_conv);
26625 int64_t ret_ref = 0;
26626 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26627 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26631 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26632 if (!ptr_is_owned(this_ptr)) return;
26633 void* this_ptr_ptr = untag_ptr(this_ptr);
26634 CHECK_ACCESS(this_ptr_ptr);
26635 LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
26636 FREE(untag_ptr(this_ptr));
26637 Logger_free(this_ptr_conv);
26640 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
26641 LDKChannelHandshakeConfig this_obj_conv;
26642 this_obj_conv.inner = untag_ptr(this_obj);
26643 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26645 ChannelHandshakeConfig_free(this_obj_conv);
26648 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
26649 LDKChannelHandshakeConfig this_ptr_conv;
26650 this_ptr_conv.inner = untag_ptr(this_ptr);
26651 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26652 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26653 this_ptr_conv.is_owned = false;
26654 int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
26658 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
26659 LDKChannelHandshakeConfig this_ptr_conv;
26660 this_ptr_conv.inner = untag_ptr(this_ptr);
26661 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26663 this_ptr_conv.is_owned = false;
26664 ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
26667 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
26668 LDKChannelHandshakeConfig this_ptr_conv;
26669 this_ptr_conv.inner = untag_ptr(this_ptr);
26670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26672 this_ptr_conv.is_owned = false;
26673 int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
26677 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
26678 LDKChannelHandshakeConfig this_ptr_conv;
26679 this_ptr_conv.inner = untag_ptr(this_ptr);
26680 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26681 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26682 this_ptr_conv.is_owned = false;
26683 ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
26686 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
26687 LDKChannelHandshakeConfig this_ptr_conv;
26688 this_ptr_conv.inner = untag_ptr(this_ptr);
26689 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26691 this_ptr_conv.is_owned = false;
26692 int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
26696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
26697 LDKChannelHandshakeConfig this_ptr_conv;
26698 this_ptr_conv.inner = untag_ptr(this_ptr);
26699 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26700 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26701 this_ptr_conv.is_owned = false;
26702 ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
26705 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1max_1inbound_1htlc_1value_1in_1flight_1percent_1of_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) {
26706 LDKChannelHandshakeConfig this_ptr_conv;
26707 this_ptr_conv.inner = untag_ptr(this_ptr);
26708 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26709 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26710 this_ptr_conv.is_owned = false;
26711 int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv);
26715 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1max_1inbound_1htlc_1value_1in_1flight_1percent_1of_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
26716 LDKChannelHandshakeConfig this_ptr_conv;
26717 this_ptr_conv.inner = untag_ptr(this_ptr);
26718 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26719 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26720 this_ptr_conv.is_owned = false;
26721 ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val);
26724 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr) {
26725 LDKChannelHandshakeConfig this_ptr_conv;
26726 this_ptr_conv.inner = untag_ptr(this_ptr);
26727 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26729 this_ptr_conv.is_owned = false;
26730 jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv);
26734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
26735 LDKChannelHandshakeConfig this_ptr_conv;
26736 this_ptr_conv.inner = untag_ptr(this_ptr);
26737 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26738 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26739 this_ptr_conv.is_owned = false;
26740 ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val);
26743 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) {
26744 LDKChannelHandshakeConfig this_ptr_conv;
26745 this_ptr_conv.inner = untag_ptr(this_ptr);
26746 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26747 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26748 this_ptr_conv.is_owned = false;
26749 jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv);
26753 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
26754 LDKChannelHandshakeConfig this_ptr_conv;
26755 this_ptr_conv.inner = untag_ptr(this_ptr);
26756 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26757 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26758 this_ptr_conv.is_owned = false;
26759 ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val);
26762 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
26763 LDKChannelHandshakeConfig this_ptr_conv;
26764 this_ptr_conv.inner = untag_ptr(this_ptr);
26765 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26766 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26767 this_ptr_conv.is_owned = false;
26768 jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
26772 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
26773 LDKChannelHandshakeConfig this_ptr_conv;
26774 this_ptr_conv.inner = untag_ptr(this_ptr);
26775 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26776 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26777 this_ptr_conv.is_owned = false;
26778 ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
26781 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1their_1channel_1reserve_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
26782 LDKChannelHandshakeConfig this_ptr_conv;
26783 this_ptr_conv.inner = untag_ptr(this_ptr);
26784 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26786 this_ptr_conv.is_owned = false;
26787 int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv);
26791 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1their_1channel_1reserve_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
26792 LDKChannelHandshakeConfig this_ptr_conv;
26793 this_ptr_conv.inner = untag_ptr(this_ptr);
26794 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26796 this_ptr_conv.is_owned = false;
26797 ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val);
26800 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg) {
26801 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg);
26802 int64_t ret_ref = 0;
26803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26808 static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) {
26809 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg);
26810 int64_t ret_ref = 0;
26811 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26812 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26816 LDKChannelHandshakeConfig arg_conv;
26817 arg_conv.inner = untag_ptr(arg);
26818 arg_conv.is_owned = ptr_is_owned(arg);
26819 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26820 arg_conv.is_owned = false;
26821 int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv);
26825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26826 LDKChannelHandshakeConfig orig_conv;
26827 orig_conv.inner = untag_ptr(orig);
26828 orig_conv.is_owned = ptr_is_owned(orig);
26829 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26830 orig_conv.is_owned = false;
26831 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
26832 int64_t ret_ref = 0;
26833 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26834 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26838 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv *env, jclass clz) {
26839 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
26840 int64_t ret_ref = 0;
26841 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26842 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26846 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
26847 LDKChannelHandshakeLimits this_obj_conv;
26848 this_obj_conv.inner = untag_ptr(this_obj);
26849 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26850 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26851 ChannelHandshakeLimits_free(this_obj_conv);
26854 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
26855 LDKChannelHandshakeLimits this_ptr_conv;
26856 this_ptr_conv.inner = untag_ptr(this_ptr);
26857 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26859 this_ptr_conv.is_owned = false;
26860 int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
26864 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
26865 LDKChannelHandshakeLimits this_ptr_conv;
26866 this_ptr_conv.inner = untag_ptr(this_ptr);
26867 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26868 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26869 this_ptr_conv.is_owned = false;
26870 ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
26873 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
26874 LDKChannelHandshakeLimits this_ptr_conv;
26875 this_ptr_conv.inner = untag_ptr(this_ptr);
26876 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26877 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26878 this_ptr_conv.is_owned = false;
26879 int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv);
26883 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
26884 LDKChannelHandshakeLimits this_ptr_conv;
26885 this_ptr_conv.inner = untag_ptr(this_ptr);
26886 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26888 this_ptr_conv.is_owned = false;
26889 ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val);
26892 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
26893 LDKChannelHandshakeLimits this_ptr_conv;
26894 this_ptr_conv.inner = untag_ptr(this_ptr);
26895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26897 this_ptr_conv.is_owned = false;
26898 int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
26902 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
26903 LDKChannelHandshakeLimits this_ptr_conv;
26904 this_ptr_conv.inner = untag_ptr(this_ptr);
26905 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26906 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26907 this_ptr_conv.is_owned = false;
26908 ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
26911 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
26912 LDKChannelHandshakeLimits this_ptr_conv;
26913 this_ptr_conv.inner = untag_ptr(this_ptr);
26914 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26916 this_ptr_conv.is_owned = false;
26917 int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
26921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
26922 LDKChannelHandshakeLimits this_ptr_conv;
26923 this_ptr_conv.inner = untag_ptr(this_ptr);
26924 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26926 this_ptr_conv.is_owned = false;
26927 ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
26930 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
26931 LDKChannelHandshakeLimits this_ptr_conv;
26932 this_ptr_conv.inner = untag_ptr(this_ptr);
26933 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26935 this_ptr_conv.is_owned = false;
26936 int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
26940 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
26941 LDKChannelHandshakeLimits this_ptr_conv;
26942 this_ptr_conv.inner = untag_ptr(this_ptr);
26943 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26945 this_ptr_conv.is_owned = false;
26946 ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
26949 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
26950 LDKChannelHandshakeLimits this_ptr_conv;
26951 this_ptr_conv.inner = untag_ptr(this_ptr);
26952 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26954 this_ptr_conv.is_owned = false;
26955 int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
26959 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
26960 LDKChannelHandshakeLimits this_ptr_conv;
26961 this_ptr_conv.inner = untag_ptr(this_ptr);
26962 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26964 this_ptr_conv.is_owned = false;
26965 ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
26968 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
26969 LDKChannelHandshakeLimits this_ptr_conv;
26970 this_ptr_conv.inner = untag_ptr(this_ptr);
26971 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26973 this_ptr_conv.is_owned = false;
26974 int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
26978 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
26979 LDKChannelHandshakeLimits this_ptr_conv;
26980 this_ptr_conv.inner = untag_ptr(this_ptr);
26981 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26983 this_ptr_conv.is_owned = false;
26984 ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
26987 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr) {
26988 LDKChannelHandshakeLimits this_ptr_conv;
26989 this_ptr_conv.inner = untag_ptr(this_ptr);
26990 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26992 this_ptr_conv.is_owned = false;
26993 jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv);
26997 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
26998 LDKChannelHandshakeLimits this_ptr_conv;
26999 this_ptr_conv.inner = untag_ptr(this_ptr);
27000 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27002 this_ptr_conv.is_owned = false;
27003 ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val);
27006 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr) {
27007 LDKChannelHandshakeLimits this_ptr_conv;
27008 this_ptr_conv.inner = untag_ptr(this_ptr);
27009 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27010 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27011 this_ptr_conv.is_owned = false;
27012 jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
27016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
27017 LDKChannelHandshakeLimits this_ptr_conv;
27018 this_ptr_conv.inner = untag_ptr(this_ptr);
27019 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27021 this_ptr_conv.is_owned = false;
27022 ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
27025 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
27026 LDKChannelHandshakeLimits this_ptr_conv;
27027 this_ptr_conv.inner = untag_ptr(this_ptr);
27028 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27030 this_ptr_conv.is_owned = false;
27031 int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
27035 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
27036 LDKChannelHandshakeLimits this_ptr_conv;
27037 this_ptr_conv.inner = untag_ptr(this_ptr);
27038 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27040 this_ptr_conv.is_owned = false;
27041 ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
27044 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv *env, jclass clz, int64_t min_funding_satoshis_arg, int64_t max_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean trust_own_funding_0conf_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) {
27045 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_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, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_delay_arg);
27046 int64_t ret_ref = 0;
27047 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27048 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27052 static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) {
27053 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg);
27054 int64_t ret_ref = 0;
27055 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27056 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27059 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27060 LDKChannelHandshakeLimits arg_conv;
27061 arg_conv.inner = untag_ptr(arg);
27062 arg_conv.is_owned = ptr_is_owned(arg);
27063 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27064 arg_conv.is_owned = false;
27065 int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv);
27069 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27070 LDKChannelHandshakeLimits orig_conv;
27071 orig_conv.inner = untag_ptr(orig);
27072 orig_conv.is_owned = ptr_is_owned(orig);
27073 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27074 orig_conv.is_owned = false;
27075 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
27076 int64_t ret_ref = 0;
27077 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27078 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27082 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv *env, jclass clz) {
27083 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
27084 int64_t ret_ref = 0;
27085 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27086 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27091 LDKChannelConfig this_obj_conv;
27092 this_obj_conv.inner = untag_ptr(this_obj);
27093 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27095 ChannelConfig_free(this_obj_conv);
27098 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
27099 LDKChannelConfig this_ptr_conv;
27100 this_ptr_conv.inner = untag_ptr(this_ptr);
27101 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27103 this_ptr_conv.is_owned = false;
27104 int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
27108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
27109 LDKChannelConfig this_ptr_conv;
27110 this_ptr_conv.inner = untag_ptr(this_ptr);
27111 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27112 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27113 this_ptr_conv.is_owned = false;
27114 ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
27117 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
27118 LDKChannelConfig this_ptr_conv;
27119 this_ptr_conv.inner = untag_ptr(this_ptr);
27120 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27122 this_ptr_conv.is_owned = false;
27123 int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
27127 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
27128 LDKChannelConfig this_ptr_conv;
27129 this_ptr_conv.inner = untag_ptr(this_ptr);
27130 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27131 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27132 this_ptr_conv.is_owned = false;
27133 ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
27136 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
27137 LDKChannelConfig this_ptr_conv;
27138 this_ptr_conv.inner = untag_ptr(this_ptr);
27139 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27141 this_ptr_conv.is_owned = false;
27142 int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
27146 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
27147 LDKChannelConfig this_ptr_conv;
27148 this_ptr_conv.inner = untag_ptr(this_ptr);
27149 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27151 this_ptr_conv.is_owned = false;
27152 ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
27155 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
27156 LDKChannelConfig this_ptr_conv;
27157 this_ptr_conv.inner = untag_ptr(this_ptr);
27158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27160 this_ptr_conv.is_owned = false;
27161 int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
27165 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27166 LDKChannelConfig this_ptr_conv;
27167 this_ptr_conv.inner = untag_ptr(this_ptr);
27168 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27170 this_ptr_conv.is_owned = false;
27171 ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
27174 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1force_1close_1avoidance_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
27175 LDKChannelConfig this_ptr_conv;
27176 this_ptr_conv.inner = untag_ptr(this_ptr);
27177 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27179 this_ptr_conv.is_owned = false;
27180 int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
27184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1force_1close_1avoidance_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27185 LDKChannelConfig this_ptr_conv;
27186 this_ptr_conv.inner = untag_ptr(this_ptr);
27187 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27189 this_ptr_conv.is_owned = false;
27190 ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
27193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) {
27194 LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg);
27195 int64_t ret_ref = 0;
27196 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27197 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27201 static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) {
27202 LDKChannelConfig ret_var = ChannelConfig_clone(arg);
27203 int64_t ret_ref = 0;
27204 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27205 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27209 LDKChannelConfig arg_conv;
27210 arg_conv.inner = untag_ptr(arg);
27211 arg_conv.is_owned = ptr_is_owned(arg);
27212 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27213 arg_conv.is_owned = false;
27214 int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv);
27218 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27219 LDKChannelConfig orig_conv;
27220 orig_conv.inner = untag_ptr(orig);
27221 orig_conv.is_owned = ptr_is_owned(orig);
27222 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27223 orig_conv.is_owned = false;
27224 LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
27225 int64_t ret_ref = 0;
27226 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27227 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27231 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27232 LDKChannelConfig a_conv;
27233 a_conv.inner = untag_ptr(a);
27234 a_conv.is_owned = ptr_is_owned(a);
27235 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
27236 a_conv.is_owned = false;
27237 LDKChannelConfig b_conv;
27238 b_conv.inner = untag_ptr(b);
27239 b_conv.is_owned = ptr_is_owned(b);
27240 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
27241 b_conv.is_owned = false;
27242 jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv);
27246 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) {
27247 LDKChannelConfig ret_var = ChannelConfig_default();
27248 int64_t ret_ref = 0;
27249 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27250 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27254 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv *env, jclass clz, int64_t obj) {
27255 LDKChannelConfig obj_conv;
27256 obj_conv.inner = untag_ptr(obj);
27257 obj_conv.is_owned = ptr_is_owned(obj);
27258 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
27259 obj_conv.is_owned = false;
27260 LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
27261 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27262 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27263 CVec_u8Z_free(ret_var);
27267 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
27268 LDKu8slice ser_ref;
27269 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
27270 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
27271 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
27272 *ret_conv = ChannelConfig_read(ser_ref);
27273 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
27274 return tag_ptr(ret_conv, true);
27277 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27278 LDKUserConfig this_obj_conv;
27279 this_obj_conv.inner = untag_ptr(this_obj);
27280 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27281 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27282 UserConfig_free(this_obj_conv);
27285 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1handshake_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
27286 LDKUserConfig this_ptr_conv;
27287 this_ptr_conv.inner = untag_ptr(this_ptr);
27288 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27289 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27290 this_ptr_conv.is_owned = false;
27291 LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&this_ptr_conv);
27292 int64_t ret_ref = 0;
27293 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27294 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27298 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1handshake_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27299 LDKUserConfig this_ptr_conv;
27300 this_ptr_conv.inner = untag_ptr(this_ptr);
27301 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27302 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27303 this_ptr_conv.is_owned = false;
27304 LDKChannelHandshakeConfig val_conv;
27305 val_conv.inner = untag_ptr(val);
27306 val_conv.is_owned = ptr_is_owned(val);
27307 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27308 val_conv = ChannelHandshakeConfig_clone(&val_conv);
27309 UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv);
27312 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1handshake_1limits(JNIEnv *env, jclass clz, int64_t this_ptr) {
27313 LDKUserConfig this_ptr_conv;
27314 this_ptr_conv.inner = untag_ptr(this_ptr);
27315 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27317 this_ptr_conv.is_owned = false;
27318 LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&this_ptr_conv);
27319 int64_t ret_ref = 0;
27320 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27321 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27325 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1handshake_1limits(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27326 LDKUserConfig this_ptr_conv;
27327 this_ptr_conv.inner = untag_ptr(this_ptr);
27328 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27330 this_ptr_conv.is_owned = false;
27331 LDKChannelHandshakeLimits val_conv;
27332 val_conv.inner = untag_ptr(val);
27333 val_conv.is_owned = ptr_is_owned(val);
27334 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27335 val_conv = ChannelHandshakeLimits_clone(&val_conv);
27336 UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv);
27339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
27340 LDKUserConfig this_ptr_conv;
27341 this_ptr_conv.inner = untag_ptr(this_ptr);
27342 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27344 this_ptr_conv.is_owned = false;
27345 LDKChannelConfig ret_var = UserConfig_get_channel_config(&this_ptr_conv);
27346 int64_t ret_ref = 0;
27347 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27348 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27352 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27353 LDKUserConfig this_ptr_conv;
27354 this_ptr_conv.inner = untag_ptr(this_ptr);
27355 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27356 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27357 this_ptr_conv.is_owned = false;
27358 LDKChannelConfig val_conv;
27359 val_conv.inner = untag_ptr(val);
27360 val_conv.is_owned = ptr_is_owned(val);
27361 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27362 val_conv = ChannelConfig_clone(&val_conv);
27363 UserConfig_set_channel_config(&this_ptr_conv, val_conv);
27366 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
27367 LDKUserConfig this_ptr_conv;
27368 this_ptr_conv.inner = untag_ptr(this_ptr);
27369 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27371 this_ptr_conv.is_owned = false;
27372 jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
27376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
27377 LDKUserConfig this_ptr_conv;
27378 this_ptr_conv.inner = untag_ptr(this_ptr);
27379 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27381 this_ptr_conv.is_owned = false;
27382 UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
27385 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
27386 LDKUserConfig this_ptr_conv;
27387 this_ptr_conv.inner = untag_ptr(this_ptr);
27388 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27390 this_ptr_conv.is_owned = false;
27391 jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
27395 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
27396 LDKUserConfig this_ptr_conv;
27397 this_ptr_conv.inner = untag_ptr(this_ptr);
27398 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27400 this_ptr_conv.is_owned = false;
27401 UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
27404 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
27405 LDKUserConfig this_ptr_conv;
27406 this_ptr_conv.inner = untag_ptr(this_ptr);
27407 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27408 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27409 this_ptr_conv.is_owned = false;
27410 jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv);
27414 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
27415 LDKUserConfig this_ptr_conv;
27416 this_ptr_conv.inner = untag_ptr(this_ptr);
27417 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27419 this_ptr_conv.is_owned = false;
27420 UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val);
27423 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg) {
27424 LDKChannelHandshakeConfig channel_handshake_config_arg_conv;
27425 channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg);
27426 channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg);
27427 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv);
27428 channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv);
27429 LDKChannelHandshakeLimits channel_handshake_limits_arg_conv;
27430 channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg);
27431 channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg);
27432 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv);
27433 channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv);
27434 LDKChannelConfig channel_config_arg_conv;
27435 channel_config_arg_conv.inner = untag_ptr(channel_config_arg);
27436 channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg);
27437 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv);
27438 channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv);
27439 LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg);
27440 int64_t ret_ref = 0;
27441 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27442 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27446 static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) {
27447 LDKUserConfig ret_var = UserConfig_clone(arg);
27448 int64_t ret_ref = 0;
27449 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27450 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27453 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27454 LDKUserConfig arg_conv;
27455 arg_conv.inner = untag_ptr(arg);
27456 arg_conv.is_owned = ptr_is_owned(arg);
27457 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27458 arg_conv.is_owned = false;
27459 int64_t ret_conv = UserConfig_clone_ptr(&arg_conv);
27463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27464 LDKUserConfig orig_conv;
27465 orig_conv.inner = untag_ptr(orig);
27466 orig_conv.is_owned = ptr_is_owned(orig);
27467 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27468 orig_conv.is_owned = false;
27469 LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
27470 int64_t ret_ref = 0;
27471 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27472 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27476 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv *env, jclass clz) {
27477 LDKUserConfig ret_var = UserConfig_default();
27478 int64_t ret_ref = 0;
27479 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27480 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27484 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27485 LDKBestBlock this_obj_conv;
27486 this_obj_conv.inner = untag_ptr(this_obj);
27487 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27488 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27489 BestBlock_free(this_obj_conv);
27492 static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) {
27493 LDKBestBlock ret_var = BestBlock_clone(arg);
27494 int64_t ret_ref = 0;
27495 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27496 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27500 LDKBestBlock arg_conv;
27501 arg_conv.inner = untag_ptr(arg);
27502 arg_conv.is_owned = ptr_is_owned(arg);
27503 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27504 arg_conv.is_owned = false;
27505 int64_t ret_conv = BestBlock_clone_ptr(&arg_conv);
27509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27510 LDKBestBlock orig_conv;
27511 orig_conv.inner = untag_ptr(orig);
27512 orig_conv.is_owned = ptr_is_owned(orig);
27513 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27514 orig_conv.is_owned = false;
27515 LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
27516 int64_t ret_ref = 0;
27517 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27518 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27522 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BestBlock_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27523 LDKBestBlock a_conv;
27524 a_conv.inner = untag_ptr(a);
27525 a_conv.is_owned = ptr_is_owned(a);
27526 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
27527 a_conv.is_owned = false;
27528 LDKBestBlock b_conv;
27529 b_conv.inner = untag_ptr(b);
27530 b_conv.is_owned = ptr_is_owned(b);
27531 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
27532 b_conv.is_owned = false;
27533 jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv);
27537 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) {
27538 LDKNetwork network_conv = LDKNetwork_from_java(env, network);
27539 LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
27540 int64_t ret_ref = 0;
27541 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27542 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27546 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, jclass clz, int8_tArray block_hash, int32_t height) {
27547 LDKThirtyTwoBytes block_hash_ref;
27548 CHECK((*env)->GetArrayLength(env, block_hash) == 32);
27549 (*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data);
27550 LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
27551 int64_t ret_ref = 0;
27552 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27553 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27557 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
27558 LDKBestBlock this_arg_conv;
27559 this_arg_conv.inner = untag_ptr(this_arg);
27560 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27562 this_arg_conv.is_owned = false;
27563 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
27564 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data);
27568 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *env, jclass clz, int64_t this_arg) {
27569 LDKBestBlock this_arg_conv;
27570 this_arg_conv.inner = untag_ptr(this_arg);
27571 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27573 this_arg_conv.is_owned = false;
27574 int32_t ret_conv = BestBlock_height(&this_arg_conv);
27578 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27579 LDKAccessError* orig_conv = (LDKAccessError*)untag_ptr(orig);
27580 jclass ret_conv = LDKAccessError_to_java(env, AccessError_clone(orig_conv));
27584 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1chain(JNIEnv *env, jclass clz) {
27585 jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_chain());
27589 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1tx(JNIEnv *env, jclass clz) {
27590 jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_tx());
27594 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27595 if (!ptr_is_owned(this_ptr)) return;
27596 void* this_ptr_ptr = untag_ptr(this_ptr);
27597 CHECK_ACCESS(this_ptr_ptr);
27598 LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
27599 FREE(untag_ptr(this_ptr));
27600 Access_free(this_ptr_conv);
27603 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27604 if (!ptr_is_owned(this_ptr)) return;
27605 void* this_ptr_ptr = untag_ptr(this_ptr);
27606 CHECK_ACCESS(this_ptr_ptr);
27607 LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
27608 FREE(untag_ptr(this_ptr));
27609 Listen_free(this_ptr_conv);
27612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27613 if (!ptr_is_owned(this_ptr)) return;
27614 void* this_ptr_ptr = untag_ptr(this_ptr);
27615 CHECK_ACCESS(this_ptr_ptr);
27616 LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
27617 FREE(untag_ptr(this_ptr));
27618 Confirm_free(this_ptr_conv);
27621 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27622 LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig);
27623 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_clone(orig_conv));
27627 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1completed(JNIEnv *env, jclass clz) {
27628 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_completed());
27632 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1in_1progress(JNIEnv *env, jclass clz) {
27633 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_in_progress());
27637 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1permanent_1failure(JNIEnv *env, jclass clz) {
27638 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_permanent_failure());
27642 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27643 LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a);
27644 LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b);
27645 jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv);
27649 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27650 if (!ptr_is_owned(this_ptr)) return;
27651 void* this_ptr_ptr = untag_ptr(this_ptr);
27652 CHECK_ACCESS(this_ptr_ptr);
27653 LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
27654 FREE(untag_ptr(this_ptr));
27655 Watch_free(this_ptr_conv);
27658 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27659 if (!ptr_is_owned(this_ptr)) return;
27660 void* this_ptr_ptr = untag_ptr(this_ptr);
27661 CHECK_ACCESS(this_ptr_ptr);
27662 LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
27663 FREE(untag_ptr(this_ptr));
27664 Filter_free(this_ptr_conv);
27667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27668 LDKWatchedOutput this_obj_conv;
27669 this_obj_conv.inner = untag_ptr(this_obj);
27670 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27672 WatchedOutput_free(this_obj_conv);
27675 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
27676 LDKWatchedOutput this_ptr_conv;
27677 this_ptr_conv.inner = untag_ptr(this_ptr);
27678 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27680 this_ptr_conv.is_owned = false;
27681 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
27682 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data);
27686 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
27687 LDKWatchedOutput this_ptr_conv;
27688 this_ptr_conv.inner = untag_ptr(this_ptr);
27689 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27691 this_ptr_conv.is_owned = false;
27692 LDKThirtyTwoBytes val_ref;
27693 CHECK((*env)->GetArrayLength(env, val) == 32);
27694 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
27695 WatchedOutput_set_block_hash(&this_ptr_conv, val_ref);
27698 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
27699 LDKWatchedOutput this_ptr_conv;
27700 this_ptr_conv.inner = untag_ptr(this_ptr);
27701 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27703 this_ptr_conv.is_owned = false;
27704 LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv);
27705 int64_t ret_ref = 0;
27706 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27707 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27711 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27712 LDKWatchedOutput this_ptr_conv;
27713 this_ptr_conv.inner = untag_ptr(this_ptr);
27714 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27716 this_ptr_conv.is_owned = false;
27717 LDKOutPoint val_conv;
27718 val_conv.inner = untag_ptr(val);
27719 val_conv.is_owned = ptr_is_owned(val);
27720 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27721 val_conv = OutPoint_clone(&val_conv);
27722 WatchedOutput_set_outpoint(&this_ptr_conv, val_conv);
27725 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
27726 LDKWatchedOutput this_ptr_conv;
27727 this_ptr_conv.inner = untag_ptr(this_ptr);
27728 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27730 this_ptr_conv.is_owned = false;
27731 LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv);
27732 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27733 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27737 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
27738 LDKWatchedOutput this_ptr_conv;
27739 this_ptr_conv.inner = untag_ptr(this_ptr);
27740 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27742 this_ptr_conv.is_owned = false;
27743 LDKCVec_u8Z val_ref;
27744 val_ref.datalen = (*env)->GetArrayLength(env, val);
27745 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
27746 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
27747 WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref);
27750 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv *env, jclass clz, int8_tArray block_hash_arg, int64_t outpoint_arg, int8_tArray script_pubkey_arg) {
27751 LDKThirtyTwoBytes block_hash_arg_ref;
27752 CHECK((*env)->GetArrayLength(env, block_hash_arg) == 32);
27753 (*env)->GetByteArrayRegion(env, block_hash_arg, 0, 32, block_hash_arg_ref.data);
27754 LDKOutPoint outpoint_arg_conv;
27755 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
27756 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
27757 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
27758 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
27759 LDKCVec_u8Z script_pubkey_arg_ref;
27760 script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg);
27761 script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
27762 (*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data);
27763 LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
27764 int64_t ret_ref = 0;
27765 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27766 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27770 static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) {
27771 LDKWatchedOutput ret_var = WatchedOutput_clone(arg);
27772 int64_t ret_ref = 0;
27773 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27774 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27777 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27778 LDKWatchedOutput arg_conv;
27779 arg_conv.inner = untag_ptr(arg);
27780 arg_conv.is_owned = ptr_is_owned(arg);
27781 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27782 arg_conv.is_owned = false;
27783 int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv);
27787 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27788 LDKWatchedOutput orig_conv;
27789 orig_conv.inner = untag_ptr(orig);
27790 orig_conv.is_owned = ptr_is_owned(orig);
27791 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27792 orig_conv.is_owned = false;
27793 LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv);
27794 int64_t ret_ref = 0;
27795 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27796 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27800 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27801 LDKWatchedOutput a_conv;
27802 a_conv.inner = untag_ptr(a);
27803 a_conv.is_owned = ptr_is_owned(a);
27804 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
27805 a_conv.is_owned = false;
27806 LDKWatchedOutput b_conv;
27807 b_conv.inner = untag_ptr(b);
27808 b_conv.is_owned = ptr_is_owned(b);
27809 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
27810 b_conv.is_owned = false;
27811 jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv);
27815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv *env, jclass clz, int64_t o) {
27816 LDKWatchedOutput o_conv;
27817 o_conv.inner = untag_ptr(o);
27818 o_conv.is_owned = ptr_is_owned(o);
27819 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
27820 o_conv.is_owned = false;
27821 int64_t ret_conv = WatchedOutput_hash(&o_conv);
27825 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27826 if (!ptr_is_owned(this_ptr)) return;
27827 void* this_ptr_ptr = untag_ptr(this_ptr);
27828 CHECK_ACCESS(this_ptr_ptr);
27829 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
27830 FREE(untag_ptr(this_ptr));
27831 BroadcasterInterface_free(this_ptr_conv);
27834 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27835 LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig);
27836 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_clone(orig_conv));
27840 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background(JNIEnv *env, jclass clz) {
27841 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_background());
27845 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal(JNIEnv *env, jclass clz) {
27846 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_normal());
27850 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority(JNIEnv *env, jclass clz) {
27851 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_high_priority());
27855 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27856 LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a);
27857 LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b);
27858 jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv);
27862 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27863 if (!ptr_is_owned(this_ptr)) return;
27864 void* this_ptr_ptr = untag_ptr(this_ptr);
27865 CHECK_ACCESS(this_ptr_ptr);
27866 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
27867 FREE(untag_ptr(this_ptr));
27868 FeeEstimator_free(this_ptr_conv);
27871 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27872 LDKMonitorUpdateId this_obj_conv;
27873 this_obj_conv.inner = untag_ptr(this_obj);
27874 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27875 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27876 MonitorUpdateId_free(this_obj_conv);
27879 static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) {
27880 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg);
27881 int64_t ret_ref = 0;
27882 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27883 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27887 LDKMonitorUpdateId arg_conv;
27888 arg_conv.inner = untag_ptr(arg);
27889 arg_conv.is_owned = ptr_is_owned(arg);
27890 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27891 arg_conv.is_owned = false;
27892 int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv);
27896 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27897 LDKMonitorUpdateId orig_conv;
27898 orig_conv.inner = untag_ptr(orig);
27899 orig_conv.is_owned = ptr_is_owned(orig);
27900 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27901 orig_conv.is_owned = false;
27902 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv);
27903 int64_t ret_ref = 0;
27904 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27905 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27909 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) {
27910 LDKMonitorUpdateId o_conv;
27911 o_conv.inner = untag_ptr(o);
27912 o_conv.is_owned = ptr_is_owned(o);
27913 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
27914 o_conv.is_owned = false;
27915 int64_t ret_conv = MonitorUpdateId_hash(&o_conv);
27919 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27920 LDKMonitorUpdateId a_conv;
27921 a_conv.inner = untag_ptr(a);
27922 a_conv.is_owned = ptr_is_owned(a);
27923 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
27924 a_conv.is_owned = false;
27925 LDKMonitorUpdateId b_conv;
27926 b_conv.inner = untag_ptr(b);
27927 b_conv.is_owned = ptr_is_owned(b);
27928 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
27929 b_conv.is_owned = false;
27930 jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv);
27934 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27935 if (!ptr_is_owned(this_ptr)) return;
27936 void* this_ptr_ptr = untag_ptr(this_ptr);
27937 CHECK_ACCESS(this_ptr_ptr);
27938 LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
27939 FREE(untag_ptr(this_ptr));
27940 Persist_free(this_ptr_conv);
27943 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27944 LDKLockedChannelMonitor this_obj_conv;
27945 this_obj_conv.inner = untag_ptr(this_obj);
27946 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27948 LockedChannelMonitor_free(this_obj_conv);
27951 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27952 LDKChainMonitor this_obj_conv;
27953 this_obj_conv.inner = untag_ptr(this_obj);
27954 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27956 ChainMonitor_free(this_obj_conv);
27959 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *env, jclass clz, int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) {
27960 void* chain_source_ptr = untag_ptr(chain_source);
27961 CHECK_ACCESS(chain_source_ptr);
27962 LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
27963 // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ
27964 if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
27965 // Manually implement clone for Java trait instances
27966 if (chain_source_conv.some.free == LDKFilter_JCalls_free) {
27967 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27968 LDKFilter_JCalls_cloned(&chain_source_conv.some);
27971 void* broadcaster_ptr = untag_ptr(broadcaster);
27972 CHECK_ACCESS(broadcaster_ptr);
27973 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
27974 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
27975 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27976 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
27978 void* logger_ptr = untag_ptr(logger);
27979 CHECK_ACCESS(logger_ptr);
27980 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
27981 if (logger_conv.free == LDKLogger_JCalls_free) {
27982 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27983 LDKLogger_JCalls_cloned(&logger_conv);
27985 void* feeest_ptr = untag_ptr(feeest);
27986 CHECK_ACCESS(feeest_ptr);
27987 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
27988 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
27989 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27990 LDKFeeEstimator_JCalls_cloned(&feeest_conv);
27992 void* persister_ptr = untag_ptr(persister);
27993 CHECK_ACCESS(persister_ptr);
27994 LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
27995 if (persister_conv.free == LDKPersist_JCalls_free) {
27996 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27997 LDKPersist_JCalls_cloned(&persister_conv);
27999 LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
28000 int64_t ret_ref = 0;
28001 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28002 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28006 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray ignored_channels) {
28007 LDKChainMonitor this_arg_conv;
28008 this_arg_conv.inner = untag_ptr(this_arg);
28009 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28010 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28011 this_arg_conv.is_owned = false;
28012 LDKCVec_ChannelDetailsZ ignored_channels_constr;
28013 ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels);
28014 if (ignored_channels_constr.datalen > 0)
28015 ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
28017 ignored_channels_constr.data = NULL;
28018 int64_t* ignored_channels_vals = (*env)->GetLongArrayElements (env, ignored_channels, NULL);
28019 for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
28020 int64_t ignored_channels_conv_16 = ignored_channels_vals[q];
28021 LDKChannelDetails ignored_channels_conv_16_conv;
28022 ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16);
28023 ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16);
28024 CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv);
28025 ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
28026 ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
28028 (*env)->ReleaseLongArrayElements(env, ignored_channels, ignored_channels_vals, 0);
28029 LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
28030 int64_tArray ret_arr = NULL;
28031 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
28032 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
28033 for (size_t j = 0; j < ret_var.datalen; j++) {
28034 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
28035 *ret_conv_9_copy = ret_var.data[j];
28036 int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
28037 ret_arr_ptr[j] = ret_conv_9_ref;
28039 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
28040 FREE(ret_var.data);
28044 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo) {
28045 LDKChainMonitor this_arg_conv;
28046 this_arg_conv.inner = untag_ptr(this_arg);
28047 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28048 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28049 this_arg_conv.is_owned = false;
28050 LDKOutPoint funding_txo_conv;
28051 funding_txo_conv.inner = untag_ptr(funding_txo);
28052 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
28053 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
28054 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
28055 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
28056 *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv);
28057 return tag_ptr(ret_conv, true);
28060 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1monitors(JNIEnv *env, jclass clz, int64_t this_arg) {
28061 LDKChainMonitor this_arg_conv;
28062 this_arg_conv.inner = untag_ptr(this_arg);
28063 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28065 this_arg_conv.is_owned = false;
28066 LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
28067 int64_tArray ret_arr = NULL;
28068 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
28069 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
28070 for (size_t k = 0; k < ret_var.datalen; k++) {
28071 LDKOutPoint ret_conv_10_var = ret_var.data[k];
28072 int64_t ret_conv_10_ref = 0;
28073 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
28074 ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned);
28075 ret_arr_ptr[k] = ret_conv_10_ref;
28077 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
28078 FREE(ret_var.data);
28082 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1monitor_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) {
28083 LDKChainMonitor this_arg_conv;
28084 this_arg_conv.inner = untag_ptr(this_arg);
28085 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28087 this_arg_conv.is_owned = false;
28088 LDKOutPoint funding_txo_conv;
28089 funding_txo_conv.inner = untag_ptr(funding_txo);
28090 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
28091 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
28092 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
28093 LDKMonitorUpdateId completed_update_id_conv;
28094 completed_update_id_conv.inner = untag_ptr(completed_update_id);
28095 completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id);
28096 CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv);
28097 completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
28098 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
28099 *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
28100 return tag_ptr(ret_conv, true);
28103 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
28104 LDKChainMonitor this_arg_conv;
28105 this_arg_conv.inner = untag_ptr(this_arg);
28106 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28108 this_arg_conv.is_owned = false;
28109 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
28110 *ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
28111 return tag_ptr(ret_ret, true);
28114 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) {
28115 LDKChainMonitor this_arg_conv;
28116 this_arg_conv.inner = untag_ptr(this_arg);
28117 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28118 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28119 this_arg_conv.is_owned = false;
28120 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
28121 *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
28122 return tag_ptr(ret_ret, true);
28125 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv *env, jclass clz, int64_t this_arg) {
28126 LDKChainMonitor this_arg_conv;
28127 this_arg_conv.inner = untag_ptr(this_arg);
28128 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28129 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28130 this_arg_conv.is_owned = false;
28131 LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
28132 *ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
28133 return tag_ptr(ret_ret, true);
28136 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
28137 LDKChainMonitor this_arg_conv;
28138 this_arg_conv.inner = untag_ptr(this_arg);
28139 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28141 this_arg_conv.is_owned = false;
28142 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
28143 *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
28144 return tag_ptr(ret_ret, true);
28147 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28148 LDKChannelMonitorUpdate this_obj_conv;
28149 this_obj_conv.inner = untag_ptr(this_obj);
28150 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28152 ChannelMonitorUpdate_free(this_obj_conv);
28155 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
28156 LDKChannelMonitorUpdate this_ptr_conv;
28157 this_ptr_conv.inner = untag_ptr(this_ptr);
28158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28160 this_ptr_conv.is_owned = false;
28161 int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
28165 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28166 LDKChannelMonitorUpdate this_ptr_conv;
28167 this_ptr_conv.inner = untag_ptr(this_ptr);
28168 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28170 this_ptr_conv.is_owned = false;
28171 ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
28174 static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) {
28175 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg);
28176 int64_t ret_ref = 0;
28177 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28178 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28181 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28182 LDKChannelMonitorUpdate arg_conv;
28183 arg_conv.inner = untag_ptr(arg);
28184 arg_conv.is_owned = ptr_is_owned(arg);
28185 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28186 arg_conv.is_owned = false;
28187 int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv);
28191 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28192 LDKChannelMonitorUpdate orig_conv;
28193 orig_conv.inner = untag_ptr(orig);
28194 orig_conv.is_owned = ptr_is_owned(orig);
28195 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28196 orig_conv.is_owned = false;
28197 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
28198 int64_t ret_ref = 0;
28199 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28200 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28204 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
28205 LDKChannelMonitorUpdate obj_conv;
28206 obj_conv.inner = untag_ptr(obj);
28207 obj_conv.is_owned = ptr_is_owned(obj);
28208 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
28209 obj_conv.is_owned = false;
28210 LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
28211 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
28212 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
28213 CVec_u8Z_free(ret_var);
28217 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
28218 LDKu8slice ser_ref;
28219 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
28220 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
28221 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
28222 *ret_conv = ChannelMonitorUpdate_read(ser_ref);
28223 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
28224 return tag_ptr(ret_conv, true);
28227 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
28228 if (!ptr_is_owned(this_ptr)) return;
28229 void* this_ptr_ptr = untag_ptr(this_ptr);
28230 CHECK_ACCESS(this_ptr_ptr);
28231 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
28232 FREE(untag_ptr(this_ptr));
28233 MonitorEvent_free(this_ptr_conv);
28236 static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) {
28237 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
28238 *ret_copy = MonitorEvent_clone(arg);
28239 int64_t ret_ref = tag_ptr(ret_copy, true);
28242 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28243 LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg);
28244 int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv);
28248 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28249 LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig);
28250 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
28251 *ret_copy = MonitorEvent_clone(orig_conv);
28252 int64_t ret_ref = tag_ptr(ret_copy, true);
28256 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNIEnv *env, jclass clz, int64_t a) {
28257 LDKHTLCUpdate a_conv;
28258 a_conv.inner = untag_ptr(a);
28259 a_conv.is_owned = ptr_is_owned(a);
28260 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28261 a_conv = HTLCUpdate_clone(&a_conv);
28262 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
28263 *ret_copy = MonitorEvent_htlcevent(a_conv);
28264 int64_t ret_ref = tag_ptr(ret_copy, true);
28268 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz, int64_t a) {
28269 LDKOutPoint a_conv;
28270 a_conv.inner = untag_ptr(a);
28271 a_conv.is_owned = ptr_is_owned(a);
28272 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28273 a_conv = OutPoint_clone(&a_conv);
28274 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
28275 *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv);
28276 int64_t ret_ref = tag_ptr(ret_copy, true);
28280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) {
28281 LDKOutPoint funding_txo_conv;
28282 funding_txo_conv.inner = untag_ptr(funding_txo);
28283 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
28284 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
28285 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
28286 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
28287 *ret_copy = MonitorEvent_completed(funding_txo_conv, monitor_update_id);
28288 int64_t ret_ref = tag_ptr(ret_copy, true);
28292 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed(JNIEnv *env, jclass clz, int64_t a) {
28293 LDKOutPoint a_conv;
28294 a_conv.inner = untag_ptr(a);
28295 a_conv.is_owned = ptr_is_owned(a);
28296 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28297 a_conv = OutPoint_clone(&a_conv);
28298 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
28299 *ret_copy = MonitorEvent_update_failed(a_conv);
28300 int64_t ret_ref = tag_ptr(ret_copy, true);
28304 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
28305 LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a);
28306 LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b);
28307 jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv);
28311 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) {
28312 LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
28313 LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
28314 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
28315 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
28316 CVec_u8Z_free(ret_var);
28320 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
28321 LDKu8slice ser_ref;
28322 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
28323 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
28324 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
28325 *ret_conv = MonitorEvent_read(ser_ref);
28326 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
28327 return tag_ptr(ret_conv, true);
28330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28331 LDKHTLCUpdate this_obj_conv;
28332 this_obj_conv.inner = untag_ptr(this_obj);
28333 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28335 HTLCUpdate_free(this_obj_conv);
28338 static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) {
28339 LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg);
28340 int64_t ret_ref = 0;
28341 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28342 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28346 LDKHTLCUpdate arg_conv;
28347 arg_conv.inner = untag_ptr(arg);
28348 arg_conv.is_owned = ptr_is_owned(arg);
28349 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28350 arg_conv.is_owned = false;
28351 int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv);
28355 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28356 LDKHTLCUpdate orig_conv;
28357 orig_conv.inner = untag_ptr(orig);
28358 orig_conv.is_owned = ptr_is_owned(orig);
28359 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28360 orig_conv.is_owned = false;
28361 LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
28362 int64_t ret_ref = 0;
28363 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28364 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28368 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
28369 LDKHTLCUpdate a_conv;
28370 a_conv.inner = untag_ptr(a);
28371 a_conv.is_owned = ptr_is_owned(a);
28372 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28373 a_conv.is_owned = false;
28374 LDKHTLCUpdate b_conv;
28375 b_conv.inner = untag_ptr(b);
28376 b_conv.is_owned = ptr_is_owned(b);
28377 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
28378 b_conv.is_owned = false;
28379 jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv);
28383 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
28384 LDKHTLCUpdate obj_conv;
28385 obj_conv.inner = untag_ptr(obj);
28386 obj_conv.is_owned = ptr_is_owned(obj);
28387 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
28388 obj_conv.is_owned = false;
28389 LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
28390 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
28391 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
28392 CVec_u8Z_free(ret_var);
28396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
28397 LDKu8slice ser_ref;
28398 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
28399 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
28400 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
28401 *ret_conv = HTLCUpdate_read(ser_ref);
28402 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
28403 return tag_ptr(ret_conv, true);
28406 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
28407 if (!ptr_is_owned(this_ptr)) return;
28408 void* this_ptr_ptr = untag_ptr(this_ptr);
28409 CHECK_ACCESS(this_ptr_ptr);
28410 LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
28411 FREE(untag_ptr(this_ptr));
28412 Balance_free(this_ptr_conv);
28415 static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) {
28416 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
28417 *ret_copy = Balance_clone(arg);
28418 int64_t ret_ref = tag_ptr(ret_copy, true);
28421 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28422 LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg);
28423 int64_t ret_conv = Balance_clone_ptr(arg_conv);
28427 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28428 LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig);
28429 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
28430 *ret_copy = Balance_clone(orig_conv);
28431 int64_t ret_ref = tag_ptr(ret_copy, true);
28435 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) {
28436 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
28437 *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis);
28438 int64_t ret_ref = tag_ptr(ret_copy, true);
28442 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1awaiting_1confirmations(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t confirmation_height) {
28443 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
28444 *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
28445 int64_t ret_ref = tag_ptr(ret_copy, true);
28449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1contentious_1claimable(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t timeout_height) {
28450 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
28451 *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
28452 int64_t ret_ref = tag_ptr(ret_copy, true);
28456 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1timeout_1claimable_1htlc(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t claimable_height) {
28457 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
28458 *ret_copy = Balance_maybe_timeout_claimable_htlc(claimable_amount_satoshis, claimable_height);
28459 int64_t ret_ref = tag_ptr(ret_copy, true);
28463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1preimage_1claimable_1htlc(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t expiry_height) {
28464 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
28465 *ret_copy = Balance_maybe_preimage_claimable_htlc(claimable_amount_satoshis, expiry_height);
28466 int64_t ret_ref = tag_ptr(ret_copy, true);
28470 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1counterparty_1revoked_1output_1claimable(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) {
28471 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
28472 *ret_copy = Balance_counterparty_revoked_output_claimable(claimable_amount_satoshis);
28473 int64_t ret_ref = tag_ptr(ret_copy, true);
28477 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Balance_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
28478 LDKBalance* a_conv = (LDKBalance*)untag_ptr(a);
28479 LDKBalance* b_conv = (LDKBalance*)untag_ptr(b);
28480 jboolean ret_conv = Balance_eq(a_conv, b_conv);
28484 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28485 LDKChannelMonitor this_obj_conv;
28486 this_obj_conv.inner = untag_ptr(this_obj);
28487 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28488 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28489 ChannelMonitor_free(this_obj_conv);
28492 static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) {
28493 LDKChannelMonitor ret_var = ChannelMonitor_clone(arg);
28494 int64_t ret_ref = 0;
28495 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28496 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28500 LDKChannelMonitor arg_conv;
28501 arg_conv.inner = untag_ptr(arg);
28502 arg_conv.is_owned = ptr_is_owned(arg);
28503 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28504 arg_conv.is_owned = false;
28505 int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv);
28509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28510 LDKChannelMonitor orig_conv;
28511 orig_conv.inner = untag_ptr(orig);
28512 orig_conv.is_owned = ptr_is_owned(orig);
28513 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28514 orig_conv.is_owned = false;
28515 LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv);
28516 int64_t ret_ref = 0;
28517 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28518 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28522 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(JNIEnv *env, jclass clz, int64_t obj) {
28523 LDKChannelMonitor obj_conv;
28524 obj_conv.inner = untag_ptr(obj);
28525 obj_conv.is_owned = ptr_is_owned(obj);
28526 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
28527 obj_conv.is_owned = false;
28528 LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
28529 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
28530 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
28531 CVec_u8Z_free(ret_var);
28535 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t updates, int64_t broadcaster, int64_t fee_estimator, int64_t logger) {
28536 LDKChannelMonitor this_arg_conv;
28537 this_arg_conv.inner = untag_ptr(this_arg);
28538 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28540 this_arg_conv.is_owned = false;
28541 LDKChannelMonitorUpdate updates_conv;
28542 updates_conv.inner = untag_ptr(updates);
28543 updates_conv.is_owned = ptr_is_owned(updates);
28544 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
28545 updates_conv.is_owned = false;
28546 void* broadcaster_ptr = untag_ptr(broadcaster);
28547 if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); }
28548 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
28549 void* fee_estimator_ptr = untag_ptr(fee_estimator);
28550 CHECK_ACCESS(fee_estimator_ptr);
28551 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
28552 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
28553 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28554 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
28556 void* logger_ptr = untag_ptr(logger);
28557 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
28558 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
28559 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
28560 *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
28561 return tag_ptr(ret_conv, true);
28564 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
28565 LDKChannelMonitor this_arg_conv;
28566 this_arg_conv.inner = untag_ptr(this_arg);
28567 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28568 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28569 this_arg_conv.is_owned = false;
28570 int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv);
28574 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_arg) {
28575 LDKChannelMonitor this_arg_conv;
28576 this_arg_conv.inner = untag_ptr(this_arg);
28577 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28579 this_arg_conv.is_owned = false;
28580 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
28581 *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv);
28582 return tag_ptr(ret_conv, true);
28585 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg) {
28586 LDKChannelMonitor this_arg_conv;
28587 this_arg_conv.inner = untag_ptr(this_arg);
28588 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28590 this_arg_conv.is_owned = false;
28591 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
28592 int64_tArray ret_arr = NULL;
28593 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
28594 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
28595 for (size_t o = 0; o < ret_var.datalen; o++) {
28596 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
28597 *ret_conv_40_conv = ret_var.data[o];
28598 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
28600 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
28601 FREE(ret_var.data);
28605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg, int64_t filter) {
28606 LDKChannelMonitor this_arg_conv;
28607 this_arg_conv.inner = untag_ptr(this_arg);
28608 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28609 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28610 this_arg_conv.is_owned = false;
28611 void* filter_ptr = untag_ptr(filter);
28612 if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); }
28613 LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
28614 ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
28617 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
28618 LDKChannelMonitor this_arg_conv;
28619 this_arg_conv.inner = untag_ptr(this_arg);
28620 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28622 this_arg_conv.is_owned = false;
28623 LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
28624 int64_tArray ret_arr = NULL;
28625 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
28626 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
28627 for (size_t o = 0; o < ret_var.datalen; o++) {
28628 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
28629 *ret_conv_14_copy = ret_var.data[o];
28630 int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
28631 ret_arr_ptr[o] = ret_conv_14_ref;
28633 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
28634 FREE(ret_var.data);
28638 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
28639 LDKChannelMonitor this_arg_conv;
28640 this_arg_conv.inner = untag_ptr(this_arg);
28641 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28643 this_arg_conv.is_owned = false;
28644 LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
28645 int64_tArray ret_arr = NULL;
28646 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
28647 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
28648 for (size_t h = 0; h < ret_var.datalen; h++) {
28649 LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
28650 *ret_conv_7_copy = ret_var.data[h];
28651 int64_t ret_conv_7_ref = tag_ptr(ret_conv_7_copy, true);
28652 ret_arr_ptr[h] = ret_conv_7_ref;
28654 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
28655 FREE(ret_var.data);
28659 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1counterparty_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
28660 LDKChannelMonitor this_arg_conv;
28661 this_arg_conv.inner = untag_ptr(this_arg);
28662 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28664 this_arg_conv.is_owned = false;
28665 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
28666 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form);
28670 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t logger) {
28671 LDKChannelMonitor this_arg_conv;
28672 this_arg_conv.inner = untag_ptr(this_arg);
28673 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28675 this_arg_conv.is_owned = false;
28676 void* logger_ptr = untag_ptr(logger);
28677 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
28678 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
28679 LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
28680 jobjectArray ret_arr = NULL;
28681 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
28683 for (size_t i = 0; i < ret_var.datalen; i++) {
28684 LDKTransaction ret_conv_8_var = ret_var.data[i];
28685 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen);
28686 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data);
28687 Transaction_free(ret_conv_8_var);
28688 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
28691 FREE(ret_var.data);
28695 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) {
28696 LDKChannelMonitor this_arg_conv;
28697 this_arg_conv.inner = untag_ptr(this_arg);
28698 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28700 this_arg_conv.is_owned = false;
28701 unsigned char header_arr[80];
28702 CHECK((*env)->GetArrayLength(env, header) == 80);
28703 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
28704 unsigned char (*header_ref)[80] = &header_arr;
28705 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
28706 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
28707 if (txdata_constr.datalen > 0)
28708 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
28710 txdata_constr.data = NULL;
28711 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
28712 for (size_t c = 0; c < txdata_constr.datalen; c++) {
28713 int64_t txdata_conv_28 = txdata_vals[c];
28714 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
28715 CHECK_ACCESS(txdata_conv_28_ptr);
28716 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
28717 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
28718 txdata_constr.data[c] = txdata_conv_28_conv;
28720 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
28721 void* broadcaster_ptr = untag_ptr(broadcaster);
28722 CHECK_ACCESS(broadcaster_ptr);
28723 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
28724 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
28725 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28726 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
28728 void* fee_estimator_ptr = untag_ptr(fee_estimator);
28729 CHECK_ACCESS(fee_estimator_ptr);
28730 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
28731 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
28732 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28733 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
28735 void* logger_ptr = untag_ptr(logger);
28736 CHECK_ACCESS(logger_ptr);
28737 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
28738 if (logger_conv.free == LDKLogger_JCalls_free) {
28739 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28740 LDKLogger_JCalls_cloned(&logger_conv);
28742 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
28743 int64_tArray ret_arr = NULL;
28744 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
28745 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
28746 for (size_t n = 0; n < ret_var.datalen; n++) {
28747 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
28748 *ret_conv_39_conv = ret_var.data[n];
28749 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
28751 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
28752 FREE(ret_var.data);
28756 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) {
28757 LDKChannelMonitor this_arg_conv;
28758 this_arg_conv.inner = untag_ptr(this_arg);
28759 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28760 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28761 this_arg_conv.is_owned = false;
28762 unsigned char header_arr[80];
28763 CHECK((*env)->GetArrayLength(env, header) == 80);
28764 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
28765 unsigned char (*header_ref)[80] = &header_arr;
28766 void* broadcaster_ptr = untag_ptr(broadcaster);
28767 CHECK_ACCESS(broadcaster_ptr);
28768 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
28769 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
28770 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28771 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
28773 void* fee_estimator_ptr = untag_ptr(fee_estimator);
28774 CHECK_ACCESS(fee_estimator_ptr);
28775 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
28776 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
28777 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28778 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
28780 void* logger_ptr = untag_ptr(logger);
28781 CHECK_ACCESS(logger_ptr);
28782 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
28783 if (logger_conv.free == LDKLogger_JCalls_free) {
28784 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28785 LDKLogger_JCalls_cloned(&logger_conv);
28787 ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
28790 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) {
28791 LDKChannelMonitor this_arg_conv;
28792 this_arg_conv.inner = untag_ptr(this_arg);
28793 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28794 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28795 this_arg_conv.is_owned = false;
28796 unsigned char header_arr[80];
28797 CHECK((*env)->GetArrayLength(env, header) == 80);
28798 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
28799 unsigned char (*header_ref)[80] = &header_arr;
28800 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
28801 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
28802 if (txdata_constr.datalen > 0)
28803 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
28805 txdata_constr.data = NULL;
28806 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
28807 for (size_t c = 0; c < txdata_constr.datalen; c++) {
28808 int64_t txdata_conv_28 = txdata_vals[c];
28809 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
28810 CHECK_ACCESS(txdata_conv_28_ptr);
28811 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
28812 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
28813 txdata_constr.data[c] = txdata_conv_28_conv;
28815 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
28816 void* broadcaster_ptr = untag_ptr(broadcaster);
28817 CHECK_ACCESS(broadcaster_ptr);
28818 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
28819 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
28820 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28821 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
28823 void* fee_estimator_ptr = untag_ptr(fee_estimator);
28824 CHECK_ACCESS(fee_estimator_ptr);
28825 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
28826 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
28827 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28828 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
28830 void* logger_ptr = untag_ptr(logger);
28831 CHECK_ACCESS(logger_ptr);
28832 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
28833 if (logger_conv.free == LDKLogger_JCalls_free) {
28834 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28835 LDKLogger_JCalls_cloned(&logger_conv);
28837 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
28838 int64_tArray ret_arr = NULL;
28839 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
28840 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
28841 for (size_t n = 0; n < ret_var.datalen; n++) {
28842 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
28843 *ret_conv_39_conv = ret_var.data[n];
28844 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
28846 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
28847 FREE(ret_var.data);
28851 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid, int64_t broadcaster, int64_t fee_estimator, int64_t logger) {
28852 LDKChannelMonitor this_arg_conv;
28853 this_arg_conv.inner = untag_ptr(this_arg);
28854 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28856 this_arg_conv.is_owned = false;
28857 unsigned char txid_arr[32];
28858 CHECK((*env)->GetArrayLength(env, txid) == 32);
28859 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
28860 unsigned char (*txid_ref)[32] = &txid_arr;
28861 void* broadcaster_ptr = untag_ptr(broadcaster);
28862 CHECK_ACCESS(broadcaster_ptr);
28863 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
28864 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
28865 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28866 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
28868 void* fee_estimator_ptr = untag_ptr(fee_estimator);
28869 CHECK_ACCESS(fee_estimator_ptr);
28870 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
28871 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
28872 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28873 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
28875 void* logger_ptr = untag_ptr(logger);
28876 CHECK_ACCESS(logger_ptr);
28877 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
28878 if (logger_conv.free == LDKLogger_JCalls_free) {
28879 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28880 LDKLogger_JCalls_cloned(&logger_conv);
28882 ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
28885 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) {
28886 LDKChannelMonitor this_arg_conv;
28887 this_arg_conv.inner = untag_ptr(this_arg);
28888 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28890 this_arg_conv.is_owned = false;
28891 unsigned char header_arr[80];
28892 CHECK((*env)->GetArrayLength(env, header) == 80);
28893 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
28894 unsigned char (*header_ref)[80] = &header_arr;
28895 void* broadcaster_ptr = untag_ptr(broadcaster);
28896 CHECK_ACCESS(broadcaster_ptr);
28897 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
28898 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
28899 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28900 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
28902 void* fee_estimator_ptr = untag_ptr(fee_estimator);
28903 CHECK_ACCESS(fee_estimator_ptr);
28904 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
28905 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
28906 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28907 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
28909 void* logger_ptr = untag_ptr(logger);
28910 CHECK_ACCESS(logger_ptr);
28911 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
28912 if (logger_conv.free == LDKLogger_JCalls_free) {
28913 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
28914 LDKLogger_JCalls_cloned(&logger_conv);
28916 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
28917 int64_tArray ret_arr = NULL;
28918 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
28919 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
28920 for (size_t n = 0; n < ret_var.datalen; n++) {
28921 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
28922 *ret_conv_39_conv = ret_var.data[n];
28923 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
28925 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
28926 FREE(ret_var.data);
28930 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) {
28931 LDKChannelMonitor this_arg_conv;
28932 this_arg_conv.inner = untag_ptr(this_arg);
28933 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28935 this_arg_conv.is_owned = false;
28936 LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
28937 jobjectArray ret_arr = NULL;
28938 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
28940 for (size_t i = 0; i < ret_var.datalen; i++) {
28941 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32);
28942 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data);
28943 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
28946 FREE(ret_var.data);
28950 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) {
28951 LDKChannelMonitor this_arg_conv;
28952 this_arg_conv.inner = untag_ptr(this_arg);
28953 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28955 this_arg_conv.is_owned = false;
28956 LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
28957 int64_t ret_ref = 0;
28958 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28959 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28963 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg) {
28964 LDKChannelMonitor this_arg_conv;
28965 this_arg_conv.inner = untag_ptr(this_arg);
28966 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28967 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28968 this_arg_conv.is_owned = false;
28969 LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
28970 int64_tArray ret_arr = NULL;
28971 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
28972 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
28973 for (size_t j = 0; j < ret_var.datalen; j++) {
28974 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
28975 *ret_conv_9_copy = ret_var.data[j];
28976 int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
28977 ret_arr_ptr[j] = ret_conv_9_ref;
28979 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
28980 FREE(ret_var.data);
28984 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
28985 LDKu8slice ser_ref;
28986 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
28987 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
28988 void* arg_ptr = untag_ptr(arg);
28989 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
28990 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
28991 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
28992 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
28993 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
28994 return tag_ptr(ret_conv, true);
28997 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28998 LDKOutPoint this_obj_conv;
28999 this_obj_conv.inner = untag_ptr(this_obj);
29000 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29002 OutPoint_free(this_obj_conv);
29005 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
29006 LDKOutPoint this_ptr_conv;
29007 this_ptr_conv.inner = untag_ptr(this_ptr);
29008 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29010 this_ptr_conv.is_owned = false;
29011 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
29012 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv));
29016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29017 LDKOutPoint this_ptr_conv;
29018 this_ptr_conv.inner = untag_ptr(this_ptr);
29019 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29021 this_ptr_conv.is_owned = false;
29022 LDKThirtyTwoBytes val_ref;
29023 CHECK((*env)->GetArrayLength(env, val) == 32);
29024 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
29025 OutPoint_set_txid(&this_ptr_conv, val_ref);
29028 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
29029 LDKOutPoint this_ptr_conv;
29030 this_ptr_conv.inner = untag_ptr(this_ptr);
29031 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29033 this_ptr_conv.is_owned = false;
29034 int16_t ret_conv = OutPoint_get_index(&this_ptr_conv);
29038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
29039 LDKOutPoint this_ptr_conv;
29040 this_ptr_conv.inner = untag_ptr(this_ptr);
29041 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29043 this_ptr_conv.is_owned = false;
29044 OutPoint_set_index(&this_ptr_conv, val);
29047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) {
29048 LDKThirtyTwoBytes txid_arg_ref;
29049 CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
29050 (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
29051 LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
29052 int64_t ret_ref = 0;
29053 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29054 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29058 static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) {
29059 LDKOutPoint ret_var = OutPoint_clone(arg);
29060 int64_t ret_ref = 0;
29061 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29062 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29065 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29066 LDKOutPoint arg_conv;
29067 arg_conv.inner = untag_ptr(arg);
29068 arg_conv.is_owned = ptr_is_owned(arg);
29069 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29070 arg_conv.is_owned = false;
29071 int64_t ret_conv = OutPoint_clone_ptr(&arg_conv);
29075 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29076 LDKOutPoint orig_conv;
29077 orig_conv.inner = untag_ptr(orig);
29078 orig_conv.is_owned = ptr_is_owned(orig);
29079 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29080 orig_conv.is_owned = false;
29081 LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
29082 int64_t ret_ref = 0;
29083 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29084 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29088 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29089 LDKOutPoint a_conv;
29090 a_conv.inner = untag_ptr(a);
29091 a_conv.is_owned = ptr_is_owned(a);
29092 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29093 a_conv.is_owned = false;
29094 LDKOutPoint b_conv;
29095 b_conv.inner = untag_ptr(b);
29096 b_conv.is_owned = ptr_is_owned(b);
29097 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29098 b_conv.is_owned = false;
29099 jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv);
29103 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, jclass clz, int64_t o) {
29104 LDKOutPoint o_conv;
29105 o_conv.inner = untag_ptr(o);
29106 o_conv.is_owned = ptr_is_owned(o);
29107 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
29108 o_conv.is_owned = false;
29109 int64_t ret_conv = OutPoint_hash(&o_conv);
29113 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
29114 LDKOutPoint this_arg_conv;
29115 this_arg_conv.inner = untag_ptr(this_arg);
29116 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29118 this_arg_conv.is_owned = false;
29119 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
29120 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data);
29124 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *env, jclass clz, int64_t obj) {
29125 LDKOutPoint obj_conv;
29126 obj_conv.inner = untag_ptr(obj);
29127 obj_conv.is_owned = ptr_is_owned(obj);
29128 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
29129 obj_conv.is_owned = false;
29130 LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
29131 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29132 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29133 CVec_u8Z_free(ret_var);
29137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29138 LDKu8slice ser_ref;
29139 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29140 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29141 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
29142 *ret_conv = OutPoint_read(ser_ref);
29143 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29144 return tag_ptr(ret_conv, true);
29147 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29148 LDKDelayedPaymentOutputDescriptor this_obj_conv;
29149 this_obj_conv.inner = untag_ptr(this_obj);
29150 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29152 DelayedPaymentOutputDescriptor_free(this_obj_conv);
29155 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
29156 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29157 this_ptr_conv.inner = untag_ptr(this_ptr);
29158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29160 this_ptr_conv.is_owned = false;
29161 LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
29162 int64_t ret_ref = 0;
29163 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29164 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29168 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
29169 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29170 this_ptr_conv.inner = untag_ptr(this_ptr);
29171 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29172 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29173 this_ptr_conv.is_owned = false;
29174 LDKOutPoint val_conv;
29175 val_conv.inner = untag_ptr(val);
29176 val_conv.is_owned = ptr_is_owned(val);
29177 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
29178 val_conv = OutPoint_clone(&val_conv);
29179 DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
29182 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
29183 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29184 this_ptr_conv.inner = untag_ptr(this_ptr);
29185 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29186 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29187 this_ptr_conv.is_owned = false;
29188 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
29189 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form);
29193 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29194 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29195 this_ptr_conv.inner = untag_ptr(this_ptr);
29196 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29198 this_ptr_conv.is_owned = false;
29199 LDKPublicKey val_ref;
29200 CHECK((*env)->GetArrayLength(env, val) == 33);
29201 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
29202 DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
29205 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
29206 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29207 this_ptr_conv.inner = untag_ptr(this_ptr);
29208 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29209 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29210 this_ptr_conv.is_owned = false;
29211 int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
29215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
29216 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29217 this_ptr_conv.inner = untag_ptr(this_ptr);
29218 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29220 this_ptr_conv.is_owned = false;
29221 DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
29224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) {
29225 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29226 this_ptr_conv.inner = untag_ptr(this_ptr);
29227 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29228 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29229 this_ptr_conv.is_owned = false;
29230 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
29231 *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv);
29232 return tag_ptr(ret_ref, true);
29235 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
29236 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29237 this_ptr_conv.inner = untag_ptr(this_ptr);
29238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29240 this_ptr_conv.is_owned = false;
29241 void* val_ptr = untag_ptr(val);
29242 CHECK_ACCESS(val_ptr);
29243 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
29244 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
29245 DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
29248 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
29249 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29250 this_ptr_conv.inner = untag_ptr(this_ptr);
29251 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29253 this_ptr_conv.is_owned = false;
29254 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
29255 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form);
29259 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29260 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29261 this_ptr_conv.inner = untag_ptr(this_ptr);
29262 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29263 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29264 this_ptr_conv.is_owned = false;
29265 LDKPublicKey val_ref;
29266 CHECK((*env)->GetArrayLength(env, val) == 33);
29267 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
29268 DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
29271 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
29272 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29273 this_ptr_conv.inner = untag_ptr(this_ptr);
29274 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29276 this_ptr_conv.is_owned = false;
29277 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
29278 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
29282 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29283 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29284 this_ptr_conv.inner = untag_ptr(this_ptr);
29285 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29287 this_ptr_conv.is_owned = false;
29288 LDKThirtyTwoBytes val_ref;
29289 CHECK((*env)->GetArrayLength(env, val) == 32);
29290 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
29291 DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
29294 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
29295 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29296 this_ptr_conv.inner = untag_ptr(this_ptr);
29297 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29298 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29299 this_ptr_conv.is_owned = false;
29300 int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
29304 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
29305 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
29306 this_ptr_conv.inner = untag_ptr(this_ptr);
29307 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29308 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29309 this_ptr_conv.is_owned = false;
29310 DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
29313 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int8_tArray revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) {
29314 LDKOutPoint outpoint_arg_conv;
29315 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
29316 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
29317 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
29318 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
29319 LDKPublicKey per_commitment_point_arg_ref;
29320 CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
29321 (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
29322 void* output_arg_ptr = untag_ptr(output_arg);
29323 CHECK_ACCESS(output_arg_ptr);
29324 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
29325 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
29326 LDKPublicKey revocation_pubkey_arg_ref;
29327 CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33);
29328 (*env)->GetByteArrayRegion(env, revocation_pubkey_arg, 0, 33, revocation_pubkey_arg_ref.compressed_form);
29329 LDKThirtyTwoBytes channel_keys_id_arg_ref;
29330 CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
29331 (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
29332 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_arg);
29333 int64_t ret_ref = 0;
29334 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29335 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29339 static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) {
29340 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg);
29341 int64_t ret_ref = 0;
29342 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29343 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29346 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29347 LDKDelayedPaymentOutputDescriptor arg_conv;
29348 arg_conv.inner = untag_ptr(arg);
29349 arg_conv.is_owned = ptr_is_owned(arg);
29350 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29351 arg_conv.is_owned = false;
29352 int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv);
29356 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29357 LDKDelayedPaymentOutputDescriptor orig_conv;
29358 orig_conv.inner = untag_ptr(orig);
29359 orig_conv.is_owned = ptr_is_owned(orig);
29360 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29361 orig_conv.is_owned = false;
29362 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
29363 int64_t ret_ref = 0;
29364 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29365 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29369 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29370 LDKDelayedPaymentOutputDescriptor a_conv;
29371 a_conv.inner = untag_ptr(a);
29372 a_conv.is_owned = ptr_is_owned(a);
29373 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29374 a_conv.is_owned = false;
29375 LDKDelayedPaymentOutputDescriptor b_conv;
29376 b_conv.inner = untag_ptr(b);
29377 b_conv.is_owned = ptr_is_owned(b);
29378 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29379 b_conv.is_owned = false;
29380 jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv);
29384 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
29385 LDKDelayedPaymentOutputDescriptor obj_conv;
29386 obj_conv.inner = untag_ptr(obj);
29387 obj_conv.is_owned = ptr_is_owned(obj);
29388 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
29389 obj_conv.is_owned = false;
29390 LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv);
29391 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29392 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29393 CVec_u8Z_free(ret_var);
29397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29398 LDKu8slice ser_ref;
29399 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29400 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29401 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
29402 *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
29403 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29404 return tag_ptr(ret_conv, true);
29407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29408 LDKStaticPaymentOutputDescriptor this_obj_conv;
29409 this_obj_conv.inner = untag_ptr(this_obj);
29410 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29412 StaticPaymentOutputDescriptor_free(this_obj_conv);
29415 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
29416 LDKStaticPaymentOutputDescriptor this_ptr_conv;
29417 this_ptr_conv.inner = untag_ptr(this_ptr);
29418 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29420 this_ptr_conv.is_owned = false;
29421 LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
29422 int64_t ret_ref = 0;
29423 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29424 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
29429 LDKStaticPaymentOutputDescriptor this_ptr_conv;
29430 this_ptr_conv.inner = untag_ptr(this_ptr);
29431 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29432 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29433 this_ptr_conv.is_owned = false;
29434 LDKOutPoint val_conv;
29435 val_conv.inner = untag_ptr(val);
29436 val_conv.is_owned = ptr_is_owned(val);
29437 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
29438 val_conv = OutPoint_clone(&val_conv);
29439 StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
29442 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) {
29443 LDKStaticPaymentOutputDescriptor this_ptr_conv;
29444 this_ptr_conv.inner = untag_ptr(this_ptr);
29445 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29447 this_ptr_conv.is_owned = false;
29448 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
29449 *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv);
29450 return tag_ptr(ret_ref, true);
29453 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
29454 LDKStaticPaymentOutputDescriptor this_ptr_conv;
29455 this_ptr_conv.inner = untag_ptr(this_ptr);
29456 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29458 this_ptr_conv.is_owned = false;
29459 void* val_ptr = untag_ptr(val);
29460 CHECK_ACCESS(val_ptr);
29461 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
29462 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
29463 StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
29466 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
29467 LDKStaticPaymentOutputDescriptor this_ptr_conv;
29468 this_ptr_conv.inner = untag_ptr(this_ptr);
29469 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29471 this_ptr_conv.is_owned = false;
29472 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
29473 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
29477 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29478 LDKStaticPaymentOutputDescriptor this_ptr_conv;
29479 this_ptr_conv.inner = untag_ptr(this_ptr);
29480 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29482 this_ptr_conv.is_owned = false;
29483 LDKThirtyTwoBytes val_ref;
29484 CHECK((*env)->GetArrayLength(env, val) == 32);
29485 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
29486 StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
29489 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
29490 LDKStaticPaymentOutputDescriptor this_ptr_conv;
29491 this_ptr_conv.inner = untag_ptr(this_ptr);
29492 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29494 this_ptr_conv.is_owned = false;
29495 int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
29499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
29500 LDKStaticPaymentOutputDescriptor this_ptr_conv;
29501 this_ptr_conv.inner = untag_ptr(this_ptr);
29502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29504 this_ptr_conv.is_owned = false;
29505 StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
29508 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) {
29509 LDKOutPoint outpoint_arg_conv;
29510 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
29511 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
29512 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
29513 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
29514 void* output_arg_ptr = untag_ptr(output_arg);
29515 CHECK_ACCESS(output_arg_ptr);
29516 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
29517 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
29518 LDKThirtyTwoBytes channel_keys_id_arg_ref;
29519 CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
29520 (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
29521 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
29522 int64_t ret_ref = 0;
29523 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29524 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29528 static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) {
29529 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg);
29530 int64_t ret_ref = 0;
29531 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29532 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29535 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29536 LDKStaticPaymentOutputDescriptor arg_conv;
29537 arg_conv.inner = untag_ptr(arg);
29538 arg_conv.is_owned = ptr_is_owned(arg);
29539 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29540 arg_conv.is_owned = false;
29541 int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv);
29545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29546 LDKStaticPaymentOutputDescriptor orig_conv;
29547 orig_conv.inner = untag_ptr(orig);
29548 orig_conv.is_owned = ptr_is_owned(orig);
29549 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29550 orig_conv.is_owned = false;
29551 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
29552 int64_t ret_ref = 0;
29553 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29554 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29558 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29559 LDKStaticPaymentOutputDescriptor a_conv;
29560 a_conv.inner = untag_ptr(a);
29561 a_conv.is_owned = ptr_is_owned(a);
29562 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29563 a_conv.is_owned = false;
29564 LDKStaticPaymentOutputDescriptor b_conv;
29565 b_conv.inner = untag_ptr(b);
29566 b_conv.is_owned = ptr_is_owned(b);
29567 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29568 b_conv.is_owned = false;
29569 jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv);
29573 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
29574 LDKStaticPaymentOutputDescriptor obj_conv;
29575 obj_conv.inner = untag_ptr(obj);
29576 obj_conv.is_owned = ptr_is_owned(obj);
29577 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
29578 obj_conv.is_owned = false;
29579 LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv);
29580 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29581 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29582 CVec_u8Z_free(ret_var);
29586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29587 LDKu8slice ser_ref;
29588 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29589 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29590 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
29591 *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
29592 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29593 return tag_ptr(ret_conv, true);
29596 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29597 if (!ptr_is_owned(this_ptr)) return;
29598 void* this_ptr_ptr = untag_ptr(this_ptr);
29599 CHECK_ACCESS(this_ptr_ptr);
29600 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
29601 FREE(untag_ptr(this_ptr));
29602 SpendableOutputDescriptor_free(this_ptr_conv);
29605 static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) {
29606 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
29607 *ret_copy = SpendableOutputDescriptor_clone(arg);
29608 int64_t ret_ref = tag_ptr(ret_copy, true);
29611 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29612 LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg);
29613 int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv);
29617 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29618 LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig);
29619 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
29620 *ret_copy = SpendableOutputDescriptor_clone(orig_conv);
29621 int64_t ret_ref = tag_ptr(ret_copy, true);
29625 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output) {
29626 LDKOutPoint outpoint_conv;
29627 outpoint_conv.inner = untag_ptr(outpoint);
29628 outpoint_conv.is_owned = ptr_is_owned(outpoint);
29629 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv);
29630 outpoint_conv = OutPoint_clone(&outpoint_conv);
29631 void* output_ptr = untag_ptr(output);
29632 CHECK_ACCESS(output_ptr);
29633 LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
29634 output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output));
29635 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
29636 *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
29637 int64_t ret_ref = tag_ptr(ret_copy, true);
29641 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
29642 LDKDelayedPaymentOutputDescriptor a_conv;
29643 a_conv.inner = untag_ptr(a);
29644 a_conv.is_owned = ptr_is_owned(a);
29645 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29646 a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
29647 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
29648 *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
29649 int64_t ret_ref = tag_ptr(ret_copy, true);
29653 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
29654 LDKStaticPaymentOutputDescriptor a_conv;
29655 a_conv.inner = untag_ptr(a);
29656 a_conv.is_owned = ptr_is_owned(a);
29657 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29658 a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
29659 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
29660 *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
29661 int64_t ret_ref = tag_ptr(ret_copy, true);
29665 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29666 LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a);
29667 LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b);
29668 jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv);
29672 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
29673 LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
29674 LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
29675 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29676 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29677 CVec_u8Z_free(ret_var);
29681 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29682 LDKu8slice ser_ref;
29683 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29684 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29685 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
29686 *ret_conv = SpendableOutputDescriptor_read(ser_ref);
29687 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29688 return tag_ptr(ret_conv, true);
29691 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29692 if (!ptr_is_owned(this_ptr)) return;
29693 void* this_ptr_ptr = untag_ptr(this_ptr);
29694 CHECK_ACCESS(this_ptr_ptr);
29695 LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
29696 FREE(untag_ptr(this_ptr));
29697 BaseSign_free(this_ptr_conv);
29700 static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) {
29701 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
29702 *ret_ret = Sign_clone(arg);
29703 return tag_ptr(ret_ret, true);
29705 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29706 void* arg_ptr = untag_ptr(arg);
29707 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
29708 LDKSign* arg_conv = (LDKSign*)arg_ptr;
29709 int64_t ret_conv = Sign_clone_ptr(arg_conv);
29713 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29714 void* orig_ptr = untag_ptr(orig);
29715 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
29716 LDKSign* orig_conv = (LDKSign*)orig_ptr;
29717 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
29718 *ret_ret = Sign_clone(orig_conv);
29719 return tag_ptr(ret_ret, true);
29722 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29723 if (!ptr_is_owned(this_ptr)) return;
29724 void* this_ptr_ptr = untag_ptr(this_ptr);
29725 CHECK_ACCESS(this_ptr_ptr);
29726 LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
29727 FREE(untag_ptr(this_ptr));
29728 Sign_free(this_ptr_conv);
29731 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29732 LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig);
29733 jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv));
29737 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) {
29738 jclass ret_conv = LDKRecipient_to_java(env, Recipient_node());
29742 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) {
29743 jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node());
29747 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29748 if (!ptr_is_owned(this_ptr)) return;
29749 void* this_ptr_ptr = untag_ptr(this_ptr);
29750 CHECK_ACCESS(this_ptr_ptr);
29751 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
29752 FREE(untag_ptr(this_ptr));
29753 KeysInterface_free(this_ptr_conv);
29756 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29757 LDKInMemorySigner this_obj_conv;
29758 this_obj_conv.inner = untag_ptr(this_obj);
29759 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29760 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29761 InMemorySigner_free(this_obj_conv);
29764 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
29765 LDKInMemorySigner this_ptr_conv;
29766 this_ptr_conv.inner = untag_ptr(this_ptr);
29767 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29769 this_ptr_conv.is_owned = false;
29770 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
29771 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv));
29775 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29776 LDKInMemorySigner this_ptr_conv;
29777 this_ptr_conv.inner = untag_ptr(this_ptr);
29778 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29779 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29780 this_ptr_conv.is_owned = false;
29781 LDKSecretKey val_ref;
29782 CHECK((*env)->GetArrayLength(env, val) == 32);
29783 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
29784 InMemorySigner_set_funding_key(&this_ptr_conv, val_ref);
29787 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
29788 LDKInMemorySigner this_ptr_conv;
29789 this_ptr_conv.inner = untag_ptr(this_ptr);
29790 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29791 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29792 this_ptr_conv.is_owned = false;
29793 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
29794 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv));
29798 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29799 LDKInMemorySigner this_ptr_conv;
29800 this_ptr_conv.inner = untag_ptr(this_ptr);
29801 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29802 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29803 this_ptr_conv.is_owned = false;
29804 LDKSecretKey val_ref;
29805 CHECK((*env)->GetArrayLength(env, val) == 32);
29806 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
29807 InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref);
29810 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
29811 LDKInMemorySigner this_ptr_conv;
29812 this_ptr_conv.inner = untag_ptr(this_ptr);
29813 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29815 this_ptr_conv.is_owned = false;
29816 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
29817 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv));
29821 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29822 LDKInMemorySigner this_ptr_conv;
29823 this_ptr_conv.inner = untag_ptr(this_ptr);
29824 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29826 this_ptr_conv.is_owned = false;
29827 LDKSecretKey val_ref;
29828 CHECK((*env)->GetArrayLength(env, val) == 32);
29829 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
29830 InMemorySigner_set_payment_key(&this_ptr_conv, val_ref);
29833 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
29834 LDKInMemorySigner this_ptr_conv;
29835 this_ptr_conv.inner = untag_ptr(this_ptr);
29836 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29838 this_ptr_conv.is_owned = false;
29839 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
29840 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv));
29844 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29845 LDKInMemorySigner this_ptr_conv;
29846 this_ptr_conv.inner = untag_ptr(this_ptr);
29847 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29849 this_ptr_conv.is_owned = false;
29850 LDKSecretKey val_ref;
29851 CHECK((*env)->GetArrayLength(env, val) == 32);
29852 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
29853 InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
29856 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
29857 LDKInMemorySigner this_ptr_conv;
29858 this_ptr_conv.inner = untag_ptr(this_ptr);
29859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29861 this_ptr_conv.is_owned = false;
29862 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
29863 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv));
29867 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29868 LDKInMemorySigner this_ptr_conv;
29869 this_ptr_conv.inner = untag_ptr(this_ptr);
29870 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29872 this_ptr_conv.is_owned = false;
29873 LDKSecretKey val_ref;
29874 CHECK((*env)->GetArrayLength(env, val) == 32);
29875 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
29876 InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
29879 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) {
29880 LDKInMemorySigner this_ptr_conv;
29881 this_ptr_conv.inner = untag_ptr(this_ptr);
29882 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29884 this_ptr_conv.is_owned = false;
29885 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
29886 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv));
29890 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29891 LDKInMemorySigner this_ptr_conv;
29892 this_ptr_conv.inner = untag_ptr(this_ptr);
29893 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29895 this_ptr_conv.is_owned = false;
29896 LDKThirtyTwoBytes val_ref;
29897 CHECK((*env)->GetArrayLength(env, val) == 32);
29898 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
29899 InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
29902 static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) {
29903 LDKInMemorySigner ret_var = InMemorySigner_clone(arg);
29904 int64_t ret_ref = 0;
29905 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29906 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29909 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29910 LDKInMemorySigner arg_conv;
29911 arg_conv.inner = untag_ptr(arg);
29912 arg_conv.is_owned = ptr_is_owned(arg);
29913 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29914 arg_conv.is_owned = false;
29915 int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv);
29919 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29920 LDKInMemorySigner orig_conv;
29921 orig_conv.inner = untag_ptr(orig);
29922 orig_conv.is_owned = ptr_is_owned(orig);
29923 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29924 orig_conv.is_owned = false;
29925 LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
29926 int64_t ret_ref = 0;
29927 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29928 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29932 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, int8_tArray node_secret, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id) {
29933 LDKSecretKey node_secret_ref;
29934 CHECK((*env)->GetArrayLength(env, node_secret) == 32);
29935 (*env)->GetByteArrayRegion(env, node_secret, 0, 32, node_secret_ref.bytes);
29936 LDKSecretKey funding_key_ref;
29937 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
29938 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes);
29939 LDKSecretKey revocation_base_key_ref;
29940 CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32);
29941 (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes);
29942 LDKSecretKey payment_key_ref;
29943 CHECK((*env)->GetArrayLength(env, payment_key) == 32);
29944 (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes);
29945 LDKSecretKey delayed_payment_base_key_ref;
29946 CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32);
29947 (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes);
29948 LDKSecretKey htlc_base_key_ref;
29949 CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32);
29950 (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes);
29951 LDKThirtyTwoBytes commitment_seed_ref;
29952 CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
29953 (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data);
29954 LDKThirtyTwoBytes channel_keys_id_ref;
29955 CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32);
29956 (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data);
29957 LDKInMemorySigner ret_var = InMemorySigner_new(node_secret_ref, funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref);
29958 int64_t ret_ref = 0;
29959 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29960 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
29965 LDKInMemorySigner this_arg_conv;
29966 this_arg_conv.inner = untag_ptr(this_arg);
29967 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29969 this_arg_conv.is_owned = false;
29970 LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
29971 int64_t ret_ref = 0;
29972 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29973 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29977 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
29978 LDKInMemorySigner this_arg_conv;
29979 this_arg_conv.inner = untag_ptr(this_arg);
29980 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29982 this_arg_conv.is_owned = false;
29983 int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
29987 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
29988 LDKInMemorySigner this_arg_conv;
29989 this_arg_conv.inner = untag_ptr(this_arg);
29990 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29992 this_arg_conv.is_owned = false;
29993 int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
29997 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) {
29998 LDKInMemorySigner this_arg_conv;
29999 this_arg_conv.inner = untag_ptr(this_arg);
30000 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30002 this_arg_conv.is_owned = false;
30003 jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv);
30007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) {
30008 LDKInMemorySigner this_arg_conv;
30009 this_arg_conv.inner = untag_ptr(this_arg);
30010 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30012 this_arg_conv.is_owned = false;
30013 LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
30014 int64_t ret_ref = 0;
30015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30020 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) {
30021 LDKInMemorySigner this_arg_conv;
30022 this_arg_conv.inner = untag_ptr(this_arg);
30023 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30025 this_arg_conv.is_owned = false;
30026 LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
30027 int64_t ret_ref = 0;
30028 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30029 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30033 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
30034 LDKInMemorySigner this_arg_conv;
30035 this_arg_conv.inner = untag_ptr(this_arg);
30036 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30038 this_arg_conv.is_owned = false;
30039 jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv);
30043 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) {
30044 LDKInMemorySigner this_arg_conv;
30045 this_arg_conv.inner = untag_ptr(this_arg);
30046 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30048 this_arg_conv.is_owned = false;
30049 LDKTransaction spend_tx_ref;
30050 spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
30051 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
30052 (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data);
30053 spend_tx_ref.data_is_owned = true;
30054 LDKStaticPaymentOutputDescriptor descriptor_conv;
30055 descriptor_conv.inner = untag_ptr(descriptor);
30056 descriptor_conv.is_owned = ptr_is_owned(descriptor);
30057 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
30058 descriptor_conv.is_owned = false;
30059 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
30060 *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
30061 return tag_ptr(ret_conv, true);
30064 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) {
30065 LDKInMemorySigner this_arg_conv;
30066 this_arg_conv.inner = untag_ptr(this_arg);
30067 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30068 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30069 this_arg_conv.is_owned = false;
30070 LDKTransaction spend_tx_ref;
30071 spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
30072 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
30073 (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data);
30074 spend_tx_ref.data_is_owned = true;
30075 LDKDelayedPaymentOutputDescriptor descriptor_conv;
30076 descriptor_conv.inner = untag_ptr(descriptor);
30077 descriptor_conv.is_owned = ptr_is_owned(descriptor);
30078 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
30079 descriptor_conv.is_owned = false;
30080 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
30081 *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
30082 return tag_ptr(ret_conv, true);
30085 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1BaseSign(JNIEnv *env, jclass clz, int64_t this_arg) {
30086 LDKInMemorySigner this_arg_conv;
30087 this_arg_conv.inner = untag_ptr(this_arg);
30088 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30089 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30090 this_arg_conv.is_owned = false;
30091 LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
30092 *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
30093 return tag_ptr(ret_ret, true);
30096 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JNIEnv *env, jclass clz, int64_t this_arg) {
30097 LDKInMemorySigner this_arg_conv;
30098 this_arg_conv.inner = untag_ptr(this_arg);
30099 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30100 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30101 this_arg_conv.is_owned = false;
30102 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
30103 *ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
30104 return tag_ptr(ret_ret, true);
30107 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) {
30108 LDKInMemorySigner obj_conv;
30109 obj_conv.inner = untag_ptr(obj);
30110 obj_conv.is_owned = ptr_is_owned(obj);
30111 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30112 obj_conv.is_owned = false;
30113 LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
30114 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30115 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30116 CVec_u8Z_free(ret_var);
30120 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int8_tArray arg) {
30121 LDKu8slice ser_ref;
30122 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30123 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30124 LDKSecretKey arg_ref;
30125 CHECK((*env)->GetArrayLength(env, arg) == 32);
30126 (*env)->GetByteArrayRegion(env, arg, 0, 32, arg_ref.bytes);
30127 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
30128 *ret_conv = InMemorySigner_read(ser_ref, arg_ref);
30129 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30130 return tag_ptr(ret_conv, true);
30133 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30134 LDKKeysManager this_obj_conv;
30135 this_obj_conv.inner = untag_ptr(this_obj);
30136 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30137 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30138 KeysManager_free(this_obj_conv);
30141 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) {
30142 unsigned char seed_arr[32];
30143 CHECK((*env)->GetArrayLength(env, seed) == 32);
30144 (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
30145 unsigned char (*seed_ref)[32] = &seed_arr;
30146 LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
30147 int64_t ret_ref = 0;
30148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30149 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30153 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) {
30154 LDKKeysManager this_arg_conv;
30155 this_arg_conv.inner = untag_ptr(this_arg);
30156 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30157 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30158 this_arg_conv.is_owned = false;
30159 unsigned char params_arr[32];
30160 CHECK((*env)->GetArrayLength(env, params) == 32);
30161 (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
30162 unsigned char (*params_ref)[32] = ¶ms_arr;
30163 LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
30164 int64_t ret_ref = 0;
30165 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30166 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) {
30171 LDKKeysManager this_arg_conv;
30172 this_arg_conv.inner = untag_ptr(this_arg);
30173 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30175 this_arg_conv.is_owned = false;
30176 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
30177 descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors);
30178 if (descriptors_constr.datalen > 0)
30179 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
30181 descriptors_constr.data = NULL;
30182 int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
30183 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
30184 int64_t descriptors_conv_27 = descriptors_vals[b];
30185 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
30186 CHECK_ACCESS(descriptors_conv_27_ptr);
30187 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
30188 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
30189 descriptors_constr.data[b] = descriptors_conv_27_conv;
30191 (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0);
30192 LDKCVec_TxOutZ outputs_constr;
30193 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
30194 if (outputs_constr.datalen > 0)
30195 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
30197 outputs_constr.data = NULL;
30198 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
30199 for (size_t h = 0; h < outputs_constr.datalen; h++) {
30200 int64_t outputs_conv_7 = outputs_vals[h];
30201 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
30202 CHECK_ACCESS(outputs_conv_7_ptr);
30203 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
30204 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
30205 outputs_constr.data[h] = outputs_conv_7_conv;
30207 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
30208 LDKCVec_u8Z change_destination_script_ref;
30209 change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script);
30210 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
30211 (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data);
30212 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
30213 *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
30214 return tag_ptr(ret_conv, true);
30217 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) {
30218 LDKKeysManager this_arg_conv;
30219 this_arg_conv.inner = untag_ptr(this_arg);
30220 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30222 this_arg_conv.is_owned = false;
30223 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
30224 *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
30225 return tag_ptr(ret_ret, true);
30228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30229 LDKPhantomKeysManager this_obj_conv;
30230 this_obj_conv.inner = untag_ptr(this_obj);
30231 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30232 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30233 PhantomKeysManager_free(this_obj_conv);
30236 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) {
30237 LDKPhantomKeysManager this_arg_conv;
30238 this_arg_conv.inner = untag_ptr(this_arg);
30239 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30240 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30241 this_arg_conv.is_owned = false;
30242 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
30243 *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv);
30244 return tag_ptr(ret_ret, true);
30247 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) {
30248 unsigned char seed_arr[32];
30249 CHECK((*env)->GetArrayLength(env, seed) == 32);
30250 (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
30251 unsigned char (*seed_ref)[32] = &seed_arr;
30252 unsigned char cross_node_seed_arr[32];
30253 CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32);
30254 (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr);
30255 unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
30256 LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref);
30257 int64_t ret_ref = 0;
30258 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30259 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30263 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) {
30264 LDKPhantomKeysManager this_arg_conv;
30265 this_arg_conv.inner = untag_ptr(this_arg);
30266 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30267 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30268 this_arg_conv.is_owned = false;
30269 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
30270 descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors);
30271 if (descriptors_constr.datalen > 0)
30272 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
30274 descriptors_constr.data = NULL;
30275 int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
30276 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
30277 int64_t descriptors_conv_27 = descriptors_vals[b];
30278 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
30279 CHECK_ACCESS(descriptors_conv_27_ptr);
30280 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
30281 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
30282 descriptors_constr.data[b] = descriptors_conv_27_conv;
30284 (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0);
30285 LDKCVec_TxOutZ outputs_constr;
30286 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
30287 if (outputs_constr.datalen > 0)
30288 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
30290 outputs_constr.data = NULL;
30291 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
30292 for (size_t h = 0; h < outputs_constr.datalen; h++) {
30293 int64_t outputs_conv_7 = outputs_vals[h];
30294 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
30295 CHECK_ACCESS(outputs_conv_7_ptr);
30296 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
30297 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
30298 outputs_constr.data[h] = outputs_conv_7_conv;
30300 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
30301 LDKCVec_u8Z change_destination_script_ref;
30302 change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script);
30303 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
30304 (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data);
30305 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
30306 *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
30307 return tag_ptr(ret_conv, true);
30310 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) {
30311 LDKPhantomKeysManager this_arg_conv;
30312 this_arg_conv.inner = untag_ptr(this_arg);
30313 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30314 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30315 this_arg_conv.is_owned = false;
30316 unsigned char params_arr[32];
30317 CHECK((*env)->GetArrayLength(env, params) == 32);
30318 (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
30319 unsigned char (*params_ref)[32] = ¶ms_arr;
30320 LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
30321 int64_t ret_ref = 0;
30322 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30323 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30328 LDKChannelManager this_obj_conv;
30329 this_obj_conv.inner = untag_ptr(this_obj);
30330 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30332 ChannelManager_free(this_obj_conv);
30335 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30336 LDKChainParameters this_obj_conv;
30337 this_obj_conv.inner = untag_ptr(this_obj);
30338 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30339 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30340 ChainParameters_free(this_obj_conv);
30343 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1network(JNIEnv *env, jclass clz, int64_t this_ptr) {
30344 LDKChainParameters this_ptr_conv;
30345 this_ptr_conv.inner = untag_ptr(this_ptr);
30346 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30348 this_ptr_conv.is_owned = false;
30349 jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv));
30353 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
30354 LDKChainParameters this_ptr_conv;
30355 this_ptr_conv.inner = untag_ptr(this_ptr);
30356 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30357 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30358 this_ptr_conv.is_owned = false;
30359 LDKNetwork val_conv = LDKNetwork_from_java(env, val);
30360 ChainParameters_set_network(&this_ptr_conv, val_conv);
30363 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr) {
30364 LDKChainParameters this_ptr_conv;
30365 this_ptr_conv.inner = untag_ptr(this_ptr);
30366 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30367 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30368 this_ptr_conv.is_owned = false;
30369 LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv);
30370 int64_t ret_ref = 0;
30371 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30372 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30377 LDKChainParameters this_ptr_conv;
30378 this_ptr_conv.inner = untag_ptr(this_ptr);
30379 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30381 this_ptr_conv.is_owned = false;
30382 LDKBestBlock val_conv;
30383 val_conv.inner = untag_ptr(val);
30384 val_conv.is_owned = ptr_is_owned(val);
30385 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30386 val_conv = BestBlock_clone(&val_conv);
30387 ChainParameters_set_best_block(&this_ptr_conv, val_conv);
30390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv *env, jclass clz, jclass network_arg, int64_t best_block_arg) {
30391 LDKNetwork network_arg_conv = LDKNetwork_from_java(env, network_arg);
30392 LDKBestBlock best_block_arg_conv;
30393 best_block_arg_conv.inner = untag_ptr(best_block_arg);
30394 best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg);
30395 CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv);
30396 best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
30397 LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv);
30398 int64_t ret_ref = 0;
30399 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30400 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30404 static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) {
30405 LDKChainParameters ret_var = ChainParameters_clone(arg);
30406 int64_t ret_ref = 0;
30407 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30408 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30411 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30412 LDKChainParameters arg_conv;
30413 arg_conv.inner = untag_ptr(arg);
30414 arg_conv.is_owned = ptr_is_owned(arg);
30415 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30416 arg_conv.is_owned = false;
30417 int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv);
30421 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30422 LDKChainParameters orig_conv;
30423 orig_conv.inner = untag_ptr(orig);
30424 orig_conv.is_owned = ptr_is_owned(orig);
30425 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30426 orig_conv.is_owned = false;
30427 LDKChainParameters ret_var = ChainParameters_clone(&orig_conv);
30428 int64_t ret_ref = 0;
30429 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30430 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30434 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30435 LDKCounterpartyForwardingInfo this_obj_conv;
30436 this_obj_conv.inner = untag_ptr(this_obj);
30437 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30438 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30439 CounterpartyForwardingInfo_free(this_obj_conv);
30442 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
30443 LDKCounterpartyForwardingInfo this_ptr_conv;
30444 this_ptr_conv.inner = untag_ptr(this_ptr);
30445 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30447 this_ptr_conv.is_owned = false;
30448 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv);
30452 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
30453 LDKCounterpartyForwardingInfo this_ptr_conv;
30454 this_ptr_conv.inner = untag_ptr(this_ptr);
30455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30457 this_ptr_conv.is_owned = false;
30458 CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val);
30461 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
30462 LDKCounterpartyForwardingInfo this_ptr_conv;
30463 this_ptr_conv.inner = untag_ptr(this_ptr);
30464 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30466 this_ptr_conv.is_owned = false;
30467 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv);
30471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
30472 LDKCounterpartyForwardingInfo this_ptr_conv;
30473 this_ptr_conv.inner = untag_ptr(this_ptr);
30474 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30476 this_ptr_conv.is_owned = false;
30477 CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
30480 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
30481 LDKCounterpartyForwardingInfo this_ptr_conv;
30482 this_ptr_conv.inner = untag_ptr(this_ptr);
30483 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30485 this_ptr_conv.is_owned = false;
30486 int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv);
30490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
30491 LDKCounterpartyForwardingInfo this_ptr_conv;
30492 this_ptr_conv.inner = untag_ptr(this_ptr);
30493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30495 this_ptr_conv.is_owned = false;
30496 CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
30499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) {
30500 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
30501 int64_t ret_ref = 0;
30502 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30503 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30507 static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) {
30508 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg);
30509 int64_t ret_ref = 0;
30510 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30511 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30514 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30515 LDKCounterpartyForwardingInfo arg_conv;
30516 arg_conv.inner = untag_ptr(arg);
30517 arg_conv.is_owned = ptr_is_owned(arg);
30518 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30519 arg_conv.is_owned = false;
30520 int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv);
30524 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30525 LDKCounterpartyForwardingInfo orig_conv;
30526 orig_conv.inner = untag_ptr(orig);
30527 orig_conv.is_owned = ptr_is_owned(orig);
30528 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30529 orig_conv.is_owned = false;
30530 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv);
30531 int64_t ret_ref = 0;
30532 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30533 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30537 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30538 LDKChannelCounterparty this_obj_conv;
30539 this_obj_conv.inner = untag_ptr(this_obj);
30540 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30542 ChannelCounterparty_free(this_obj_conv);
30545 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
30546 LDKChannelCounterparty this_ptr_conv;
30547 this_ptr_conv.inner = untag_ptr(this_ptr);
30548 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30549 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30550 this_ptr_conv.is_owned = false;
30551 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
30552 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form);
30556 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30557 LDKChannelCounterparty this_ptr_conv;
30558 this_ptr_conv.inner = untag_ptr(this_ptr);
30559 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30561 this_ptr_conv.is_owned = false;
30562 LDKPublicKey val_ref;
30563 CHECK((*env)->GetArrayLength(env, val) == 33);
30564 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
30565 ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref);
30568 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
30569 LDKChannelCounterparty this_ptr_conv;
30570 this_ptr_conv.inner = untag_ptr(this_ptr);
30571 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30573 this_ptr_conv.is_owned = false;
30574 LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv);
30575 int64_t ret_ref = 0;
30576 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30577 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30581 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30582 LDKChannelCounterparty this_ptr_conv;
30583 this_ptr_conv.inner = untag_ptr(this_ptr);
30584 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30586 this_ptr_conv.is_owned = false;
30587 LDKInitFeatures val_conv;
30588 val_conv.inner = untag_ptr(val);
30589 val_conv.is_owned = ptr_is_owned(val);
30590 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30591 val_conv = InitFeatures_clone(&val_conv);
30592 ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
30595 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) {
30596 LDKChannelCounterparty this_ptr_conv;
30597 this_ptr_conv.inner = untag_ptr(this_ptr);
30598 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30600 this_ptr_conv.is_owned = false;
30601 int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
30605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30606 LDKChannelCounterparty this_ptr_conv;
30607 this_ptr_conv.inner = untag_ptr(this_ptr);
30608 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30609 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30610 this_ptr_conv.is_owned = false;
30611 ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
30614 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr) {
30615 LDKChannelCounterparty this_ptr_conv;
30616 this_ptr_conv.inner = untag_ptr(this_ptr);
30617 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30618 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30619 this_ptr_conv.is_owned = false;
30620 LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
30621 int64_t ret_ref = 0;
30622 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30623 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30627 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30628 LDKChannelCounterparty this_ptr_conv;
30629 this_ptr_conv.inner = untag_ptr(this_ptr);
30630 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30631 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30632 this_ptr_conv.is_owned = false;
30633 LDKCounterpartyForwardingInfo val_conv;
30634 val_conv.inner = untag_ptr(val);
30635 val_conv.is_owned = ptr_is_owned(val);
30636 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30637 val_conv = CounterpartyForwardingInfo_clone(&val_conv);
30638 ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv);
30641 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
30642 LDKChannelCounterparty this_ptr_conv;
30643 this_ptr_conv.inner = untag_ptr(this_ptr);
30644 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30646 this_ptr_conv.is_owned = false;
30647 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
30648 *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv);
30649 int64_t ret_ref = tag_ptr(ret_copy, true);
30653 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1outbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30654 LDKChannelCounterparty this_ptr_conv;
30655 this_ptr_conv.inner = untag_ptr(this_ptr);
30656 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30658 this_ptr_conv.is_owned = false;
30659 void* val_ptr = untag_ptr(val);
30660 CHECK_ACCESS(val_ptr);
30661 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
30662 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
30663 ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
30666 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
30667 LDKChannelCounterparty this_ptr_conv;
30668 this_ptr_conv.inner = untag_ptr(this_ptr);
30669 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30670 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30671 this_ptr_conv.is_owned = false;
30672 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
30673 *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv);
30674 int64_t ret_ref = tag_ptr(ret_copy, true);
30678 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1outbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30679 LDKChannelCounterparty this_ptr_conv;
30680 this_ptr_conv.inner = untag_ptr(this_ptr);
30681 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30683 this_ptr_conv.is_owned = false;
30684 void* val_ptr = untag_ptr(val);
30685 CHECK_ACCESS(val_ptr);
30686 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
30687 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
30688 ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
30691 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JNIEnv *env, jclass clz, int8_tArray node_id_arg, int64_t features_arg, int64_t unspendable_punishment_reserve_arg, int64_t forwarding_info_arg, int64_t outbound_htlc_minimum_msat_arg, int64_t outbound_htlc_maximum_msat_arg) {
30692 LDKPublicKey node_id_arg_ref;
30693 CHECK((*env)->GetArrayLength(env, node_id_arg) == 33);
30694 (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form);
30695 LDKInitFeatures features_arg_conv;
30696 features_arg_conv.inner = untag_ptr(features_arg);
30697 features_arg_conv.is_owned = ptr_is_owned(features_arg);
30698 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
30699 features_arg_conv = InitFeatures_clone(&features_arg_conv);
30700 LDKCounterpartyForwardingInfo forwarding_info_arg_conv;
30701 forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg);
30702 forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg);
30703 CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv);
30704 forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
30705 void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg);
30706 CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr);
30707 LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr);
30708 outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg));
30709 void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg);
30710 CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr);
30711 LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr);
30712 outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg));
30713 LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv, outbound_htlc_minimum_msat_arg_conv, outbound_htlc_maximum_msat_arg_conv);
30714 int64_t ret_ref = 0;
30715 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30716 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30720 static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) {
30721 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg);
30722 int64_t ret_ref = 0;
30723 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30724 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30727 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30728 LDKChannelCounterparty arg_conv;
30729 arg_conv.inner = untag_ptr(arg);
30730 arg_conv.is_owned = ptr_is_owned(arg);
30731 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30732 arg_conv.is_owned = false;
30733 int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv);
30737 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30738 LDKChannelCounterparty orig_conv;
30739 orig_conv.inner = untag_ptr(orig);
30740 orig_conv.is_owned = ptr_is_owned(orig);
30741 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30742 orig_conv.is_owned = false;
30743 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv);
30744 int64_t ret_ref = 0;
30745 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30746 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30750 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30751 LDKChannelDetails this_obj_conv;
30752 this_obj_conv.inner = untag_ptr(this_obj);
30753 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30754 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30755 ChannelDetails_free(this_obj_conv);
30758 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
30759 LDKChannelDetails this_ptr_conv;
30760 this_ptr_conv.inner = untag_ptr(this_ptr);
30761 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30762 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30763 this_ptr_conv.is_owned = false;
30764 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30765 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv));
30769 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30770 LDKChannelDetails this_ptr_conv;
30771 this_ptr_conv.inner = untag_ptr(this_ptr);
30772 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30774 this_ptr_conv.is_owned = false;
30775 LDKThirtyTwoBytes val_ref;
30776 CHECK((*env)->GetArrayLength(env, val) == 32);
30777 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30778 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref);
30781 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr) {
30782 LDKChannelDetails this_ptr_conv;
30783 this_ptr_conv.inner = untag_ptr(this_ptr);
30784 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30786 this_ptr_conv.is_owned = false;
30787 LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
30788 int64_t ret_ref = 0;
30789 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30790 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30794 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30795 LDKChannelDetails this_ptr_conv;
30796 this_ptr_conv.inner = untag_ptr(this_ptr);
30797 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30798 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30799 this_ptr_conv.is_owned = false;
30800 LDKChannelCounterparty val_conv;
30801 val_conv.inner = untag_ptr(val);
30802 val_conv.is_owned = ptr_is_owned(val);
30803 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30804 val_conv = ChannelCounterparty_clone(&val_conv);
30805 ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
30808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr) {
30809 LDKChannelDetails this_ptr_conv;
30810 this_ptr_conv.inner = untag_ptr(this_ptr);
30811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30813 this_ptr_conv.is_owned = false;
30814 LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
30815 int64_t ret_ref = 0;
30816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30821 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30822 LDKChannelDetails this_ptr_conv;
30823 this_ptr_conv.inner = untag_ptr(this_ptr);
30824 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30826 this_ptr_conv.is_owned = false;
30827 LDKOutPoint val_conv;
30828 val_conv.inner = untag_ptr(val);
30829 val_conv.is_owned = ptr_is_owned(val);
30830 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30831 val_conv = OutPoint_clone(&val_conv);
30832 ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv);
30835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
30836 LDKChannelDetails this_ptr_conv;
30837 this_ptr_conv.inner = untag_ptr(this_ptr);
30838 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30840 this_ptr_conv.is_owned = false;
30841 LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv);
30842 int64_t ret_ref = 0;
30843 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30844 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30849 LDKChannelDetails this_ptr_conv;
30850 this_ptr_conv.inner = untag_ptr(this_ptr);
30851 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30852 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30853 this_ptr_conv.is_owned = false;
30854 LDKChannelTypeFeatures val_conv;
30855 val_conv.inner = untag_ptr(val);
30856 val_conv.is_owned = ptr_is_owned(val);
30857 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30858 val_conv = ChannelTypeFeatures_clone(&val_conv);
30859 ChannelDetails_set_channel_type(&this_ptr_conv, val_conv);
30862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
30863 LDKChannelDetails this_ptr_conv;
30864 this_ptr_conv.inner = untag_ptr(this_ptr);
30865 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30867 this_ptr_conv.is_owned = false;
30868 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
30869 *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv);
30870 int64_t ret_ref = tag_ptr(ret_copy, true);
30874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30875 LDKChannelDetails this_ptr_conv;
30876 this_ptr_conv.inner = untag_ptr(this_ptr);
30877 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30878 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30879 this_ptr_conv.is_owned = false;
30880 void* val_ptr = untag_ptr(val);
30881 CHECK_ACCESS(val_ptr);
30882 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
30883 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
30884 ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
30887 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
30888 LDKChannelDetails this_ptr_conv;
30889 this_ptr_conv.inner = untag_ptr(this_ptr);
30890 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30891 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30892 this_ptr_conv.is_owned = false;
30893 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
30894 *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv);
30895 int64_t ret_ref = tag_ptr(ret_copy, true);
30899 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30900 LDKChannelDetails this_ptr_conv;
30901 this_ptr_conv.inner = untag_ptr(this_ptr);
30902 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30904 this_ptr_conv.is_owned = false;
30905 void* val_ptr = untag_ptr(val);
30906 CHECK_ACCESS(val_ptr);
30907 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
30908 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
30909 ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv);
30912 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
30913 LDKChannelDetails this_ptr_conv;
30914 this_ptr_conv.inner = untag_ptr(this_ptr);
30915 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30917 this_ptr_conv.is_owned = false;
30918 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
30919 *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv);
30920 int64_t ret_ref = tag_ptr(ret_copy, true);
30924 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30925 LDKChannelDetails this_ptr_conv;
30926 this_ptr_conv.inner = untag_ptr(this_ptr);
30927 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30929 this_ptr_conv.is_owned = false;
30930 void* val_ptr = untag_ptr(val);
30931 CHECK_ACCESS(val_ptr);
30932 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
30933 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
30934 ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv);
30937 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
30938 LDKChannelDetails this_ptr_conv;
30939 this_ptr_conv.inner = untag_ptr(this_ptr);
30940 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30942 this_ptr_conv.is_owned = false;
30943 int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
30947 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30948 LDKChannelDetails this_ptr_conv;
30949 this_ptr_conv.inner = untag_ptr(this_ptr);
30950 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30952 this_ptr_conv.is_owned = false;
30953 ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
30956 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) {
30957 LDKChannelDetails this_ptr_conv;
30958 this_ptr_conv.inner = untag_ptr(this_ptr);
30959 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30961 this_ptr_conv.is_owned = false;
30962 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
30963 *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv);
30964 int64_t ret_ref = tag_ptr(ret_copy, true);
30968 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30969 LDKChannelDetails this_ptr_conv;
30970 this_ptr_conv.inner = untag_ptr(this_ptr);
30971 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30973 this_ptr_conv.is_owned = false;
30974 void* val_ptr = untag_ptr(val);
30975 CHECK_ACCESS(val_ptr);
30976 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
30977 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
30978 ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
30981 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
30982 LDKChannelDetails this_ptr_conv;
30983 this_ptr_conv.inner = untag_ptr(this_ptr);
30984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30986 this_ptr_conv.is_owned = false;
30987 int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv);
30991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30992 LDKChannelDetails this_ptr_conv;
30993 this_ptr_conv.inner = untag_ptr(this_ptr);
30994 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30995 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30996 this_ptr_conv.is_owned = false;
30997 ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
31000 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
31001 LDKChannelDetails this_ptr_conv;
31002 this_ptr_conv.inner = untag_ptr(this_ptr);
31003 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31005 this_ptr_conv.is_owned = false;
31006 int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv);
31010 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31011 LDKChannelDetails this_ptr_conv;
31012 this_ptr_conv.inner = untag_ptr(this_ptr);
31013 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31014 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31015 this_ptr_conv.is_owned = false;
31016 ChannelDetails_set_balance_msat(&this_ptr_conv, val);
31019 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
31020 LDKChannelDetails this_ptr_conv;
31021 this_ptr_conv.inner = untag_ptr(this_ptr);
31022 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31024 this_ptr_conv.is_owned = false;
31025 int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
31029 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31030 LDKChannelDetails this_ptr_conv;
31031 this_ptr_conv.inner = untag_ptr(this_ptr);
31032 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31033 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31034 this_ptr_conv.is_owned = false;
31035 ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
31038 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1next_1outbound_1htlc_1limit_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
31039 LDKChannelDetails this_ptr_conv;
31040 this_ptr_conv.inner = untag_ptr(this_ptr);
31041 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31043 this_ptr_conv.is_owned = false;
31044 int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv);
31048 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1next_1outbound_1htlc_1limit_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31049 LDKChannelDetails this_ptr_conv;
31050 this_ptr_conv.inner = untag_ptr(this_ptr);
31051 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31052 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31053 this_ptr_conv.is_owned = false;
31054 ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val);
31057 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
31058 LDKChannelDetails this_ptr_conv;
31059 this_ptr_conv.inner = untag_ptr(this_ptr);
31060 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31061 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31062 this_ptr_conv.is_owned = false;
31063 int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
31067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31068 LDKChannelDetails this_ptr_conv;
31069 this_ptr_conv.inner = untag_ptr(this_ptr);
31070 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31071 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31072 this_ptr_conv.is_owned = false;
31073 ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
31076 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr) {
31077 LDKChannelDetails this_ptr_conv;
31078 this_ptr_conv.inner = untag_ptr(this_ptr);
31079 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31080 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31081 this_ptr_conv.is_owned = false;
31082 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
31083 *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv);
31084 int64_t ret_ref = tag_ptr(ret_copy, true);
31088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31089 LDKChannelDetails this_ptr_conv;
31090 this_ptr_conv.inner = untag_ptr(this_ptr);
31091 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31092 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31093 this_ptr_conv.is_owned = false;
31094 void* val_ptr = untag_ptr(val);
31095 CHECK_ACCESS(val_ptr);
31096 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
31097 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
31098 ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
31101 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
31102 LDKChannelDetails this_ptr_conv;
31103 this_ptr_conv.inner = untag_ptr(this_ptr);
31104 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31105 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31106 this_ptr_conv.is_owned = false;
31107 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
31108 *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv);
31109 int64_t ret_ref = tag_ptr(ret_copy, true);
31113 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31114 LDKChannelDetails this_ptr_conv;
31115 this_ptr_conv.inner = untag_ptr(this_ptr);
31116 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31118 this_ptr_conv.is_owned = false;
31119 void* val_ptr = untag_ptr(val);
31120 CHECK_ACCESS(val_ptr);
31121 LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
31122 val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val));
31123 ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
31126 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr) {
31127 LDKChannelDetails this_ptr_conv;
31128 this_ptr_conv.inner = untag_ptr(this_ptr);
31129 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31130 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31131 this_ptr_conv.is_owned = false;
31132 jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv);
31136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
31137 LDKChannelDetails this_ptr_conv;
31138 this_ptr_conv.inner = untag_ptr(this_ptr);
31139 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31141 this_ptr_conv.is_owned = false;
31142 ChannelDetails_set_is_outbound(&this_ptr_conv, val);
31145 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr) {
31146 LDKChannelDetails this_ptr_conv;
31147 this_ptr_conv.inner = untag_ptr(this_ptr);
31148 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31149 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31150 this_ptr_conv.is_owned = false;
31151 jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv);
31155 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
31156 LDKChannelDetails this_ptr_conv;
31157 this_ptr_conv.inner = untag_ptr(this_ptr);
31158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31160 this_ptr_conv.is_owned = false;
31161 ChannelDetails_set_is_channel_ready(&this_ptr_conv, val);
31164 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr) {
31165 LDKChannelDetails this_ptr_conv;
31166 this_ptr_conv.inner = untag_ptr(this_ptr);
31167 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31168 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31169 this_ptr_conv.is_owned = false;
31170 jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv);
31174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
31175 LDKChannelDetails this_ptr_conv;
31176 this_ptr_conv.inner = untag_ptr(this_ptr);
31177 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31179 this_ptr_conv.is_owned = false;
31180 ChannelDetails_set_is_usable(&this_ptr_conv, val);
31183 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr) {
31184 LDKChannelDetails this_ptr_conv;
31185 this_ptr_conv.inner = untag_ptr(this_ptr);
31186 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31187 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31188 this_ptr_conv.is_owned = false;
31189 jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv);
31193 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
31194 LDKChannelDetails this_ptr_conv;
31195 this_ptr_conv.inner = untag_ptr(this_ptr);
31196 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31198 this_ptr_conv.is_owned = false;
31199 ChannelDetails_set_is_public(&this_ptr_conv, val);
31202 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
31203 LDKChannelDetails this_ptr_conv;
31204 this_ptr_conv.inner = untag_ptr(this_ptr);
31205 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31206 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31207 this_ptr_conv.is_owned = false;
31208 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
31209 *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv);
31210 int64_t ret_ref = tag_ptr(ret_copy, true);
31214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31215 LDKChannelDetails this_ptr_conv;
31216 this_ptr_conv.inner = untag_ptr(this_ptr);
31217 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31219 this_ptr_conv.is_owned = false;
31220 void* val_ptr = untag_ptr(val);
31221 CHECK_ACCESS(val_ptr);
31222 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
31223 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
31224 ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
31227 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
31228 LDKChannelDetails this_ptr_conv;
31229 this_ptr_conv.inner = untag_ptr(this_ptr);
31230 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31232 this_ptr_conv.is_owned = false;
31233 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
31234 *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv);
31235 int64_t ret_ref = tag_ptr(ret_copy, true);
31239 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31240 LDKChannelDetails this_ptr_conv;
31241 this_ptr_conv.inner = untag_ptr(this_ptr);
31242 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31244 this_ptr_conv.is_owned = false;
31245 void* val_ptr = untag_ptr(val);
31246 CHECK_ACCESS(val_ptr);
31247 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
31248 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
31249 ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
31252 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
31253 LDKChannelDetails this_ptr_conv;
31254 this_ptr_conv.inner = untag_ptr(this_ptr);
31255 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31257 this_ptr_conv.is_owned = false;
31258 LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv);
31259 int64_t ret_ref = 0;
31260 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31261 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31265 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31266 LDKChannelDetails this_ptr_conv;
31267 this_ptr_conv.inner = untag_ptr(this_ptr);
31268 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31270 this_ptr_conv.is_owned = false;
31271 LDKChannelConfig val_conv;
31272 val_conv.inner = untag_ptr(val);
31273 val_conv.is_owned = ptr_is_owned(val);
31274 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
31275 val_conv = ChannelConfig_clone(&val_conv);
31276 ChannelDetails_set_config(&this_ptr_conv, val_conv);
31279 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t channel_type_arg, int64_t short_channel_id_arg, int64_t outbound_scid_alias_arg, int64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, jboolean is_usable_arg, jboolean is_public_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_t config_arg) {
31280 LDKThirtyTwoBytes channel_id_arg_ref;
31281 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
31282 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
31283 LDKChannelCounterparty counterparty_arg_conv;
31284 counterparty_arg_conv.inner = untag_ptr(counterparty_arg);
31285 counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg);
31286 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv);
31287 counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
31288 LDKOutPoint funding_txo_arg_conv;
31289 funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg);
31290 funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg);
31291 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv);
31292 funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
31293 LDKChannelTypeFeatures channel_type_arg_conv;
31294 channel_type_arg_conv.inner = untag_ptr(channel_type_arg);
31295 channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg);
31296 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv);
31297 channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv);
31298 void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg);
31299 CHECK_ACCESS(short_channel_id_arg_ptr);
31300 LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
31301 short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg));
31302 void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg);
31303 CHECK_ACCESS(outbound_scid_alias_arg_ptr);
31304 LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr);
31305 outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg));
31306 void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg);
31307 CHECK_ACCESS(inbound_scid_alias_arg_ptr);
31308 LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr);
31309 inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg));
31310 void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg);
31311 CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
31312 LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
31313 void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg);
31314 CHECK_ACCESS(confirmations_required_arg_ptr);
31315 LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
31316 confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg));
31317 void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg);
31318 CHECK_ACCESS(force_close_spend_delay_arg_ptr);
31319 LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
31320 force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg));
31321 void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg);
31322 CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr);
31323 LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr);
31324 inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg));
31325 void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg);
31326 CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr);
31327 LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr);
31328 inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg));
31329 LDKChannelConfig config_arg_conv;
31330 config_arg_conv.inner = untag_ptr(config_arg);
31331 config_arg_conv.is_owned = ptr_is_owned(config_arg);
31332 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv);
31333 config_arg_conv = ChannelConfig_clone(&config_arg_conv);
31334 LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv);
31335 int64_t ret_ref = 0;
31336 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31337 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31341 static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) {
31342 LDKChannelDetails ret_var = ChannelDetails_clone(arg);
31343 int64_t ret_ref = 0;
31344 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31345 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31348 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31349 LDKChannelDetails arg_conv;
31350 arg_conv.inner = untag_ptr(arg);
31351 arg_conv.is_owned = ptr_is_owned(arg);
31352 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31353 arg_conv.is_owned = false;
31354 int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv);
31358 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31359 LDKChannelDetails orig_conv;
31360 orig_conv.inner = untag_ptr(orig);
31361 orig_conv.is_owned = ptr_is_owned(orig);
31362 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31363 orig_conv.is_owned = false;
31364 LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
31365 int64_t ret_ref = 0;
31366 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31367 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31371 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
31372 LDKChannelDetails this_arg_conv;
31373 this_arg_conv.inner = untag_ptr(this_arg);
31374 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31375 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31376 this_arg_conv.is_owned = false;
31377 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
31378 *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv);
31379 int64_t ret_ref = tag_ptr(ret_copy, true);
31383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
31384 LDKChannelDetails this_arg_conv;
31385 this_arg_conv.inner = untag_ptr(this_arg);
31386 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31388 this_arg_conv.is_owned = false;
31389 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
31390 *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv);
31391 int64_t ret_ref = tag_ptr(ret_copy, true);
31395 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31396 if (!ptr_is_owned(this_ptr)) return;
31397 void* this_ptr_ptr = untag_ptr(this_ptr);
31398 CHECK_ACCESS(this_ptr_ptr);
31399 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
31400 FREE(untag_ptr(this_ptr));
31401 PaymentSendFailure_free(this_ptr_conv);
31404 static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
31405 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
31406 *ret_copy = PaymentSendFailure_clone(arg);
31407 int64_t ret_ref = tag_ptr(ret_copy, true);
31410 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31411 LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
31412 int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
31416 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31417 LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
31418 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
31419 *ret_copy = PaymentSendFailure_clone(orig_conv);
31420 int64_t ret_ref = tag_ptr(ret_copy, true);
31424 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) {
31425 void* a_ptr = untag_ptr(a);
31426 CHECK_ACCESS(a_ptr);
31427 LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
31428 a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
31429 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
31430 *ret_copy = PaymentSendFailure_parameter_error(a_conv);
31431 int64_t ret_ref = tag_ptr(ret_copy, true);
31435 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) {
31436 LDKCVec_CResult_NoneAPIErrorZZ a_constr;
31437 a_constr.datalen = (*env)->GetArrayLength(env, a);
31438 if (a_constr.datalen > 0)
31439 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
31441 a_constr.data = NULL;
31442 int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
31443 for (size_t w = 0; w < a_constr.datalen; w++) {
31444 int64_t a_conv_22 = a_vals[w];
31445 void* a_conv_22_ptr = untag_ptr(a_conv_22);
31446 CHECK_ACCESS(a_conv_22_ptr);
31447 LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
31448 a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
31449 a_constr.data[w] = a_conv_22_conv;
31451 (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
31452 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
31453 *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
31454 int64_t ret_ref = tag_ptr(ret_copy, true);
31458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_1safe(JNIEnv *env, jclass clz, int64_tArray a) {
31459 LDKCVec_APIErrorZ a_constr;
31460 a_constr.datalen = (*env)->GetArrayLength(env, a);
31461 if (a_constr.datalen > 0)
31462 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
31464 a_constr.data = NULL;
31465 int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
31466 for (size_t k = 0; k < a_constr.datalen; k++) {
31467 int64_t a_conv_10 = a_vals[k];
31468 void* a_conv_10_ptr = untag_ptr(a_conv_10);
31469 CHECK_ACCESS(a_conv_10_ptr);
31470 LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
31471 a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
31472 a_constr.data[k] = a_conv_10_conv;
31474 (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
31475 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
31476 *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
31477 int64_t ret_ref = tag_ptr(ret_copy, true);
31481 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) {
31482 LDKCVec_CResult_NoneAPIErrorZZ results_constr;
31483 results_constr.datalen = (*env)->GetArrayLength(env, results);
31484 if (results_constr.datalen > 0)
31485 results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
31487 results_constr.data = NULL;
31488 int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL);
31489 for (size_t w = 0; w < results_constr.datalen; w++) {
31490 int64_t results_conv_22 = results_vals[w];
31491 void* results_conv_22_ptr = untag_ptr(results_conv_22);
31492 CHECK_ACCESS(results_conv_22_ptr);
31493 LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
31494 results_constr.data[w] = results_conv_22_conv;
31496 (*env)->ReleaseLongArrayElements(env, results, results_vals, 0);
31497 LDKRouteParameters failed_paths_retry_conv;
31498 failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
31499 failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
31500 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
31501 failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
31502 LDKThirtyTwoBytes payment_id_ref;
31503 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
31504 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
31505 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
31506 *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
31507 int64_t ret_ref = tag_ptr(ret_copy, true);
31511 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31512 LDKPhantomRouteHints this_obj_conv;
31513 this_obj_conv.inner = untag_ptr(this_obj);
31514 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31516 PhantomRouteHints_free(this_obj_conv);
31519 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
31520 LDKPhantomRouteHints this_ptr_conv;
31521 this_ptr_conv.inner = untag_ptr(this_ptr);
31522 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31524 this_ptr_conv.is_owned = false;
31525 LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv);
31526 int64_tArray ret_arr = NULL;
31527 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
31528 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
31529 for (size_t q = 0; q < ret_var.datalen; q++) {
31530 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
31531 int64_t ret_conv_16_ref = 0;
31532 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
31533 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
31534 ret_arr_ptr[q] = ret_conv_16_ref;
31536 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
31537 FREE(ret_var.data);
31541 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
31542 LDKPhantomRouteHints this_ptr_conv;
31543 this_ptr_conv.inner = untag_ptr(this_ptr);
31544 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31545 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31546 this_ptr_conv.is_owned = false;
31547 LDKCVec_ChannelDetailsZ val_constr;
31548 val_constr.datalen = (*env)->GetArrayLength(env, val);
31549 if (val_constr.datalen > 0)
31550 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
31552 val_constr.data = NULL;
31553 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
31554 for (size_t q = 0; q < val_constr.datalen; q++) {
31555 int64_t val_conv_16 = val_vals[q];
31556 LDKChannelDetails val_conv_16_conv;
31557 val_conv_16_conv.inner = untag_ptr(val_conv_16);
31558 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
31559 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
31560 val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
31561 val_constr.data[q] = val_conv_16_conv;
31563 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
31564 PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
31567 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr) {
31568 LDKPhantomRouteHints this_ptr_conv;
31569 this_ptr_conv.inner = untag_ptr(this_ptr);
31570 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31571 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31572 this_ptr_conv.is_owned = false;
31573 int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv);
31577 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31578 LDKPhantomRouteHints this_ptr_conv;
31579 this_ptr_conv.inner = untag_ptr(this_ptr);
31580 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31581 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31582 this_ptr_conv.is_owned = false;
31583 PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val);
31586 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
31587 LDKPhantomRouteHints this_ptr_conv;
31588 this_ptr_conv.inner = untag_ptr(this_ptr);
31589 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31590 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31591 this_ptr_conv.is_owned = false;
31592 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31593 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form);
31597 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31598 LDKPhantomRouteHints this_ptr_conv;
31599 this_ptr_conv.inner = untag_ptr(this_ptr);
31600 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31601 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31602 this_ptr_conv.is_owned = false;
31603 LDKPublicKey val_ref;
31604 CHECK((*env)->GetArrayLength(env, val) == 33);
31605 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31606 PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref);
31609 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1new(JNIEnv *env, jclass clz, int64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) {
31610 LDKCVec_ChannelDetailsZ channels_arg_constr;
31611 channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg);
31612 if (channels_arg_constr.datalen > 0)
31613 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
31615 channels_arg_constr.data = NULL;
31616 int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL);
31617 for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
31618 int64_t channels_arg_conv_16 = channels_arg_vals[q];
31619 LDKChannelDetails channels_arg_conv_16_conv;
31620 channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16);
31621 channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16);
31622 CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv);
31623 channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
31624 channels_arg_constr.data[q] = channels_arg_conv_16_conv;
31626 (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0);
31627 LDKPublicKey real_node_pubkey_arg_ref;
31628 CHECK((*env)->GetArrayLength(env, real_node_pubkey_arg) == 33);
31629 (*env)->GetByteArrayRegion(env, real_node_pubkey_arg, 0, 33, real_node_pubkey_arg_ref.compressed_form);
31630 LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref);
31631 int64_t ret_ref = 0;
31632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31637 static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) {
31638 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg);
31639 int64_t ret_ref = 0;
31640 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31641 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31644 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31645 LDKPhantomRouteHints arg_conv;
31646 arg_conv.inner = untag_ptr(arg);
31647 arg_conv.is_owned = ptr_is_owned(arg);
31648 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31649 arg_conv.is_owned = false;
31650 int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv);
31654 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31655 LDKPhantomRouteHints orig_conv;
31656 orig_conv.inner = untag_ptr(orig);
31657 orig_conv.is_owned = ptr_is_owned(orig);
31658 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31659 orig_conv.is_owned = false;
31660 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv);
31661 int64_t ret_ref = 0;
31662 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31663 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31667 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t keys_manager, int64_t config, int64_t params) {
31668 void* fee_est_ptr = untag_ptr(fee_est);
31669 CHECK_ACCESS(fee_est_ptr);
31670 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
31671 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
31672 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
31673 LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
31675 void* chain_monitor_ptr = untag_ptr(chain_monitor);
31676 CHECK_ACCESS(chain_monitor_ptr);
31677 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
31678 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
31679 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
31680 LDKWatch_JCalls_cloned(&chain_monitor_conv);
31682 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
31683 CHECK_ACCESS(tx_broadcaster_ptr);
31684 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
31685 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
31686 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
31687 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
31689 void* logger_ptr = untag_ptr(logger);
31690 CHECK_ACCESS(logger_ptr);
31691 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
31692 if (logger_conv.free == LDKLogger_JCalls_free) {
31693 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
31694 LDKLogger_JCalls_cloned(&logger_conv);
31696 void* keys_manager_ptr = untag_ptr(keys_manager);
31697 CHECK_ACCESS(keys_manager_ptr);
31698 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
31699 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
31700 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
31701 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
31703 LDKUserConfig config_conv;
31704 config_conv.inner = untag_ptr(config);
31705 config_conv.is_owned = ptr_is_owned(config);
31706 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
31707 config_conv = UserConfig_clone(&config_conv);
31708 LDKChainParameters params_conv;
31709 params_conv.inner = untag_ptr(params);
31710 params_conv.is_owned = ptr_is_owned(params);
31711 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
31712 params_conv = ChainParameters_clone(¶ms_conv);
31713 LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv);
31714 int64_t ret_ref = 0;
31715 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31716 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1current_1default_1configuration(JNIEnv *env, jclass clz, int64_t this_arg) {
31721 LDKChannelManager this_arg_conv;
31722 this_arg_conv.inner = untag_ptr(this_arg);
31723 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31724 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31725 this_arg_conv.is_owned = false;
31726 LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv);
31727 int64_t ret_ref = 0;
31728 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31729 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31733 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int64_t user_channel_id, int64_t override_config) {
31734 LDKChannelManager this_arg_conv;
31735 this_arg_conv.inner = untag_ptr(this_arg);
31736 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31738 this_arg_conv.is_owned = false;
31739 LDKPublicKey their_network_key_ref;
31740 CHECK((*env)->GetArrayLength(env, their_network_key) == 33);
31741 (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form);
31742 LDKUserConfig override_config_conv;
31743 override_config_conv.inner = untag_ptr(override_config);
31744 override_config_conv.is_owned = ptr_is_owned(override_config);
31745 CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
31746 override_config_conv = UserConfig_clone(&override_config_conv);
31747 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
31748 *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv);
31749 return tag_ptr(ret_conv, true);
31752 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
31753 LDKChannelManager this_arg_conv;
31754 this_arg_conv.inner = untag_ptr(this_arg);
31755 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31756 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31757 this_arg_conv.is_owned = false;
31758 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
31759 int64_tArray ret_arr = NULL;
31760 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
31761 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
31762 for (size_t q = 0; q < ret_var.datalen; q++) {
31763 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
31764 int64_t ret_conv_16_ref = 0;
31765 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
31766 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
31767 ret_arr_ptr[q] = ret_conv_16_ref;
31769 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
31770 FREE(ret_var.data);
31774 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
31775 LDKChannelManager this_arg_conv;
31776 this_arg_conv.inner = untag_ptr(this_arg);
31777 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31779 this_arg_conv.is_owned = false;
31780 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
31781 int64_tArray ret_arr = NULL;
31782 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
31783 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
31784 for (size_t q = 0; q < ret_var.datalen; q++) {
31785 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
31786 int64_t ret_conv_16_ref = 0;
31787 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
31788 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
31789 ret_arr_ptr[q] = ret_conv_16_ref;
31791 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
31792 FREE(ret_var.data);
31796 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) {
31797 LDKChannelManager this_arg_conv;
31798 this_arg_conv.inner = untag_ptr(this_arg);
31799 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31800 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31801 this_arg_conv.is_owned = false;
31802 unsigned char channel_id_arr[32];
31803 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
31804 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
31805 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
31806 LDKPublicKey counterparty_node_id_ref;
31807 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
31808 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
31809 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
31810 *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
31811 return tag_ptr(ret_conv, true);
31814 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel_1with_1target_1feerate(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id, int32_t target_feerate_sats_per_1000_weight) {
31815 LDKChannelManager this_arg_conv;
31816 this_arg_conv.inner = untag_ptr(this_arg);
31817 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31818 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31819 this_arg_conv.is_owned = false;
31820 unsigned char channel_id_arr[32];
31821 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
31822 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
31823 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
31824 LDKPublicKey counterparty_node_id_ref;
31825 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
31826 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
31827 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
31828 *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight);
31829 return tag_ptr(ret_conv, true);
31832 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) {
31833 LDKChannelManager this_arg_conv;
31834 this_arg_conv.inner = untag_ptr(this_arg);
31835 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31837 this_arg_conv.is_owned = false;
31838 unsigned char channel_id_arr[32];
31839 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
31840 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
31841 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
31842 LDKPublicKey counterparty_node_id_ref;
31843 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
31844 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
31845 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
31846 *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
31847 return tag_ptr(ret_conv, true);
31850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) {
31851 LDKChannelManager this_arg_conv;
31852 this_arg_conv.inner = untag_ptr(this_arg);
31853 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31854 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31855 this_arg_conv.is_owned = false;
31856 unsigned char channel_id_arr[32];
31857 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
31858 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
31859 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
31860 LDKPublicKey counterparty_node_id_ref;
31861 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
31862 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
31863 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
31864 *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
31865 return tag_ptr(ret_conv, true);
31868 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg) {
31869 LDKChannelManager this_arg_conv;
31870 this_arg_conv.inner = untag_ptr(this_arg);
31871 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31873 this_arg_conv.is_owned = false;
31874 ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv);
31877 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg) {
31878 LDKChannelManager this_arg_conv;
31879 this_arg_conv.inner = untag_ptr(this_arg);
31880 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31881 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31882 this_arg_conv.is_owned = false;
31883 ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv);
31886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret) {
31887 LDKChannelManager this_arg_conv;
31888 this_arg_conv.inner = untag_ptr(this_arg);
31889 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31891 this_arg_conv.is_owned = false;
31892 LDKRoute route_conv;
31893 route_conv.inner = untag_ptr(route);
31894 route_conv.is_owned = ptr_is_owned(route);
31895 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
31896 route_conv.is_owned = false;
31897 LDKThirtyTwoBytes payment_hash_ref;
31898 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
31899 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
31900 LDKThirtyTwoBytes payment_secret_ref;
31901 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
31902 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
31903 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
31904 *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref);
31905 return tag_ptr(ret_conv, true);
31908 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) {
31909 LDKChannelManager this_arg_conv;
31910 this_arg_conv.inner = untag_ptr(this_arg);
31911 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31913 this_arg_conv.is_owned = false;
31914 LDKRoute route_conv;
31915 route_conv.inner = untag_ptr(route);
31916 route_conv.is_owned = ptr_is_owned(route);
31917 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
31918 route_conv.is_owned = false;
31919 LDKThirtyTwoBytes payment_id_ref;
31920 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
31921 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
31922 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
31923 *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
31924 return tag_ptr(ret_conv, true);
31927 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) {
31928 LDKChannelManager this_arg_conv;
31929 this_arg_conv.inner = untag_ptr(this_arg);
31930 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31931 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31932 this_arg_conv.is_owned = false;
31933 LDKThirtyTwoBytes payment_id_ref;
31934 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
31935 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
31936 ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
31939 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) {
31940 LDKChannelManager this_arg_conv;
31941 this_arg_conv.inner = untag_ptr(this_arg);
31942 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31943 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31944 this_arg_conv.is_owned = false;
31945 LDKRoute route_conv;
31946 route_conv.inner = untag_ptr(route);
31947 route_conv.is_owned = ptr_is_owned(route);
31948 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
31949 route_conv.is_owned = false;
31950 LDKThirtyTwoBytes payment_preimage_ref;
31951 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
31952 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
31953 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
31954 *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
31955 return tag_ptr(ret_conv, true);
31958 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1probe(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray hops) {
31959 LDKChannelManager this_arg_conv;
31960 this_arg_conv.inner = untag_ptr(this_arg);
31961 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31963 this_arg_conv.is_owned = false;
31964 LDKCVec_RouteHopZ hops_constr;
31965 hops_constr.datalen = (*env)->GetArrayLength(env, hops);
31966 if (hops_constr.datalen > 0)
31967 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
31969 hops_constr.data = NULL;
31970 int64_t* hops_vals = (*env)->GetLongArrayElements (env, hops, NULL);
31971 for (size_t k = 0; k < hops_constr.datalen; k++) {
31972 int64_t hops_conv_10 = hops_vals[k];
31973 LDKRouteHop hops_conv_10_conv;
31974 hops_conv_10_conv.inner = untag_ptr(hops_conv_10);
31975 hops_conv_10_conv.is_owned = ptr_is_owned(hops_conv_10);
31976 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv_10_conv);
31977 hops_conv_10_conv = RouteHop_clone(&hops_conv_10_conv);
31978 hops_constr.data[k] = hops_conv_10_conv;
31980 (*env)->ReleaseLongArrayElements(env, hops, hops_vals, 0);
31981 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
31982 *ret_conv = ChannelManager_send_probe(&this_arg_conv, hops_constr);
31983 return tag_ptr(ret_conv, true);
31986 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) {
31987 LDKChannelManager this_arg_conv;
31988 this_arg_conv.inner = untag_ptr(this_arg);
31989 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31990 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31991 this_arg_conv.is_owned = false;
31992 unsigned char temporary_channel_id_arr[32];
31993 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
31994 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
31995 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
31996 LDKPublicKey counterparty_node_id_ref;
31997 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
31998 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
31999 LDKTransaction funding_transaction_ref;
32000 funding_transaction_ref.datalen = (*env)->GetArrayLength(env, funding_transaction);
32001 funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes");
32002 (*env)->GetByteArrayRegion(env, funding_transaction, 0, funding_transaction_ref.datalen, funding_transaction_ref.data);
32003 funding_transaction_ref.data_is_owned = true;
32004 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
32005 *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref);
32006 return tag_ptr(ret_conv, true);
32009 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1update_1channel_1config(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray counterparty_node_id, jobjectArray channel_ids, int64_t config) {
32010 LDKChannelManager this_arg_conv;
32011 this_arg_conv.inner = untag_ptr(this_arg);
32012 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32014 this_arg_conv.is_owned = false;
32015 LDKPublicKey counterparty_node_id_ref;
32016 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
32017 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
32018 LDKCVec_ThirtyTwoBytesZ channel_ids_constr;
32019 channel_ids_constr.datalen = (*env)->GetArrayLength(env, channel_ids);
32020 if (channel_ids_constr.datalen > 0)
32021 channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
32023 channel_ids_constr.data = NULL;
32024 for (size_t i = 0; i < channel_ids_constr.datalen; i++) {
32025 int8_tArray channel_ids_conv_8 = (*env)->GetObjectArrayElement(env, channel_ids, i);
32026 LDKThirtyTwoBytes channel_ids_conv_8_ref;
32027 CHECK((*env)->GetArrayLength(env, channel_ids_conv_8) == 32);
32028 (*env)->GetByteArrayRegion(env, channel_ids_conv_8, 0, 32, channel_ids_conv_8_ref.data);
32029 channel_ids_constr.data[i] = channel_ids_conv_8_ref;
32031 LDKChannelConfig config_conv;
32032 config_conv.inner = untag_ptr(config);
32033 config_conv.is_owned = ptr_is_owned(config);
32034 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
32035 config_conv.is_owned = false;
32036 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
32037 *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv);
32038 return tag_ptr(ret_conv, true);
32041 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv *env, jclass clz, int64_t this_arg) {
32042 LDKChannelManager this_arg_conv;
32043 this_arg_conv.inner = untag_ptr(this_arg);
32044 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32046 this_arg_conv.is_owned = false;
32047 ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
32050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
32051 LDKChannelManager this_arg_conv;
32052 this_arg_conv.inner = untag_ptr(this_arg);
32053 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32055 this_arg_conv.is_owned = false;
32056 ChannelManager_timer_tick_occurred(&this_arg_conv);
32059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) {
32060 LDKChannelManager this_arg_conv;
32061 this_arg_conv.inner = untag_ptr(this_arg);
32062 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32064 this_arg_conv.is_owned = false;
32065 unsigned char payment_hash_arr[32];
32066 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32067 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
32068 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
32069 ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref);
32072 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_preimage) {
32073 LDKChannelManager this_arg_conv;
32074 this_arg_conv.inner = untag_ptr(this_arg);
32075 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32077 this_arg_conv.is_owned = false;
32078 LDKThirtyTwoBytes payment_preimage_ref;
32079 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
32080 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
32081 ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref);
32084 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
32085 LDKChannelManager this_arg_conv;
32086 this_arg_conv.inner = untag_ptr(this_arg);
32087 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32088 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32089 this_arg_conv.is_owned = false;
32090 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
32091 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form);
32095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t user_channel_id) {
32096 LDKChannelManager this_arg_conv;
32097 this_arg_conv.inner = untag_ptr(this_arg);
32098 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32099 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32100 this_arg_conv.is_owned = false;
32101 unsigned char temporary_channel_id_arr[32];
32102 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
32103 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
32104 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
32105 LDKPublicKey counterparty_node_id_ref;
32106 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
32107 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
32108 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
32109 *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
32110 return tag_ptr(ret_conv, true);
32113 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel_1from_1trusted_1peer_10conf(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t user_channel_id) {
32114 LDKChannelManager this_arg_conv;
32115 this_arg_conv.inner = untag_ptr(this_arg);
32116 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32118 this_arg_conv.is_owned = false;
32119 unsigned char temporary_channel_id_arr[32];
32120 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
32121 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
32122 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
32123 LDKPublicKey counterparty_node_id_ref;
32124 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
32125 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
32126 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
32127 *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
32128 return tag_ptr(ret_conv, true);
32131 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
32132 LDKChannelManager this_arg_conv;
32133 this_arg_conv.inner = untag_ptr(this_arg);
32134 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32136 this_arg_conv.is_owned = false;
32137 void* min_value_msat_ptr = untag_ptr(min_value_msat);
32138 CHECK_ACCESS(min_value_msat_ptr);
32139 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
32140 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
32141 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
32142 *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
32143 return tag_ptr(ret_conv, true);
32146 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
32147 LDKChannelManager this_arg_conv;
32148 this_arg_conv.inner = untag_ptr(this_arg);
32149 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32151 this_arg_conv.is_owned = false;
32152 void* min_value_msat_ptr = untag_ptr(min_value_msat);
32153 CHECK_ACCESS(min_value_msat_ptr);
32154 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
32155 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
32156 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
32157 *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
32158 return tag_ptr(ret_conv, true);
32161 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
32162 LDKChannelManager this_arg_conv;
32163 this_arg_conv.inner = untag_ptr(this_arg);
32164 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32166 this_arg_conv.is_owned = false;
32167 LDKThirtyTwoBytes payment_hash_ref;
32168 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32169 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
32170 void* min_value_msat_ptr = untag_ptr(min_value_msat);
32171 CHECK_ACCESS(min_value_msat_ptr);
32172 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
32173 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
32174 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
32175 *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
32176 return tag_ptr(ret_conv, true);
32179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
32180 LDKChannelManager this_arg_conv;
32181 this_arg_conv.inner = untag_ptr(this_arg);
32182 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32183 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32184 this_arg_conv.is_owned = false;
32185 LDKThirtyTwoBytes payment_hash_ref;
32186 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32187 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
32188 void* min_value_msat_ptr = untag_ptr(min_value_msat);
32189 CHECK_ACCESS(min_value_msat_ptr);
32190 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
32191 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
32192 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
32193 *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
32194 return tag_ptr(ret_conv, true);
32197 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) {
32198 LDKChannelManager this_arg_conv;
32199 this_arg_conv.inner = untag_ptr(this_arg);
32200 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32202 this_arg_conv.is_owned = false;
32203 LDKThirtyTwoBytes payment_hash_ref;
32204 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32205 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
32206 LDKThirtyTwoBytes payment_secret_ref;
32207 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
32208 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
32209 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
32210 *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
32211 return tag_ptr(ret_conv, true);
32214 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
32215 LDKChannelManager this_arg_conv;
32216 this_arg_conv.inner = untag_ptr(this_arg);
32217 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32219 this_arg_conv.is_owned = false;
32220 int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv);
32224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) {
32225 LDKChannelManager this_arg_conv;
32226 this_arg_conv.inner = untag_ptr(this_arg);
32227 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32228 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32229 this_arg_conv.is_owned = false;
32230 LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv);
32231 int64_t ret_ref = 0;
32232 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32233 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
32238 LDKChannelManager this_arg_conv;
32239 this_arg_conv.inner = untag_ptr(this_arg);
32240 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32242 this_arg_conv.is_owned = false;
32243 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
32244 *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
32245 return tag_ptr(ret_ret, true);
32248 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
32249 LDKChannelManager this_arg_conv;
32250 this_arg_conv.inner = untag_ptr(this_arg);
32251 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32253 this_arg_conv.is_owned = false;
32254 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
32255 *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
32256 return tag_ptr(ret_ret, true);
32259 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
32260 LDKChannelManager this_arg_conv;
32261 this_arg_conv.inner = untag_ptr(this_arg);
32262 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32263 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32264 this_arg_conv.is_owned = false;
32265 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
32266 *ret_ret = ChannelManager_as_Listen(&this_arg_conv);
32267 return tag_ptr(ret_ret, true);
32270 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) {
32271 LDKChannelManager this_arg_conv;
32272 this_arg_conv.inner = untag_ptr(this_arg);
32273 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32274 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32275 this_arg_conv.is_owned = false;
32276 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
32277 *ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
32278 return tag_ptr(ret_ret, true);
32281 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update_1timeout(JNIEnv *env, jclass clz, int64_t this_arg, int64_t max_wait) {
32282 LDKChannelManager this_arg_conv;
32283 this_arg_conv.inner = untag_ptr(this_arg);
32284 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32286 this_arg_conv.is_owned = false;
32287 jboolean ret_conv = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait);
32291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update(JNIEnv *env, jclass clz, int64_t this_arg) {
32292 LDKChannelManager this_arg_conv;
32293 this_arg_conv.inner = untag_ptr(this_arg);
32294 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32296 this_arg_conv.is_owned = false;
32297 ChannelManager_await_persistable_update(&this_arg_conv);
32300 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1persistable_1update_1future(JNIEnv *env, jclass clz, int64_t this_arg) {
32301 LDKChannelManager this_arg_conv;
32302 this_arg_conv.inner = untag_ptr(this_arg);
32303 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32304 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32305 this_arg_conv.is_owned = false;
32306 LDKFuture ret_var = ChannelManager_get_persistable_update_future(&this_arg_conv);
32307 int64_t ret_ref = 0;
32308 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32309 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32313 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) {
32314 LDKChannelManager this_arg_conv;
32315 this_arg_conv.inner = untag_ptr(this_arg);
32316 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32317 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32318 this_arg_conv.is_owned = false;
32319 LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
32320 int64_t ret_ref = 0;
32321 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32322 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32326 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
32327 LDKChannelManager this_arg_conv;
32328 this_arg_conv.inner = untag_ptr(this_arg);
32329 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32331 this_arg_conv.is_owned = false;
32332 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
32333 *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
32334 return tag_ptr(ret_ret, true);
32337 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1node_1features(JNIEnv *env, jclass clz) {
32338 LDKNodeFeatures ret_var = provided_node_features();
32339 int64_t ret_ref = 0;
32340 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32341 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1channel_1features(JNIEnv *env, jclass clz) {
32346 LDKChannelFeatures ret_var = provided_channel_features();
32347 int64_t ret_ref = 0;
32348 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32349 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32353 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1init_1features(JNIEnv *env, jclass clz) {
32354 LDKInitFeatures ret_var = provided_init_features();
32355 int64_t ret_ref = 0;
32356 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32357 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32361 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
32362 LDKCounterpartyForwardingInfo obj_conv;
32363 obj_conv.inner = untag_ptr(obj);
32364 obj_conv.is_owned = ptr_is_owned(obj);
32365 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32366 obj_conv.is_owned = false;
32367 LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv);
32368 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
32369 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
32370 CVec_u8Z_free(ret_var);
32374 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
32375 LDKu8slice ser_ref;
32376 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
32377 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
32378 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
32379 *ret_conv = CounterpartyForwardingInfo_read(ser_ref);
32380 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
32381 return tag_ptr(ret_conv, true);
32384 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1write(JNIEnv *env, jclass clz, int64_t obj) {
32385 LDKChannelCounterparty obj_conv;
32386 obj_conv.inner = untag_ptr(obj);
32387 obj_conv.is_owned = ptr_is_owned(obj);
32388 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32389 obj_conv.is_owned = false;
32390 LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv);
32391 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
32392 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
32393 CVec_u8Z_free(ret_var);
32397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
32398 LDKu8slice ser_ref;
32399 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
32400 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
32401 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
32402 *ret_conv = ChannelCounterparty_read(ser_ref);
32403 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
32404 return tag_ptr(ret_conv, true);
32407 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1write(JNIEnv *env, jclass clz, int64_t obj) {
32408 LDKChannelDetails obj_conv;
32409 obj_conv.inner = untag_ptr(obj);
32410 obj_conv.is_owned = ptr_is_owned(obj);
32411 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32412 obj_conv.is_owned = false;
32413 LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv);
32414 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
32415 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
32416 CVec_u8Z_free(ret_var);
32420 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
32421 LDKu8slice ser_ref;
32422 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
32423 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
32424 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
32425 *ret_conv = ChannelDetails_read(ser_ref);
32426 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
32427 return tag_ptr(ret_conv, true);
32430 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1write(JNIEnv *env, jclass clz, int64_t obj) {
32431 LDKPhantomRouteHints obj_conv;
32432 obj_conv.inner = untag_ptr(obj);
32433 obj_conv.is_owned = ptr_is_owned(obj);
32434 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32435 obj_conv.is_owned = false;
32436 LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv);
32437 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
32438 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
32439 CVec_u8Z_free(ret_var);
32443 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
32444 LDKu8slice ser_ref;
32445 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
32446 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
32447 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
32448 *ret_conv = PhantomRouteHints_read(ser_ref);
32449 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
32450 return tag_ptr(ret_conv, true);
32453 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(JNIEnv *env, jclass clz, int64_t obj) {
32454 LDKChannelManager obj_conv;
32455 obj_conv.inner = untag_ptr(obj);
32456 obj_conv.is_owned = ptr_is_owned(obj);
32457 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32458 obj_conv.is_owned = false;
32459 LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
32460 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
32461 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
32462 CVec_u8Z_free(ret_var);
32466 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32467 LDKChannelManagerReadArgs this_obj_conv;
32468 this_obj_conv.inner = untag_ptr(this_obj);
32469 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32471 ChannelManagerReadArgs_free(this_obj_conv);
32474 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr) {
32475 LDKChannelManagerReadArgs this_ptr_conv;
32476 this_ptr_conv.inner = untag_ptr(this_ptr);
32477 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32478 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32479 this_ptr_conv.is_owned = false;
32480 // WARNING: This object doesn't live past this scope, needs clone!
32481 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv), false);
32485 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32486 LDKChannelManagerReadArgs this_ptr_conv;
32487 this_ptr_conv.inner = untag_ptr(this_ptr);
32488 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32489 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32490 this_ptr_conv.is_owned = false;
32491 void* val_ptr = untag_ptr(val);
32492 CHECK_ACCESS(val_ptr);
32493 LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
32494 if (val_conv.free == LDKKeysInterface_JCalls_free) {
32495 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
32496 LDKKeysInterface_JCalls_cloned(&val_conv);
32498 ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
32501 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr) {
32502 LDKChannelManagerReadArgs this_ptr_conv;
32503 this_ptr_conv.inner = untag_ptr(this_ptr);
32504 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32505 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32506 this_ptr_conv.is_owned = false;
32507 // WARNING: This object doesn't live past this scope, needs clone!
32508 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false);
32512 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32513 LDKChannelManagerReadArgs this_ptr_conv;
32514 this_ptr_conv.inner = untag_ptr(this_ptr);
32515 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32516 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32517 this_ptr_conv.is_owned = false;
32518 void* val_ptr = untag_ptr(val);
32519 CHECK_ACCESS(val_ptr);
32520 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
32521 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
32522 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
32523 LDKFeeEstimator_JCalls_cloned(&val_conv);
32525 ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
32528 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr) {
32529 LDKChannelManagerReadArgs this_ptr_conv;
32530 this_ptr_conv.inner = untag_ptr(this_ptr);
32531 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32533 this_ptr_conv.is_owned = false;
32534 // WARNING: This object doesn't live past this scope, needs clone!
32535 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false);
32539 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32540 LDKChannelManagerReadArgs this_ptr_conv;
32541 this_ptr_conv.inner = untag_ptr(this_ptr);
32542 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32543 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32544 this_ptr_conv.is_owned = false;
32545 void* val_ptr = untag_ptr(val);
32546 CHECK_ACCESS(val_ptr);
32547 LDKWatch val_conv = *(LDKWatch*)(val_ptr);
32548 if (val_conv.free == LDKWatch_JCalls_free) {
32549 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
32550 LDKWatch_JCalls_cloned(&val_conv);
32552 ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
32555 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr) {
32556 LDKChannelManagerReadArgs this_ptr_conv;
32557 this_ptr_conv.inner = untag_ptr(this_ptr);
32558 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32560 this_ptr_conv.is_owned = false;
32561 // WARNING: This object doesn't live past this scope, needs clone!
32562 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false);
32566 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32567 LDKChannelManagerReadArgs this_ptr_conv;
32568 this_ptr_conv.inner = untag_ptr(this_ptr);
32569 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32570 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32571 this_ptr_conv.is_owned = false;
32572 void* val_ptr = untag_ptr(val);
32573 CHECK_ACCESS(val_ptr);
32574 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
32575 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
32576 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
32577 LDKBroadcasterInterface_JCalls_cloned(&val_conv);
32579 ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
32582 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv *env, jclass clz, int64_t this_ptr) {
32583 LDKChannelManagerReadArgs this_ptr_conv;
32584 this_ptr_conv.inner = untag_ptr(this_ptr);
32585 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32587 this_ptr_conv.is_owned = false;
32588 // WARNING: This object doesn't live past this scope, needs clone!
32589 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false);
32593 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32594 LDKChannelManagerReadArgs this_ptr_conv;
32595 this_ptr_conv.inner = untag_ptr(this_ptr);
32596 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32598 this_ptr_conv.is_owned = false;
32599 void* val_ptr = untag_ptr(val);
32600 CHECK_ACCESS(val_ptr);
32601 LDKLogger val_conv = *(LDKLogger*)(val_ptr);
32602 if (val_conv.free == LDKLogger_JCalls_free) {
32603 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
32604 LDKLogger_JCalls_cloned(&val_conv);
32606 ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
32609 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
32610 LDKChannelManagerReadArgs this_ptr_conv;
32611 this_ptr_conv.inner = untag_ptr(this_ptr);
32612 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32613 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32614 this_ptr_conv.is_owned = false;
32615 LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
32616 int64_t ret_ref = 0;
32617 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32618 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32623 LDKChannelManagerReadArgs this_ptr_conv;
32624 this_ptr_conv.inner = untag_ptr(this_ptr);
32625 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32626 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32627 this_ptr_conv.is_owned = false;
32628 LDKUserConfig val_conv;
32629 val_conv.inner = untag_ptr(val);
32630 val_conv.is_owned = ptr_is_owned(val);
32631 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32632 val_conv = UserConfig_clone(&val_conv);
32633 ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
32636 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t default_config, int64_tArray channel_monitors) {
32637 void* keys_manager_ptr = untag_ptr(keys_manager);
32638 CHECK_ACCESS(keys_manager_ptr);
32639 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
32640 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
32641 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
32642 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
32644 void* fee_estimator_ptr = untag_ptr(fee_estimator);
32645 CHECK_ACCESS(fee_estimator_ptr);
32646 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
32647 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
32648 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
32649 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
32651 void* chain_monitor_ptr = untag_ptr(chain_monitor);
32652 CHECK_ACCESS(chain_monitor_ptr);
32653 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
32654 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
32655 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
32656 LDKWatch_JCalls_cloned(&chain_monitor_conv);
32658 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
32659 CHECK_ACCESS(tx_broadcaster_ptr);
32660 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
32661 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
32662 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
32663 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
32665 void* logger_ptr = untag_ptr(logger);
32666 CHECK_ACCESS(logger_ptr);
32667 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
32668 if (logger_conv.free == LDKLogger_JCalls_free) {
32669 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
32670 LDKLogger_JCalls_cloned(&logger_conv);
32672 LDKUserConfig default_config_conv;
32673 default_config_conv.inner = untag_ptr(default_config);
32674 default_config_conv.is_owned = ptr_is_owned(default_config);
32675 CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv);
32676 default_config_conv = UserConfig_clone(&default_config_conv);
32677 LDKCVec_ChannelMonitorZ channel_monitors_constr;
32678 channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors);
32679 if (channel_monitors_constr.datalen > 0)
32680 channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
32682 channel_monitors_constr.data = NULL;
32683 int64_t* channel_monitors_vals = (*env)->GetLongArrayElements (env, channel_monitors, NULL);
32684 for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
32685 int64_t channel_monitors_conv_16 = channel_monitors_vals[q];
32686 LDKChannelMonitor channel_monitors_conv_16_conv;
32687 channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16);
32688 channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16);
32689 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
32690 channel_monitors_conv_16_conv.is_owned = false;
32691 channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
32693 (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0);
32694 LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
32695 int64_t ret_ref = 0;
32696 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32697 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
32702 LDKu8slice ser_ref;
32703 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
32704 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
32705 LDKChannelManagerReadArgs arg_conv;
32706 arg_conv.inner = untag_ptr(arg);
32707 arg_conv.is_owned = ptr_is_owned(arg);
32708 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32709 // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
32711 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
32712 *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
32713 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
32714 return tag_ptr(ret_conv, true);
32717 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32718 LDKExpandedKey this_obj_conv;
32719 this_obj_conv.inner = untag_ptr(this_obj);
32720 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32722 ExpandedKey_free(this_obj_conv);
32725 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1new(JNIEnv *env, jclass clz, int8_tArray key_material) {
32726 unsigned char key_material_arr[32];
32727 CHECK((*env)->GetArrayLength(env, key_material) == 32);
32728 (*env)->GetByteArrayRegion(env, key_material, 0, 32, key_material_arr);
32729 unsigned char (*key_material_ref)[32] = &key_material_arr;
32730 LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref);
32731 int64_t ret_ref = 0;
32732 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32733 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32737 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create(JNIEnv *env, jclass clz, int64_t keys, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t keys_manager, int64_t current_time) {
32738 LDKExpandedKey keys_conv;
32739 keys_conv.inner = untag_ptr(keys);
32740 keys_conv.is_owned = ptr_is_owned(keys);
32741 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
32742 keys_conv.is_owned = false;
32743 void* min_value_msat_ptr = untag_ptr(min_value_msat);
32744 CHECK_ACCESS(min_value_msat_ptr);
32745 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
32746 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
32747 void* keys_manager_ptr = untag_ptr(keys_manager);
32748 if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
32749 LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
32750 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
32751 *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, keys_manager_conv, current_time);
32752 return tag_ptr(ret_conv, true);
32755 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1from_1hash(JNIEnv *env, jclass clz, int64_t keys, int64_t min_value_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t current_time) {
32756 LDKExpandedKey keys_conv;
32757 keys_conv.inner = untag_ptr(keys);
32758 keys_conv.is_owned = ptr_is_owned(keys);
32759 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
32760 keys_conv.is_owned = false;
32761 void* min_value_msat_ptr = untag_ptr(min_value_msat);
32762 CHECK_ACCESS(min_value_msat_ptr);
32763 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
32764 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
32765 LDKThirtyTwoBytes payment_hash_ref;
32766 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32767 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
32768 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
32769 *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time);
32770 return tag_ptr(ret_conv, true);
32773 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
32774 if (!ptr_is_owned(this_ptr)) return;
32775 void* this_ptr_ptr = untag_ptr(this_ptr);
32776 CHECK_ACCESS(this_ptr_ptr);
32777 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)(this_ptr_ptr);
32778 FREE(untag_ptr(this_ptr));
32779 DecodeError_free(this_ptr_conv);
32782 static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
32783 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
32784 *ret_copy = DecodeError_clone(arg);
32785 int64_t ret_ref = tag_ptr(ret_copy, true);
32788 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32789 LDKDecodeError* arg_conv = (LDKDecodeError*)untag_ptr(arg);
32790 int64_t ret_conv = DecodeError_clone_ptr(arg_conv);
32794 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32795 LDKDecodeError* orig_conv = (LDKDecodeError*)untag_ptr(orig);
32796 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
32797 *ret_copy = DecodeError_clone(orig_conv);
32798 int64_t ret_ref = tag_ptr(ret_copy, true);
32802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1version(JNIEnv *env, jclass clz) {
32803 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
32804 *ret_copy = DecodeError_unknown_version();
32805 int64_t ret_ref = tag_ptr(ret_copy, true);
32809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1required_1feature(JNIEnv *env, jclass clz) {
32810 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
32811 *ret_copy = DecodeError_unknown_required_feature();
32812 int64_t ret_ref = tag_ptr(ret_copy, true);
32816 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1invalid_1value(JNIEnv *env, jclass clz) {
32817 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
32818 *ret_copy = DecodeError_invalid_value();
32819 int64_t ret_ref = tag_ptr(ret_copy, true);
32823 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1short_1read(JNIEnv *env, jclass clz) {
32824 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
32825 *ret_copy = DecodeError_short_read();
32826 int64_t ret_ref = tag_ptr(ret_copy, true);
32830 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1bad_1length_1descriptor(JNIEnv *env, jclass clz) {
32831 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
32832 *ret_copy = DecodeError_bad_length_descriptor();
32833 int64_t ret_ref = tag_ptr(ret_copy, true);
32837 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1io(JNIEnv *env, jclass clz, jclass a) {
32838 LDKIOError a_conv = LDKIOError_from_java(env, a);
32839 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
32840 *ret_copy = DecodeError_io(a_conv);
32841 int64_t ret_ref = tag_ptr(ret_copy, true);
32845 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unsupported_1compression(JNIEnv *env, jclass clz) {
32846 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
32847 *ret_copy = DecodeError_unsupported_compression();
32848 int64_t ret_ref = tag_ptr(ret_copy, true);
32852 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DecodeError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
32853 LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a);
32854 LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b);
32855 jboolean ret_conv = DecodeError_eq(a_conv, b_conv);
32859 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32860 LDKInit this_obj_conv;
32861 this_obj_conv.inner = untag_ptr(this_obj);
32862 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32863 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32864 Init_free(this_obj_conv);
32867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
32868 LDKInit this_ptr_conv;
32869 this_ptr_conv.inner = untag_ptr(this_ptr);
32870 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32872 this_ptr_conv.is_owned = false;
32873 LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
32874 int64_t ret_ref = 0;
32875 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32876 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32880 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32881 LDKInit this_ptr_conv;
32882 this_ptr_conv.inner = untag_ptr(this_ptr);
32883 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32884 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32885 this_ptr_conv.is_owned = false;
32886 LDKInitFeatures val_conv;
32887 val_conv.inner = untag_ptr(val);
32888 val_conv.is_owned = ptr_is_owned(val);
32889 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32890 val_conv = InitFeatures_clone(&val_conv);
32891 Init_set_features(&this_ptr_conv, val_conv);
32894 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr) {
32895 LDKInit this_ptr_conv;
32896 this_ptr_conv.inner = untag_ptr(this_ptr);
32897 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32899 this_ptr_conv.is_owned = false;
32900 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
32901 *ret_copy = Init_get_remote_network_address(&this_ptr_conv);
32902 int64_t ret_ref = tag_ptr(ret_copy, true);
32906 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32907 LDKInit this_ptr_conv;
32908 this_ptr_conv.inner = untag_ptr(this_ptr);
32909 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32910 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32911 this_ptr_conv.is_owned = false;
32912 void* val_ptr = untag_ptr(val);
32913 CHECK_ACCESS(val_ptr);
32914 LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr);
32915 val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(val));
32916 Init_set_remote_network_address(&this_ptr_conv, val_conv);
32919 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jclass clz, int64_t features_arg, int64_t remote_network_address_arg) {
32920 LDKInitFeatures features_arg_conv;
32921 features_arg_conv.inner = untag_ptr(features_arg);
32922 features_arg_conv.is_owned = ptr_is_owned(features_arg);
32923 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
32924 features_arg_conv = InitFeatures_clone(&features_arg_conv);
32925 void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg);
32926 CHECK_ACCESS(remote_network_address_arg_ptr);
32927 LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr);
32928 LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv);
32929 int64_t ret_ref = 0;
32930 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32931 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32935 static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) {
32936 LDKInit ret_var = Init_clone(arg);
32937 int64_t ret_ref = 0;
32938 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32939 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32942 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32944 arg_conv.inner = untag_ptr(arg);
32945 arg_conv.is_owned = ptr_is_owned(arg);
32946 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32947 arg_conv.is_owned = false;
32948 int64_t ret_conv = Init_clone_ptr(&arg_conv);
32952 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32954 orig_conv.inner = untag_ptr(orig);
32955 orig_conv.is_owned = ptr_is_owned(orig);
32956 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32957 orig_conv.is_owned = false;
32958 LDKInit ret_var = Init_clone(&orig_conv);
32959 int64_t ret_ref = 0;
32960 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32961 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32965 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Init_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
32967 a_conv.inner = untag_ptr(a);
32968 a_conv.is_owned = ptr_is_owned(a);
32969 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
32970 a_conv.is_owned = false;
32972 b_conv.inner = untag_ptr(b);
32973 b_conv.is_owned = ptr_is_owned(b);
32974 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
32975 b_conv.is_owned = false;
32976 jboolean ret_conv = Init_eq(&a_conv, &b_conv);
32980 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32981 LDKErrorMessage this_obj_conv;
32982 this_obj_conv.inner = untag_ptr(this_obj);
32983 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32985 ErrorMessage_free(this_obj_conv);
32988 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32989 LDKErrorMessage this_ptr_conv;
32990 this_ptr_conv.inner = untag_ptr(this_ptr);
32991 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32993 this_ptr_conv.is_owned = false;
32994 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32995 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv));
32999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33000 LDKErrorMessage this_ptr_conv;
33001 this_ptr_conv.inner = untag_ptr(this_ptr);
33002 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33004 this_ptr_conv.is_owned = false;
33005 LDKThirtyTwoBytes val_ref;
33006 CHECK((*env)->GetArrayLength(env, val) == 32);
33007 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33008 ErrorMessage_set_channel_id(&this_ptr_conv, val_ref);
33011 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
33012 LDKErrorMessage this_ptr_conv;
33013 this_ptr_conv.inner = untag_ptr(this_ptr);
33014 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33016 this_ptr_conv.is_owned = false;
33017 LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
33018 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
33023 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
33024 LDKErrorMessage this_ptr_conv;
33025 this_ptr_conv.inner = untag_ptr(this_ptr);
33026 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33027 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33028 this_ptr_conv.is_owned = false;
33029 LDKStr val_conv = java_to_owned_str(env, val);
33030 ErrorMessage_set_data(&this_ptr_conv, val_conv);
33033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) {
33034 LDKThirtyTwoBytes channel_id_arg_ref;
33035 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
33036 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
33037 LDKStr data_arg_conv = java_to_owned_str(env, data_arg);
33038 LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
33039 int64_t ret_ref = 0;
33040 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33041 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33045 static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) {
33046 LDKErrorMessage ret_var = ErrorMessage_clone(arg);
33047 int64_t ret_ref = 0;
33048 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33049 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33052 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33053 LDKErrorMessage arg_conv;
33054 arg_conv.inner = untag_ptr(arg);
33055 arg_conv.is_owned = ptr_is_owned(arg);
33056 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33057 arg_conv.is_owned = false;
33058 int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv);
33062 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33063 LDKErrorMessage orig_conv;
33064 orig_conv.inner = untag_ptr(orig);
33065 orig_conv.is_owned = ptr_is_owned(orig);
33066 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33067 orig_conv.is_owned = false;
33068 LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv);
33069 int64_t ret_ref = 0;
33070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33075 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
33076 LDKErrorMessage a_conv;
33077 a_conv.inner = untag_ptr(a);
33078 a_conv.is_owned = ptr_is_owned(a);
33079 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33080 a_conv.is_owned = false;
33081 LDKErrorMessage b_conv;
33082 b_conv.inner = untag_ptr(b);
33083 b_conv.is_owned = ptr_is_owned(b);
33084 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33085 b_conv.is_owned = false;
33086 jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv);
33090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33091 LDKWarningMessage this_obj_conv;
33092 this_obj_conv.inner = untag_ptr(this_obj);
33093 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33095 WarningMessage_free(this_obj_conv);
33098 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
33099 LDKWarningMessage this_ptr_conv;
33100 this_ptr_conv.inner = untag_ptr(this_ptr);
33101 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33103 this_ptr_conv.is_owned = false;
33104 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33105 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *WarningMessage_get_channel_id(&this_ptr_conv));
33109 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33110 LDKWarningMessage this_ptr_conv;
33111 this_ptr_conv.inner = untag_ptr(this_ptr);
33112 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33114 this_ptr_conv.is_owned = false;
33115 LDKThirtyTwoBytes val_ref;
33116 CHECK((*env)->GetArrayLength(env, val) == 32);
33117 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33118 WarningMessage_set_channel_id(&this_ptr_conv, val_ref);
33121 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
33122 LDKWarningMessage this_ptr_conv;
33123 this_ptr_conv.inner = untag_ptr(this_ptr);
33124 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33125 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33126 this_ptr_conv.is_owned = false;
33127 LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv);
33128 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
33133 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
33134 LDKWarningMessage this_ptr_conv;
33135 this_ptr_conv.inner = untag_ptr(this_ptr);
33136 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33137 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33138 this_ptr_conv.is_owned = false;
33139 LDKStr val_conv = java_to_owned_str(env, val);
33140 WarningMessage_set_data(&this_ptr_conv, val_conv);
33143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) {
33144 LDKThirtyTwoBytes channel_id_arg_ref;
33145 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
33146 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
33147 LDKStr data_arg_conv = java_to_owned_str(env, data_arg);
33148 LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv);
33149 int64_t ret_ref = 0;
33150 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33151 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33155 static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) {
33156 LDKWarningMessage ret_var = WarningMessage_clone(arg);
33157 int64_t ret_ref = 0;
33158 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33159 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33163 LDKWarningMessage arg_conv;
33164 arg_conv.inner = untag_ptr(arg);
33165 arg_conv.is_owned = ptr_is_owned(arg);
33166 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33167 arg_conv.is_owned = false;
33168 int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv);
33172 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33173 LDKWarningMessage orig_conv;
33174 orig_conv.inner = untag_ptr(orig);
33175 orig_conv.is_owned = ptr_is_owned(orig);
33176 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33177 orig_conv.is_owned = false;
33178 LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv);
33179 int64_t ret_ref = 0;
33180 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33181 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33185 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WarningMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
33186 LDKWarningMessage a_conv;
33187 a_conv.inner = untag_ptr(a);
33188 a_conv.is_owned = ptr_is_owned(a);
33189 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33190 a_conv.is_owned = false;
33191 LDKWarningMessage b_conv;
33192 b_conv.inner = untag_ptr(b);
33193 b_conv.is_owned = ptr_is_owned(b);
33194 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33195 b_conv.is_owned = false;
33196 jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv);
33200 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33201 LDKPing this_obj_conv;
33202 this_obj_conv.inner = untag_ptr(this_obj);
33203 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33205 Ping_free(this_obj_conv);
33208 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) {
33209 LDKPing this_ptr_conv;
33210 this_ptr_conv.inner = untag_ptr(this_ptr);
33211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33213 this_ptr_conv.is_owned = false;
33214 int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv);
33218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
33219 LDKPing this_ptr_conv;
33220 this_ptr_conv.inner = untag_ptr(this_ptr);
33221 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33223 this_ptr_conv.is_owned = false;
33224 Ping_set_ponglen(&this_ptr_conv, val);
33227 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) {
33228 LDKPing this_ptr_conv;
33229 this_ptr_conv.inner = untag_ptr(this_ptr);
33230 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33232 this_ptr_conv.is_owned = false;
33233 int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv);
33237 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
33238 LDKPing this_ptr_conv;
33239 this_ptr_conv.inner = untag_ptr(this_ptr);
33240 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33242 this_ptr_conv.is_owned = false;
33243 Ping_set_byteslen(&this_ptr_conv, val);
33246 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) {
33247 LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg);
33248 int64_t ret_ref = 0;
33249 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33250 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33254 static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) {
33255 LDKPing ret_var = Ping_clone(arg);
33256 int64_t ret_ref = 0;
33257 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33258 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33261 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33263 arg_conv.inner = untag_ptr(arg);
33264 arg_conv.is_owned = ptr_is_owned(arg);
33265 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33266 arg_conv.is_owned = false;
33267 int64_t ret_conv = Ping_clone_ptr(&arg_conv);
33271 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33273 orig_conv.inner = untag_ptr(orig);
33274 orig_conv.is_owned = ptr_is_owned(orig);
33275 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33276 orig_conv.is_owned = false;
33277 LDKPing ret_var = Ping_clone(&orig_conv);
33278 int64_t ret_ref = 0;
33279 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33280 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33284 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Ping_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
33286 a_conv.inner = untag_ptr(a);
33287 a_conv.is_owned = ptr_is_owned(a);
33288 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33289 a_conv.is_owned = false;
33291 b_conv.inner = untag_ptr(b);
33292 b_conv.is_owned = ptr_is_owned(b);
33293 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33294 b_conv.is_owned = false;
33295 jboolean ret_conv = Ping_eq(&a_conv, &b_conv);
33299 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33300 LDKPong this_obj_conv;
33301 this_obj_conv.inner = untag_ptr(this_obj);
33302 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33304 Pong_free(this_obj_conv);
33307 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) {
33308 LDKPong this_ptr_conv;
33309 this_ptr_conv.inner = untag_ptr(this_ptr);
33310 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33312 this_ptr_conv.is_owned = false;
33313 int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv);
33317 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
33318 LDKPong this_ptr_conv;
33319 this_ptr_conv.inner = untag_ptr(this_ptr);
33320 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33322 this_ptr_conv.is_owned = false;
33323 Pong_set_byteslen(&this_ptr_conv, val);
33326 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) {
33327 LDKPong ret_var = Pong_new(byteslen_arg);
33328 int64_t ret_ref = 0;
33329 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33330 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33334 static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) {
33335 LDKPong ret_var = Pong_clone(arg);
33336 int64_t ret_ref = 0;
33337 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33338 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33341 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33343 arg_conv.inner = untag_ptr(arg);
33344 arg_conv.is_owned = ptr_is_owned(arg);
33345 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33346 arg_conv.is_owned = false;
33347 int64_t ret_conv = Pong_clone_ptr(&arg_conv);
33351 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33353 orig_conv.inner = untag_ptr(orig);
33354 orig_conv.is_owned = ptr_is_owned(orig);
33355 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33356 orig_conv.is_owned = false;
33357 LDKPong ret_var = Pong_clone(&orig_conv);
33358 int64_t ret_ref = 0;
33359 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33360 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33364 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Pong_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
33366 a_conv.inner = untag_ptr(a);
33367 a_conv.is_owned = ptr_is_owned(a);
33368 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33369 a_conv.is_owned = false;
33371 b_conv.inner = untag_ptr(b);
33372 b_conv.is_owned = ptr_is_owned(b);
33373 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33374 b_conv.is_owned = false;
33375 jboolean ret_conv = Pong_eq(&a_conv, &b_conv);
33379 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33380 LDKOpenChannel this_obj_conv;
33381 this_obj_conv.inner = untag_ptr(this_obj);
33382 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33384 OpenChannel_free(this_obj_conv);
33387 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
33388 LDKOpenChannel this_ptr_conv;
33389 this_ptr_conv.inner = untag_ptr(this_ptr);
33390 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33392 this_ptr_conv.is_owned = false;
33393 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33394 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv));
33398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33399 LDKOpenChannel this_ptr_conv;
33400 this_ptr_conv.inner = untag_ptr(this_ptr);
33401 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33402 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33403 this_ptr_conv.is_owned = false;
33404 LDKThirtyTwoBytes val_ref;
33405 CHECK((*env)->GetArrayLength(env, val) == 32);
33406 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33407 OpenChannel_set_chain_hash(&this_ptr_conv, val_ref);
33410 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
33411 LDKOpenChannel this_ptr_conv;
33412 this_ptr_conv.inner = untag_ptr(this_ptr);
33413 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33415 this_ptr_conv.is_owned = false;
33416 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33417 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv));
33421 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33422 LDKOpenChannel this_ptr_conv;
33423 this_ptr_conv.inner = untag_ptr(this_ptr);
33424 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33426 this_ptr_conv.is_owned = false;
33427 LDKThirtyTwoBytes val_ref;
33428 CHECK((*env)->GetArrayLength(env, val) == 32);
33429 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33430 OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
33433 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
33434 LDKOpenChannel this_ptr_conv;
33435 this_ptr_conv.inner = untag_ptr(this_ptr);
33436 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33438 this_ptr_conv.is_owned = false;
33439 int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv);
33443 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33444 LDKOpenChannel this_ptr_conv;
33445 this_ptr_conv.inner = untag_ptr(this_ptr);
33446 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33448 this_ptr_conv.is_owned = false;
33449 OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
33452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
33453 LDKOpenChannel this_ptr_conv;
33454 this_ptr_conv.inner = untag_ptr(this_ptr);
33455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33457 this_ptr_conv.is_owned = false;
33458 int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv);
33462 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33463 LDKOpenChannel this_ptr_conv;
33464 this_ptr_conv.inner = untag_ptr(this_ptr);
33465 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33467 this_ptr_conv.is_owned = false;
33468 OpenChannel_set_push_msat(&this_ptr_conv, val);
33471 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
33472 LDKOpenChannel this_ptr_conv;
33473 this_ptr_conv.inner = untag_ptr(this_ptr);
33474 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33476 this_ptr_conv.is_owned = false;
33477 int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
33481 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33482 LDKOpenChannel this_ptr_conv;
33483 this_ptr_conv.inner = untag_ptr(this_ptr);
33484 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33486 this_ptr_conv.is_owned = false;
33487 OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
33490 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
33491 LDKOpenChannel this_ptr_conv;
33492 this_ptr_conv.inner = untag_ptr(this_ptr);
33493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33495 this_ptr_conv.is_owned = false;
33496 int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
33500 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33501 LDKOpenChannel this_ptr_conv;
33502 this_ptr_conv.inner = untag_ptr(this_ptr);
33503 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33505 this_ptr_conv.is_owned = false;
33506 OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
33509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
33510 LDKOpenChannel this_ptr_conv;
33511 this_ptr_conv.inner = untag_ptr(this_ptr);
33512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33514 this_ptr_conv.is_owned = false;
33515 int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
33519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33520 LDKOpenChannel this_ptr_conv;
33521 this_ptr_conv.inner = untag_ptr(this_ptr);
33522 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33524 this_ptr_conv.is_owned = false;
33525 OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
33528 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
33529 LDKOpenChannel this_ptr_conv;
33530 this_ptr_conv.inner = untag_ptr(this_ptr);
33531 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33533 this_ptr_conv.is_owned = false;
33534 int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
33538 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33539 LDKOpenChannel this_ptr_conv;
33540 this_ptr_conv.inner = untag_ptr(this_ptr);
33541 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33543 this_ptr_conv.is_owned = false;
33544 OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
33547 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) {
33548 LDKOpenChannel this_ptr_conv;
33549 this_ptr_conv.inner = untag_ptr(this_ptr);
33550 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33552 this_ptr_conv.is_owned = false;
33553 int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
33557 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
33558 LDKOpenChannel this_ptr_conv;
33559 this_ptr_conv.inner = untag_ptr(this_ptr);
33560 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33562 this_ptr_conv.is_owned = false;
33563 OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
33566 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
33567 LDKOpenChannel this_ptr_conv;
33568 this_ptr_conv.inner = untag_ptr(this_ptr);
33569 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33570 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33571 this_ptr_conv.is_owned = false;
33572 int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv);
33576 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
33577 LDKOpenChannel this_ptr_conv;
33578 this_ptr_conv.inner = untag_ptr(this_ptr);
33579 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33580 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33581 this_ptr_conv.is_owned = false;
33582 OpenChannel_set_to_self_delay(&this_ptr_conv, val);
33585 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
33586 LDKOpenChannel this_ptr_conv;
33587 this_ptr_conv.inner = untag_ptr(this_ptr);
33588 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33590 this_ptr_conv.is_owned = false;
33591 int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
33595 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
33596 LDKOpenChannel this_ptr_conv;
33597 this_ptr_conv.inner = untag_ptr(this_ptr);
33598 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33600 this_ptr_conv.is_owned = false;
33601 OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
33604 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
33605 LDKOpenChannel this_ptr_conv;
33606 this_ptr_conv.inner = untag_ptr(this_ptr);
33607 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33608 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33609 this_ptr_conv.is_owned = false;
33610 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33611 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
33615 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33616 LDKOpenChannel this_ptr_conv;
33617 this_ptr_conv.inner = untag_ptr(this_ptr);
33618 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33619 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33620 this_ptr_conv.is_owned = false;
33621 LDKPublicKey val_ref;
33622 CHECK((*env)->GetArrayLength(env, val) == 33);
33623 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33624 OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
33627 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
33628 LDKOpenChannel this_ptr_conv;
33629 this_ptr_conv.inner = untag_ptr(this_ptr);
33630 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33631 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33632 this_ptr_conv.is_owned = false;
33633 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33634 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
33638 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33639 LDKOpenChannel this_ptr_conv;
33640 this_ptr_conv.inner = untag_ptr(this_ptr);
33641 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33643 this_ptr_conv.is_owned = false;
33644 LDKPublicKey val_ref;
33645 CHECK((*env)->GetArrayLength(env, val) == 33);
33646 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33647 OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
33650 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
33651 LDKOpenChannel this_ptr_conv;
33652 this_ptr_conv.inner = untag_ptr(this_ptr);
33653 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33655 this_ptr_conv.is_owned = false;
33656 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33657 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form);
33661 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33662 LDKOpenChannel this_ptr_conv;
33663 this_ptr_conv.inner = untag_ptr(this_ptr);
33664 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33666 this_ptr_conv.is_owned = false;
33667 LDKPublicKey val_ref;
33668 CHECK((*env)->GetArrayLength(env, val) == 33);
33669 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33670 OpenChannel_set_payment_point(&this_ptr_conv, val_ref);
33673 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
33674 LDKOpenChannel this_ptr_conv;
33675 this_ptr_conv.inner = untag_ptr(this_ptr);
33676 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33677 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33678 this_ptr_conv.is_owned = false;
33679 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33680 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
33684 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33685 LDKOpenChannel this_ptr_conv;
33686 this_ptr_conv.inner = untag_ptr(this_ptr);
33687 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33689 this_ptr_conv.is_owned = false;
33690 LDKPublicKey val_ref;
33691 CHECK((*env)->GetArrayLength(env, val) == 33);
33692 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33693 OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
33696 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
33697 LDKOpenChannel this_ptr_conv;
33698 this_ptr_conv.inner = untag_ptr(this_ptr);
33699 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33700 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33701 this_ptr_conv.is_owned = false;
33702 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33703 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
33707 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33708 LDKOpenChannel this_ptr_conv;
33709 this_ptr_conv.inner = untag_ptr(this_ptr);
33710 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33711 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33712 this_ptr_conv.is_owned = false;
33713 LDKPublicKey val_ref;
33714 CHECK((*env)->GetArrayLength(env, val) == 33);
33715 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33716 OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
33719 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
33720 LDKOpenChannel this_ptr_conv;
33721 this_ptr_conv.inner = untag_ptr(this_ptr);
33722 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33724 this_ptr_conv.is_owned = false;
33725 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33726 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
33730 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33731 LDKOpenChannel this_ptr_conv;
33732 this_ptr_conv.inner = untag_ptr(this_ptr);
33733 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33734 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33735 this_ptr_conv.is_owned = false;
33736 LDKPublicKey val_ref;
33737 CHECK((*env)->GetArrayLength(env, val) == 33);
33738 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33739 OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
33742 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) {
33743 LDKOpenChannel this_ptr_conv;
33744 this_ptr_conv.inner = untag_ptr(this_ptr);
33745 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33747 this_ptr_conv.is_owned = false;
33748 int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv);
33752 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
33753 LDKOpenChannel this_ptr_conv;
33754 this_ptr_conv.inner = untag_ptr(this_ptr);
33755 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33756 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33757 this_ptr_conv.is_owned = false;
33758 OpenChannel_set_channel_flags(&this_ptr_conv, val);
33761 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
33762 LDKOpenChannel this_ptr_conv;
33763 this_ptr_conv.inner = untag_ptr(this_ptr);
33764 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33765 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33766 this_ptr_conv.is_owned = false;
33767 LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
33768 int64_t ret_ref = 0;
33769 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33770 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33774 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33775 LDKOpenChannel this_ptr_conv;
33776 this_ptr_conv.inner = untag_ptr(this_ptr);
33777 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33779 this_ptr_conv.is_owned = false;
33780 LDKChannelTypeFeatures val_conv;
33781 val_conv.inner = untag_ptr(val);
33782 val_conv.is_owned = ptr_is_owned(val);
33783 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
33784 val_conv = ChannelTypeFeatures_clone(&val_conv);
33785 OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
33788 static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
33789 LDKOpenChannel ret_var = OpenChannel_clone(arg);
33790 int64_t ret_ref = 0;
33791 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33792 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33795 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33796 LDKOpenChannel arg_conv;
33797 arg_conv.inner = untag_ptr(arg);
33798 arg_conv.is_owned = ptr_is_owned(arg);
33799 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33800 arg_conv.is_owned = false;
33801 int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv);
33805 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33806 LDKOpenChannel orig_conv;
33807 orig_conv.inner = untag_ptr(orig);
33808 orig_conv.is_owned = ptr_is_owned(orig);
33809 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33810 orig_conv.is_owned = false;
33811 LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
33812 int64_t ret_ref = 0;
33813 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33814 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33818 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OpenChannel_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
33819 LDKOpenChannel a_conv;
33820 a_conv.inner = untag_ptr(a);
33821 a_conv.is_owned = ptr_is_owned(a);
33822 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
33823 a_conv.is_owned = false;
33824 LDKOpenChannel b_conv;
33825 b_conv.inner = untag_ptr(b);
33826 b_conv.is_owned = ptr_is_owned(b);
33827 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
33828 b_conv.is_owned = false;
33829 jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv);
33833 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33834 LDKAcceptChannel this_obj_conv;
33835 this_obj_conv.inner = untag_ptr(this_obj);
33836 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33838 AcceptChannel_free(this_obj_conv);
33841 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
33842 LDKAcceptChannel this_ptr_conv;
33843 this_ptr_conv.inner = untag_ptr(this_ptr);
33844 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33845 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33846 this_ptr_conv.is_owned = false;
33847 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33848 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv));
33852 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33853 LDKAcceptChannel this_ptr_conv;
33854 this_ptr_conv.inner = untag_ptr(this_ptr);
33855 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33856 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33857 this_ptr_conv.is_owned = false;
33858 LDKThirtyTwoBytes val_ref;
33859 CHECK((*env)->GetArrayLength(env, val) == 32);
33860 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33861 AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
33864 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
33865 LDKAcceptChannel this_ptr_conv;
33866 this_ptr_conv.inner = untag_ptr(this_ptr);
33867 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33868 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33869 this_ptr_conv.is_owned = false;
33870 int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
33874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33875 LDKAcceptChannel this_ptr_conv;
33876 this_ptr_conv.inner = untag_ptr(this_ptr);
33877 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33878 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33879 this_ptr_conv.is_owned = false;
33880 AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
33883 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
33884 LDKAcceptChannel this_ptr_conv;
33885 this_ptr_conv.inner = untag_ptr(this_ptr);
33886 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33888 this_ptr_conv.is_owned = false;
33889 int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
33893 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33894 LDKAcceptChannel this_ptr_conv;
33895 this_ptr_conv.inner = untag_ptr(this_ptr);
33896 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33897 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33898 this_ptr_conv.is_owned = false;
33899 AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
33902 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
33903 LDKAcceptChannel this_ptr_conv;
33904 this_ptr_conv.inner = untag_ptr(this_ptr);
33905 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33906 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33907 this_ptr_conv.is_owned = false;
33908 int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
33912 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33913 LDKAcceptChannel this_ptr_conv;
33914 this_ptr_conv.inner = untag_ptr(this_ptr);
33915 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33917 this_ptr_conv.is_owned = false;
33918 AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
33921 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
33922 LDKAcceptChannel this_ptr_conv;
33923 this_ptr_conv.inner = untag_ptr(this_ptr);
33924 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33926 this_ptr_conv.is_owned = false;
33927 int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
33931 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33932 LDKAcceptChannel this_ptr_conv;
33933 this_ptr_conv.inner = untag_ptr(this_ptr);
33934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33936 this_ptr_conv.is_owned = false;
33937 AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
33940 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
33941 LDKAcceptChannel this_ptr_conv;
33942 this_ptr_conv.inner = untag_ptr(this_ptr);
33943 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33945 this_ptr_conv.is_owned = false;
33946 int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv);
33950 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
33951 LDKAcceptChannel this_ptr_conv;
33952 this_ptr_conv.inner = untag_ptr(this_ptr);
33953 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33955 this_ptr_conv.is_owned = false;
33956 AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
33959 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
33960 LDKAcceptChannel this_ptr_conv;
33961 this_ptr_conv.inner = untag_ptr(this_ptr);
33962 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33964 this_ptr_conv.is_owned = false;
33965 int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv);
33969 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
33970 LDKAcceptChannel this_ptr_conv;
33971 this_ptr_conv.inner = untag_ptr(this_ptr);
33972 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33974 this_ptr_conv.is_owned = false;
33975 AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
33978 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
33979 LDKAcceptChannel this_ptr_conv;
33980 this_ptr_conv.inner = untag_ptr(this_ptr);
33981 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33983 this_ptr_conv.is_owned = false;
33984 int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
33988 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
33989 LDKAcceptChannel this_ptr_conv;
33990 this_ptr_conv.inner = untag_ptr(this_ptr);
33991 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33993 this_ptr_conv.is_owned = false;
33994 AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
33997 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
33998 LDKAcceptChannel this_ptr_conv;
33999 this_ptr_conv.inner = untag_ptr(this_ptr);
34000 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34002 this_ptr_conv.is_owned = false;
34003 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
34004 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
34008 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34009 LDKAcceptChannel this_ptr_conv;
34010 this_ptr_conv.inner = untag_ptr(this_ptr);
34011 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34012 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34013 this_ptr_conv.is_owned = false;
34014 LDKPublicKey val_ref;
34015 CHECK((*env)->GetArrayLength(env, val) == 33);
34016 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
34017 AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
34020 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
34021 LDKAcceptChannel this_ptr_conv;
34022 this_ptr_conv.inner = untag_ptr(this_ptr);
34023 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34025 this_ptr_conv.is_owned = false;
34026 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
34027 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
34031 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34032 LDKAcceptChannel this_ptr_conv;
34033 this_ptr_conv.inner = untag_ptr(this_ptr);
34034 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34036 this_ptr_conv.is_owned = false;
34037 LDKPublicKey val_ref;
34038 CHECK((*env)->GetArrayLength(env, val) == 33);
34039 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
34040 AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
34043 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
34044 LDKAcceptChannel this_ptr_conv;
34045 this_ptr_conv.inner = untag_ptr(this_ptr);
34046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34048 this_ptr_conv.is_owned = false;
34049 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
34050 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form);
34054 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34055 LDKAcceptChannel this_ptr_conv;
34056 this_ptr_conv.inner = untag_ptr(this_ptr);
34057 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34058 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34059 this_ptr_conv.is_owned = false;
34060 LDKPublicKey val_ref;
34061 CHECK((*env)->GetArrayLength(env, val) == 33);
34062 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
34063 AcceptChannel_set_payment_point(&this_ptr_conv, val_ref);
34066 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
34067 LDKAcceptChannel this_ptr_conv;
34068 this_ptr_conv.inner = untag_ptr(this_ptr);
34069 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34070 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34071 this_ptr_conv.is_owned = false;
34072 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
34073 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
34077 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34078 LDKAcceptChannel this_ptr_conv;
34079 this_ptr_conv.inner = untag_ptr(this_ptr);
34080 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34081 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34082 this_ptr_conv.is_owned = false;
34083 LDKPublicKey val_ref;
34084 CHECK((*env)->GetArrayLength(env, val) == 33);
34085 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
34086 AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
34089 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
34090 LDKAcceptChannel this_ptr_conv;
34091 this_ptr_conv.inner = untag_ptr(this_ptr);
34092 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34093 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34094 this_ptr_conv.is_owned = false;
34095 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
34096 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
34100 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34101 LDKAcceptChannel this_ptr_conv;
34102 this_ptr_conv.inner = untag_ptr(this_ptr);
34103 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34105 this_ptr_conv.is_owned = false;
34106 LDKPublicKey val_ref;
34107 CHECK((*env)->GetArrayLength(env, val) == 33);
34108 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
34109 AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
34112 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
34113 LDKAcceptChannel this_ptr_conv;
34114 this_ptr_conv.inner = untag_ptr(this_ptr);
34115 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34117 this_ptr_conv.is_owned = false;
34118 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
34119 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
34123 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34124 LDKAcceptChannel this_ptr_conv;
34125 this_ptr_conv.inner = untag_ptr(this_ptr);
34126 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34127 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34128 this_ptr_conv.is_owned = false;
34129 LDKPublicKey val_ref;
34130 CHECK((*env)->GetArrayLength(env, val) == 33);
34131 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
34132 AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
34135 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
34136 LDKAcceptChannel this_ptr_conv;
34137 this_ptr_conv.inner = untag_ptr(this_ptr);
34138 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34140 this_ptr_conv.is_owned = false;
34141 LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv);
34142 int64_t ret_ref = 0;
34143 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34144 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34148 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34149 LDKAcceptChannel this_ptr_conv;
34150 this_ptr_conv.inner = untag_ptr(this_ptr);
34151 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34153 this_ptr_conv.is_owned = false;
34154 LDKChannelTypeFeatures val_conv;
34155 val_conv.inner = untag_ptr(val);
34156 val_conv.is_owned = ptr_is_owned(val);
34157 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34158 val_conv = ChannelTypeFeatures_clone(&val_conv);
34159 AcceptChannel_set_channel_type(&this_ptr_conv, val_conv);
34162 static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) {
34163 LDKAcceptChannel ret_var = AcceptChannel_clone(arg);
34164 int64_t ret_ref = 0;
34165 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34166 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34169 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34170 LDKAcceptChannel arg_conv;
34171 arg_conv.inner = untag_ptr(arg);
34172 arg_conv.is_owned = ptr_is_owned(arg);
34173 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34174 arg_conv.is_owned = false;
34175 int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv);
34179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34180 LDKAcceptChannel orig_conv;
34181 orig_conv.inner = untag_ptr(orig);
34182 orig_conv.is_owned = ptr_is_owned(orig);
34183 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34184 orig_conv.is_owned = false;
34185 LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
34186 int64_t ret_ref = 0;
34187 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34188 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34192 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34193 LDKAcceptChannel a_conv;
34194 a_conv.inner = untag_ptr(a);
34195 a_conv.is_owned = ptr_is_owned(a);
34196 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34197 a_conv.is_owned = false;
34198 LDKAcceptChannel b_conv;
34199 b_conv.inner = untag_ptr(b);
34200 b_conv.is_owned = ptr_is_owned(b);
34201 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34202 b_conv.is_owned = false;
34203 jboolean ret_conv = AcceptChannel_eq(&a_conv, &b_conv);
34207 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34208 LDKFundingCreated this_obj_conv;
34209 this_obj_conv.inner = untag_ptr(this_obj);
34210 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34211 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34212 FundingCreated_free(this_obj_conv);
34215 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
34216 LDKFundingCreated this_ptr_conv;
34217 this_ptr_conv.inner = untag_ptr(this_ptr);
34218 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34220 this_ptr_conv.is_owned = false;
34221 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34222 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv));
34226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34227 LDKFundingCreated this_ptr_conv;
34228 this_ptr_conv.inner = untag_ptr(this_ptr);
34229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34231 this_ptr_conv.is_owned = false;
34232 LDKThirtyTwoBytes val_ref;
34233 CHECK((*env)->GetArrayLength(env, val) == 32);
34234 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34235 FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref);
34238 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
34239 LDKFundingCreated this_ptr_conv;
34240 this_ptr_conv.inner = untag_ptr(this_ptr);
34241 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34242 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34243 this_ptr_conv.is_owned = false;
34244 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34245 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv));
34249 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34250 LDKFundingCreated this_ptr_conv;
34251 this_ptr_conv.inner = untag_ptr(this_ptr);
34252 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34253 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34254 this_ptr_conv.is_owned = false;
34255 LDKThirtyTwoBytes val_ref;
34256 CHECK((*env)->GetArrayLength(env, val) == 32);
34257 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34258 FundingCreated_set_funding_txid(&this_ptr_conv, val_ref);
34261 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
34262 LDKFundingCreated this_ptr_conv;
34263 this_ptr_conv.inner = untag_ptr(this_ptr);
34264 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34266 this_ptr_conv.is_owned = false;
34267 int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv);
34271 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
34272 LDKFundingCreated this_ptr_conv;
34273 this_ptr_conv.inner = untag_ptr(this_ptr);
34274 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34276 this_ptr_conv.is_owned = false;
34277 FundingCreated_set_funding_output_index(&this_ptr_conv, val);
34280 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
34281 LDKFundingCreated this_ptr_conv;
34282 this_ptr_conv.inner = untag_ptr(this_ptr);
34283 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34285 this_ptr_conv.is_owned = false;
34286 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
34287 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form);
34291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34292 LDKFundingCreated this_ptr_conv;
34293 this_ptr_conv.inner = untag_ptr(this_ptr);
34294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34296 this_ptr_conv.is_owned = false;
34297 LDKSignature val_ref;
34298 CHECK((*env)->GetArrayLength(env, val) == 64);
34299 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
34300 FundingCreated_set_signature(&this_ptr_conv, val_ref);
34303 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) {
34304 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
34305 CHECK((*env)->GetArrayLength(env, temporary_channel_id_arg) == 32);
34306 (*env)->GetByteArrayRegion(env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data);
34307 LDKThirtyTwoBytes funding_txid_arg_ref;
34308 CHECK((*env)->GetArrayLength(env, funding_txid_arg) == 32);
34309 (*env)->GetByteArrayRegion(env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data);
34310 LDKSignature signature_arg_ref;
34311 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
34312 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
34313 LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
34314 int64_t ret_ref = 0;
34315 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34316 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34320 static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) {
34321 LDKFundingCreated ret_var = FundingCreated_clone(arg);
34322 int64_t ret_ref = 0;
34323 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34324 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34327 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34328 LDKFundingCreated arg_conv;
34329 arg_conv.inner = untag_ptr(arg);
34330 arg_conv.is_owned = ptr_is_owned(arg);
34331 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34332 arg_conv.is_owned = false;
34333 int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv);
34337 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34338 LDKFundingCreated orig_conv;
34339 orig_conv.inner = untag_ptr(orig);
34340 orig_conv.is_owned = ptr_is_owned(orig);
34341 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34342 orig_conv.is_owned = false;
34343 LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
34344 int64_t ret_ref = 0;
34345 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34346 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34350 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingCreated_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34351 LDKFundingCreated a_conv;
34352 a_conv.inner = untag_ptr(a);
34353 a_conv.is_owned = ptr_is_owned(a);
34354 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34355 a_conv.is_owned = false;
34356 LDKFundingCreated b_conv;
34357 b_conv.inner = untag_ptr(b);
34358 b_conv.is_owned = ptr_is_owned(b);
34359 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34360 b_conv.is_owned = false;
34361 jboolean ret_conv = FundingCreated_eq(&a_conv, &b_conv);
34365 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34366 LDKFundingSigned this_obj_conv;
34367 this_obj_conv.inner = untag_ptr(this_obj);
34368 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34369 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34370 FundingSigned_free(this_obj_conv);
34373 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
34374 LDKFundingSigned this_ptr_conv;
34375 this_ptr_conv.inner = untag_ptr(this_ptr);
34376 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34378 this_ptr_conv.is_owned = false;
34379 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34380 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv));
34384 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34385 LDKFundingSigned this_ptr_conv;
34386 this_ptr_conv.inner = untag_ptr(this_ptr);
34387 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34388 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34389 this_ptr_conv.is_owned = false;
34390 LDKThirtyTwoBytes val_ref;
34391 CHECK((*env)->GetArrayLength(env, val) == 32);
34392 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34393 FundingSigned_set_channel_id(&this_ptr_conv, val_ref);
34396 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
34397 LDKFundingSigned this_ptr_conv;
34398 this_ptr_conv.inner = untag_ptr(this_ptr);
34399 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34401 this_ptr_conv.is_owned = false;
34402 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
34403 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form);
34407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34408 LDKFundingSigned this_ptr_conv;
34409 this_ptr_conv.inner = untag_ptr(this_ptr);
34410 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34412 this_ptr_conv.is_owned = false;
34413 LDKSignature val_ref;
34414 CHECK((*env)->GetArrayLength(env, val) == 64);
34415 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
34416 FundingSigned_set_signature(&this_ptr_conv, val_ref);
34419 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg) {
34420 LDKThirtyTwoBytes channel_id_arg_ref;
34421 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
34422 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
34423 LDKSignature signature_arg_ref;
34424 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
34425 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
34426 LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
34427 int64_t ret_ref = 0;
34428 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34429 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34433 static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) {
34434 LDKFundingSigned ret_var = FundingSigned_clone(arg);
34435 int64_t ret_ref = 0;
34436 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34437 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34441 LDKFundingSigned arg_conv;
34442 arg_conv.inner = untag_ptr(arg);
34443 arg_conv.is_owned = ptr_is_owned(arg);
34444 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34445 arg_conv.is_owned = false;
34446 int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv);
34450 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34451 LDKFundingSigned orig_conv;
34452 orig_conv.inner = untag_ptr(orig);
34453 orig_conv.is_owned = ptr_is_owned(orig);
34454 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34455 orig_conv.is_owned = false;
34456 LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
34457 int64_t ret_ref = 0;
34458 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34459 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34463 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34464 LDKFundingSigned a_conv;
34465 a_conv.inner = untag_ptr(a);
34466 a_conv.is_owned = ptr_is_owned(a);
34467 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34468 a_conv.is_owned = false;
34469 LDKFundingSigned b_conv;
34470 b_conv.inner = untag_ptr(b);
34471 b_conv.is_owned = ptr_is_owned(b);
34472 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34473 b_conv.is_owned = false;
34474 jboolean ret_conv = FundingSigned_eq(&a_conv, &b_conv);
34478 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34479 LDKChannelReady this_obj_conv;
34480 this_obj_conv.inner = untag_ptr(this_obj);
34481 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34482 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34483 ChannelReady_free(this_obj_conv);
34486 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
34487 LDKChannelReady this_ptr_conv;
34488 this_ptr_conv.inner = untag_ptr(this_ptr);
34489 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34490 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34491 this_ptr_conv.is_owned = false;
34492 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34493 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReady_get_channel_id(&this_ptr_conv));
34497 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34498 LDKChannelReady this_ptr_conv;
34499 this_ptr_conv.inner = untag_ptr(this_ptr);
34500 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34501 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34502 this_ptr_conv.is_owned = false;
34503 LDKThirtyTwoBytes val_ref;
34504 CHECK((*env)->GetArrayLength(env, val) == 32);
34505 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34506 ChannelReady_set_channel_id(&this_ptr_conv, val_ref);
34509 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
34510 LDKChannelReady this_ptr_conv;
34511 this_ptr_conv.inner = untag_ptr(this_ptr);
34512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34514 this_ptr_conv.is_owned = false;
34515 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
34516 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
34520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34521 LDKChannelReady this_ptr_conv;
34522 this_ptr_conv.inner = untag_ptr(this_ptr);
34523 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34524 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34525 this_ptr_conv.is_owned = false;
34526 LDKPublicKey val_ref;
34527 CHECK((*env)->GetArrayLength(env, val) == 33);
34528 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
34529 ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref);
34532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
34533 LDKChannelReady this_ptr_conv;
34534 this_ptr_conv.inner = untag_ptr(this_ptr);
34535 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34537 this_ptr_conv.is_owned = false;
34538 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
34539 *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv);
34540 int64_t ret_ref = tag_ptr(ret_copy, true);
34544 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34545 LDKChannelReady this_ptr_conv;
34546 this_ptr_conv.inner = untag_ptr(this_ptr);
34547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34549 this_ptr_conv.is_owned = false;
34550 void* val_ptr = untag_ptr(val);
34551 CHECK_ACCESS(val_ptr);
34552 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
34553 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
34554 ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv);
34557 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_t short_channel_id_alias_arg) {
34558 LDKThirtyTwoBytes channel_id_arg_ref;
34559 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
34560 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
34561 LDKPublicKey next_per_commitment_point_arg_ref;
34562 CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
34563 (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
34564 void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg);
34565 CHECK_ACCESS(short_channel_id_alias_arg_ptr);
34566 LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr);
34567 short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg));
34568 LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv);
34569 int64_t ret_ref = 0;
34570 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34571 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34575 static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) {
34576 LDKChannelReady ret_var = ChannelReady_clone(arg);
34577 int64_t ret_ref = 0;
34578 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34579 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34582 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34583 LDKChannelReady arg_conv;
34584 arg_conv.inner = untag_ptr(arg);
34585 arg_conv.is_owned = ptr_is_owned(arg);
34586 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34587 arg_conv.is_owned = false;
34588 int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv);
34592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34593 LDKChannelReady orig_conv;
34594 orig_conv.inner = untag_ptr(orig);
34595 orig_conv.is_owned = ptr_is_owned(orig);
34596 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34597 orig_conv.is_owned = false;
34598 LDKChannelReady ret_var = ChannelReady_clone(&orig_conv);
34599 int64_t ret_ref = 0;
34600 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34601 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34605 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReady_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34606 LDKChannelReady a_conv;
34607 a_conv.inner = untag_ptr(a);
34608 a_conv.is_owned = ptr_is_owned(a);
34609 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34610 a_conv.is_owned = false;
34611 LDKChannelReady b_conv;
34612 b_conv.inner = untag_ptr(b);
34613 b_conv.is_owned = ptr_is_owned(b);
34614 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34615 b_conv.is_owned = false;
34616 jboolean ret_conv = ChannelReady_eq(&a_conv, &b_conv);
34620 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34621 LDKShutdown this_obj_conv;
34622 this_obj_conv.inner = untag_ptr(this_obj);
34623 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34625 Shutdown_free(this_obj_conv);
34628 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
34629 LDKShutdown this_ptr_conv;
34630 this_ptr_conv.inner = untag_ptr(this_ptr);
34631 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34633 this_ptr_conv.is_owned = false;
34634 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34635 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv));
34639 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34640 LDKShutdown this_ptr_conv;
34641 this_ptr_conv.inner = untag_ptr(this_ptr);
34642 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34644 this_ptr_conv.is_owned = false;
34645 LDKThirtyTwoBytes val_ref;
34646 CHECK((*env)->GetArrayLength(env, val) == 32);
34647 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34648 Shutdown_set_channel_id(&this_ptr_conv, val_ref);
34651 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
34652 LDKShutdown this_ptr_conv;
34653 this_ptr_conv.inner = untag_ptr(this_ptr);
34654 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34656 this_ptr_conv.is_owned = false;
34657 LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
34658 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34659 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34663 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34664 LDKShutdown this_ptr_conv;
34665 this_ptr_conv.inner = untag_ptr(this_ptr);
34666 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34668 this_ptr_conv.is_owned = false;
34669 LDKCVec_u8Z val_ref;
34670 val_ref.datalen = (*env)->GetArrayLength(env, val);
34671 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
34672 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
34673 Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref);
34676 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) {
34677 LDKThirtyTwoBytes channel_id_arg_ref;
34678 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
34679 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
34680 LDKCVec_u8Z scriptpubkey_arg_ref;
34681 scriptpubkey_arg_ref.datalen = (*env)->GetArrayLength(env, scriptpubkey_arg);
34682 scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
34683 (*env)->GetByteArrayRegion(env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data);
34684 LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
34685 int64_t ret_ref = 0;
34686 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34687 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34691 static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) {
34692 LDKShutdown ret_var = Shutdown_clone(arg);
34693 int64_t ret_ref = 0;
34694 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34695 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34698 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34699 LDKShutdown arg_conv;
34700 arg_conv.inner = untag_ptr(arg);
34701 arg_conv.is_owned = ptr_is_owned(arg);
34702 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34703 arg_conv.is_owned = false;
34704 int64_t ret_conv = Shutdown_clone_ptr(&arg_conv);
34708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34709 LDKShutdown orig_conv;
34710 orig_conv.inner = untag_ptr(orig);
34711 orig_conv.is_owned = ptr_is_owned(orig);
34712 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34713 orig_conv.is_owned = false;
34714 LDKShutdown ret_var = Shutdown_clone(&orig_conv);
34715 int64_t ret_ref = 0;
34716 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34717 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34721 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Shutdown_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34722 LDKShutdown a_conv;
34723 a_conv.inner = untag_ptr(a);
34724 a_conv.is_owned = ptr_is_owned(a);
34725 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34726 a_conv.is_owned = false;
34727 LDKShutdown b_conv;
34728 b_conv.inner = untag_ptr(b);
34729 b_conv.is_owned = ptr_is_owned(b);
34730 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34731 b_conv.is_owned = false;
34732 jboolean ret_conv = Shutdown_eq(&a_conv, &b_conv);
34736 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34737 LDKClosingSignedFeeRange this_obj_conv;
34738 this_obj_conv.inner = untag_ptr(this_obj);
34739 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34741 ClosingSignedFeeRange_free(this_obj_conv);
34744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
34745 LDKClosingSignedFeeRange this_ptr_conv;
34746 this_ptr_conv.inner = untag_ptr(this_ptr);
34747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34749 this_ptr_conv.is_owned = false;
34750 int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
34754 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34755 LDKClosingSignedFeeRange this_ptr_conv;
34756 this_ptr_conv.inner = untag_ptr(this_ptr);
34757 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34759 this_ptr_conv.is_owned = false;
34760 ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
34763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
34764 LDKClosingSignedFeeRange this_ptr_conv;
34765 this_ptr_conv.inner = untag_ptr(this_ptr);
34766 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34767 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34768 this_ptr_conv.is_owned = false;
34769 int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
34773 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34774 LDKClosingSignedFeeRange this_ptr_conv;
34775 this_ptr_conv.inner = untag_ptr(this_ptr);
34776 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34777 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34778 this_ptr_conv.is_owned = false;
34779 ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
34782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new(JNIEnv *env, jclass clz, int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) {
34783 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
34784 int64_t ret_ref = 0;
34785 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34786 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34790 static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) {
34791 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg);
34792 int64_t ret_ref = 0;
34793 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34794 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34797 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34798 LDKClosingSignedFeeRange arg_conv;
34799 arg_conv.inner = untag_ptr(arg);
34800 arg_conv.is_owned = ptr_is_owned(arg);
34801 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34802 arg_conv.is_owned = false;
34803 int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv);
34807 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34808 LDKClosingSignedFeeRange orig_conv;
34809 orig_conv.inner = untag_ptr(orig);
34810 orig_conv.is_owned = ptr_is_owned(orig);
34811 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34812 orig_conv.is_owned = false;
34813 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
34814 int64_t ret_ref = 0;
34815 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34816 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34820 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34821 LDKClosingSignedFeeRange a_conv;
34822 a_conv.inner = untag_ptr(a);
34823 a_conv.is_owned = ptr_is_owned(a);
34824 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34825 a_conv.is_owned = false;
34826 LDKClosingSignedFeeRange b_conv;
34827 b_conv.inner = untag_ptr(b);
34828 b_conv.is_owned = ptr_is_owned(b);
34829 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34830 b_conv.is_owned = false;
34831 jboolean ret_conv = ClosingSignedFeeRange_eq(&a_conv, &b_conv);
34835 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34836 LDKClosingSigned this_obj_conv;
34837 this_obj_conv.inner = untag_ptr(this_obj);
34838 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34840 ClosingSigned_free(this_obj_conv);
34843 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
34844 LDKClosingSigned this_ptr_conv;
34845 this_ptr_conv.inner = untag_ptr(this_ptr);
34846 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34848 this_ptr_conv.is_owned = false;
34849 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34850 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv));
34854 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34855 LDKClosingSigned this_ptr_conv;
34856 this_ptr_conv.inner = untag_ptr(this_ptr);
34857 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34859 this_ptr_conv.is_owned = false;
34860 LDKThirtyTwoBytes val_ref;
34861 CHECK((*env)->GetArrayLength(env, val) == 32);
34862 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34863 ClosingSigned_set_channel_id(&this_ptr_conv, val_ref);
34866 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
34867 LDKClosingSigned this_ptr_conv;
34868 this_ptr_conv.inner = untag_ptr(this_ptr);
34869 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34870 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34871 this_ptr_conv.is_owned = false;
34872 int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
34876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34877 LDKClosingSigned this_ptr_conv;
34878 this_ptr_conv.inner = untag_ptr(this_ptr);
34879 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34880 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34881 this_ptr_conv.is_owned = false;
34882 ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
34885 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
34886 LDKClosingSigned this_ptr_conv;
34887 this_ptr_conv.inner = untag_ptr(this_ptr);
34888 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34890 this_ptr_conv.is_owned = false;
34891 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
34892 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form);
34896 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34897 LDKClosingSigned this_ptr_conv;
34898 this_ptr_conv.inner = untag_ptr(this_ptr);
34899 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34900 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34901 this_ptr_conv.is_owned = false;
34902 LDKSignature val_ref;
34903 CHECK((*env)->GetArrayLength(env, val) == 64);
34904 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
34905 ClosingSigned_set_signature(&this_ptr_conv, val_ref);
34908 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr) {
34909 LDKClosingSigned this_ptr_conv;
34910 this_ptr_conv.inner = untag_ptr(this_ptr);
34911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34913 this_ptr_conv.is_owned = false;
34914 LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
34915 int64_t ret_ref = 0;
34916 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34917 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34922 LDKClosingSigned this_ptr_conv;
34923 this_ptr_conv.inner = untag_ptr(this_ptr);
34924 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34926 this_ptr_conv.is_owned = false;
34927 LDKClosingSignedFeeRange val_conv;
34928 val_conv.inner = untag_ptr(val);
34929 val_conv.is_owned = ptr_is_owned(val);
34930 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34931 val_conv = ClosingSignedFeeRange_clone(&val_conv);
34932 ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
34935 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_t fee_range_arg) {
34936 LDKThirtyTwoBytes channel_id_arg_ref;
34937 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
34938 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
34939 LDKSignature signature_arg_ref;
34940 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
34941 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
34942 LDKClosingSignedFeeRange fee_range_arg_conv;
34943 fee_range_arg_conv.inner = untag_ptr(fee_range_arg);
34944 fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg);
34945 CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv);
34946 fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
34947 LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv);
34948 int64_t ret_ref = 0;
34949 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34950 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34954 static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) {
34955 LDKClosingSigned ret_var = ClosingSigned_clone(arg);
34956 int64_t ret_ref = 0;
34957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34961 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34962 LDKClosingSigned arg_conv;
34963 arg_conv.inner = untag_ptr(arg);
34964 arg_conv.is_owned = ptr_is_owned(arg);
34965 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34966 arg_conv.is_owned = false;
34967 int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv);
34971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34972 LDKClosingSigned orig_conv;
34973 orig_conv.inner = untag_ptr(orig);
34974 orig_conv.is_owned = ptr_is_owned(orig);
34975 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34976 orig_conv.is_owned = false;
34977 LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
34978 int64_t ret_ref = 0;
34979 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34980 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34984 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34985 LDKClosingSigned a_conv;
34986 a_conv.inner = untag_ptr(a);
34987 a_conv.is_owned = ptr_is_owned(a);
34988 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34989 a_conv.is_owned = false;
34990 LDKClosingSigned b_conv;
34991 b_conv.inner = untag_ptr(b);
34992 b_conv.is_owned = ptr_is_owned(b);
34993 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34994 b_conv.is_owned = false;
34995 jboolean ret_conv = ClosingSigned_eq(&a_conv, &b_conv);
34999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35000 LDKUpdateAddHTLC this_obj_conv;
35001 this_obj_conv.inner = untag_ptr(this_obj);
35002 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35004 UpdateAddHTLC_free(this_obj_conv);
35007 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35008 LDKUpdateAddHTLC this_ptr_conv;
35009 this_ptr_conv.inner = untag_ptr(this_ptr);
35010 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35012 this_ptr_conv.is_owned = false;
35013 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35014 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv));
35018 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35019 LDKUpdateAddHTLC this_ptr_conv;
35020 this_ptr_conv.inner = untag_ptr(this_ptr);
35021 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35023 this_ptr_conv.is_owned = false;
35024 LDKThirtyTwoBytes val_ref;
35025 CHECK((*env)->GetArrayLength(env, val) == 32);
35026 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35027 UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref);
35030 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35031 LDKUpdateAddHTLC this_ptr_conv;
35032 this_ptr_conv.inner = untag_ptr(this_ptr);
35033 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35035 this_ptr_conv.is_owned = false;
35036 int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
35040 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35041 LDKUpdateAddHTLC this_ptr_conv;
35042 this_ptr_conv.inner = untag_ptr(this_ptr);
35043 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35044 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35045 this_ptr_conv.is_owned = false;
35046 UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
35049 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
35050 LDKUpdateAddHTLC this_ptr_conv;
35051 this_ptr_conv.inner = untag_ptr(this_ptr);
35052 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35053 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35054 this_ptr_conv.is_owned = false;
35055 int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
35059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35060 LDKUpdateAddHTLC this_ptr_conv;
35061 this_ptr_conv.inner = untag_ptr(this_ptr);
35062 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35064 this_ptr_conv.is_owned = false;
35065 UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
35068 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
35069 LDKUpdateAddHTLC this_ptr_conv;
35070 this_ptr_conv.inner = untag_ptr(this_ptr);
35071 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35073 this_ptr_conv.is_owned = false;
35074 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35075 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv));
35079 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35080 LDKUpdateAddHTLC this_ptr_conv;
35081 this_ptr_conv.inner = untag_ptr(this_ptr);
35082 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35083 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35084 this_ptr_conv.is_owned = false;
35085 LDKThirtyTwoBytes val_ref;
35086 CHECK((*env)->GetArrayLength(env, val) == 32);
35087 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35088 UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref);
35091 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) {
35092 LDKUpdateAddHTLC this_ptr_conv;
35093 this_ptr_conv.inner = untag_ptr(this_ptr);
35094 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35096 this_ptr_conv.is_owned = false;
35097 int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
35101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
35102 LDKUpdateAddHTLC this_ptr_conv;
35103 this_ptr_conv.inner = untag_ptr(this_ptr);
35104 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35105 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35106 this_ptr_conv.is_owned = false;
35107 UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
35110 static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) {
35111 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg);
35112 int64_t ret_ref = 0;
35113 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35114 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35117 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35118 LDKUpdateAddHTLC arg_conv;
35119 arg_conv.inner = untag_ptr(arg);
35120 arg_conv.is_owned = ptr_is_owned(arg);
35121 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35122 arg_conv.is_owned = false;
35123 int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv);
35127 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35128 LDKUpdateAddHTLC orig_conv;
35129 orig_conv.inner = untag_ptr(orig);
35130 orig_conv.is_owned = ptr_is_owned(orig);
35131 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35132 orig_conv.is_owned = false;
35133 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
35134 int64_t ret_ref = 0;
35135 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35136 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35140 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35141 LDKUpdateAddHTLC a_conv;
35142 a_conv.inner = untag_ptr(a);
35143 a_conv.is_owned = ptr_is_owned(a);
35144 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35145 a_conv.is_owned = false;
35146 LDKUpdateAddHTLC b_conv;
35147 b_conv.inner = untag_ptr(b);
35148 b_conv.is_owned = ptr_is_owned(b);
35149 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35150 b_conv.is_owned = false;
35151 jboolean ret_conv = UpdateAddHTLC_eq(&a_conv, &b_conv);
35155 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35156 LDKOnionMessage this_obj_conv;
35157 this_obj_conv.inner = untag_ptr(this_obj);
35158 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35160 OnionMessage_free(this_obj_conv);
35163 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessage_1get_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
35164 LDKOnionMessage this_ptr_conv;
35165 this_ptr_conv.inner = untag_ptr(this_ptr);
35166 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35168 this_ptr_conv.is_owned = false;
35169 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35170 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OnionMessage_get_blinding_point(&this_ptr_conv).compressed_form);
35174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessage_1set_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35175 LDKOnionMessage this_ptr_conv;
35176 this_ptr_conv.inner = untag_ptr(this_ptr);
35177 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35179 this_ptr_conv.is_owned = false;
35180 LDKPublicKey val_ref;
35181 CHECK((*env)->GetArrayLength(env, val) == 33);
35182 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35183 OnionMessage_set_blinding_point(&this_ptr_conv, val_ref);
35186 static inline uint64_t OnionMessage_clone_ptr(LDKOnionMessage *NONNULL_PTR arg) {
35187 LDKOnionMessage ret_var = OnionMessage_clone(arg);
35188 int64_t ret_ref = 0;
35189 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35190 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35194 LDKOnionMessage arg_conv;
35195 arg_conv.inner = untag_ptr(arg);
35196 arg_conv.is_owned = ptr_is_owned(arg);
35197 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35198 arg_conv.is_owned = false;
35199 int64_t ret_conv = OnionMessage_clone_ptr(&arg_conv);
35203 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35204 LDKOnionMessage orig_conv;
35205 orig_conv.inner = untag_ptr(orig);
35206 orig_conv.is_owned = ptr_is_owned(orig);
35207 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35208 orig_conv.is_owned = false;
35209 LDKOnionMessage ret_var = OnionMessage_clone(&orig_conv);
35210 int64_t ret_ref = 0;
35211 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35212 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35216 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OnionMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35217 LDKOnionMessage a_conv;
35218 a_conv.inner = untag_ptr(a);
35219 a_conv.is_owned = ptr_is_owned(a);
35220 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35221 a_conv.is_owned = false;
35222 LDKOnionMessage b_conv;
35223 b_conv.inner = untag_ptr(b);
35224 b_conv.is_owned = ptr_is_owned(b);
35225 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35226 b_conv.is_owned = false;
35227 jboolean ret_conv = OnionMessage_eq(&a_conv, &b_conv);
35231 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35232 LDKUpdateFulfillHTLC this_obj_conv;
35233 this_obj_conv.inner = untag_ptr(this_obj);
35234 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35236 UpdateFulfillHTLC_free(this_obj_conv);
35239 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35240 LDKUpdateFulfillHTLC this_ptr_conv;
35241 this_ptr_conv.inner = untag_ptr(this_ptr);
35242 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35244 this_ptr_conv.is_owned = false;
35245 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35246 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv));
35250 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35251 LDKUpdateFulfillHTLC this_ptr_conv;
35252 this_ptr_conv.inner = untag_ptr(this_ptr);
35253 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35255 this_ptr_conv.is_owned = false;
35256 LDKThirtyTwoBytes val_ref;
35257 CHECK((*env)->GetArrayLength(env, val) == 32);
35258 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35259 UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref);
35262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35263 LDKUpdateFulfillHTLC this_ptr_conv;
35264 this_ptr_conv.inner = untag_ptr(this_ptr);
35265 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35267 this_ptr_conv.is_owned = false;
35268 int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
35272 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35273 LDKUpdateFulfillHTLC this_ptr_conv;
35274 this_ptr_conv.inner = untag_ptr(this_ptr);
35275 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35276 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35277 this_ptr_conv.is_owned = false;
35278 UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
35281 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) {
35282 LDKUpdateFulfillHTLC this_ptr_conv;
35283 this_ptr_conv.inner = untag_ptr(this_ptr);
35284 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35286 this_ptr_conv.is_owned = false;
35287 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35288 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv));
35292 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35293 LDKUpdateFulfillHTLC this_ptr_conv;
35294 this_ptr_conv.inner = untag_ptr(this_ptr);
35295 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35296 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35297 this_ptr_conv.is_owned = false;
35298 LDKThirtyTwoBytes val_ref;
35299 CHECK((*env)->GetArrayLength(env, val) == 32);
35300 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35301 UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref);
35304 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t htlc_id_arg, int8_tArray payment_preimage_arg) {
35305 LDKThirtyTwoBytes channel_id_arg_ref;
35306 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
35307 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
35308 LDKThirtyTwoBytes payment_preimage_arg_ref;
35309 CHECK((*env)->GetArrayLength(env, payment_preimage_arg) == 32);
35310 (*env)->GetByteArrayRegion(env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data);
35311 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
35312 int64_t ret_ref = 0;
35313 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35314 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35318 static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) {
35319 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg);
35320 int64_t ret_ref = 0;
35321 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35322 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35325 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35326 LDKUpdateFulfillHTLC arg_conv;
35327 arg_conv.inner = untag_ptr(arg);
35328 arg_conv.is_owned = ptr_is_owned(arg);
35329 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35330 arg_conv.is_owned = false;
35331 int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv);
35335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35336 LDKUpdateFulfillHTLC orig_conv;
35337 orig_conv.inner = untag_ptr(orig);
35338 orig_conv.is_owned = ptr_is_owned(orig);
35339 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35340 orig_conv.is_owned = false;
35341 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
35342 int64_t ret_ref = 0;
35343 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35344 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35348 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35349 LDKUpdateFulfillHTLC a_conv;
35350 a_conv.inner = untag_ptr(a);
35351 a_conv.is_owned = ptr_is_owned(a);
35352 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35353 a_conv.is_owned = false;
35354 LDKUpdateFulfillHTLC b_conv;
35355 b_conv.inner = untag_ptr(b);
35356 b_conv.is_owned = ptr_is_owned(b);
35357 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35358 b_conv.is_owned = false;
35359 jboolean ret_conv = UpdateFulfillHTLC_eq(&a_conv, &b_conv);
35363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35364 LDKUpdateFailHTLC this_obj_conv;
35365 this_obj_conv.inner = untag_ptr(this_obj);
35366 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35367 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35368 UpdateFailHTLC_free(this_obj_conv);
35371 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35372 LDKUpdateFailHTLC this_ptr_conv;
35373 this_ptr_conv.inner = untag_ptr(this_ptr);
35374 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35375 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35376 this_ptr_conv.is_owned = false;
35377 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35378 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv));
35382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35383 LDKUpdateFailHTLC this_ptr_conv;
35384 this_ptr_conv.inner = untag_ptr(this_ptr);
35385 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35386 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35387 this_ptr_conv.is_owned = false;
35388 LDKThirtyTwoBytes val_ref;
35389 CHECK((*env)->GetArrayLength(env, val) == 32);
35390 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35391 UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref);
35394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35395 LDKUpdateFailHTLC this_ptr_conv;
35396 this_ptr_conv.inner = untag_ptr(this_ptr);
35397 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35399 this_ptr_conv.is_owned = false;
35400 int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
35404 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35405 LDKUpdateFailHTLC this_ptr_conv;
35406 this_ptr_conv.inner = untag_ptr(this_ptr);
35407 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35408 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35409 this_ptr_conv.is_owned = false;
35410 UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
35413 static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) {
35414 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg);
35415 int64_t ret_ref = 0;
35416 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35417 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35420 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35421 LDKUpdateFailHTLC arg_conv;
35422 arg_conv.inner = untag_ptr(arg);
35423 arg_conv.is_owned = ptr_is_owned(arg);
35424 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35425 arg_conv.is_owned = false;
35426 int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv);
35430 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35431 LDKUpdateFailHTLC orig_conv;
35432 orig_conv.inner = untag_ptr(orig);
35433 orig_conv.is_owned = ptr_is_owned(orig);
35434 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35435 orig_conv.is_owned = false;
35436 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
35437 int64_t ret_ref = 0;
35438 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35439 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35443 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35444 LDKUpdateFailHTLC a_conv;
35445 a_conv.inner = untag_ptr(a);
35446 a_conv.is_owned = ptr_is_owned(a);
35447 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35448 a_conv.is_owned = false;
35449 LDKUpdateFailHTLC b_conv;
35450 b_conv.inner = untag_ptr(b);
35451 b_conv.is_owned = ptr_is_owned(b);
35452 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35453 b_conv.is_owned = false;
35454 jboolean ret_conv = UpdateFailHTLC_eq(&a_conv, &b_conv);
35458 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35459 LDKUpdateFailMalformedHTLC this_obj_conv;
35460 this_obj_conv.inner = untag_ptr(this_obj);
35461 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35463 UpdateFailMalformedHTLC_free(this_obj_conv);
35466 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35467 LDKUpdateFailMalformedHTLC this_ptr_conv;
35468 this_ptr_conv.inner = untag_ptr(this_ptr);
35469 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35471 this_ptr_conv.is_owned = false;
35472 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35473 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv));
35477 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35478 LDKUpdateFailMalformedHTLC this_ptr_conv;
35479 this_ptr_conv.inner = untag_ptr(this_ptr);
35480 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35482 this_ptr_conv.is_owned = false;
35483 LDKThirtyTwoBytes val_ref;
35484 CHECK((*env)->GetArrayLength(env, val) == 32);
35485 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35486 UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref);
35489 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35490 LDKUpdateFailMalformedHTLC this_ptr_conv;
35491 this_ptr_conv.inner = untag_ptr(this_ptr);
35492 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35494 this_ptr_conv.is_owned = false;
35495 int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
35499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35500 LDKUpdateFailMalformedHTLC this_ptr_conv;
35501 this_ptr_conv.inner = untag_ptr(this_ptr);
35502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35504 this_ptr_conv.is_owned = false;
35505 UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
35508 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr) {
35509 LDKUpdateFailMalformedHTLC this_ptr_conv;
35510 this_ptr_conv.inner = untag_ptr(this_ptr);
35511 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35513 this_ptr_conv.is_owned = false;
35514 int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
35518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35519 LDKUpdateFailMalformedHTLC this_ptr_conv;
35520 this_ptr_conv.inner = untag_ptr(this_ptr);
35521 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35523 this_ptr_conv.is_owned = false;
35524 UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
35527 static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) {
35528 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg);
35529 int64_t ret_ref = 0;
35530 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35531 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35535 LDKUpdateFailMalformedHTLC arg_conv;
35536 arg_conv.inner = untag_ptr(arg);
35537 arg_conv.is_owned = ptr_is_owned(arg);
35538 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35539 arg_conv.is_owned = false;
35540 int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv);
35544 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35545 LDKUpdateFailMalformedHTLC orig_conv;
35546 orig_conv.inner = untag_ptr(orig);
35547 orig_conv.is_owned = ptr_is_owned(orig);
35548 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35549 orig_conv.is_owned = false;
35550 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
35551 int64_t ret_ref = 0;
35552 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35553 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35557 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35558 LDKUpdateFailMalformedHTLC a_conv;
35559 a_conv.inner = untag_ptr(a);
35560 a_conv.is_owned = ptr_is_owned(a);
35561 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35562 a_conv.is_owned = false;
35563 LDKUpdateFailMalformedHTLC b_conv;
35564 b_conv.inner = untag_ptr(b);
35565 b_conv.is_owned = ptr_is_owned(b);
35566 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35567 b_conv.is_owned = false;
35568 jboolean ret_conv = UpdateFailMalformedHTLC_eq(&a_conv, &b_conv);
35572 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35573 LDKCommitmentSigned this_obj_conv;
35574 this_obj_conv.inner = untag_ptr(this_obj);
35575 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35577 CommitmentSigned_free(this_obj_conv);
35580 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35581 LDKCommitmentSigned this_ptr_conv;
35582 this_ptr_conv.inner = untag_ptr(this_ptr);
35583 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35584 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35585 this_ptr_conv.is_owned = false;
35586 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35587 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv));
35591 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35592 LDKCommitmentSigned this_ptr_conv;
35593 this_ptr_conv.inner = untag_ptr(this_ptr);
35594 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35595 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35596 this_ptr_conv.is_owned = false;
35597 LDKThirtyTwoBytes val_ref;
35598 CHECK((*env)->GetArrayLength(env, val) == 32);
35599 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35600 CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref);
35603 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
35604 LDKCommitmentSigned this_ptr_conv;
35605 this_ptr_conv.inner = untag_ptr(this_ptr);
35606 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35608 this_ptr_conv.is_owned = false;
35609 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
35610 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form);
35614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35615 LDKCommitmentSigned this_ptr_conv;
35616 this_ptr_conv.inner = untag_ptr(this_ptr);
35617 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35618 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35619 this_ptr_conv.is_owned = false;
35620 LDKSignature val_ref;
35621 CHECK((*env)->GetArrayLength(env, val) == 64);
35622 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
35623 CommitmentSigned_set_signature(&this_ptr_conv, val_ref);
35626 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr) {
35627 LDKCommitmentSigned this_ptr_conv;
35628 this_ptr_conv.inner = untag_ptr(this_ptr);
35629 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35630 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35631 this_ptr_conv.is_owned = false;
35632 LDKCVec_SignatureZ ret_var = CommitmentSigned_get_htlc_signatures(&this_ptr_conv);
35633 jobjectArray ret_arr = NULL;
35634 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
35636 for (size_t i = 0; i < ret_var.datalen; i++) {
35637 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
35638 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
35639 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
35642 FREE(ret_var.data);
35646 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
35647 LDKCommitmentSigned this_ptr_conv;
35648 this_ptr_conv.inner = untag_ptr(this_ptr);
35649 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35650 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35651 this_ptr_conv.is_owned = false;
35652 LDKCVec_SignatureZ val_constr;
35653 val_constr.datalen = (*env)->GetArrayLength(env, val);
35654 if (val_constr.datalen > 0)
35655 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
35657 val_constr.data = NULL;
35658 for (size_t i = 0; i < val_constr.datalen; i++) {
35659 int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
35660 LDKSignature val_conv_8_ref;
35661 CHECK((*env)->GetArrayLength(env, val_conv_8) == 64);
35662 (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form);
35663 val_constr.data[i] = val_conv_8_ref;
35665 CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
35668 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg, jobjectArray htlc_signatures_arg) {
35669 LDKThirtyTwoBytes channel_id_arg_ref;
35670 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
35671 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
35672 LDKSignature signature_arg_ref;
35673 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
35674 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
35675 LDKCVec_SignatureZ htlc_signatures_arg_constr;
35676 htlc_signatures_arg_constr.datalen = (*env)->GetArrayLength(env, htlc_signatures_arg);
35677 if (htlc_signatures_arg_constr.datalen > 0)
35678 htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
35680 htlc_signatures_arg_constr.data = NULL;
35681 for (size_t i = 0; i < htlc_signatures_arg_constr.datalen; i++) {
35682 int8_tArray htlc_signatures_arg_conv_8 = (*env)->GetObjectArrayElement(env, htlc_signatures_arg, i);
35683 LDKSignature htlc_signatures_arg_conv_8_ref;
35684 CHECK((*env)->GetArrayLength(env, htlc_signatures_arg_conv_8) == 64);
35685 (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form);
35686 htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref;
35688 LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
35689 int64_t ret_ref = 0;
35690 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35691 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35695 static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) {
35696 LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg);
35697 int64_t ret_ref = 0;
35698 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35699 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35703 LDKCommitmentSigned arg_conv;
35704 arg_conv.inner = untag_ptr(arg);
35705 arg_conv.is_owned = ptr_is_owned(arg);
35706 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35707 arg_conv.is_owned = false;
35708 int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv);
35712 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35713 LDKCommitmentSigned orig_conv;
35714 orig_conv.inner = untag_ptr(orig);
35715 orig_conv.is_owned = ptr_is_owned(orig);
35716 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35717 orig_conv.is_owned = false;
35718 LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
35719 int64_t ret_ref = 0;
35720 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35721 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35725 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35726 LDKCommitmentSigned a_conv;
35727 a_conv.inner = untag_ptr(a);
35728 a_conv.is_owned = ptr_is_owned(a);
35729 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35730 a_conv.is_owned = false;
35731 LDKCommitmentSigned b_conv;
35732 b_conv.inner = untag_ptr(b);
35733 b_conv.is_owned = ptr_is_owned(b);
35734 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35735 b_conv.is_owned = false;
35736 jboolean ret_conv = CommitmentSigned_eq(&a_conv, &b_conv);
35740 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35741 LDKRevokeAndACK this_obj_conv;
35742 this_obj_conv.inner = untag_ptr(this_obj);
35743 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35745 RevokeAndACK_free(this_obj_conv);
35748 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35749 LDKRevokeAndACK this_ptr_conv;
35750 this_ptr_conv.inner = untag_ptr(this_ptr);
35751 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35752 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35753 this_ptr_conv.is_owned = false;
35754 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35755 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv));
35759 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35760 LDKRevokeAndACK this_ptr_conv;
35761 this_ptr_conv.inner = untag_ptr(this_ptr);
35762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35764 this_ptr_conv.is_owned = false;
35765 LDKThirtyTwoBytes val_ref;
35766 CHECK((*env)->GetArrayLength(env, val) == 32);
35767 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35768 RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref);
35771 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) {
35772 LDKRevokeAndACK this_ptr_conv;
35773 this_ptr_conv.inner = untag_ptr(this_ptr);
35774 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35775 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35776 this_ptr_conv.is_owned = false;
35777 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35778 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv));
35782 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35783 LDKRevokeAndACK this_ptr_conv;
35784 this_ptr_conv.inner = untag_ptr(this_ptr);
35785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35787 this_ptr_conv.is_owned = false;
35788 LDKThirtyTwoBytes val_ref;
35789 CHECK((*env)->GetArrayLength(env, val) == 32);
35790 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35791 RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref);
35794 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
35795 LDKRevokeAndACK this_ptr_conv;
35796 this_ptr_conv.inner = untag_ptr(this_ptr);
35797 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35798 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35799 this_ptr_conv.is_owned = false;
35800 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35801 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
35805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35806 LDKRevokeAndACK this_ptr_conv;
35807 this_ptr_conv.inner = untag_ptr(this_ptr);
35808 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35809 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35810 this_ptr_conv.is_owned = false;
35811 LDKPublicKey val_ref;
35812 CHECK((*env)->GetArrayLength(env, val) == 33);
35813 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35814 RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref);
35817 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray per_commitment_secret_arg, int8_tArray next_per_commitment_point_arg) {
35818 LDKThirtyTwoBytes channel_id_arg_ref;
35819 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
35820 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
35821 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
35822 CHECK((*env)->GetArrayLength(env, per_commitment_secret_arg) == 32);
35823 (*env)->GetByteArrayRegion(env, per_commitment_secret_arg, 0, 32, per_commitment_secret_arg_ref.data);
35824 LDKPublicKey next_per_commitment_point_arg_ref;
35825 CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
35826 (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
35827 LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
35828 int64_t ret_ref = 0;
35829 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35830 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35834 static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) {
35835 LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg);
35836 int64_t ret_ref = 0;
35837 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35838 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35841 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35842 LDKRevokeAndACK arg_conv;
35843 arg_conv.inner = untag_ptr(arg);
35844 arg_conv.is_owned = ptr_is_owned(arg);
35845 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35846 arg_conv.is_owned = false;
35847 int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv);
35851 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35852 LDKRevokeAndACK orig_conv;
35853 orig_conv.inner = untag_ptr(orig);
35854 orig_conv.is_owned = ptr_is_owned(orig);
35855 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35856 orig_conv.is_owned = false;
35857 LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
35858 int64_t ret_ref = 0;
35859 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35860 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35864 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35865 LDKRevokeAndACK a_conv;
35866 a_conv.inner = untag_ptr(a);
35867 a_conv.is_owned = ptr_is_owned(a);
35868 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35869 a_conv.is_owned = false;
35870 LDKRevokeAndACK b_conv;
35871 b_conv.inner = untag_ptr(b);
35872 b_conv.is_owned = ptr_is_owned(b);
35873 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35874 b_conv.is_owned = false;
35875 jboolean ret_conv = RevokeAndACK_eq(&a_conv, &b_conv);
35879 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35880 LDKUpdateFee this_obj_conv;
35881 this_obj_conv.inner = untag_ptr(this_obj);
35882 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35884 UpdateFee_free(this_obj_conv);
35887 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35888 LDKUpdateFee this_ptr_conv;
35889 this_ptr_conv.inner = untag_ptr(this_ptr);
35890 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35891 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35892 this_ptr_conv.is_owned = false;
35893 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35894 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv));
35898 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35899 LDKUpdateFee this_ptr_conv;
35900 this_ptr_conv.inner = untag_ptr(this_ptr);
35901 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35903 this_ptr_conv.is_owned = false;
35904 LDKThirtyTwoBytes val_ref;
35905 CHECK((*env)->GetArrayLength(env, val) == 32);
35906 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35907 UpdateFee_set_channel_id(&this_ptr_conv, val_ref);
35910 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) {
35911 LDKUpdateFee this_ptr_conv;
35912 this_ptr_conv.inner = untag_ptr(this_ptr);
35913 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35915 this_ptr_conv.is_owned = false;
35916 int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
35920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
35921 LDKUpdateFee this_ptr_conv;
35922 this_ptr_conv.inner = untag_ptr(this_ptr);
35923 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35925 this_ptr_conv.is_owned = false;
35926 UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
35929 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) {
35930 LDKThirtyTwoBytes channel_id_arg_ref;
35931 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
35932 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
35933 LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
35934 int64_t ret_ref = 0;
35935 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35936 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35940 static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) {
35941 LDKUpdateFee ret_var = UpdateFee_clone(arg);
35942 int64_t ret_ref = 0;
35943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35947 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35948 LDKUpdateFee arg_conv;
35949 arg_conv.inner = untag_ptr(arg);
35950 arg_conv.is_owned = ptr_is_owned(arg);
35951 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35952 arg_conv.is_owned = false;
35953 int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv);
35957 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35958 LDKUpdateFee orig_conv;
35959 orig_conv.inner = untag_ptr(orig);
35960 orig_conv.is_owned = ptr_is_owned(orig);
35961 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35962 orig_conv.is_owned = false;
35963 LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
35964 int64_t ret_ref = 0;
35965 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35966 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35970 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35971 LDKUpdateFee a_conv;
35972 a_conv.inner = untag_ptr(a);
35973 a_conv.is_owned = ptr_is_owned(a);
35974 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35975 a_conv.is_owned = false;
35976 LDKUpdateFee b_conv;
35977 b_conv.inner = untag_ptr(b);
35978 b_conv.is_owned = ptr_is_owned(b);
35979 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35980 b_conv.is_owned = false;
35981 jboolean ret_conv = UpdateFee_eq(&a_conv, &b_conv);
35985 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35986 LDKDataLossProtect this_obj_conv;
35987 this_obj_conv.inner = untag_ptr(this_obj);
35988 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35990 DataLossProtect_free(this_obj_conv);
35993 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) {
35994 LDKDataLossProtect this_ptr_conv;
35995 this_ptr_conv.inner = untag_ptr(this_ptr);
35996 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35998 this_ptr_conv.is_owned = false;
35999 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36000 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv));
36004 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36005 LDKDataLossProtect this_ptr_conv;
36006 this_ptr_conv.inner = untag_ptr(this_ptr);
36007 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36009 this_ptr_conv.is_owned = false;
36010 LDKThirtyTwoBytes val_ref;
36011 CHECK((*env)->GetArrayLength(env, val) == 32);
36012 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36013 DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref);
36016 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
36017 LDKDataLossProtect this_ptr_conv;
36018 this_ptr_conv.inner = untag_ptr(this_ptr);
36019 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36021 this_ptr_conv.is_owned = false;
36022 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
36023 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form);
36027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36028 LDKDataLossProtect this_ptr_conv;
36029 this_ptr_conv.inner = untag_ptr(this_ptr);
36030 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36032 this_ptr_conv.is_owned = false;
36033 LDKPublicKey val_ref;
36034 CHECK((*env)->GetArrayLength(env, val) == 33);
36035 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
36036 DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref);
36039 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv *env, jclass clz, int8_tArray your_last_per_commitment_secret_arg, int8_tArray my_current_per_commitment_point_arg) {
36040 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
36041 CHECK((*env)->GetArrayLength(env, your_last_per_commitment_secret_arg) == 32);
36042 (*env)->GetByteArrayRegion(env, your_last_per_commitment_secret_arg, 0, 32, your_last_per_commitment_secret_arg_ref.data);
36043 LDKPublicKey my_current_per_commitment_point_arg_ref;
36044 CHECK((*env)->GetArrayLength(env, my_current_per_commitment_point_arg) == 33);
36045 (*env)->GetByteArrayRegion(env, my_current_per_commitment_point_arg, 0, 33, my_current_per_commitment_point_arg_ref.compressed_form);
36046 LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
36047 int64_t ret_ref = 0;
36048 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36049 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36053 static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) {
36054 LDKDataLossProtect ret_var = DataLossProtect_clone(arg);
36055 int64_t ret_ref = 0;
36056 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36057 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36060 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36061 LDKDataLossProtect arg_conv;
36062 arg_conv.inner = untag_ptr(arg);
36063 arg_conv.is_owned = ptr_is_owned(arg);
36064 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36065 arg_conv.is_owned = false;
36066 int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv);
36070 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36071 LDKDataLossProtect orig_conv;
36072 orig_conv.inner = untag_ptr(orig);
36073 orig_conv.is_owned = ptr_is_owned(orig);
36074 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36075 orig_conv.is_owned = false;
36076 LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
36077 int64_t ret_ref = 0;
36078 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36079 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36083 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36084 LDKDataLossProtect a_conv;
36085 a_conv.inner = untag_ptr(a);
36086 a_conv.is_owned = ptr_is_owned(a);
36087 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36088 a_conv.is_owned = false;
36089 LDKDataLossProtect b_conv;
36090 b_conv.inner = untag_ptr(b);
36091 b_conv.is_owned = ptr_is_owned(b);
36092 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36093 b_conv.is_owned = false;
36094 jboolean ret_conv = DataLossProtect_eq(&a_conv, &b_conv);
36098 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36099 LDKChannelReestablish this_obj_conv;
36100 this_obj_conv.inner = untag_ptr(this_obj);
36101 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36103 ChannelReestablish_free(this_obj_conv);
36106 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36107 LDKChannelReestablish this_ptr_conv;
36108 this_ptr_conv.inner = untag_ptr(this_ptr);
36109 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36110 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36111 this_ptr_conv.is_owned = false;
36112 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36113 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv));
36117 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36118 LDKChannelReestablish this_ptr_conv;
36119 this_ptr_conv.inner = untag_ptr(this_ptr);
36120 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36122 this_ptr_conv.is_owned = false;
36123 LDKThirtyTwoBytes val_ref;
36124 CHECK((*env)->GetArrayLength(env, val) == 32);
36125 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36126 ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref);
36129 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) {
36130 LDKChannelReestablish this_ptr_conv;
36131 this_ptr_conv.inner = untag_ptr(this_ptr);
36132 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36134 this_ptr_conv.is_owned = false;
36135 int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
36139 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36140 LDKChannelReestablish this_ptr_conv;
36141 this_ptr_conv.inner = untag_ptr(this_ptr);
36142 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36144 this_ptr_conv.is_owned = false;
36145 ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
36148 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) {
36149 LDKChannelReestablish this_ptr_conv;
36150 this_ptr_conv.inner = untag_ptr(this_ptr);
36151 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36153 this_ptr_conv.is_owned = false;
36154 int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
36158 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36159 LDKChannelReestablish this_ptr_conv;
36160 this_ptr_conv.inner = untag_ptr(this_ptr);
36161 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36162 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36163 this_ptr_conv.is_owned = false;
36164 ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
36167 static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) {
36168 LDKChannelReestablish ret_var = ChannelReestablish_clone(arg);
36169 int64_t ret_ref = 0;
36170 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36171 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36174 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36175 LDKChannelReestablish arg_conv;
36176 arg_conv.inner = untag_ptr(arg);
36177 arg_conv.is_owned = ptr_is_owned(arg);
36178 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36179 arg_conv.is_owned = false;
36180 int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv);
36184 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36185 LDKChannelReestablish orig_conv;
36186 orig_conv.inner = untag_ptr(orig);
36187 orig_conv.is_owned = ptr_is_owned(orig);
36188 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36189 orig_conv.is_owned = false;
36190 LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
36191 int64_t ret_ref = 0;
36192 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36193 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36197 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36198 LDKChannelReestablish a_conv;
36199 a_conv.inner = untag_ptr(a);
36200 a_conv.is_owned = ptr_is_owned(a);
36201 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36202 a_conv.is_owned = false;
36203 LDKChannelReestablish b_conv;
36204 b_conv.inner = untag_ptr(b);
36205 b_conv.is_owned = ptr_is_owned(b);
36206 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36207 b_conv.is_owned = false;
36208 jboolean ret_conv = ChannelReestablish_eq(&a_conv, &b_conv);
36212 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36213 LDKAnnouncementSignatures this_obj_conv;
36214 this_obj_conv.inner = untag_ptr(this_obj);
36215 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36216 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36217 AnnouncementSignatures_free(this_obj_conv);
36220 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36221 LDKAnnouncementSignatures this_ptr_conv;
36222 this_ptr_conv.inner = untag_ptr(this_ptr);
36223 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36224 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36225 this_ptr_conv.is_owned = false;
36226 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36227 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv));
36231 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36232 LDKAnnouncementSignatures this_ptr_conv;
36233 this_ptr_conv.inner = untag_ptr(this_ptr);
36234 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36236 this_ptr_conv.is_owned = false;
36237 LDKThirtyTwoBytes val_ref;
36238 CHECK((*env)->GetArrayLength(env, val) == 32);
36239 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36240 AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref);
36243 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36244 LDKAnnouncementSignatures this_ptr_conv;
36245 this_ptr_conv.inner = untag_ptr(this_ptr);
36246 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36248 this_ptr_conv.is_owned = false;
36249 int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
36253 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36254 LDKAnnouncementSignatures this_ptr_conv;
36255 this_ptr_conv.inner = untag_ptr(this_ptr);
36256 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36257 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36258 this_ptr_conv.is_owned = false;
36259 AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
36262 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
36263 LDKAnnouncementSignatures this_ptr_conv;
36264 this_ptr_conv.inner = untag_ptr(this_ptr);
36265 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36267 this_ptr_conv.is_owned = false;
36268 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
36269 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form);
36273 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36274 LDKAnnouncementSignatures this_ptr_conv;
36275 this_ptr_conv.inner = untag_ptr(this_ptr);
36276 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36278 this_ptr_conv.is_owned = false;
36279 LDKSignature val_ref;
36280 CHECK((*env)->GetArrayLength(env, val) == 64);
36281 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
36282 AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref);
36285 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
36286 LDKAnnouncementSignatures this_ptr_conv;
36287 this_ptr_conv.inner = untag_ptr(this_ptr);
36288 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36289 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36290 this_ptr_conv.is_owned = false;
36291 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
36292 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form);
36296 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36297 LDKAnnouncementSignatures this_ptr_conv;
36298 this_ptr_conv.inner = untag_ptr(this_ptr);
36299 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36301 this_ptr_conv.is_owned = false;
36302 LDKSignature val_ref;
36303 CHECK((*env)->GetArrayLength(env, val) == 64);
36304 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
36305 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref);
36308 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t short_channel_id_arg, int8_tArray node_signature_arg, int8_tArray bitcoin_signature_arg) {
36309 LDKThirtyTwoBytes channel_id_arg_ref;
36310 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
36311 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
36312 LDKSignature node_signature_arg_ref;
36313 CHECK((*env)->GetArrayLength(env, node_signature_arg) == 64);
36314 (*env)->GetByteArrayRegion(env, node_signature_arg, 0, 64, node_signature_arg_ref.compact_form);
36315 LDKSignature bitcoin_signature_arg_ref;
36316 CHECK((*env)->GetArrayLength(env, bitcoin_signature_arg) == 64);
36317 (*env)->GetByteArrayRegion(env, bitcoin_signature_arg, 0, 64, bitcoin_signature_arg_ref.compact_form);
36318 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
36319 int64_t ret_ref = 0;
36320 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36321 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36325 static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) {
36326 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg);
36327 int64_t ret_ref = 0;
36328 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36329 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36332 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36333 LDKAnnouncementSignatures arg_conv;
36334 arg_conv.inner = untag_ptr(arg);
36335 arg_conv.is_owned = ptr_is_owned(arg);
36336 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36337 arg_conv.is_owned = false;
36338 int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv);
36342 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36343 LDKAnnouncementSignatures orig_conv;
36344 orig_conv.inner = untag_ptr(orig);
36345 orig_conv.is_owned = ptr_is_owned(orig);
36346 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36347 orig_conv.is_owned = false;
36348 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
36349 int64_t ret_ref = 0;
36350 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36351 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36355 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36356 LDKAnnouncementSignatures a_conv;
36357 a_conv.inner = untag_ptr(a);
36358 a_conv.is_owned = ptr_is_owned(a);
36359 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36360 a_conv.is_owned = false;
36361 LDKAnnouncementSignatures b_conv;
36362 b_conv.inner = untag_ptr(b);
36363 b_conv.is_owned = ptr_is_owned(b);
36364 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36365 b_conv.is_owned = false;
36366 jboolean ret_conv = AnnouncementSignatures_eq(&a_conv, &b_conv);
36370 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
36371 if (!ptr_is_owned(this_ptr)) return;
36372 void* this_ptr_ptr = untag_ptr(this_ptr);
36373 CHECK_ACCESS(this_ptr_ptr);
36374 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
36375 FREE(untag_ptr(this_ptr));
36376 NetAddress_free(this_ptr_conv);
36379 static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) {
36380 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
36381 *ret_copy = NetAddress_clone(arg);
36382 int64_t ret_ref = tag_ptr(ret_copy, true);
36385 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36386 LDKNetAddress* arg_conv = (LDKNetAddress*)untag_ptr(arg);
36387 int64_t ret_conv = NetAddress_clone_ptr(arg_conv);
36391 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36392 LDKNetAddress* orig_conv = (LDKNetAddress*)untag_ptr(orig);
36393 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
36394 *ret_copy = NetAddress_clone(orig_conv);
36395 int64_t ret_ref = tag_ptr(ret_copy, true);
36399 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
36400 LDKFourBytes addr_ref;
36401 CHECK((*env)->GetArrayLength(env, addr) == 4);
36402 (*env)->GetByteArrayRegion(env, addr, 0, 4, addr_ref.data);
36403 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
36404 *ret_copy = NetAddress_ipv4(addr_ref, port);
36405 int64_t ret_ref = tag_ptr(ret_copy, true);
36409 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
36410 LDKSixteenBytes addr_ref;
36411 CHECK((*env)->GetArrayLength(env, addr) == 16);
36412 (*env)->GetByteArrayRegion(env, addr, 0, 16, addr_ref.data);
36413 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
36414 *ret_copy = NetAddress_ipv6(addr_ref, port);
36415 int64_t ret_ref = tag_ptr(ret_copy, true);
36419 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray a) {
36420 LDKTwelveBytes a_ref;
36421 CHECK((*env)->GetArrayLength(env, a) == 12);
36422 (*env)->GetByteArrayRegion(env, a, 0, 12, a_ref.data);
36423 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
36424 *ret_copy = NetAddress_onion_v2(a_ref);
36425 int64_t ret_ref = tag_ptr(ret_copy, true);
36429 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v3(JNIEnv *env, jclass clz, int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) {
36430 LDKThirtyTwoBytes ed25519_pubkey_ref;
36431 CHECK((*env)->GetArrayLength(env, ed25519_pubkey) == 32);
36432 (*env)->GetByteArrayRegion(env, ed25519_pubkey, 0, 32, ed25519_pubkey_ref.data);
36433 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
36434 *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
36435 int64_t ret_ref = tag_ptr(ret_copy, true);
36439 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1hostname(JNIEnv *env, jclass clz, int64_t hostname, int16_t port) {
36440 LDKHostname hostname_conv;
36441 hostname_conv.inner = untag_ptr(hostname);
36442 hostname_conv.is_owned = ptr_is_owned(hostname);
36443 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_conv);
36444 hostname_conv = Hostname_clone(&hostname_conv);
36445 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
36446 *ret_copy = NetAddress_hostname(hostname_conv, port);
36447 int64_t ret_ref = tag_ptr(ret_copy, true);
36451 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetAddress_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36452 LDKNetAddress* a_conv = (LDKNetAddress*)untag_ptr(a);
36453 LDKNetAddress* b_conv = (LDKNetAddress*)untag_ptr(b);
36454 jboolean ret_conv = NetAddress_eq(a_conv, b_conv);
36458 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) {
36459 LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
36460 LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
36461 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36462 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36463 CVec_u8Z_free(ret_var);
36467 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36468 LDKu8slice ser_ref;
36469 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36470 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36471 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
36472 *ret_conv = NetAddress_read(ser_ref);
36473 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36474 return tag_ptr(ret_conv, true);
36477 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36478 LDKUnsignedNodeAnnouncement this_obj_conv;
36479 this_obj_conv.inner = untag_ptr(this_obj);
36480 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36482 UnsignedNodeAnnouncement_free(this_obj_conv);
36485 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
36486 LDKUnsignedNodeAnnouncement this_ptr_conv;
36487 this_ptr_conv.inner = untag_ptr(this_ptr);
36488 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36489 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36490 this_ptr_conv.is_owned = false;
36491 LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
36492 int64_t ret_ref = 0;
36493 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36494 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36498 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36499 LDKUnsignedNodeAnnouncement this_ptr_conv;
36500 this_ptr_conv.inner = untag_ptr(this_ptr);
36501 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36503 this_ptr_conv.is_owned = false;
36504 LDKNodeFeatures val_conv;
36505 val_conv.inner = untag_ptr(val);
36506 val_conv.is_owned = ptr_is_owned(val);
36507 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
36508 val_conv = NodeFeatures_clone(&val_conv);
36509 UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv);
36512 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
36513 LDKUnsignedNodeAnnouncement this_ptr_conv;
36514 this_ptr_conv.inner = untag_ptr(this_ptr);
36515 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36516 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36517 this_ptr_conv.is_owned = false;
36518 int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
36522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
36523 LDKUnsignedNodeAnnouncement this_ptr_conv;
36524 this_ptr_conv.inner = untag_ptr(this_ptr);
36525 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36526 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36527 this_ptr_conv.is_owned = false;
36528 UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
36531 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36532 LDKUnsignedNodeAnnouncement this_ptr_conv;
36533 this_ptr_conv.inner = untag_ptr(this_ptr);
36534 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36535 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36536 this_ptr_conv.is_owned = false;
36537 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
36538 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form);
36542 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36543 LDKUnsignedNodeAnnouncement this_ptr_conv;
36544 this_ptr_conv.inner = untag_ptr(this_ptr);
36545 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36546 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36547 this_ptr_conv.is_owned = false;
36548 LDKPublicKey val_ref;
36549 CHECK((*env)->GetArrayLength(env, val) == 33);
36550 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
36551 UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref);
36554 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) {
36555 LDKUnsignedNodeAnnouncement this_ptr_conv;
36556 this_ptr_conv.inner = untag_ptr(this_ptr);
36557 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36558 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36559 this_ptr_conv.is_owned = false;
36560 int8_tArray ret_arr = (*env)->NewByteArray(env, 3);
36561 (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv));
36565 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36566 LDKUnsignedNodeAnnouncement this_ptr_conv;
36567 this_ptr_conv.inner = untag_ptr(this_ptr);
36568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36570 this_ptr_conv.is_owned = false;
36571 LDKThreeBytes val_ref;
36572 CHECK((*env)->GetArrayLength(env, val) == 3);
36573 (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data);
36574 UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref);
36577 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
36578 LDKUnsignedNodeAnnouncement this_ptr_conv;
36579 this_ptr_conv.inner = untag_ptr(this_ptr);
36580 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36581 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36582 this_ptr_conv.is_owned = false;
36583 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36584 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv));
36588 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36589 LDKUnsignedNodeAnnouncement this_ptr_conv;
36590 this_ptr_conv.inner = untag_ptr(this_ptr);
36591 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36592 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36593 this_ptr_conv.is_owned = false;
36594 LDKThirtyTwoBytes val_ref;
36595 CHECK((*env)->GetArrayLength(env, val) == 32);
36596 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36597 UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref);
36600 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) {
36601 LDKUnsignedNodeAnnouncement this_ptr_conv;
36602 this_ptr_conv.inner = untag_ptr(this_ptr);
36603 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36604 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36605 this_ptr_conv.is_owned = false;
36606 LDKCVec_NetAddressZ ret_var = UnsignedNodeAnnouncement_get_addresses(&this_ptr_conv);
36607 int64_tArray ret_arr = NULL;
36608 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
36609 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
36610 for (size_t m = 0; m < ret_var.datalen; m++) {
36611 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
36612 *ret_conv_12_copy = ret_var.data[m];
36613 int64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
36614 ret_arr_ptr[m] = ret_conv_12_ref;
36616 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
36617 FREE(ret_var.data);
36621 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
36622 LDKUnsignedNodeAnnouncement this_ptr_conv;
36623 this_ptr_conv.inner = untag_ptr(this_ptr);
36624 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36625 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36626 this_ptr_conv.is_owned = false;
36627 LDKCVec_NetAddressZ val_constr;
36628 val_constr.datalen = (*env)->GetArrayLength(env, val);
36629 if (val_constr.datalen > 0)
36630 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
36632 val_constr.data = NULL;
36633 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
36634 for (size_t m = 0; m < val_constr.datalen; m++) {
36635 int64_t val_conv_12 = val_vals[m];
36636 void* val_conv_12_ptr = untag_ptr(val_conv_12);
36637 CHECK_ACCESS(val_conv_12_ptr);
36638 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
36639 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
36640 val_constr.data[m] = val_conv_12_conv;
36642 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
36643 UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
36646 static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) {
36647 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg);
36648 int64_t ret_ref = 0;
36649 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36650 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36653 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36654 LDKUnsignedNodeAnnouncement arg_conv;
36655 arg_conv.inner = untag_ptr(arg);
36656 arg_conv.is_owned = ptr_is_owned(arg);
36657 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36658 arg_conv.is_owned = false;
36659 int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv);
36663 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36664 LDKUnsignedNodeAnnouncement orig_conv;
36665 orig_conv.inner = untag_ptr(orig);
36666 orig_conv.is_owned = ptr_is_owned(orig);
36667 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36668 orig_conv.is_owned = false;
36669 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
36670 int64_t ret_ref = 0;
36671 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36672 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36676 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36677 LDKUnsignedNodeAnnouncement a_conv;
36678 a_conv.inner = untag_ptr(a);
36679 a_conv.is_owned = ptr_is_owned(a);
36680 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36681 a_conv.is_owned = false;
36682 LDKUnsignedNodeAnnouncement b_conv;
36683 b_conv.inner = untag_ptr(b);
36684 b_conv.is_owned = ptr_is_owned(b);
36685 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36686 b_conv.is_owned = false;
36687 jboolean ret_conv = UnsignedNodeAnnouncement_eq(&a_conv, &b_conv);
36691 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36692 LDKNodeAnnouncement this_obj_conv;
36693 this_obj_conv.inner = untag_ptr(this_obj);
36694 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36696 NodeAnnouncement_free(this_obj_conv);
36699 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
36700 LDKNodeAnnouncement this_ptr_conv;
36701 this_ptr_conv.inner = untag_ptr(this_ptr);
36702 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36704 this_ptr_conv.is_owned = false;
36705 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
36706 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form);
36710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36711 LDKNodeAnnouncement this_ptr_conv;
36712 this_ptr_conv.inner = untag_ptr(this_ptr);
36713 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36714 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36715 this_ptr_conv.is_owned = false;
36716 LDKSignature val_ref;
36717 CHECK((*env)->GetArrayLength(env, val) == 64);
36718 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
36719 NodeAnnouncement_set_signature(&this_ptr_conv, val_ref);
36722 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
36723 LDKNodeAnnouncement this_ptr_conv;
36724 this_ptr_conv.inner = untag_ptr(this_ptr);
36725 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36727 this_ptr_conv.is_owned = false;
36728 LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
36729 int64_t ret_ref = 0;
36730 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36731 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36736 LDKNodeAnnouncement this_ptr_conv;
36737 this_ptr_conv.inner = untag_ptr(this_ptr);
36738 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36740 this_ptr_conv.is_owned = false;
36741 LDKUnsignedNodeAnnouncement val_conv;
36742 val_conv.inner = untag_ptr(val);
36743 val_conv.is_owned = ptr_is_owned(val);
36744 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
36745 val_conv = UnsignedNodeAnnouncement_clone(&val_conv);
36746 NodeAnnouncement_set_contents(&this_ptr_conv, val_conv);
36749 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) {
36750 LDKSignature signature_arg_ref;
36751 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
36752 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
36753 LDKUnsignedNodeAnnouncement contents_arg_conv;
36754 contents_arg_conv.inner = untag_ptr(contents_arg);
36755 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
36756 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
36757 contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
36758 LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv);
36759 int64_t ret_ref = 0;
36760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36765 static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) {
36766 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg);
36767 int64_t ret_ref = 0;
36768 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36769 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36773 LDKNodeAnnouncement arg_conv;
36774 arg_conv.inner = untag_ptr(arg);
36775 arg_conv.is_owned = ptr_is_owned(arg);
36776 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36777 arg_conv.is_owned = false;
36778 int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv);
36782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36783 LDKNodeAnnouncement orig_conv;
36784 orig_conv.inner = untag_ptr(orig);
36785 orig_conv.is_owned = ptr_is_owned(orig);
36786 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36787 orig_conv.is_owned = false;
36788 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
36789 int64_t ret_ref = 0;
36790 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36791 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36795 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36796 LDKNodeAnnouncement a_conv;
36797 a_conv.inner = untag_ptr(a);
36798 a_conv.is_owned = ptr_is_owned(a);
36799 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36800 a_conv.is_owned = false;
36801 LDKNodeAnnouncement b_conv;
36802 b_conv.inner = untag_ptr(b);
36803 b_conv.is_owned = ptr_is_owned(b);
36804 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36805 b_conv.is_owned = false;
36806 jboolean ret_conv = NodeAnnouncement_eq(&a_conv, &b_conv);
36810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36811 LDKUnsignedChannelAnnouncement this_obj_conv;
36812 this_obj_conv.inner = untag_ptr(this_obj);
36813 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36815 UnsignedChannelAnnouncement_free(this_obj_conv);
36818 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
36819 LDKUnsignedChannelAnnouncement this_ptr_conv;
36820 this_ptr_conv.inner = untag_ptr(this_ptr);
36821 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36822 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36823 this_ptr_conv.is_owned = false;
36824 LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
36825 int64_t ret_ref = 0;
36826 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36827 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36832 LDKUnsignedChannelAnnouncement this_ptr_conv;
36833 this_ptr_conv.inner = untag_ptr(this_ptr);
36834 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36836 this_ptr_conv.is_owned = false;
36837 LDKChannelFeatures val_conv;
36838 val_conv.inner = untag_ptr(val);
36839 val_conv.is_owned = ptr_is_owned(val);
36840 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
36841 val_conv = ChannelFeatures_clone(&val_conv);
36842 UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv);
36845 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
36846 LDKUnsignedChannelAnnouncement this_ptr_conv;
36847 this_ptr_conv.inner = untag_ptr(this_ptr);
36848 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36849 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36850 this_ptr_conv.is_owned = false;
36851 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36852 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv));
36856 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36857 LDKUnsignedChannelAnnouncement this_ptr_conv;
36858 this_ptr_conv.inner = untag_ptr(this_ptr);
36859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36861 this_ptr_conv.is_owned = false;
36862 LDKThirtyTwoBytes val_ref;
36863 CHECK((*env)->GetArrayLength(env, val) == 32);
36864 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36865 UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref);
36868 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36869 LDKUnsignedChannelAnnouncement this_ptr_conv;
36870 this_ptr_conv.inner = untag_ptr(this_ptr);
36871 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36873 this_ptr_conv.is_owned = false;
36874 int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
36878 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36879 LDKUnsignedChannelAnnouncement this_ptr_conv;
36880 this_ptr_conv.inner = untag_ptr(this_ptr);
36881 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36882 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36883 this_ptr_conv.is_owned = false;
36884 UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
36887 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
36888 LDKUnsignedChannelAnnouncement this_ptr_conv;
36889 this_ptr_conv.inner = untag_ptr(this_ptr);
36890 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36891 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36892 this_ptr_conv.is_owned = false;
36893 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
36894 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form);
36898 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36899 LDKUnsignedChannelAnnouncement this_ptr_conv;
36900 this_ptr_conv.inner = untag_ptr(this_ptr);
36901 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36903 this_ptr_conv.is_owned = false;
36904 LDKPublicKey val_ref;
36905 CHECK((*env)->GetArrayLength(env, val) == 33);
36906 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
36907 UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref);
36910 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
36911 LDKUnsignedChannelAnnouncement this_ptr_conv;
36912 this_ptr_conv.inner = untag_ptr(this_ptr);
36913 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36915 this_ptr_conv.is_owned = false;
36916 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
36917 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form);
36921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36922 LDKUnsignedChannelAnnouncement this_ptr_conv;
36923 this_ptr_conv.inner = untag_ptr(this_ptr);
36924 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36926 this_ptr_conv.is_owned = false;
36927 LDKPublicKey val_ref;
36928 CHECK((*env)->GetArrayLength(env, val) == 33);
36929 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
36930 UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref);
36933 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
36934 LDKUnsignedChannelAnnouncement this_ptr_conv;
36935 this_ptr_conv.inner = untag_ptr(this_ptr);
36936 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36938 this_ptr_conv.is_owned = false;
36939 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
36940 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form);
36944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36945 LDKUnsignedChannelAnnouncement this_ptr_conv;
36946 this_ptr_conv.inner = untag_ptr(this_ptr);
36947 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36948 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36949 this_ptr_conv.is_owned = false;
36950 LDKPublicKey val_ref;
36951 CHECK((*env)->GetArrayLength(env, val) == 33);
36952 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
36953 UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref);
36956 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
36957 LDKUnsignedChannelAnnouncement this_ptr_conv;
36958 this_ptr_conv.inner = untag_ptr(this_ptr);
36959 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36961 this_ptr_conv.is_owned = false;
36962 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
36963 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form);
36967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36968 LDKUnsignedChannelAnnouncement this_ptr_conv;
36969 this_ptr_conv.inner = untag_ptr(this_ptr);
36970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36972 this_ptr_conv.is_owned = false;
36973 LDKPublicKey val_ref;
36974 CHECK((*env)->GetArrayLength(env, val) == 33);
36975 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
36976 UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref);
36979 static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
36980 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg);
36981 int64_t ret_ref = 0;
36982 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36983 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36986 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36987 LDKUnsignedChannelAnnouncement arg_conv;
36988 arg_conv.inner = untag_ptr(arg);
36989 arg_conv.is_owned = ptr_is_owned(arg);
36990 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36991 arg_conv.is_owned = false;
36992 int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv);
36996 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36997 LDKUnsignedChannelAnnouncement orig_conv;
36998 orig_conv.inner = untag_ptr(orig);
36999 orig_conv.is_owned = ptr_is_owned(orig);
37000 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37001 orig_conv.is_owned = false;
37002 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv);
37003 int64_t ret_ref = 0;
37004 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37005 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37009 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37010 LDKUnsignedChannelAnnouncement a_conv;
37011 a_conv.inner = untag_ptr(a);
37012 a_conv.is_owned = ptr_is_owned(a);
37013 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37014 a_conv.is_owned = false;
37015 LDKUnsignedChannelAnnouncement b_conv;
37016 b_conv.inner = untag_ptr(b);
37017 b_conv.is_owned = ptr_is_owned(b);
37018 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37019 b_conv.is_owned = false;
37020 jboolean ret_conv = UnsignedChannelAnnouncement_eq(&a_conv, &b_conv);
37024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37025 LDKChannelAnnouncement this_obj_conv;
37026 this_obj_conv.inner = untag_ptr(this_obj);
37027 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37029 ChannelAnnouncement_free(this_obj_conv);
37032 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
37033 LDKChannelAnnouncement this_ptr_conv;
37034 this_ptr_conv.inner = untag_ptr(this_ptr);
37035 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37037 this_ptr_conv.is_owned = false;
37038 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
37039 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form);
37043 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37044 LDKChannelAnnouncement this_ptr_conv;
37045 this_ptr_conv.inner = untag_ptr(this_ptr);
37046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37048 this_ptr_conv.is_owned = false;
37049 LDKSignature val_ref;
37050 CHECK((*env)->GetArrayLength(env, val) == 64);
37051 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
37052 ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref);
37055 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
37056 LDKChannelAnnouncement this_ptr_conv;
37057 this_ptr_conv.inner = untag_ptr(this_ptr);
37058 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37060 this_ptr_conv.is_owned = false;
37061 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
37062 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form);
37066 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37067 LDKChannelAnnouncement this_ptr_conv;
37068 this_ptr_conv.inner = untag_ptr(this_ptr);
37069 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37070 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37071 this_ptr_conv.is_owned = false;
37072 LDKSignature val_ref;
37073 CHECK((*env)->GetArrayLength(env, val) == 64);
37074 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
37075 ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref);
37078 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
37079 LDKChannelAnnouncement this_ptr_conv;
37080 this_ptr_conv.inner = untag_ptr(this_ptr);
37081 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37083 this_ptr_conv.is_owned = false;
37084 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
37085 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form);
37089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37090 LDKChannelAnnouncement this_ptr_conv;
37091 this_ptr_conv.inner = untag_ptr(this_ptr);
37092 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37093 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37094 this_ptr_conv.is_owned = false;
37095 LDKSignature val_ref;
37096 CHECK((*env)->GetArrayLength(env, val) == 64);
37097 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
37098 ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref);
37101 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
37102 LDKChannelAnnouncement this_ptr_conv;
37103 this_ptr_conv.inner = untag_ptr(this_ptr);
37104 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37105 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37106 this_ptr_conv.is_owned = false;
37107 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
37108 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form);
37112 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37113 LDKChannelAnnouncement this_ptr_conv;
37114 this_ptr_conv.inner = untag_ptr(this_ptr);
37115 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37117 this_ptr_conv.is_owned = false;
37118 LDKSignature val_ref;
37119 CHECK((*env)->GetArrayLength(env, val) == 64);
37120 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
37121 ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref);
37124 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
37125 LDKChannelAnnouncement this_ptr_conv;
37126 this_ptr_conv.inner = untag_ptr(this_ptr);
37127 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37128 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37129 this_ptr_conv.is_owned = false;
37130 LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
37131 int64_t ret_ref = 0;
37132 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37133 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37137 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37138 LDKChannelAnnouncement this_ptr_conv;
37139 this_ptr_conv.inner = untag_ptr(this_ptr);
37140 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37141 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37142 this_ptr_conv.is_owned = false;
37143 LDKUnsignedChannelAnnouncement val_conv;
37144 val_conv.inner = untag_ptr(val);
37145 val_conv.is_owned = ptr_is_owned(val);
37146 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
37147 val_conv = UnsignedChannelAnnouncement_clone(&val_conv);
37148 ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv);
37151 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray node_signature_1_arg, int8_tArray node_signature_2_arg, int8_tArray bitcoin_signature_1_arg, int8_tArray bitcoin_signature_2_arg, int64_t contents_arg) {
37152 LDKSignature node_signature_1_arg_ref;
37153 CHECK((*env)->GetArrayLength(env, node_signature_1_arg) == 64);
37154 (*env)->GetByteArrayRegion(env, node_signature_1_arg, 0, 64, node_signature_1_arg_ref.compact_form);
37155 LDKSignature node_signature_2_arg_ref;
37156 CHECK((*env)->GetArrayLength(env, node_signature_2_arg) == 64);
37157 (*env)->GetByteArrayRegion(env, node_signature_2_arg, 0, 64, node_signature_2_arg_ref.compact_form);
37158 LDKSignature bitcoin_signature_1_arg_ref;
37159 CHECK((*env)->GetArrayLength(env, bitcoin_signature_1_arg) == 64);
37160 (*env)->GetByteArrayRegion(env, bitcoin_signature_1_arg, 0, 64, bitcoin_signature_1_arg_ref.compact_form);
37161 LDKSignature bitcoin_signature_2_arg_ref;
37162 CHECK((*env)->GetArrayLength(env, bitcoin_signature_2_arg) == 64);
37163 (*env)->GetByteArrayRegion(env, bitcoin_signature_2_arg, 0, 64, bitcoin_signature_2_arg_ref.compact_form);
37164 LDKUnsignedChannelAnnouncement contents_arg_conv;
37165 contents_arg_conv.inner = untag_ptr(contents_arg);
37166 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
37167 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
37168 contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
37169 LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv);
37170 int64_t ret_ref = 0;
37171 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37172 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37176 static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) {
37177 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg);
37178 int64_t ret_ref = 0;
37179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37183 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37184 LDKChannelAnnouncement arg_conv;
37185 arg_conv.inner = untag_ptr(arg);
37186 arg_conv.is_owned = ptr_is_owned(arg);
37187 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37188 arg_conv.is_owned = false;
37189 int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv);
37193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37194 LDKChannelAnnouncement orig_conv;
37195 orig_conv.inner = untag_ptr(orig);
37196 orig_conv.is_owned = ptr_is_owned(orig);
37197 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37198 orig_conv.is_owned = false;
37199 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
37200 int64_t ret_ref = 0;
37201 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37202 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37206 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37207 LDKChannelAnnouncement a_conv;
37208 a_conv.inner = untag_ptr(a);
37209 a_conv.is_owned = ptr_is_owned(a);
37210 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37211 a_conv.is_owned = false;
37212 LDKChannelAnnouncement b_conv;
37213 b_conv.inner = untag_ptr(b);
37214 b_conv.is_owned = ptr_is_owned(b);
37215 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37216 b_conv.is_owned = false;
37217 jboolean ret_conv = ChannelAnnouncement_eq(&a_conv, &b_conv);
37221 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37222 LDKUnsignedChannelUpdate this_obj_conv;
37223 this_obj_conv.inner = untag_ptr(this_obj);
37224 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37225 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37226 UnsignedChannelUpdate_free(this_obj_conv);
37229 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
37230 LDKUnsignedChannelUpdate this_ptr_conv;
37231 this_ptr_conv.inner = untag_ptr(this_ptr);
37232 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37233 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37234 this_ptr_conv.is_owned = false;
37235 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37236 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv));
37240 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37241 LDKUnsignedChannelUpdate this_ptr_conv;
37242 this_ptr_conv.inner = untag_ptr(this_ptr);
37243 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37245 this_ptr_conv.is_owned = false;
37246 LDKThirtyTwoBytes val_ref;
37247 CHECK((*env)->GetArrayLength(env, val) == 32);
37248 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37249 UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref);
37252 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37253 LDKUnsignedChannelUpdate this_ptr_conv;
37254 this_ptr_conv.inner = untag_ptr(this_ptr);
37255 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37257 this_ptr_conv.is_owned = false;
37258 int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
37262 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37263 LDKUnsignedChannelUpdate this_ptr_conv;
37264 this_ptr_conv.inner = untag_ptr(this_ptr);
37265 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37267 this_ptr_conv.is_owned = false;
37268 UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
37271 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
37272 LDKUnsignedChannelUpdate this_ptr_conv;
37273 this_ptr_conv.inner = untag_ptr(this_ptr);
37274 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37276 this_ptr_conv.is_owned = false;
37277 int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
37281 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
37282 LDKUnsignedChannelUpdate this_ptr_conv;
37283 this_ptr_conv.inner = untag_ptr(this_ptr);
37284 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37286 this_ptr_conv.is_owned = false;
37287 UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
37290 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) {
37291 LDKUnsignedChannelUpdate this_ptr_conv;
37292 this_ptr_conv.inner = untag_ptr(this_ptr);
37293 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37295 this_ptr_conv.is_owned = false;
37296 int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
37300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
37301 LDKUnsignedChannelUpdate this_ptr_conv;
37302 this_ptr_conv.inner = untag_ptr(this_ptr);
37303 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37304 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37305 this_ptr_conv.is_owned = false;
37306 UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
37309 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
37310 LDKUnsignedChannelUpdate this_ptr_conv;
37311 this_ptr_conv.inner = untag_ptr(this_ptr);
37312 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37314 this_ptr_conv.is_owned = false;
37315 int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
37319 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
37320 LDKUnsignedChannelUpdate this_ptr_conv;
37321 this_ptr_conv.inner = untag_ptr(this_ptr);
37322 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37324 this_ptr_conv.is_owned = false;
37325 UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
37328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
37329 LDKUnsignedChannelUpdate this_ptr_conv;
37330 this_ptr_conv.inner = untag_ptr(this_ptr);
37331 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37332 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37333 this_ptr_conv.is_owned = false;
37334 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
37338 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37339 LDKUnsignedChannelUpdate this_ptr_conv;
37340 this_ptr_conv.inner = untag_ptr(this_ptr);
37341 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37342 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37343 this_ptr_conv.is_owned = false;
37344 UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
37347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
37348 LDKUnsignedChannelUpdate this_ptr_conv;
37349 this_ptr_conv.inner = untag_ptr(this_ptr);
37350 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37352 this_ptr_conv.is_owned = false;
37353 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv);
37357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37358 LDKUnsignedChannelUpdate this_ptr_conv;
37359 this_ptr_conv.inner = untag_ptr(this_ptr);
37360 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37362 this_ptr_conv.is_owned = false;
37363 UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val);
37366 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
37367 LDKUnsignedChannelUpdate this_ptr_conv;
37368 this_ptr_conv.inner = untag_ptr(this_ptr);
37369 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37371 this_ptr_conv.is_owned = false;
37372 int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
37376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
37377 LDKUnsignedChannelUpdate this_ptr_conv;
37378 this_ptr_conv.inner = untag_ptr(this_ptr);
37379 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37381 this_ptr_conv.is_owned = false;
37382 UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
37385 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
37386 LDKUnsignedChannelUpdate this_ptr_conv;
37387 this_ptr_conv.inner = untag_ptr(this_ptr);
37388 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37390 this_ptr_conv.is_owned = false;
37391 int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
37395 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
37396 LDKUnsignedChannelUpdate this_ptr_conv;
37397 this_ptr_conv.inner = untag_ptr(this_ptr);
37398 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37400 this_ptr_conv.is_owned = false;
37401 UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
37404 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1excess_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
37405 LDKUnsignedChannelUpdate this_ptr_conv;
37406 this_ptr_conv.inner = untag_ptr(this_ptr);
37407 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37408 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37409 this_ptr_conv.is_owned = false;
37410 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_conv);
37411 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37412 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37413 CVec_u8Z_free(ret_var);
37417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1excess_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37418 LDKUnsignedChannelUpdate this_ptr_conv;
37419 this_ptr_conv.inner = untag_ptr(this_ptr);
37420 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37422 this_ptr_conv.is_owned = false;
37423 LDKCVec_u8Z val_ref;
37424 val_ref.datalen = (*env)->GetArrayLength(env, val);
37425 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
37426 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
37427 UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref);
37430 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) {
37431 LDKThirtyTwoBytes chain_hash_arg_ref;
37432 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
37433 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
37434 LDKCVec_u8Z excess_data_arg_ref;
37435 excess_data_arg_ref.datalen = (*env)->GetArrayLength(env, excess_data_arg);
37436 excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes");
37437 (*env)->GetByteArrayRegion(env, excess_data_arg, 0, excess_data_arg_ref.datalen, excess_data_arg_ref.data);
37438 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_ref);
37439 int64_t ret_ref = 0;
37440 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37441 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37445 static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) {
37446 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg);
37447 int64_t ret_ref = 0;
37448 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37449 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37453 LDKUnsignedChannelUpdate arg_conv;
37454 arg_conv.inner = untag_ptr(arg);
37455 arg_conv.is_owned = ptr_is_owned(arg);
37456 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37457 arg_conv.is_owned = false;
37458 int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv);
37462 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37463 LDKUnsignedChannelUpdate orig_conv;
37464 orig_conv.inner = untag_ptr(orig);
37465 orig_conv.is_owned = ptr_is_owned(orig);
37466 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37467 orig_conv.is_owned = false;
37468 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
37469 int64_t ret_ref = 0;
37470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37471 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37475 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37476 LDKUnsignedChannelUpdate a_conv;
37477 a_conv.inner = untag_ptr(a);
37478 a_conv.is_owned = ptr_is_owned(a);
37479 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37480 a_conv.is_owned = false;
37481 LDKUnsignedChannelUpdate b_conv;
37482 b_conv.inner = untag_ptr(b);
37483 b_conv.is_owned = ptr_is_owned(b);
37484 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37485 b_conv.is_owned = false;
37486 jboolean ret_conv = UnsignedChannelUpdate_eq(&a_conv, &b_conv);
37490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37491 LDKChannelUpdate this_obj_conv;
37492 this_obj_conv.inner = untag_ptr(this_obj);
37493 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37495 ChannelUpdate_free(this_obj_conv);
37498 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
37499 LDKChannelUpdate this_ptr_conv;
37500 this_ptr_conv.inner = untag_ptr(this_ptr);
37501 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37503 this_ptr_conv.is_owned = false;
37504 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
37505 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form);
37509 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37510 LDKChannelUpdate this_ptr_conv;
37511 this_ptr_conv.inner = untag_ptr(this_ptr);
37512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37514 this_ptr_conv.is_owned = false;
37515 LDKSignature val_ref;
37516 CHECK((*env)->GetArrayLength(env, val) == 64);
37517 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
37518 ChannelUpdate_set_signature(&this_ptr_conv, val_ref);
37521 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
37522 LDKChannelUpdate this_ptr_conv;
37523 this_ptr_conv.inner = untag_ptr(this_ptr);
37524 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37526 this_ptr_conv.is_owned = false;
37527 LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
37528 int64_t ret_ref = 0;
37529 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37530 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37534 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37535 LDKChannelUpdate this_ptr_conv;
37536 this_ptr_conv.inner = untag_ptr(this_ptr);
37537 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37538 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37539 this_ptr_conv.is_owned = false;
37540 LDKUnsignedChannelUpdate val_conv;
37541 val_conv.inner = untag_ptr(val);
37542 val_conv.is_owned = ptr_is_owned(val);
37543 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
37544 val_conv = UnsignedChannelUpdate_clone(&val_conv);
37545 ChannelUpdate_set_contents(&this_ptr_conv, val_conv);
37548 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) {
37549 LDKSignature signature_arg_ref;
37550 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
37551 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
37552 LDKUnsignedChannelUpdate contents_arg_conv;
37553 contents_arg_conv.inner = untag_ptr(contents_arg);
37554 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
37555 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
37556 contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
37557 LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv);
37558 int64_t ret_ref = 0;
37559 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37560 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37564 static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) {
37565 LDKChannelUpdate ret_var = ChannelUpdate_clone(arg);
37566 int64_t ret_ref = 0;
37567 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37568 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37571 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37572 LDKChannelUpdate arg_conv;
37573 arg_conv.inner = untag_ptr(arg);
37574 arg_conv.is_owned = ptr_is_owned(arg);
37575 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37576 arg_conv.is_owned = false;
37577 int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv);
37581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37582 LDKChannelUpdate orig_conv;
37583 orig_conv.inner = untag_ptr(orig);
37584 orig_conv.is_owned = ptr_is_owned(orig);
37585 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37586 orig_conv.is_owned = false;
37587 LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
37588 int64_t ret_ref = 0;
37589 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37590 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37594 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37595 LDKChannelUpdate a_conv;
37596 a_conv.inner = untag_ptr(a);
37597 a_conv.is_owned = ptr_is_owned(a);
37598 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37599 a_conv.is_owned = false;
37600 LDKChannelUpdate b_conv;
37601 b_conv.inner = untag_ptr(b);
37602 b_conv.is_owned = ptr_is_owned(b);
37603 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37604 b_conv.is_owned = false;
37605 jboolean ret_conv = ChannelUpdate_eq(&a_conv, &b_conv);
37609 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37610 LDKQueryChannelRange this_obj_conv;
37611 this_obj_conv.inner = untag_ptr(this_obj);
37612 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37613 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37614 QueryChannelRange_free(this_obj_conv);
37617 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
37618 LDKQueryChannelRange this_ptr_conv;
37619 this_ptr_conv.inner = untag_ptr(this_ptr);
37620 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37622 this_ptr_conv.is_owned = false;
37623 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37624 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv));
37628 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37629 LDKQueryChannelRange this_ptr_conv;
37630 this_ptr_conv.inner = untag_ptr(this_ptr);
37631 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37633 this_ptr_conv.is_owned = false;
37634 LDKThirtyTwoBytes val_ref;
37635 CHECK((*env)->GetArrayLength(env, val) == 32);
37636 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37637 QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
37640 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) {
37641 LDKQueryChannelRange this_ptr_conv;
37642 this_ptr_conv.inner = untag_ptr(this_ptr);
37643 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37645 this_ptr_conv.is_owned = false;
37646 int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
37650 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
37651 LDKQueryChannelRange this_ptr_conv;
37652 this_ptr_conv.inner = untag_ptr(this_ptr);
37653 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37655 this_ptr_conv.is_owned = false;
37656 QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
37659 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) {
37660 LDKQueryChannelRange this_ptr_conv;
37661 this_ptr_conv.inner = untag_ptr(this_ptr);
37662 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37664 this_ptr_conv.is_owned = false;
37665 int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
37669 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
37670 LDKQueryChannelRange this_ptr_conv;
37671 this_ptr_conv.inner = untag_ptr(this_ptr);
37672 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37674 this_ptr_conv.is_owned = false;
37675 QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
37678 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg) {
37679 LDKThirtyTwoBytes chain_hash_arg_ref;
37680 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
37681 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
37682 LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
37683 int64_t ret_ref = 0;
37684 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37685 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37689 static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) {
37690 LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg);
37691 int64_t ret_ref = 0;
37692 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37693 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37697 LDKQueryChannelRange arg_conv;
37698 arg_conv.inner = untag_ptr(arg);
37699 arg_conv.is_owned = ptr_is_owned(arg);
37700 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37701 arg_conv.is_owned = false;
37702 int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv);
37706 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37707 LDKQueryChannelRange orig_conv;
37708 orig_conv.inner = untag_ptr(orig);
37709 orig_conv.is_owned = ptr_is_owned(orig);
37710 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37711 orig_conv.is_owned = false;
37712 LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
37713 int64_t ret_ref = 0;
37714 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37715 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37719 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37720 LDKQueryChannelRange a_conv;
37721 a_conv.inner = untag_ptr(a);
37722 a_conv.is_owned = ptr_is_owned(a);
37723 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37724 a_conv.is_owned = false;
37725 LDKQueryChannelRange b_conv;
37726 b_conv.inner = untag_ptr(b);
37727 b_conv.is_owned = ptr_is_owned(b);
37728 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37729 b_conv.is_owned = false;
37730 jboolean ret_conv = QueryChannelRange_eq(&a_conv, &b_conv);
37734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37735 LDKReplyChannelRange this_obj_conv;
37736 this_obj_conv.inner = untag_ptr(this_obj);
37737 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37738 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37739 ReplyChannelRange_free(this_obj_conv);
37742 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
37743 LDKReplyChannelRange this_ptr_conv;
37744 this_ptr_conv.inner = untag_ptr(this_ptr);
37745 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37747 this_ptr_conv.is_owned = false;
37748 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37749 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv));
37753 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37754 LDKReplyChannelRange this_ptr_conv;
37755 this_ptr_conv.inner = untag_ptr(this_ptr);
37756 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37757 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37758 this_ptr_conv.is_owned = false;
37759 LDKThirtyTwoBytes val_ref;
37760 CHECK((*env)->GetArrayLength(env, val) == 32);
37761 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37762 ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
37765 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) {
37766 LDKReplyChannelRange this_ptr_conv;
37767 this_ptr_conv.inner = untag_ptr(this_ptr);
37768 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37769 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37770 this_ptr_conv.is_owned = false;
37771 int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
37775 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
37776 LDKReplyChannelRange this_ptr_conv;
37777 this_ptr_conv.inner = untag_ptr(this_ptr);
37778 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37779 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37780 this_ptr_conv.is_owned = false;
37781 ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
37784 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) {
37785 LDKReplyChannelRange this_ptr_conv;
37786 this_ptr_conv.inner = untag_ptr(this_ptr);
37787 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37789 this_ptr_conv.is_owned = false;
37790 int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
37794 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
37795 LDKReplyChannelRange this_ptr_conv;
37796 this_ptr_conv.inner = untag_ptr(this_ptr);
37797 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37798 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37799 this_ptr_conv.is_owned = false;
37800 ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
37803 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr) {
37804 LDKReplyChannelRange this_ptr_conv;
37805 this_ptr_conv.inner = untag_ptr(this_ptr);
37806 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37808 this_ptr_conv.is_owned = false;
37809 jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv);
37813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
37814 LDKReplyChannelRange this_ptr_conv;
37815 this_ptr_conv.inner = untag_ptr(this_ptr);
37816 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37818 this_ptr_conv.is_owned = false;
37819 ReplyChannelRange_set_sync_complete(&this_ptr_conv, val);
37822 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr) {
37823 LDKReplyChannelRange this_ptr_conv;
37824 this_ptr_conv.inner = untag_ptr(this_ptr);
37825 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37827 this_ptr_conv.is_owned = false;
37828 LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv);
37829 int64_tArray ret_arr = NULL;
37830 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
37831 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
37832 for (size_t g = 0; g < ret_var.datalen; g++) {
37833 int64_t ret_conv_6_conv = ret_var.data[g];
37834 ret_arr_ptr[g] = ret_conv_6_conv;
37836 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
37837 FREE(ret_var.data);
37841 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
37842 LDKReplyChannelRange this_ptr_conv;
37843 this_ptr_conv.inner = untag_ptr(this_ptr);
37844 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37845 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37846 this_ptr_conv.is_owned = false;
37847 LDKCVec_u64Z val_constr;
37848 val_constr.datalen = (*env)->GetArrayLength(env, val);
37849 if (val_constr.datalen > 0)
37850 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
37852 val_constr.data = NULL;
37853 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
37854 for (size_t g = 0; g < val_constr.datalen; g++) {
37855 int64_t val_conv_6 = val_vals[g];
37856 val_constr.data[g] = val_conv_6;
37858 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
37859 ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
37862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg, jboolean sync_complete_arg, int64_tArray short_channel_ids_arg) {
37863 LDKThirtyTwoBytes chain_hash_arg_ref;
37864 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
37865 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
37866 LDKCVec_u64Z short_channel_ids_arg_constr;
37867 short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg);
37868 if (short_channel_ids_arg_constr.datalen > 0)
37869 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
37871 short_channel_ids_arg_constr.data = NULL;
37872 int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL);
37873 for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) {
37874 int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g];
37875 short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6;
37877 (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
37878 LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
37879 int64_t ret_ref = 0;
37880 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37881 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37885 static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) {
37886 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg);
37887 int64_t ret_ref = 0;
37888 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37889 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37892 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37893 LDKReplyChannelRange arg_conv;
37894 arg_conv.inner = untag_ptr(arg);
37895 arg_conv.is_owned = ptr_is_owned(arg);
37896 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37897 arg_conv.is_owned = false;
37898 int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv);
37902 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37903 LDKReplyChannelRange orig_conv;
37904 orig_conv.inner = untag_ptr(orig);
37905 orig_conv.is_owned = ptr_is_owned(orig);
37906 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37907 orig_conv.is_owned = false;
37908 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
37909 int64_t ret_ref = 0;
37910 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37911 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37915 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37916 LDKReplyChannelRange a_conv;
37917 a_conv.inner = untag_ptr(a);
37918 a_conv.is_owned = ptr_is_owned(a);
37919 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37920 a_conv.is_owned = false;
37921 LDKReplyChannelRange b_conv;
37922 b_conv.inner = untag_ptr(b);
37923 b_conv.is_owned = ptr_is_owned(b);
37924 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37925 b_conv.is_owned = false;
37926 jboolean ret_conv = ReplyChannelRange_eq(&a_conv, &b_conv);
37930 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37931 LDKQueryShortChannelIds this_obj_conv;
37932 this_obj_conv.inner = untag_ptr(this_obj);
37933 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37935 QueryShortChannelIds_free(this_obj_conv);
37938 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
37939 LDKQueryShortChannelIds this_ptr_conv;
37940 this_ptr_conv.inner = untag_ptr(this_ptr);
37941 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37943 this_ptr_conv.is_owned = false;
37944 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37945 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv));
37949 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37950 LDKQueryShortChannelIds this_ptr_conv;
37951 this_ptr_conv.inner = untag_ptr(this_ptr);
37952 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37954 this_ptr_conv.is_owned = false;
37955 LDKThirtyTwoBytes val_ref;
37956 CHECK((*env)->GetArrayLength(env, val) == 32);
37957 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37958 QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref);
37961 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr) {
37962 LDKQueryShortChannelIds this_ptr_conv;
37963 this_ptr_conv.inner = untag_ptr(this_ptr);
37964 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37966 this_ptr_conv.is_owned = false;
37967 LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv);
37968 int64_tArray ret_arr = NULL;
37969 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
37970 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
37971 for (size_t g = 0; g < ret_var.datalen; g++) {
37972 int64_t ret_conv_6_conv = ret_var.data[g];
37973 ret_arr_ptr[g] = ret_conv_6_conv;
37975 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
37976 FREE(ret_var.data);
37980 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
37981 LDKQueryShortChannelIds this_ptr_conv;
37982 this_ptr_conv.inner = untag_ptr(this_ptr);
37983 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37985 this_ptr_conv.is_owned = false;
37986 LDKCVec_u64Z val_constr;
37987 val_constr.datalen = (*env)->GetArrayLength(env, val);
37988 if (val_constr.datalen > 0)
37989 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
37991 val_constr.data = NULL;
37992 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
37993 for (size_t g = 0; g < val_constr.datalen; g++) {
37994 int64_t val_conv_6 = val_vals[g];
37995 val_constr.data[g] = val_conv_6;
37997 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
37998 QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
38001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) {
38002 LDKThirtyTwoBytes chain_hash_arg_ref;
38003 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
38004 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
38005 LDKCVec_u64Z short_channel_ids_arg_constr;
38006 short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg);
38007 if (short_channel_ids_arg_constr.datalen > 0)
38008 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
38010 short_channel_ids_arg_constr.data = NULL;
38011 int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL);
38012 for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) {
38013 int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g];
38014 short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6;
38016 (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
38017 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
38018 int64_t ret_ref = 0;
38019 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38020 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38024 static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) {
38025 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg);
38026 int64_t ret_ref = 0;
38027 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38028 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38031 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38032 LDKQueryShortChannelIds arg_conv;
38033 arg_conv.inner = untag_ptr(arg);
38034 arg_conv.is_owned = ptr_is_owned(arg);
38035 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38036 arg_conv.is_owned = false;
38037 int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv);
38041 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38042 LDKQueryShortChannelIds orig_conv;
38043 orig_conv.inner = untag_ptr(orig);
38044 orig_conv.is_owned = ptr_is_owned(orig);
38045 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38046 orig_conv.is_owned = false;
38047 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
38048 int64_t ret_ref = 0;
38049 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38050 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38054 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38055 LDKQueryShortChannelIds a_conv;
38056 a_conv.inner = untag_ptr(a);
38057 a_conv.is_owned = ptr_is_owned(a);
38058 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38059 a_conv.is_owned = false;
38060 LDKQueryShortChannelIds b_conv;
38061 b_conv.inner = untag_ptr(b);
38062 b_conv.is_owned = ptr_is_owned(b);
38063 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38064 b_conv.is_owned = false;
38065 jboolean ret_conv = QueryShortChannelIds_eq(&a_conv, &b_conv);
38069 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38070 LDKReplyShortChannelIdsEnd this_obj_conv;
38071 this_obj_conv.inner = untag_ptr(this_obj);
38072 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38074 ReplyShortChannelIdsEnd_free(this_obj_conv);
38077 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
38078 LDKReplyShortChannelIdsEnd this_ptr_conv;
38079 this_ptr_conv.inner = untag_ptr(this_ptr);
38080 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38081 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38082 this_ptr_conv.is_owned = false;
38083 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
38084 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv));
38088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38089 LDKReplyShortChannelIdsEnd this_ptr_conv;
38090 this_ptr_conv.inner = untag_ptr(this_ptr);
38091 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38092 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38093 this_ptr_conv.is_owned = false;
38094 LDKThirtyTwoBytes val_ref;
38095 CHECK((*env)->GetArrayLength(env, val) == 32);
38096 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
38097 ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref);
38100 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr) {
38101 LDKReplyShortChannelIdsEnd this_ptr_conv;
38102 this_ptr_conv.inner = untag_ptr(this_ptr);
38103 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38105 this_ptr_conv.is_owned = false;
38106 jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
38110 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
38111 LDKReplyShortChannelIdsEnd this_ptr_conv;
38112 this_ptr_conv.inner = untag_ptr(this_ptr);
38113 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38114 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38115 this_ptr_conv.is_owned = false;
38116 ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
38119 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, jboolean full_information_arg) {
38120 LDKThirtyTwoBytes chain_hash_arg_ref;
38121 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
38122 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
38123 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
38124 int64_t ret_ref = 0;
38125 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38126 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38130 static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) {
38131 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg);
38132 int64_t ret_ref = 0;
38133 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38134 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38138 LDKReplyShortChannelIdsEnd arg_conv;
38139 arg_conv.inner = untag_ptr(arg);
38140 arg_conv.is_owned = ptr_is_owned(arg);
38141 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38142 arg_conv.is_owned = false;
38143 int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv);
38147 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38148 LDKReplyShortChannelIdsEnd orig_conv;
38149 orig_conv.inner = untag_ptr(orig);
38150 orig_conv.is_owned = ptr_is_owned(orig);
38151 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38152 orig_conv.is_owned = false;
38153 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
38154 int64_t ret_ref = 0;
38155 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38156 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38160 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38161 LDKReplyShortChannelIdsEnd a_conv;
38162 a_conv.inner = untag_ptr(a);
38163 a_conv.is_owned = ptr_is_owned(a);
38164 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38165 a_conv.is_owned = false;
38166 LDKReplyShortChannelIdsEnd b_conv;
38167 b_conv.inner = untag_ptr(b);
38168 b_conv.is_owned = ptr_is_owned(b);
38169 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38170 b_conv.is_owned = false;
38171 jboolean ret_conv = ReplyShortChannelIdsEnd_eq(&a_conv, &b_conv);
38175 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38176 LDKGossipTimestampFilter this_obj_conv;
38177 this_obj_conv.inner = untag_ptr(this_obj);
38178 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38179 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38180 GossipTimestampFilter_free(this_obj_conv);
38183 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
38184 LDKGossipTimestampFilter this_ptr_conv;
38185 this_ptr_conv.inner = untag_ptr(this_ptr);
38186 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38187 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38188 this_ptr_conv.is_owned = false;
38189 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
38190 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv));
38194 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38195 LDKGossipTimestampFilter this_ptr_conv;
38196 this_ptr_conv.inner = untag_ptr(this_ptr);
38197 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38198 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38199 this_ptr_conv.is_owned = false;
38200 LDKThirtyTwoBytes val_ref;
38201 CHECK((*env)->GetArrayLength(env, val) == 32);
38202 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
38203 GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref);
38206 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
38207 LDKGossipTimestampFilter this_ptr_conv;
38208 this_ptr_conv.inner = untag_ptr(this_ptr);
38209 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38211 this_ptr_conv.is_owned = false;
38212 int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
38216 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
38217 LDKGossipTimestampFilter this_ptr_conv;
38218 this_ptr_conv.inner = untag_ptr(this_ptr);
38219 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38220 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38221 this_ptr_conv.is_owned = false;
38222 GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
38225 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr) {
38226 LDKGossipTimestampFilter this_ptr_conv;
38227 this_ptr_conv.inner = untag_ptr(this_ptr);
38228 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38229 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38230 this_ptr_conv.is_owned = false;
38231 int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
38235 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
38236 LDKGossipTimestampFilter this_ptr_conv;
38237 this_ptr_conv.inner = untag_ptr(this_ptr);
38238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38240 this_ptr_conv.is_owned = false;
38241 GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
38244 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_timestamp_arg, int32_t timestamp_range_arg) {
38245 LDKThirtyTwoBytes chain_hash_arg_ref;
38246 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
38247 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
38248 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
38249 int64_t ret_ref = 0;
38250 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38251 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38255 static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) {
38256 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg);
38257 int64_t ret_ref = 0;
38258 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38259 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38263 LDKGossipTimestampFilter arg_conv;
38264 arg_conv.inner = untag_ptr(arg);
38265 arg_conv.is_owned = ptr_is_owned(arg);
38266 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38267 arg_conv.is_owned = false;
38268 int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv);
38272 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38273 LDKGossipTimestampFilter orig_conv;
38274 orig_conv.inner = untag_ptr(orig);
38275 orig_conv.is_owned = ptr_is_owned(orig);
38276 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38277 orig_conv.is_owned = false;
38278 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv);
38279 int64_t ret_ref = 0;
38280 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38281 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38285 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38286 LDKGossipTimestampFilter a_conv;
38287 a_conv.inner = untag_ptr(a);
38288 a_conv.is_owned = ptr_is_owned(a);
38289 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38290 a_conv.is_owned = false;
38291 LDKGossipTimestampFilter b_conv;
38292 b_conv.inner = untag_ptr(b);
38293 b_conv.is_owned = ptr_is_owned(b);
38294 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38295 b_conv.is_owned = false;
38296 jboolean ret_conv = GossipTimestampFilter_eq(&a_conv, &b_conv);
38300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
38301 if (!ptr_is_owned(this_ptr)) return;
38302 void* this_ptr_ptr = untag_ptr(this_ptr);
38303 CHECK_ACCESS(this_ptr_ptr);
38304 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
38305 FREE(untag_ptr(this_ptr));
38306 ErrorAction_free(this_ptr_conv);
38309 static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) {
38310 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
38311 *ret_copy = ErrorAction_clone(arg);
38312 int64_t ret_ref = tag_ptr(ret_copy, true);
38315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38316 LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg);
38317 int64_t ret_conv = ErrorAction_clone_ptr(arg_conv);
38321 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38322 LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig);
38323 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
38324 *ret_copy = ErrorAction_clone(orig_conv);
38325 int64_t ret_ref = tag_ptr(ret_copy, true);
38329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1peer(JNIEnv *env, jclass clz, int64_t msg) {
38330 LDKErrorMessage msg_conv;
38331 msg_conv.inner = untag_ptr(msg);
38332 msg_conv.is_owned = ptr_is_owned(msg);
38333 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
38334 msg_conv = ErrorMessage_clone(&msg_conv);
38335 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
38336 *ret_copy = ErrorAction_disconnect_peer(msg_conv);
38337 int64_t ret_ref = tag_ptr(ret_copy, true);
38341 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error(JNIEnv *env, jclass clz) {
38342 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
38343 *ret_copy = ErrorAction_ignore_error();
38344 int64_t ret_ref = tag_ptr(ret_copy, true);
38348 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1and_1log(JNIEnv *env, jclass clz, jclass a) {
38349 LDKLevel a_conv = LDKLevel_from_java(env, a);
38350 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
38351 *ret_copy = ErrorAction_ignore_and_log(a_conv);
38352 int64_t ret_ref = tag_ptr(ret_copy, true);
38356 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip(JNIEnv *env, jclass clz) {
38357 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
38358 *ret_copy = ErrorAction_ignore_duplicate_gossip();
38359 int64_t ret_ref = tag_ptr(ret_copy, true);
38363 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) {
38364 LDKErrorMessage msg_conv;
38365 msg_conv.inner = untag_ptr(msg);
38366 msg_conv.is_owned = ptr_is_owned(msg);
38367 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
38368 msg_conv = ErrorMessage_clone(&msg_conv);
38369 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
38370 *ret_copy = ErrorAction_send_error_message(msg_conv);
38371 int64_t ret_ref = tag_ptr(ret_copy, true);
38375 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1warning_1message(JNIEnv *env, jclass clz, int64_t msg, jclass log_level) {
38376 LDKWarningMessage msg_conv;
38377 msg_conv.inner = untag_ptr(msg);
38378 msg_conv.is_owned = ptr_is_owned(msg);
38379 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
38380 msg_conv = WarningMessage_clone(&msg_conv);
38381 LDKLevel log_level_conv = LDKLevel_from_java(env, log_level);
38382 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
38383 *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv);
38384 int64_t ret_ref = tag_ptr(ret_copy, true);
38388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38389 LDKLightningError this_obj_conv;
38390 this_obj_conv.inner = untag_ptr(this_obj);
38391 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38392 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38393 LightningError_free(this_obj_conv);
38396 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv *env, jclass clz, int64_t this_ptr) {
38397 LDKLightningError this_ptr_conv;
38398 this_ptr_conv.inner = untag_ptr(this_ptr);
38399 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38401 this_ptr_conv.is_owned = false;
38402 LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
38403 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
38408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
38409 LDKLightningError this_ptr_conv;
38410 this_ptr_conv.inner = untag_ptr(this_ptr);
38411 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38412 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38413 this_ptr_conv.is_owned = false;
38414 LDKStr val_conv = java_to_owned_str(env, val);
38415 LightningError_set_err(&this_ptr_conv, val_conv);
38418 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv *env, jclass clz, int64_t this_ptr) {
38419 LDKLightningError this_ptr_conv;
38420 this_ptr_conv.inner = untag_ptr(this_ptr);
38421 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38423 this_ptr_conv.is_owned = false;
38424 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
38425 *ret_copy = LightningError_get_action(&this_ptr_conv);
38426 int64_t ret_ref = tag_ptr(ret_copy, true);
38430 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38431 LDKLightningError this_ptr_conv;
38432 this_ptr_conv.inner = untag_ptr(this_ptr);
38433 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38435 this_ptr_conv.is_owned = false;
38436 void* val_ptr = untag_ptr(val);
38437 CHECK_ACCESS(val_ptr);
38438 LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
38439 val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val));
38440 LightningError_set_action(&this_ptr_conv, val_conv);
38443 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *env, jclass clz, jstring err_arg, int64_t action_arg) {
38444 LDKStr err_arg_conv = java_to_owned_str(env, err_arg);
38445 void* action_arg_ptr = untag_ptr(action_arg);
38446 CHECK_ACCESS(action_arg_ptr);
38447 LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
38448 action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg));
38449 LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
38450 int64_t ret_ref = 0;
38451 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38452 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38456 static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) {
38457 LDKLightningError ret_var = LightningError_clone(arg);
38458 int64_t ret_ref = 0;
38459 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38460 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38464 LDKLightningError arg_conv;
38465 arg_conv.inner = untag_ptr(arg);
38466 arg_conv.is_owned = ptr_is_owned(arg);
38467 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38468 arg_conv.is_owned = false;
38469 int64_t ret_conv = LightningError_clone_ptr(&arg_conv);
38473 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38474 LDKLightningError orig_conv;
38475 orig_conv.inner = untag_ptr(orig);
38476 orig_conv.is_owned = ptr_is_owned(orig);
38477 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38478 orig_conv.is_owned = false;
38479 LDKLightningError ret_var = LightningError_clone(&orig_conv);
38480 int64_t ret_ref = 0;
38481 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38482 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38486 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38487 LDKCommitmentUpdate this_obj_conv;
38488 this_obj_conv.inner = untag_ptr(this_obj);
38489 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38490 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38491 CommitmentUpdate_free(this_obj_conv);
38494 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
38495 LDKCommitmentUpdate this_ptr_conv;
38496 this_ptr_conv.inner = untag_ptr(this_ptr);
38497 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38499 this_ptr_conv.is_owned = false;
38500 LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
38501 int64_tArray ret_arr = NULL;
38502 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
38503 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
38504 for (size_t p = 0; p < ret_var.datalen; p++) {
38505 LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
38506 int64_t ret_conv_15_ref = 0;
38507 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var);
38508 ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned);
38509 ret_arr_ptr[p] = ret_conv_15_ref;
38511 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
38512 FREE(ret_var.data);
38516 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
38517 LDKCommitmentUpdate this_ptr_conv;
38518 this_ptr_conv.inner = untag_ptr(this_ptr);
38519 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38520 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38521 this_ptr_conv.is_owned = false;
38522 LDKCVec_UpdateAddHTLCZ val_constr;
38523 val_constr.datalen = (*env)->GetArrayLength(env, val);
38524 if (val_constr.datalen > 0)
38525 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
38527 val_constr.data = NULL;
38528 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
38529 for (size_t p = 0; p < val_constr.datalen; p++) {
38530 int64_t val_conv_15 = val_vals[p];
38531 LDKUpdateAddHTLC val_conv_15_conv;
38532 val_conv_15_conv.inner = untag_ptr(val_conv_15);
38533 val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15);
38534 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv);
38535 val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
38536 val_constr.data[p] = val_conv_15_conv;
38538 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
38539 CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
38542 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
38543 LDKCommitmentUpdate this_ptr_conv;
38544 this_ptr_conv.inner = untag_ptr(this_ptr);
38545 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38546 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38547 this_ptr_conv.is_owned = false;
38548 LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
38549 int64_tArray ret_arr = NULL;
38550 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
38551 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
38552 for (size_t t = 0; t < ret_var.datalen; t++) {
38553 LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
38554 int64_t ret_conv_19_ref = 0;
38555 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var);
38556 ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned);
38557 ret_arr_ptr[t] = ret_conv_19_ref;
38559 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
38560 FREE(ret_var.data);
38564 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
38565 LDKCommitmentUpdate this_ptr_conv;
38566 this_ptr_conv.inner = untag_ptr(this_ptr);
38567 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38568 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38569 this_ptr_conv.is_owned = false;
38570 LDKCVec_UpdateFulfillHTLCZ val_constr;
38571 val_constr.datalen = (*env)->GetArrayLength(env, val);
38572 if (val_constr.datalen > 0)
38573 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
38575 val_constr.data = NULL;
38576 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
38577 for (size_t t = 0; t < val_constr.datalen; t++) {
38578 int64_t val_conv_19 = val_vals[t];
38579 LDKUpdateFulfillHTLC val_conv_19_conv;
38580 val_conv_19_conv.inner = untag_ptr(val_conv_19);
38581 val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19);
38582 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv);
38583 val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
38584 val_constr.data[t] = val_conv_19_conv;
38586 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
38587 CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
38590 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
38591 LDKCommitmentUpdate this_ptr_conv;
38592 this_ptr_conv.inner = untag_ptr(this_ptr);
38593 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38595 this_ptr_conv.is_owned = false;
38596 LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
38597 int64_tArray ret_arr = NULL;
38598 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
38599 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
38600 for (size_t q = 0; q < ret_var.datalen; q++) {
38601 LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
38602 int64_t ret_conv_16_ref = 0;
38603 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
38604 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
38605 ret_arr_ptr[q] = ret_conv_16_ref;
38607 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
38608 FREE(ret_var.data);
38612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
38613 LDKCommitmentUpdate this_ptr_conv;
38614 this_ptr_conv.inner = untag_ptr(this_ptr);
38615 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38616 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38617 this_ptr_conv.is_owned = false;
38618 LDKCVec_UpdateFailHTLCZ val_constr;
38619 val_constr.datalen = (*env)->GetArrayLength(env, val);
38620 if (val_constr.datalen > 0)
38621 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
38623 val_constr.data = NULL;
38624 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
38625 for (size_t q = 0; q < val_constr.datalen; q++) {
38626 int64_t val_conv_16 = val_vals[q];
38627 LDKUpdateFailHTLC val_conv_16_conv;
38628 val_conv_16_conv.inner = untag_ptr(val_conv_16);
38629 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
38630 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
38631 val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
38632 val_constr.data[q] = val_conv_16_conv;
38634 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
38635 CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
38638 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
38639 LDKCommitmentUpdate this_ptr_conv;
38640 this_ptr_conv.inner = untag_ptr(this_ptr);
38641 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38643 this_ptr_conv.is_owned = false;
38644 LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
38645 int64_tArray ret_arr = NULL;
38646 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
38647 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
38648 for (size_t z = 0; z < ret_var.datalen; z++) {
38649 LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
38650 int64_t ret_conv_25_ref = 0;
38651 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var);
38652 ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned);
38653 ret_arr_ptr[z] = ret_conv_25_ref;
38655 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
38656 FREE(ret_var.data);
38660 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
38661 LDKCommitmentUpdate this_ptr_conv;
38662 this_ptr_conv.inner = untag_ptr(this_ptr);
38663 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38665 this_ptr_conv.is_owned = false;
38666 LDKCVec_UpdateFailMalformedHTLCZ val_constr;
38667 val_constr.datalen = (*env)->GetArrayLength(env, val);
38668 if (val_constr.datalen > 0)
38669 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
38671 val_constr.data = NULL;
38672 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
38673 for (size_t z = 0; z < val_constr.datalen; z++) {
38674 int64_t val_conv_25 = val_vals[z];
38675 LDKUpdateFailMalformedHTLC val_conv_25_conv;
38676 val_conv_25_conv.inner = untag_ptr(val_conv_25);
38677 val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25);
38678 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv);
38679 val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
38680 val_constr.data[z] = val_conv_25_conv;
38682 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
38683 CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
38686 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr) {
38687 LDKCommitmentUpdate this_ptr_conv;
38688 this_ptr_conv.inner = untag_ptr(this_ptr);
38689 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38691 this_ptr_conv.is_owned = false;
38692 LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
38693 int64_t ret_ref = 0;
38694 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38695 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38699 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38700 LDKCommitmentUpdate this_ptr_conv;
38701 this_ptr_conv.inner = untag_ptr(this_ptr);
38702 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38704 this_ptr_conv.is_owned = false;
38705 LDKUpdateFee val_conv;
38706 val_conv.inner = untag_ptr(val);
38707 val_conv.is_owned = ptr_is_owned(val);
38708 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38709 val_conv = UpdateFee_clone(&val_conv);
38710 CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv);
38713 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr) {
38714 LDKCommitmentUpdate this_ptr_conv;
38715 this_ptr_conv.inner = untag_ptr(this_ptr);
38716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38718 this_ptr_conv.is_owned = false;
38719 LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
38720 int64_t ret_ref = 0;
38721 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38722 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38726 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38727 LDKCommitmentUpdate this_ptr_conv;
38728 this_ptr_conv.inner = untag_ptr(this_ptr);
38729 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38731 this_ptr_conv.is_owned = false;
38732 LDKCommitmentSigned val_conv;
38733 val_conv.inner = untag_ptr(val);
38734 val_conv.is_owned = ptr_is_owned(val);
38735 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38736 val_conv = CommitmentSigned_clone(&val_conv);
38737 CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv);
38740 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEnv *env, jclass clz, int64_tArray update_add_htlcs_arg, int64_tArray update_fulfill_htlcs_arg, int64_tArray update_fail_htlcs_arg, int64_tArray update_fail_malformed_htlcs_arg, int64_t update_fee_arg, int64_t commitment_signed_arg) {
38741 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr;
38742 update_add_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_add_htlcs_arg);
38743 if (update_add_htlcs_arg_constr.datalen > 0)
38744 update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
38746 update_add_htlcs_arg_constr.data = NULL;
38747 int64_t* update_add_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_add_htlcs_arg, NULL);
38748 for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
38749 int64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
38750 LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
38751 update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15);
38752 update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15);
38753 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv);
38754 update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
38755 update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
38757 (*env)->ReleaseLongArrayElements(env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0);
38758 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
38759 update_fulfill_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fulfill_htlcs_arg);
38760 if (update_fulfill_htlcs_arg_constr.datalen > 0)
38761 update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
38763 update_fulfill_htlcs_arg_constr.data = NULL;
38764 int64_t* update_fulfill_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fulfill_htlcs_arg, NULL);
38765 for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
38766 int64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
38767 LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
38768 update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19);
38769 update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19);
38770 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv);
38771 update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
38772 update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
38774 (*env)->ReleaseLongArrayElements(env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0);
38775 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
38776 update_fail_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_htlcs_arg);
38777 if (update_fail_htlcs_arg_constr.datalen > 0)
38778 update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
38780 update_fail_htlcs_arg_constr.data = NULL;
38781 int64_t* update_fail_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_htlcs_arg, NULL);
38782 for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
38783 int64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
38784 LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
38785 update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16);
38786 update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16);
38787 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv);
38788 update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
38789 update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
38791 (*env)->ReleaseLongArrayElements(env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0);
38792 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
38793 update_fail_malformed_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_malformed_htlcs_arg);
38794 if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
38795 update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
38797 update_fail_malformed_htlcs_arg_constr.data = NULL;
38798 int64_t* update_fail_malformed_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_malformed_htlcs_arg, NULL);
38799 for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
38800 int64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
38801 LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
38802 update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25);
38803 update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25);
38804 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv);
38805 update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
38806 update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
38808 (*env)->ReleaseLongArrayElements(env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0);
38809 LDKUpdateFee update_fee_arg_conv;
38810 update_fee_arg_conv.inner = untag_ptr(update_fee_arg);
38811 update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg);
38812 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv);
38813 update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv);
38814 LDKCommitmentSigned commitment_signed_arg_conv;
38815 commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg);
38816 commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg);
38817 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv);
38818 commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
38819 LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv);
38820 int64_t ret_ref = 0;
38821 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38822 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38826 static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) {
38827 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg);
38828 int64_t ret_ref = 0;
38829 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38830 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38833 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38834 LDKCommitmentUpdate arg_conv;
38835 arg_conv.inner = untag_ptr(arg);
38836 arg_conv.is_owned = ptr_is_owned(arg);
38837 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38838 arg_conv.is_owned = false;
38839 int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv);
38843 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38844 LDKCommitmentUpdate orig_conv;
38845 orig_conv.inner = untag_ptr(orig);
38846 orig_conv.is_owned = ptr_is_owned(orig);
38847 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38848 orig_conv.is_owned = false;
38849 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
38850 int64_t ret_ref = 0;
38851 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38852 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38856 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38857 LDKCommitmentUpdate a_conv;
38858 a_conv.inner = untag_ptr(a);
38859 a_conv.is_owned = ptr_is_owned(a);
38860 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38861 a_conv.is_owned = false;
38862 LDKCommitmentUpdate b_conv;
38863 b_conv.inner = untag_ptr(b);
38864 b_conv.is_owned = ptr_is_owned(b);
38865 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38866 b_conv.is_owned = false;
38867 jboolean ret_conv = CommitmentUpdate_eq(&a_conv, &b_conv);
38871 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
38872 if (!ptr_is_owned(this_ptr)) return;
38873 void* this_ptr_ptr = untag_ptr(this_ptr);
38874 CHECK_ACCESS(this_ptr_ptr);
38875 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
38876 FREE(untag_ptr(this_ptr));
38877 ChannelMessageHandler_free(this_ptr_conv);
38880 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
38881 if (!ptr_is_owned(this_ptr)) return;
38882 void* this_ptr_ptr = untag_ptr(this_ptr);
38883 CHECK_ACCESS(this_ptr_ptr);
38884 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
38885 FREE(untag_ptr(this_ptr));
38886 RoutingMessageHandler_free(this_ptr_conv);
38889 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
38890 if (!ptr_is_owned(this_ptr)) return;
38891 void* this_ptr_ptr = untag_ptr(this_ptr);
38892 CHECK_ACCESS(this_ptr_ptr);
38893 LDKOnionMessageHandler this_ptr_conv = *(LDKOnionMessageHandler*)(this_ptr_ptr);
38894 FREE(untag_ptr(this_ptr));
38895 OnionMessageHandler_free(this_ptr_conv);
38898 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv *env, jclass clz, int64_t obj) {
38899 LDKAcceptChannel obj_conv;
38900 obj_conv.inner = untag_ptr(obj);
38901 obj_conv.is_owned = ptr_is_owned(obj);
38902 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38903 obj_conv.is_owned = false;
38904 LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
38905 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38906 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38907 CVec_u8Z_free(ret_var);
38911 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
38912 LDKu8slice ser_ref;
38913 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
38914 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
38915 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
38916 *ret_conv = AcceptChannel_read(ser_ref);
38917 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
38918 return tag_ptr(ret_conv, true);
38921 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
38922 LDKAnnouncementSignatures obj_conv;
38923 obj_conv.inner = untag_ptr(obj);
38924 obj_conv.is_owned = ptr_is_owned(obj);
38925 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38926 obj_conv.is_owned = false;
38927 LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
38928 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38929 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38930 CVec_u8Z_free(ret_var);
38934 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
38935 LDKu8slice ser_ref;
38936 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
38937 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
38938 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
38939 *ret_conv = AnnouncementSignatures_read(ser_ref);
38940 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
38941 return tag_ptr(ret_conv, true);
38944 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv *env, jclass clz, int64_t obj) {
38945 LDKChannelReestablish obj_conv;
38946 obj_conv.inner = untag_ptr(obj);
38947 obj_conv.is_owned = ptr_is_owned(obj);
38948 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38949 obj_conv.is_owned = false;
38950 LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
38951 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38952 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38953 CVec_u8Z_free(ret_var);
38957 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
38958 LDKu8slice ser_ref;
38959 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
38960 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
38961 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
38962 *ret_conv = ChannelReestablish_read(ser_ref);
38963 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
38964 return tag_ptr(ret_conv, true);
38967 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
38968 LDKClosingSigned obj_conv;
38969 obj_conv.inner = untag_ptr(obj);
38970 obj_conv.is_owned = ptr_is_owned(obj);
38971 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38972 obj_conv.is_owned = false;
38973 LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
38974 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38975 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38976 CVec_u8Z_free(ret_var);
38980 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
38981 LDKu8slice ser_ref;
38982 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
38983 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
38984 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
38985 *ret_conv = ClosingSigned_read(ser_ref);
38986 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
38987 return tag_ptr(ret_conv, true);
38990 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
38991 LDKClosingSignedFeeRange obj_conv;
38992 obj_conv.inner = untag_ptr(obj);
38993 obj_conv.is_owned = ptr_is_owned(obj);
38994 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38995 obj_conv.is_owned = false;
38996 LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
38997 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38998 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38999 CVec_u8Z_free(ret_var);
39003 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39004 LDKu8slice ser_ref;
39005 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39006 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39007 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
39008 *ret_conv = ClosingSignedFeeRange_read(ser_ref);
39009 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39010 return tag_ptr(ret_conv, true);
39013 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
39014 LDKCommitmentSigned obj_conv;
39015 obj_conv.inner = untag_ptr(obj);
39016 obj_conv.is_owned = ptr_is_owned(obj);
39017 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39018 obj_conv.is_owned = false;
39019 LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
39020 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39021 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39022 CVec_u8Z_free(ret_var);
39026 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39027 LDKu8slice ser_ref;
39028 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39029 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39030 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
39031 *ret_conv = CommitmentSigned_read(ser_ref);
39032 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39033 return tag_ptr(ret_conv, true);
39036 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv *env, jclass clz, int64_t obj) {
39037 LDKFundingCreated obj_conv;
39038 obj_conv.inner = untag_ptr(obj);
39039 obj_conv.is_owned = ptr_is_owned(obj);
39040 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39041 obj_conv.is_owned = false;
39042 LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
39043 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39044 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39045 CVec_u8Z_free(ret_var);
39049 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39050 LDKu8slice ser_ref;
39051 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39052 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39053 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
39054 *ret_conv = FundingCreated_read(ser_ref);
39055 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39056 return tag_ptr(ret_conv, true);
39059 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
39060 LDKFundingSigned obj_conv;
39061 obj_conv.inner = untag_ptr(obj);
39062 obj_conv.is_owned = ptr_is_owned(obj);
39063 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39064 obj_conv.is_owned = false;
39065 LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
39066 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39067 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39068 CVec_u8Z_free(ret_var);
39072 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39073 LDKu8slice ser_ref;
39074 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39075 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39076 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
39077 *ret_conv = FundingSigned_read(ser_ref);
39078 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39079 return tag_ptr(ret_conv, true);
39082 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1write(JNIEnv *env, jclass clz, int64_t obj) {
39083 LDKChannelReady obj_conv;
39084 obj_conv.inner = untag_ptr(obj);
39085 obj_conv.is_owned = ptr_is_owned(obj);
39086 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39087 obj_conv.is_owned = false;
39088 LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv);
39089 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39090 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39091 CVec_u8Z_free(ret_var);
39095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39096 LDKu8slice ser_ref;
39097 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39098 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39099 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
39100 *ret_conv = ChannelReady_read(ser_ref);
39101 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39102 return tag_ptr(ret_conv, true);
39105 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env, jclass clz, int64_t obj) {
39107 obj_conv.inner = untag_ptr(obj);
39108 obj_conv.is_owned = ptr_is_owned(obj);
39109 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39110 obj_conv.is_owned = false;
39111 LDKCVec_u8Z ret_var = Init_write(&obj_conv);
39112 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39113 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39114 CVec_u8Z_free(ret_var);
39118 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39119 LDKu8slice ser_ref;
39120 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39121 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39122 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
39123 *ret_conv = Init_read(ser_ref);
39124 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39125 return tag_ptr(ret_conv, true);
39128 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv *env, jclass clz, int64_t obj) {
39129 LDKOpenChannel obj_conv;
39130 obj_conv.inner = untag_ptr(obj);
39131 obj_conv.is_owned = ptr_is_owned(obj);
39132 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39133 obj_conv.is_owned = false;
39134 LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
39135 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39136 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39137 CVec_u8Z_free(ret_var);
39141 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39142 LDKu8slice ser_ref;
39143 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39144 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39145 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
39146 *ret_conv = OpenChannel_read(ser_ref);
39147 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39148 return tag_ptr(ret_conv, true);
39151 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv *env, jclass clz, int64_t obj) {
39152 LDKRevokeAndACK obj_conv;
39153 obj_conv.inner = untag_ptr(obj);
39154 obj_conv.is_owned = ptr_is_owned(obj);
39155 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39156 obj_conv.is_owned = false;
39157 LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
39158 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39159 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39160 CVec_u8Z_free(ret_var);
39164 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39165 LDKu8slice ser_ref;
39166 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39167 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39168 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
39169 *ret_conv = RevokeAndACK_read(ser_ref);
39170 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39171 return tag_ptr(ret_conv, true);
39174 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv *env, jclass clz, int64_t obj) {
39175 LDKShutdown obj_conv;
39176 obj_conv.inner = untag_ptr(obj);
39177 obj_conv.is_owned = ptr_is_owned(obj);
39178 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39179 obj_conv.is_owned = false;
39180 LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
39181 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39182 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39183 CVec_u8Z_free(ret_var);
39187 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39188 LDKu8slice ser_ref;
39189 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39190 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39191 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
39192 *ret_conv = Shutdown_read(ser_ref);
39193 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39194 return tag_ptr(ret_conv, true);
39197 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
39198 LDKUpdateFailHTLC obj_conv;
39199 obj_conv.inner = untag_ptr(obj);
39200 obj_conv.is_owned = ptr_is_owned(obj);
39201 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39202 obj_conv.is_owned = false;
39203 LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
39204 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39205 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39206 CVec_u8Z_free(ret_var);
39210 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39211 LDKu8slice ser_ref;
39212 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39213 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39214 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
39215 *ret_conv = UpdateFailHTLC_read(ser_ref);
39216 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39217 return tag_ptr(ret_conv, true);
39220 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
39221 LDKUpdateFailMalformedHTLC obj_conv;
39222 obj_conv.inner = untag_ptr(obj);
39223 obj_conv.is_owned = ptr_is_owned(obj);
39224 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39225 obj_conv.is_owned = false;
39226 LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
39227 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39228 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39229 CVec_u8Z_free(ret_var);
39233 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39234 LDKu8slice ser_ref;
39235 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39236 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39237 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
39238 *ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
39239 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39240 return tag_ptr(ret_conv, true);
39243 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv *env, jclass clz, int64_t obj) {
39244 LDKUpdateFee obj_conv;
39245 obj_conv.inner = untag_ptr(obj);
39246 obj_conv.is_owned = ptr_is_owned(obj);
39247 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39248 obj_conv.is_owned = false;
39249 LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
39250 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39251 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39252 CVec_u8Z_free(ret_var);
39256 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39257 LDKu8slice ser_ref;
39258 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39259 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39260 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
39261 *ret_conv = UpdateFee_read(ser_ref);
39262 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39263 return tag_ptr(ret_conv, true);
39266 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
39267 LDKUpdateFulfillHTLC obj_conv;
39268 obj_conv.inner = untag_ptr(obj);
39269 obj_conv.is_owned = ptr_is_owned(obj);
39270 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39271 obj_conv.is_owned = false;
39272 LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
39273 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39274 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39275 CVec_u8Z_free(ret_var);
39279 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39280 LDKu8slice ser_ref;
39281 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39282 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39283 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
39284 *ret_conv = UpdateFulfillHTLC_read(ser_ref);
39285 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39286 return tag_ptr(ret_conv, true);
39289 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
39290 LDKUpdateAddHTLC obj_conv;
39291 obj_conv.inner = untag_ptr(obj);
39292 obj_conv.is_owned = ptr_is_owned(obj);
39293 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39294 obj_conv.is_owned = false;
39295 LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
39296 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39297 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39298 CVec_u8Z_free(ret_var);
39302 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39303 LDKu8slice ser_ref;
39304 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39305 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39306 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
39307 *ret_conv = UpdateAddHTLC_read(ser_ref);
39308 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39309 return tag_ptr(ret_conv, true);
39312 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39313 LDKu8slice ser_ref;
39314 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39315 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39316 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
39317 *ret_conv = OnionMessage_read(ser_ref);
39318 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39319 return tag_ptr(ret_conv, true);
39322 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
39323 LDKOnionMessage obj_conv;
39324 obj_conv.inner = untag_ptr(obj);
39325 obj_conv.is_owned = ptr_is_owned(obj);
39326 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39327 obj_conv.is_owned = false;
39328 LDKCVec_u8Z ret_var = OnionMessage_write(&obj_conv);
39329 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39330 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39331 CVec_u8Z_free(ret_var);
39335 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env, jclass clz, int64_t obj) {
39337 obj_conv.inner = untag_ptr(obj);
39338 obj_conv.is_owned = ptr_is_owned(obj);
39339 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39340 obj_conv.is_owned = false;
39341 LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
39342 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39343 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39344 CVec_u8Z_free(ret_var);
39348 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39349 LDKu8slice ser_ref;
39350 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39351 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39352 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
39353 *ret_conv = Ping_read(ser_ref);
39354 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39355 return tag_ptr(ret_conv, true);
39358 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env, jclass clz, int64_t obj) {
39360 obj_conv.inner = untag_ptr(obj);
39361 obj_conv.is_owned = ptr_is_owned(obj);
39362 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39363 obj_conv.is_owned = false;
39364 LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
39365 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39366 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39367 CVec_u8Z_free(ret_var);
39371 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39372 LDKu8slice ser_ref;
39373 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39374 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39375 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
39376 *ret_conv = Pong_read(ser_ref);
39377 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39378 return tag_ptr(ret_conv, true);
39381 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
39382 LDKUnsignedChannelAnnouncement obj_conv;
39383 obj_conv.inner = untag_ptr(obj);
39384 obj_conv.is_owned = ptr_is_owned(obj);
39385 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39386 obj_conv.is_owned = false;
39387 LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
39388 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39389 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39390 CVec_u8Z_free(ret_var);
39394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39395 LDKu8slice ser_ref;
39396 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39397 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39398 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
39399 *ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
39400 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39401 return tag_ptr(ret_conv, true);
39404 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
39405 LDKChannelAnnouncement obj_conv;
39406 obj_conv.inner = untag_ptr(obj);
39407 obj_conv.is_owned = ptr_is_owned(obj);
39408 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39409 obj_conv.is_owned = false;
39410 LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
39411 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39412 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39413 CVec_u8Z_free(ret_var);
39417 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39418 LDKu8slice ser_ref;
39419 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39420 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39421 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
39422 *ret_conv = ChannelAnnouncement_read(ser_ref);
39423 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39424 return tag_ptr(ret_conv, true);
39427 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
39428 LDKUnsignedChannelUpdate obj_conv;
39429 obj_conv.inner = untag_ptr(obj);
39430 obj_conv.is_owned = ptr_is_owned(obj);
39431 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39432 obj_conv.is_owned = false;
39433 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
39434 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39435 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39436 CVec_u8Z_free(ret_var);
39440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39441 LDKu8slice ser_ref;
39442 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39443 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39444 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
39445 *ret_conv = UnsignedChannelUpdate_read(ser_ref);
39446 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39447 return tag_ptr(ret_conv, true);
39450 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
39451 LDKChannelUpdate obj_conv;
39452 obj_conv.inner = untag_ptr(obj);
39453 obj_conv.is_owned = ptr_is_owned(obj);
39454 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39455 obj_conv.is_owned = false;
39456 LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
39457 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39458 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39459 CVec_u8Z_free(ret_var);
39463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39464 LDKu8slice ser_ref;
39465 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39466 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39467 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
39468 *ret_conv = ChannelUpdate_read(ser_ref);
39469 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39470 return tag_ptr(ret_conv, true);
39473 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
39474 LDKErrorMessage obj_conv;
39475 obj_conv.inner = untag_ptr(obj);
39476 obj_conv.is_owned = ptr_is_owned(obj);
39477 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39478 obj_conv.is_owned = false;
39479 LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
39480 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39481 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39482 CVec_u8Z_free(ret_var);
39486 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39487 LDKu8slice ser_ref;
39488 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39489 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39490 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
39491 *ret_conv = ErrorMessage_read(ser_ref);
39492 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39493 return tag_ptr(ret_conv, true);
39496 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
39497 LDKWarningMessage obj_conv;
39498 obj_conv.inner = untag_ptr(obj);
39499 obj_conv.is_owned = ptr_is_owned(obj);
39500 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39501 obj_conv.is_owned = false;
39502 LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv);
39503 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39504 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39505 CVec_u8Z_free(ret_var);
39509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39510 LDKu8slice ser_ref;
39511 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39512 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39513 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
39514 *ret_conv = WarningMessage_read(ser_ref);
39515 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39516 return tag_ptr(ret_conv, true);
39519 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
39520 LDKUnsignedNodeAnnouncement obj_conv;
39521 obj_conv.inner = untag_ptr(obj);
39522 obj_conv.is_owned = ptr_is_owned(obj);
39523 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39524 obj_conv.is_owned = false;
39525 LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
39526 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39527 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39528 CVec_u8Z_free(ret_var);
39532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39533 LDKu8slice ser_ref;
39534 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39535 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39536 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
39537 *ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
39538 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39539 return tag_ptr(ret_conv, true);
39542 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
39543 LDKNodeAnnouncement obj_conv;
39544 obj_conv.inner = untag_ptr(obj);
39545 obj_conv.is_owned = ptr_is_owned(obj);
39546 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39547 obj_conv.is_owned = false;
39548 LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
39549 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39550 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39551 CVec_u8Z_free(ret_var);
39555 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39556 LDKu8slice ser_ref;
39557 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39558 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39559 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
39560 *ret_conv = NodeAnnouncement_read(ser_ref);
39561 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39562 return tag_ptr(ret_conv, true);
39565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39566 LDKu8slice ser_ref;
39567 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39568 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39569 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
39570 *ret_conv = QueryShortChannelIds_read(ser_ref);
39571 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39572 return tag_ptr(ret_conv, true);
39575 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv *env, jclass clz, int64_t obj) {
39576 LDKQueryShortChannelIds obj_conv;
39577 obj_conv.inner = untag_ptr(obj);
39578 obj_conv.is_owned = ptr_is_owned(obj);
39579 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39580 obj_conv.is_owned = false;
39581 LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
39582 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39583 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39584 CVec_u8Z_free(ret_var);
39588 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv *env, jclass clz, int64_t obj) {
39589 LDKReplyShortChannelIdsEnd obj_conv;
39590 obj_conv.inner = untag_ptr(obj);
39591 obj_conv.is_owned = ptr_is_owned(obj);
39592 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39593 obj_conv.is_owned = false;
39594 LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
39595 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39596 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39597 CVec_u8Z_free(ret_var);
39601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39602 LDKu8slice ser_ref;
39603 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39604 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39605 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
39606 *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
39607 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39608 return tag_ptr(ret_conv, true);
39611 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blocknum(JNIEnv *env, jclass clz, int64_t this_arg) {
39612 LDKQueryChannelRange this_arg_conv;
39613 this_arg_conv.inner = untag_ptr(this_arg);
39614 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39616 this_arg_conv.is_owned = false;
39617 int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv);
39621 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
39622 LDKQueryChannelRange obj_conv;
39623 obj_conv.inner = untag_ptr(obj);
39624 obj_conv.is_owned = ptr_is_owned(obj);
39625 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39626 obj_conv.is_owned = false;
39627 LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
39628 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39629 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39630 CVec_u8Z_free(ret_var);
39634 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39635 LDKu8slice ser_ref;
39636 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39637 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39638 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
39639 *ret_conv = QueryChannelRange_read(ser_ref);
39640 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39641 return tag_ptr(ret_conv, true);
39644 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39645 LDKu8slice ser_ref;
39646 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39647 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39648 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
39649 *ret_conv = ReplyChannelRange_read(ser_ref);
39650 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39651 return tag_ptr(ret_conv, true);
39654 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
39655 LDKReplyChannelRange obj_conv;
39656 obj_conv.inner = untag_ptr(obj);
39657 obj_conv.is_owned = ptr_is_owned(obj);
39658 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39659 obj_conv.is_owned = false;
39660 LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
39661 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39662 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39663 CVec_u8Z_free(ret_var);
39667 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv *env, jclass clz, int64_t obj) {
39668 LDKGossipTimestampFilter obj_conv;
39669 obj_conv.inner = untag_ptr(obj);
39670 obj_conv.is_owned = ptr_is_owned(obj);
39671 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39672 obj_conv.is_owned = false;
39673 LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
39674 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39675 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39676 CVec_u8Z_free(ret_var);
39680 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39681 LDKu8slice ser_ref;
39682 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39683 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39684 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
39685 *ret_conv = GossipTimestampFilter_read(ser_ref);
39686 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39687 return tag_ptr(ret_conv, true);
39690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
39691 if (!ptr_is_owned(this_ptr)) return;
39692 void* this_ptr_ptr = untag_ptr(this_ptr);
39693 CHECK_ACCESS(this_ptr_ptr);
39694 LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
39695 FREE(untag_ptr(this_ptr));
39696 CustomMessageHandler_free(this_ptr_conv);
39699 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39700 LDKIgnoringMessageHandler this_obj_conv;
39701 this_obj_conv.inner = untag_ptr(this_obj);
39702 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39704 IgnoringMessageHandler_free(this_obj_conv);
39707 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) {
39708 LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
39709 int64_t ret_ref = 0;
39710 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39711 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39715 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
39716 LDKIgnoringMessageHandler this_arg_conv;
39717 this_arg_conv.inner = untag_ptr(this_arg);
39718 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39719 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39720 this_arg_conv.is_owned = false;
39721 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
39722 *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
39723 return tag_ptr(ret_ret, true);
39726 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
39727 LDKIgnoringMessageHandler this_arg_conv;
39728 this_arg_conv.inner = untag_ptr(this_arg);
39729 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39731 this_arg_conv.is_owned = false;
39732 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
39733 *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
39734 return tag_ptr(ret_ret, true);
39737 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1OnionMessageProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
39738 LDKIgnoringMessageHandler this_arg_conv;
39739 this_arg_conv.inner = untag_ptr(this_arg);
39740 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39742 this_arg_conv.is_owned = false;
39743 LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
39744 *ret_ret = IgnoringMessageHandler_as_OnionMessageProvider(&this_arg_conv);
39745 return tag_ptr(ret_ret, true);
39748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1OnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
39749 LDKIgnoringMessageHandler this_arg_conv;
39750 this_arg_conv.inner = untag_ptr(this_arg);
39751 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39752 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39753 this_arg_conv.is_owned = false;
39754 LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
39755 *ret_ret = IgnoringMessageHandler_as_OnionMessageHandler(&this_arg_conv);
39756 return tag_ptr(ret_ret, true);
39759 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomOnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
39760 LDKIgnoringMessageHandler this_arg_conv;
39761 this_arg_conv.inner = untag_ptr(this_arg);
39762 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39764 this_arg_conv.is_owned = false;
39765 LDKCustomOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
39766 *ret_ret = IgnoringMessageHandler_as_CustomOnionMessageHandler(&this_arg_conv);
39767 return tag_ptr(ret_ret, true);
39770 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t this_arg) {
39771 LDKIgnoringMessageHandler this_arg_conv;
39772 this_arg_conv.inner = untag_ptr(this_arg);
39773 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39775 this_arg_conv.is_owned = false;
39776 LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
39777 *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
39778 return tag_ptr(ret_ret, true);
39781 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
39782 LDKIgnoringMessageHandler this_arg_conv;
39783 this_arg_conv.inner = untag_ptr(this_arg);
39784 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39786 this_arg_conv.is_owned = false;
39787 LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
39788 *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
39789 return tag_ptr(ret_ret, true);
39792 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39793 LDKErroringMessageHandler this_obj_conv;
39794 this_obj_conv.inner = untag_ptr(this_obj);
39795 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39796 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39797 ErroringMessageHandler_free(this_obj_conv);
39800 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) {
39801 LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
39802 int64_t ret_ref = 0;
39803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
39809 LDKErroringMessageHandler this_arg_conv;
39810 this_arg_conv.inner = untag_ptr(this_arg);
39811 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39813 this_arg_conv.is_owned = false;
39814 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
39815 *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
39816 return tag_ptr(ret_ret, true);
39819 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
39820 LDKErroringMessageHandler this_arg_conv;
39821 this_arg_conv.inner = untag_ptr(this_arg);
39822 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39823 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39824 this_arg_conv.is_owned = false;
39825 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
39826 *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
39827 return tag_ptr(ret_ret, true);
39830 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39831 LDKMessageHandler this_obj_conv;
39832 this_obj_conv.inner = untag_ptr(this_obj);
39833 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39834 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39835 MessageHandler_free(this_obj_conv);
39838 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
39839 LDKMessageHandler this_ptr_conv;
39840 this_ptr_conv.inner = untag_ptr(this_ptr);
39841 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39842 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39843 this_ptr_conv.is_owned = false;
39844 // WARNING: This object doesn't live past this scope, needs clone!
39845 int64_t ret_ret = tag_ptr(MessageHandler_get_chan_handler(&this_ptr_conv), false);
39849 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39850 LDKMessageHandler this_ptr_conv;
39851 this_ptr_conv.inner = untag_ptr(this_ptr);
39852 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39854 this_ptr_conv.is_owned = false;
39855 void* val_ptr = untag_ptr(val);
39856 CHECK_ACCESS(val_ptr);
39857 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
39858 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
39859 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39860 LDKChannelMessageHandler_JCalls_cloned(&val_conv);
39862 MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
39865 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
39866 LDKMessageHandler this_ptr_conv;
39867 this_ptr_conv.inner = untag_ptr(this_ptr);
39868 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39869 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39870 this_ptr_conv.is_owned = false;
39871 // WARNING: This object doesn't live past this scope, needs clone!
39872 int64_t ret_ret = tag_ptr(MessageHandler_get_route_handler(&this_ptr_conv), false);
39876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39877 LDKMessageHandler this_ptr_conv;
39878 this_ptr_conv.inner = untag_ptr(this_ptr);
39879 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39880 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39881 this_ptr_conv.is_owned = false;
39882 void* val_ptr = untag_ptr(val);
39883 CHECK_ACCESS(val_ptr);
39884 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
39885 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
39886 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39887 LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
39889 MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
39892 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1onion_1message_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
39893 LDKMessageHandler this_ptr_conv;
39894 this_ptr_conv.inner = untag_ptr(this_ptr);
39895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39897 this_ptr_conv.is_owned = false;
39898 // WARNING: This object doesn't live past this scope, needs clone!
39899 int64_t ret_ret = tag_ptr(MessageHandler_get_onion_message_handler(&this_ptr_conv), false);
39903 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1onion_1message_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39904 LDKMessageHandler this_ptr_conv;
39905 this_ptr_conv.inner = untag_ptr(this_ptr);
39906 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39908 this_ptr_conv.is_owned = false;
39909 void* val_ptr = untag_ptr(val);
39910 CHECK_ACCESS(val_ptr);
39911 LDKOnionMessageHandler val_conv = *(LDKOnionMessageHandler*)(val_ptr);
39912 if (val_conv.free == LDKOnionMessageHandler_JCalls_free) {
39913 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39914 LDKOnionMessageHandler_JCalls_cloned(&val_conv);
39916 MessageHandler_set_onion_message_handler(&this_ptr_conv, val_conv);
39919 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv *env, jclass clz, int64_t chan_handler_arg, int64_t route_handler_arg, int64_t onion_message_handler_arg) {
39920 void* chan_handler_arg_ptr = untag_ptr(chan_handler_arg);
39921 CHECK_ACCESS(chan_handler_arg_ptr);
39922 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
39923 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
39924 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39925 LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
39927 void* route_handler_arg_ptr = untag_ptr(route_handler_arg);
39928 CHECK_ACCESS(route_handler_arg_ptr);
39929 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
39930 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
39931 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39932 LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
39934 void* onion_message_handler_arg_ptr = untag_ptr(onion_message_handler_arg);
39935 CHECK_ACCESS(onion_message_handler_arg_ptr);
39936 LDKOnionMessageHandler onion_message_handler_arg_conv = *(LDKOnionMessageHandler*)(onion_message_handler_arg_ptr);
39937 if (onion_message_handler_arg_conv.free == LDKOnionMessageHandler_JCalls_free) {
39938 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39939 LDKOnionMessageHandler_JCalls_cloned(&onion_message_handler_arg_conv);
39941 LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv, onion_message_handler_arg_conv);
39942 int64_t ret_ref = 0;
39943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39948 static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) {
39949 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
39950 *ret_ret = SocketDescriptor_clone(arg);
39951 return tag_ptr(ret_ret, true);
39953 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39954 void* arg_ptr = untag_ptr(arg);
39955 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
39956 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr;
39957 int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv);
39961 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39962 void* orig_ptr = untag_ptr(orig);
39963 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
39964 LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
39965 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
39966 *ret_ret = SocketDescriptor_clone(orig_conv);
39967 return tag_ptr(ret_ret, true);
39970 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
39971 if (!ptr_is_owned(this_ptr)) return;
39972 void* this_ptr_ptr = untag_ptr(this_ptr);
39973 CHECK_ACCESS(this_ptr_ptr);
39974 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
39975 FREE(untag_ptr(this_ptr));
39976 SocketDescriptor_free(this_ptr_conv);
39979 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39980 LDKPeerHandleError this_obj_conv;
39981 this_obj_conv.inner = untag_ptr(this_obj);
39982 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39984 PeerHandleError_free(this_obj_conv);
39987 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr) {
39988 LDKPeerHandleError this_ptr_conv;
39989 this_ptr_conv.inner = untag_ptr(this_ptr);
39990 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39992 this_ptr_conv.is_owned = false;
39993 jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv);
39997 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
39998 LDKPeerHandleError this_ptr_conv;
39999 this_ptr_conv.inner = untag_ptr(this_ptr);
40000 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40002 this_ptr_conv.is_owned = false;
40003 PeerHandleError_set_no_connection_possible(&this_ptr_conv, val);
40006 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv *env, jclass clz, jboolean no_connection_possible_arg) {
40007 LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg);
40008 int64_t ret_ref = 0;
40009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40014 static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) {
40015 LDKPeerHandleError ret_var = PeerHandleError_clone(arg);
40016 int64_t ret_ref = 0;
40017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40018 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40021 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40022 LDKPeerHandleError arg_conv;
40023 arg_conv.inner = untag_ptr(arg);
40024 arg_conv.is_owned = ptr_is_owned(arg);
40025 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40026 arg_conv.is_owned = false;
40027 int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv);
40031 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40032 LDKPeerHandleError orig_conv;
40033 orig_conv.inner = untag_ptr(orig);
40034 orig_conv.is_owned = ptr_is_owned(orig);
40035 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40036 orig_conv.is_owned = false;
40037 LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv);
40038 int64_t ret_ref = 0;
40039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40044 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40045 LDKPeerManager this_obj_conv;
40046 this_obj_conv.inner = untag_ptr(this_obj);
40047 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40048 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40049 PeerManager_free(this_obj_conv);
40052 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int32_t current_time, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler) {
40053 LDKMessageHandler message_handler_conv;
40054 message_handler_conv.inner = untag_ptr(message_handler);
40055 message_handler_conv.is_owned = ptr_is_owned(message_handler);
40056 CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
40057 // WARNING: we need a move here but no clone is available for LDKMessageHandler
40059 LDKSecretKey our_node_secret_ref;
40060 CHECK((*env)->GetArrayLength(env, our_node_secret) == 32);
40061 (*env)->GetByteArrayRegion(env, our_node_secret, 0, 32, our_node_secret_ref.bytes);
40062 unsigned char ephemeral_random_data_arr[32];
40063 CHECK((*env)->GetArrayLength(env, ephemeral_random_data) == 32);
40064 (*env)->GetByteArrayRegion(env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
40065 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
40066 void* logger_ptr = untag_ptr(logger);
40067 CHECK_ACCESS(logger_ptr);
40068 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
40069 if (logger_conv.free == LDKLogger_JCalls_free) {
40070 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40071 LDKLogger_JCalls_cloned(&logger_conv);
40073 void* custom_message_handler_ptr = untag_ptr(custom_message_handler);
40074 CHECK_ACCESS(custom_message_handler_ptr);
40075 LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
40076 if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
40077 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40078 LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
40080 LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, current_time, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv);
40081 int64_t ret_ref = 0;
40082 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40083 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40087 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv *env, jclass clz, int64_t this_arg) {
40088 LDKPeerManager this_arg_conv;
40089 this_arg_conv.inner = untag_ptr(this_arg);
40090 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40092 this_arg_conv.is_owned = false;
40093 LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
40094 jobjectArray ret_arr = NULL;
40095 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
40097 for (size_t i = 0; i < ret_var.datalen; i++) {
40098 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33);
40099 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form);
40100 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
40103 FREE(ret_var.data);
40107 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1connection(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t descriptor, int64_t remote_network_address) {
40108 LDKPeerManager this_arg_conv;
40109 this_arg_conv.inner = untag_ptr(this_arg);
40110 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40112 this_arg_conv.is_owned = false;
40113 LDKPublicKey their_node_id_ref;
40114 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
40115 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
40116 void* descriptor_ptr = untag_ptr(descriptor);
40117 CHECK_ACCESS(descriptor_ptr);
40118 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
40119 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
40120 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40121 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
40123 void* remote_network_address_ptr = untag_ptr(remote_network_address);
40124 CHECK_ACCESS(remote_network_address_ptr);
40125 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
40126 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
40127 *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv);
40128 return tag_ptr(ret_conv, true);
40131 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor, int64_t remote_network_address) {
40132 LDKPeerManager this_arg_conv;
40133 this_arg_conv.inner = untag_ptr(this_arg);
40134 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40136 this_arg_conv.is_owned = false;
40137 void* descriptor_ptr = untag_ptr(descriptor);
40138 CHECK_ACCESS(descriptor_ptr);
40139 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
40140 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
40141 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40142 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
40144 void* remote_network_address_ptr = untag_ptr(remote_network_address);
40145 CHECK_ACCESS(remote_network_address_ptr);
40146 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
40147 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
40148 *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv);
40149 return tag_ptr(ret_conv, true);
40152 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) {
40153 LDKPeerManager this_arg_conv;
40154 this_arg_conv.inner = untag_ptr(this_arg);
40155 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40156 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40157 this_arg_conv.is_owned = false;
40158 void* descriptor_ptr = untag_ptr(descriptor);
40159 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
40160 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
40161 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
40162 *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
40163 return tag_ptr(ret_conv, true);
40166 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t peer_descriptor, int8_tArray data) {
40167 LDKPeerManager this_arg_conv;
40168 this_arg_conv.inner = untag_ptr(this_arg);
40169 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40171 this_arg_conv.is_owned = false;
40172 void* peer_descriptor_ptr = untag_ptr(peer_descriptor);
40173 if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); }
40174 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
40175 LDKu8slice data_ref;
40176 data_ref.datalen = (*env)->GetArrayLength(env, data);
40177 data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
40178 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
40179 *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
40180 (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0);
40181 return tag_ptr(ret_conv, true);
40184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
40185 LDKPeerManager this_arg_conv;
40186 this_arg_conv.inner = untag_ptr(this_arg);
40187 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40189 this_arg_conv.is_owned = false;
40190 PeerManager_process_events(&this_arg_conv);
40193 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) {
40194 LDKPeerManager this_arg_conv;
40195 this_arg_conv.inner = untag_ptr(this_arg);
40196 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40198 this_arg_conv.is_owned = false;
40199 void* descriptor_ptr = untag_ptr(descriptor);
40200 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
40201 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
40202 PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
40205 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1by_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id, jboolean no_connection_possible) {
40206 LDKPeerManager this_arg_conv;
40207 this_arg_conv.inner = untag_ptr(this_arg);
40208 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40209 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40210 this_arg_conv.is_owned = false;
40211 LDKPublicKey node_id_ref;
40212 CHECK((*env)->GetArrayLength(env, node_id) == 33);
40213 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
40214 PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
40217 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers(JNIEnv *env, jclass clz, int64_t this_arg) {
40218 LDKPeerManager this_arg_conv;
40219 this_arg_conv.inner = untag_ptr(this_arg);
40220 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40222 this_arg_conv.is_owned = false;
40223 PeerManager_disconnect_all_peers(&this_arg_conv);
40226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
40227 LDKPeerManager this_arg_conv;
40228 this_arg_conv.inner = untag_ptr(this_arg);
40229 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40231 this_arg_conv.is_owned = false;
40232 PeerManager_timer_tick_occurred(&this_arg_conv);
40235 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray rgb, int8_tArray alias, int64_tArray addresses) {
40236 LDKPeerManager this_arg_conv;
40237 this_arg_conv.inner = untag_ptr(this_arg);
40238 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40240 this_arg_conv.is_owned = false;
40241 LDKThreeBytes rgb_ref;
40242 CHECK((*env)->GetArrayLength(env, rgb) == 3);
40243 (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data);
40244 LDKThirtyTwoBytes alias_ref;
40245 CHECK((*env)->GetArrayLength(env, alias) == 32);
40246 (*env)->GetByteArrayRegion(env, alias, 0, 32, alias_ref.data);
40247 LDKCVec_NetAddressZ addresses_constr;
40248 addresses_constr.datalen = (*env)->GetArrayLength(env, addresses);
40249 if (addresses_constr.datalen > 0)
40250 addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
40252 addresses_constr.data = NULL;
40253 int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL);
40254 for (size_t m = 0; m < addresses_constr.datalen; m++) {
40255 int64_t addresses_conv_12 = addresses_vals[m];
40256 void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
40257 CHECK_ACCESS(addresses_conv_12_ptr);
40258 LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
40259 addresses_constr.data[m] = addresses_conv_12_conv;
40261 (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0);
40262 PeerManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
40265 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
40266 int64_t ret_conv = htlc_success_tx_weight(opt_anchors);
40270 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
40271 int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors);
40275 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) {
40276 unsigned char commitment_seed_arr[32];
40277 CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
40278 (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_arr);
40279 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
40280 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
40281 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data);
40285 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1closing_1transaction(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) {
40286 LDKCVec_u8Z to_holder_script_ref;
40287 to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
40288 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
40289 (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data);
40290 LDKCVec_u8Z to_counterparty_script_ref;
40291 to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script);
40292 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
40293 (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data);
40294 LDKOutPoint funding_outpoint_conv;
40295 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
40296 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
40297 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
40298 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
40299 LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
40300 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40301 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40302 Transaction_free(ret_var);
40306 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40307 LDKCounterpartyCommitmentSecrets this_obj_conv;
40308 this_obj_conv.inner = untag_ptr(this_obj);
40309 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40311 CounterpartyCommitmentSecrets_free(this_obj_conv);
40314 static inline uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) {
40315 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg);
40316 int64_t ret_ref = 0;
40317 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40318 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40321 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40322 LDKCounterpartyCommitmentSecrets arg_conv;
40323 arg_conv.inner = untag_ptr(arg);
40324 arg_conv.is_owned = ptr_is_owned(arg);
40325 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40326 arg_conv.is_owned = false;
40327 int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv);
40331 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40332 LDKCounterpartyCommitmentSecrets orig_conv;
40333 orig_conv.inner = untag_ptr(orig);
40334 orig_conv.is_owned = ptr_is_owned(orig);
40335 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40336 orig_conv.is_owned = false;
40337 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv);
40338 int64_t ret_ref = 0;
40339 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40340 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40344 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1new(JNIEnv *env, jclass clz) {
40345 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new();
40346 int64_t ret_ref = 0;
40347 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40348 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1min_1seen_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
40353 LDKCounterpartyCommitmentSecrets this_arg_conv;
40354 this_arg_conv.inner = untag_ptr(this_arg);
40355 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40356 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40357 this_arg_conv.is_owned = false;
40358 int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv);
40362 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1provide_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx, int8_tArray secret) {
40363 LDKCounterpartyCommitmentSecrets this_arg_conv;
40364 this_arg_conv.inner = untag_ptr(this_arg);
40365 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40367 this_arg_conv.is_owned = false;
40368 LDKThirtyTwoBytes secret_ref;
40369 CHECK((*env)->GetArrayLength(env, secret) == 32);
40370 (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_ref.data);
40371 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
40372 *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref);
40373 return tag_ptr(ret_conv, true);
40376 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
40377 LDKCounterpartyCommitmentSecrets this_arg_conv;
40378 this_arg_conv.inner = untag_ptr(this_arg);
40379 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40381 this_arg_conv.is_owned = false;
40382 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
40383 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data);
40387 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1write(JNIEnv *env, jclass clz, int64_t obj) {
40388 LDKCounterpartyCommitmentSecrets obj_conv;
40389 obj_conv.inner = untag_ptr(obj);
40390 obj_conv.is_owned = ptr_is_owned(obj);
40391 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40392 obj_conv.is_owned = false;
40393 LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv);
40394 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40395 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40396 CVec_u8Z_free(ret_var);
40400 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40401 LDKu8slice ser_ref;
40402 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40403 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40404 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
40405 *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
40406 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40407 return tag_ptr(ret_conv, true);
40410 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_secret) {
40411 LDKPublicKey per_commitment_point_ref;
40412 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
40413 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
40414 unsigned char base_secret_arr[32];
40415 CHECK((*env)->GetArrayLength(env, base_secret) == 32);
40416 (*env)->GetByteArrayRegion(env, base_secret, 0, 32, base_secret_arr);
40417 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
40418 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
40419 *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref);
40420 return tag_ptr(ret_conv, true);
40423 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_point) {
40424 LDKPublicKey per_commitment_point_ref;
40425 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
40426 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
40427 LDKPublicKey base_point_ref;
40428 CHECK((*env)->GetArrayLength(env, base_point) == 33);
40429 (*env)->GetByteArrayRegion(env, base_point, 0, 33, base_point_ref.compressed_form);
40430 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
40431 *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref);
40432 return tag_ptr(ret_conv, true);
40435 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_secret, int8_tArray countersignatory_revocation_base_secret) {
40436 unsigned char per_commitment_secret_arr[32];
40437 CHECK((*env)->GetArrayLength(env, per_commitment_secret) == 32);
40438 (*env)->GetByteArrayRegion(env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
40439 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
40440 unsigned char countersignatory_revocation_base_secret_arr[32];
40441 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_secret) == 32);
40442 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
40443 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
40444 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
40445 *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
40446 return tag_ptr(ret_conv, true);
40449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray countersignatory_revocation_base_point) {
40450 LDKPublicKey per_commitment_point_ref;
40451 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
40452 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
40453 LDKPublicKey countersignatory_revocation_base_point_ref;
40454 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_point) == 33);
40455 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_point, 0, 33, countersignatory_revocation_base_point_ref.compressed_form);
40456 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
40457 *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref);
40458 return tag_ptr(ret_conv, true);
40461 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40462 LDKTxCreationKeys this_obj_conv;
40463 this_obj_conv.inner = untag_ptr(this_obj);
40464 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40466 TxCreationKeys_free(this_obj_conv);
40469 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
40470 LDKTxCreationKeys this_ptr_conv;
40471 this_ptr_conv.inner = untag_ptr(this_ptr);
40472 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40473 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40474 this_ptr_conv.is_owned = false;
40475 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
40476 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form);
40480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40481 LDKTxCreationKeys this_ptr_conv;
40482 this_ptr_conv.inner = untag_ptr(this_ptr);
40483 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40485 this_ptr_conv.is_owned = false;
40486 LDKPublicKey val_ref;
40487 CHECK((*env)->GetArrayLength(env, val) == 33);
40488 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
40489 TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref);
40492 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
40493 LDKTxCreationKeys this_ptr_conv;
40494 this_ptr_conv.inner = untag_ptr(this_ptr);
40495 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40496 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40497 this_ptr_conv.is_owned = false;
40498 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
40499 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form);
40503 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40504 LDKTxCreationKeys this_ptr_conv;
40505 this_ptr_conv.inner = untag_ptr(this_ptr);
40506 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40507 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40508 this_ptr_conv.is_owned = false;
40509 LDKPublicKey val_ref;
40510 CHECK((*env)->GetArrayLength(env, val) == 33);
40511 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
40512 TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref);
40515 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
40516 LDKTxCreationKeys this_ptr_conv;
40517 this_ptr_conv.inner = untag_ptr(this_ptr);
40518 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40519 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40520 this_ptr_conv.is_owned = false;
40521 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
40522 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form);
40526 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40527 LDKTxCreationKeys this_ptr_conv;
40528 this_ptr_conv.inner = untag_ptr(this_ptr);
40529 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40530 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40531 this_ptr_conv.is_owned = false;
40532 LDKPublicKey val_ref;
40533 CHECK((*env)->GetArrayLength(env, val) == 33);
40534 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
40535 TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref);
40538 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
40539 LDKTxCreationKeys this_ptr_conv;
40540 this_ptr_conv.inner = untag_ptr(this_ptr);
40541 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40543 this_ptr_conv.is_owned = false;
40544 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
40545 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form);
40549 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40550 LDKTxCreationKeys this_ptr_conv;
40551 this_ptr_conv.inner = untag_ptr(this_ptr);
40552 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40553 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40554 this_ptr_conv.is_owned = false;
40555 LDKPublicKey val_ref;
40556 CHECK((*env)->GetArrayLength(env, val) == 33);
40557 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
40558 TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref);
40561 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
40562 LDKTxCreationKeys this_ptr_conv;
40563 this_ptr_conv.inner = untag_ptr(this_ptr);
40564 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40566 this_ptr_conv.is_owned = false;
40567 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
40568 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form);
40572 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40573 LDKTxCreationKeys this_ptr_conv;
40574 this_ptr_conv.inner = untag_ptr(this_ptr);
40575 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40577 this_ptr_conv.is_owned = false;
40578 LDKPublicKey val_ref;
40579 CHECK((*env)->GetArrayLength(env, val) == 33);
40580 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
40581 TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref);
40584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv *env, jclass clz, int8_tArray per_commitment_point_arg, int8_tArray revocation_key_arg, int8_tArray broadcaster_htlc_key_arg, int8_tArray countersignatory_htlc_key_arg, int8_tArray broadcaster_delayed_payment_key_arg) {
40585 LDKPublicKey per_commitment_point_arg_ref;
40586 CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
40587 (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
40588 LDKPublicKey revocation_key_arg_ref;
40589 CHECK((*env)->GetArrayLength(env, revocation_key_arg) == 33);
40590 (*env)->GetByteArrayRegion(env, revocation_key_arg, 0, 33, revocation_key_arg_ref.compressed_form);
40591 LDKPublicKey broadcaster_htlc_key_arg_ref;
40592 CHECK((*env)->GetArrayLength(env, broadcaster_htlc_key_arg) == 33);
40593 (*env)->GetByteArrayRegion(env, broadcaster_htlc_key_arg, 0, 33, broadcaster_htlc_key_arg_ref.compressed_form);
40594 LDKPublicKey countersignatory_htlc_key_arg_ref;
40595 CHECK((*env)->GetArrayLength(env, countersignatory_htlc_key_arg) == 33);
40596 (*env)->GetByteArrayRegion(env, countersignatory_htlc_key_arg, 0, 33, countersignatory_htlc_key_arg_ref.compressed_form);
40597 LDKPublicKey broadcaster_delayed_payment_key_arg_ref;
40598 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key_arg) == 33);
40599 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form);
40600 LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref);
40601 int64_t ret_ref = 0;
40602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40607 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
40608 LDKTxCreationKeys a_conv;
40609 a_conv.inner = untag_ptr(a);
40610 a_conv.is_owned = ptr_is_owned(a);
40611 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40612 a_conv.is_owned = false;
40613 LDKTxCreationKeys b_conv;
40614 b_conv.inner = untag_ptr(b);
40615 b_conv.is_owned = ptr_is_owned(b);
40616 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40617 b_conv.is_owned = false;
40618 jboolean ret_conv = TxCreationKeys_eq(&a_conv, &b_conv);
40622 static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
40623 LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
40624 int64_t ret_ref = 0;
40625 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40626 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40629 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40630 LDKTxCreationKeys arg_conv;
40631 arg_conv.inner = untag_ptr(arg);
40632 arg_conv.is_owned = ptr_is_owned(arg);
40633 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40634 arg_conv.is_owned = false;
40635 int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv);
40639 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40640 LDKTxCreationKeys orig_conv;
40641 orig_conv.inner = untag_ptr(orig);
40642 orig_conv.is_owned = ptr_is_owned(orig);
40643 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40644 orig_conv.is_owned = false;
40645 LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
40646 int64_t ret_ref = 0;
40647 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40648 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40652 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
40653 LDKTxCreationKeys obj_conv;
40654 obj_conv.inner = untag_ptr(obj);
40655 obj_conv.is_owned = ptr_is_owned(obj);
40656 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40657 obj_conv.is_owned = false;
40658 LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
40659 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40660 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40661 CVec_u8Z_free(ret_var);
40665 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40666 LDKu8slice ser_ref;
40667 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40668 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40669 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
40670 *ret_conv = TxCreationKeys_read(ser_ref);
40671 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40672 return tag_ptr(ret_conv, true);
40675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40676 LDKChannelPublicKeys this_obj_conv;
40677 this_obj_conv.inner = untag_ptr(this_obj);
40678 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40680 ChannelPublicKeys_free(this_obj_conv);
40683 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
40684 LDKChannelPublicKeys this_ptr_conv;
40685 this_ptr_conv.inner = untag_ptr(this_ptr);
40686 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40687 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40688 this_ptr_conv.is_owned = false;
40689 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
40690 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form);
40694 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40695 LDKChannelPublicKeys this_ptr_conv;
40696 this_ptr_conv.inner = untag_ptr(this_ptr);
40697 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40699 this_ptr_conv.is_owned = false;
40700 LDKPublicKey val_ref;
40701 CHECK((*env)->GetArrayLength(env, val) == 33);
40702 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
40703 ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref);
40706 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
40707 LDKChannelPublicKeys this_ptr_conv;
40708 this_ptr_conv.inner = untag_ptr(this_ptr);
40709 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40710 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40711 this_ptr_conv.is_owned = false;
40712 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
40713 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form);
40717 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40718 LDKChannelPublicKeys this_ptr_conv;
40719 this_ptr_conv.inner = untag_ptr(this_ptr);
40720 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40722 this_ptr_conv.is_owned = false;
40723 LDKPublicKey val_ref;
40724 CHECK((*env)->GetArrayLength(env, val) == 33);
40725 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
40726 ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref);
40729 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
40730 LDKChannelPublicKeys this_ptr_conv;
40731 this_ptr_conv.inner = untag_ptr(this_ptr);
40732 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40734 this_ptr_conv.is_owned = false;
40735 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
40736 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form);
40740 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40741 LDKChannelPublicKeys this_ptr_conv;
40742 this_ptr_conv.inner = untag_ptr(this_ptr);
40743 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40745 this_ptr_conv.is_owned = false;
40746 LDKPublicKey val_ref;
40747 CHECK((*env)->GetArrayLength(env, val) == 33);
40748 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
40749 ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref);
40752 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
40753 LDKChannelPublicKeys this_ptr_conv;
40754 this_ptr_conv.inner = untag_ptr(this_ptr);
40755 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40756 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40757 this_ptr_conv.is_owned = false;
40758 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
40759 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
40763 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40764 LDKChannelPublicKeys this_ptr_conv;
40765 this_ptr_conv.inner = untag_ptr(this_ptr);
40766 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40767 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40768 this_ptr_conv.is_owned = false;
40769 LDKPublicKey val_ref;
40770 CHECK((*env)->GetArrayLength(env, val) == 33);
40771 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
40772 ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
40775 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
40776 LDKChannelPublicKeys this_ptr_conv;
40777 this_ptr_conv.inner = untag_ptr(this_ptr);
40778 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40779 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40780 this_ptr_conv.is_owned = false;
40781 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
40782 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form);
40786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40787 LDKChannelPublicKeys this_ptr_conv;
40788 this_ptr_conv.inner = untag_ptr(this_ptr);
40789 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40790 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40791 this_ptr_conv.is_owned = false;
40792 LDKPublicKey val_ref;
40793 CHECK((*env)->GetArrayLength(env, val) == 33);
40794 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
40795 ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref);
40798 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIEnv *env, jclass clz, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_point_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg) {
40799 LDKPublicKey funding_pubkey_arg_ref;
40800 CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33);
40801 (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form);
40802 LDKPublicKey revocation_basepoint_arg_ref;
40803 CHECK((*env)->GetArrayLength(env, revocation_basepoint_arg) == 33);
40804 (*env)->GetByteArrayRegion(env, revocation_basepoint_arg, 0, 33, revocation_basepoint_arg_ref.compressed_form);
40805 LDKPublicKey payment_point_arg_ref;
40806 CHECK((*env)->GetArrayLength(env, payment_point_arg) == 33);
40807 (*env)->GetByteArrayRegion(env, payment_point_arg, 0, 33, payment_point_arg_ref.compressed_form);
40808 LDKPublicKey delayed_payment_basepoint_arg_ref;
40809 CHECK((*env)->GetArrayLength(env, delayed_payment_basepoint_arg) == 33);
40810 (*env)->GetByteArrayRegion(env, delayed_payment_basepoint_arg, 0, 33, delayed_payment_basepoint_arg_ref.compressed_form);
40811 LDKPublicKey htlc_basepoint_arg_ref;
40812 CHECK((*env)->GetArrayLength(env, htlc_basepoint_arg) == 33);
40813 (*env)->GetByteArrayRegion(env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form);
40814 LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref);
40815 int64_t ret_ref = 0;
40816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40821 static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) {
40822 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg);
40823 int64_t ret_ref = 0;
40824 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40825 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40828 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40829 LDKChannelPublicKeys arg_conv;
40830 arg_conv.inner = untag_ptr(arg);
40831 arg_conv.is_owned = ptr_is_owned(arg);
40832 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40833 arg_conv.is_owned = false;
40834 int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv);
40838 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40839 LDKChannelPublicKeys orig_conv;
40840 orig_conv.inner = untag_ptr(orig);
40841 orig_conv.is_owned = ptr_is_owned(orig);
40842 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40843 orig_conv.is_owned = false;
40844 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
40845 int64_t ret_ref = 0;
40846 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40847 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40851 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
40852 LDKChannelPublicKeys a_conv;
40853 a_conv.inner = untag_ptr(a);
40854 a_conv.is_owned = ptr_is_owned(a);
40855 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40856 a_conv.is_owned = false;
40857 LDKChannelPublicKeys b_conv;
40858 b_conv.inner = untag_ptr(b);
40859 b_conv.is_owned = ptr_is_owned(b);
40860 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40861 b_conv.is_owned = false;
40862 jboolean ret_conv = ChannelPublicKeys_eq(&a_conv, &b_conv);
40866 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
40867 LDKChannelPublicKeys obj_conv;
40868 obj_conv.inner = untag_ptr(obj);
40869 obj_conv.is_owned = ptr_is_owned(obj);
40870 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40871 obj_conv.is_owned = false;
40872 LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
40873 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40874 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40875 CVec_u8Z_free(ret_var);
40879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40880 LDKu8slice ser_ref;
40881 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40882 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40883 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
40884 *ret_conv = ChannelPublicKeys_read(ser_ref);
40885 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40886 return tag_ptr(ret_conv, true);
40889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray broadcaster_delayed_payment_base, int8_tArray broadcaster_htlc_base, int8_tArray countersignatory_revocation_base, int8_tArray countersignatory_htlc_base) {
40890 LDKPublicKey per_commitment_point_ref;
40891 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
40892 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
40893 LDKPublicKey broadcaster_delayed_payment_base_ref;
40894 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_base) == 33);
40895 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_base, 0, 33, broadcaster_delayed_payment_base_ref.compressed_form);
40896 LDKPublicKey broadcaster_htlc_base_ref;
40897 CHECK((*env)->GetArrayLength(env, broadcaster_htlc_base) == 33);
40898 (*env)->GetByteArrayRegion(env, broadcaster_htlc_base, 0, 33, broadcaster_htlc_base_ref.compressed_form);
40899 LDKPublicKey countersignatory_revocation_base_ref;
40900 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base) == 33);
40901 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base, 0, 33, countersignatory_revocation_base_ref.compressed_form);
40902 LDKPublicKey countersignatory_htlc_base_ref;
40903 CHECK((*env)->GetArrayLength(env, countersignatory_htlc_base) == 33);
40904 (*env)->GetByteArrayRegion(env, countersignatory_htlc_base, 0, 33, countersignatory_htlc_base_ref.compressed_form);
40905 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
40906 *ret_conv = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref);
40907 return tag_ptr(ret_conv, true);
40910 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1channel_1static_1keys(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int64_t broadcaster_keys, int64_t countersignatory_keys) {
40911 LDKPublicKey per_commitment_point_ref;
40912 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
40913 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
40914 LDKChannelPublicKeys broadcaster_keys_conv;
40915 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
40916 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
40917 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
40918 broadcaster_keys_conv.is_owned = false;
40919 LDKChannelPublicKeys countersignatory_keys_conv;
40920 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
40921 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
40922 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
40923 countersignatory_keys_conv.is_owned = false;
40924 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
40925 *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
40926 return tag_ptr(ret_conv, true);
40929 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv *env, jclass clz, int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) {
40930 LDKPublicKey revocation_key_ref;
40931 CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
40932 (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
40933 LDKPublicKey broadcaster_delayed_payment_key_ref;
40934 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33);
40935 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
40936 LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
40937 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40938 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40939 CVec_u8Z_free(ret_var);
40943 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40944 LDKHTLCOutputInCommitment this_obj_conv;
40945 this_obj_conv.inner = untag_ptr(this_obj);
40946 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40948 HTLCOutputInCommitment_free(this_obj_conv);
40951 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv *env, jclass clz, int64_t this_ptr) {
40952 LDKHTLCOutputInCommitment this_ptr_conv;
40953 this_ptr_conv.inner = untag_ptr(this_ptr);
40954 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40956 this_ptr_conv.is_owned = false;
40957 jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
40961 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
40962 LDKHTLCOutputInCommitment this_ptr_conv;
40963 this_ptr_conv.inner = untag_ptr(this_ptr);
40964 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40966 this_ptr_conv.is_owned = false;
40967 HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
40970 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
40971 LDKHTLCOutputInCommitment this_ptr_conv;
40972 this_ptr_conv.inner = untag_ptr(this_ptr);
40973 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40975 this_ptr_conv.is_owned = false;
40976 int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
40980 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
40981 LDKHTLCOutputInCommitment this_ptr_conv;
40982 this_ptr_conv.inner = untag_ptr(this_ptr);
40983 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40985 this_ptr_conv.is_owned = false;
40986 HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
40989 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) {
40990 LDKHTLCOutputInCommitment this_ptr_conv;
40991 this_ptr_conv.inner = untag_ptr(this_ptr);
40992 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40994 this_ptr_conv.is_owned = false;
40995 int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
40999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
41000 LDKHTLCOutputInCommitment this_ptr_conv;
41001 this_ptr_conv.inner = untag_ptr(this_ptr);
41002 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41004 this_ptr_conv.is_owned = false;
41005 HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
41008 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
41009 LDKHTLCOutputInCommitment this_ptr_conv;
41010 this_ptr_conv.inner = untag_ptr(this_ptr);
41011 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41012 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41013 this_ptr_conv.is_owned = false;
41014 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
41015 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv));
41019 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
41020 LDKHTLCOutputInCommitment this_ptr_conv;
41021 this_ptr_conv.inner = untag_ptr(this_ptr);
41022 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41024 this_ptr_conv.is_owned = false;
41025 LDKThirtyTwoBytes val_ref;
41026 CHECK((*env)->GetArrayLength(env, val) == 32);
41027 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
41028 HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref);
41031 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
41032 LDKHTLCOutputInCommitment this_ptr_conv;
41033 this_ptr_conv.inner = untag_ptr(this_ptr);
41034 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41036 this_ptr_conv.is_owned = false;
41037 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
41038 *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv);
41039 int64_t ret_ref = tag_ptr(ret_copy, true);
41043 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41044 LDKHTLCOutputInCommitment this_ptr_conv;
41045 this_ptr_conv.inner = untag_ptr(this_ptr);
41046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41048 this_ptr_conv.is_owned = false;
41049 void* val_ptr = untag_ptr(val);
41050 CHECK_ACCESS(val_ptr);
41051 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
41052 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
41053 HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
41056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new(JNIEnv *env, jclass clz, jboolean offered_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, int64_t transaction_output_index_arg) {
41057 LDKThirtyTwoBytes payment_hash_arg_ref;
41058 CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32);
41059 (*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data);
41060 void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg);
41061 CHECK_ACCESS(transaction_output_index_arg_ptr);
41062 LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
41063 transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg));
41064 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
41065 int64_t ret_ref = 0;
41066 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41067 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41071 static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) {
41072 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg);
41073 int64_t ret_ref = 0;
41074 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41075 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41079 LDKHTLCOutputInCommitment arg_conv;
41080 arg_conv.inner = untag_ptr(arg);
41081 arg_conv.is_owned = ptr_is_owned(arg);
41082 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41083 arg_conv.is_owned = false;
41084 int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv);
41088 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41089 LDKHTLCOutputInCommitment orig_conv;
41090 orig_conv.inner = untag_ptr(orig);
41091 orig_conv.is_owned = ptr_is_owned(orig);
41092 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41093 orig_conv.is_owned = false;
41094 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
41095 int64_t ret_ref = 0;
41096 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41097 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41101 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
41102 LDKHTLCOutputInCommitment a_conv;
41103 a_conv.inner = untag_ptr(a);
41104 a_conv.is_owned = ptr_is_owned(a);
41105 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41106 a_conv.is_owned = false;
41107 LDKHTLCOutputInCommitment b_conv;
41108 b_conv.inner = untag_ptr(b);
41109 b_conv.is_owned = ptr_is_owned(b);
41110 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41111 b_conv.is_owned = false;
41112 jboolean ret_conv = HTLCOutputInCommitment_eq(&a_conv, &b_conv);
41116 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) {
41117 LDKHTLCOutputInCommitment obj_conv;
41118 obj_conv.inner = untag_ptr(obj);
41119 obj_conv.is_owned = ptr_is_owned(obj);
41120 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41121 obj_conv.is_owned = false;
41122 LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
41123 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41124 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41125 CVec_u8Z_free(ret_var);
41129 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41130 LDKu8slice ser_ref;
41131 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41132 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41133 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
41134 *ret_conv = HTLCOutputInCommitment_read(ser_ref);
41135 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41136 return tag_ptr(ret_conv, true);
41139 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv *env, jclass clz, int64_t htlc, jboolean opt_anchors, int64_t keys) {
41140 LDKHTLCOutputInCommitment htlc_conv;
41141 htlc_conv.inner = untag_ptr(htlc);
41142 htlc_conv.is_owned = ptr_is_owned(htlc);
41143 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
41144 htlc_conv.is_owned = false;
41145 LDKTxCreationKeys keys_conv;
41146 keys_conv.inner = untag_ptr(keys);
41147 keys_conv.is_owned = ptr_is_owned(keys);
41148 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
41149 keys_conv.is_owned = false;
41150 LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
41151 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41152 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41153 CVec_u8Z_free(ret_var);
41157 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv *env, jclass clz, int8_tArray broadcaster, int8_tArray countersignatory) {
41158 LDKPublicKey broadcaster_ref;
41159 CHECK((*env)->GetArrayLength(env, broadcaster) == 33);
41160 (*env)->GetByteArrayRegion(env, broadcaster, 0, 33, broadcaster_ref.compressed_form);
41161 LDKPublicKey countersignatory_ref;
41162 CHECK((*env)->GetArrayLength(env, countersignatory) == 33);
41163 (*env)->GetByteArrayRegion(env, countersignatory, 0, 33, countersignatory_ref.compressed_form);
41164 LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
41165 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41166 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41167 CVec_u8Z_free(ret_var);
41171 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
41172 unsigned char commitment_txid_arr[32];
41173 CHECK((*env)->GetArrayLength(env, commitment_txid) == 32);
41174 (*env)->GetByteArrayRegion(env, commitment_txid, 0, 32, commitment_txid_arr);
41175 unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr;
41176 LDKHTLCOutputInCommitment htlc_conv;
41177 htlc_conv.inner = untag_ptr(htlc);
41178 htlc_conv.is_owned = ptr_is_owned(htlc);
41179 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
41180 htlc_conv.is_owned = false;
41181 LDKPublicKey broadcaster_delayed_payment_key_ref;
41182 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33);
41183 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
41184 LDKPublicKey revocation_key_ref;
41185 CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
41186 (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
41187 LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref);
41188 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41189 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41190 Transaction_free(ret_var);
41194 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript(JNIEnv *env, jclass clz, int8_tArray funding_pubkey) {
41195 LDKPublicKey funding_pubkey_ref;
41196 CHECK((*env)->GetArrayLength(env, funding_pubkey) == 33);
41197 (*env)->GetByteArrayRegion(env, funding_pubkey, 0, 33, funding_pubkey_ref.compressed_form);
41198 LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
41199 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41200 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41201 CVec_u8Z_free(ret_var);
41205 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41206 LDKChannelTransactionParameters this_obj_conv;
41207 this_obj_conv.inner = untag_ptr(this_obj);
41208 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41209 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41210 ChannelTransactionParameters_free(this_obj_conv);
41213 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) {
41214 LDKChannelTransactionParameters this_ptr_conv;
41215 this_ptr_conv.inner = untag_ptr(this_ptr);
41216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41218 this_ptr_conv.is_owned = false;
41219 LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv);
41220 int64_t ret_ref = 0;
41221 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41222 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41227 LDKChannelTransactionParameters this_ptr_conv;
41228 this_ptr_conv.inner = untag_ptr(this_ptr);
41229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41231 this_ptr_conv.is_owned = false;
41232 LDKChannelPublicKeys val_conv;
41233 val_conv.inner = untag_ptr(val);
41234 val_conv.is_owned = ptr_is_owned(val);
41235 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41236 val_conv = ChannelPublicKeys_clone(&val_conv);
41237 ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv);
41240 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
41241 LDKChannelTransactionParameters this_ptr_conv;
41242 this_ptr_conv.inner = untag_ptr(this_ptr);
41243 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41245 this_ptr_conv.is_owned = false;
41246 int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv);
41250 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
41251 LDKChannelTransactionParameters this_ptr_conv;
41252 this_ptr_conv.inner = untag_ptr(this_ptr);
41253 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41255 this_ptr_conv.is_owned = false;
41256 ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val);
41259 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr) {
41260 LDKChannelTransactionParameters this_ptr_conv;
41261 this_ptr_conv.inner = untag_ptr(this_ptr);
41262 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41263 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41264 this_ptr_conv.is_owned = false;
41265 jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv);
41269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
41270 LDKChannelTransactionParameters this_ptr_conv;
41271 this_ptr_conv.inner = untag_ptr(this_ptr);
41272 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41273 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41274 this_ptr_conv.is_owned = false;
41275 ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val);
41278 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) {
41279 LDKChannelTransactionParameters this_ptr_conv;
41280 this_ptr_conv.inner = untag_ptr(this_ptr);
41281 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41282 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41283 this_ptr_conv.is_owned = false;
41284 LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
41285 int64_t ret_ref = 0;
41286 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41287 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41292 LDKChannelTransactionParameters this_ptr_conv;
41293 this_ptr_conv.inner = untag_ptr(this_ptr);
41294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41296 this_ptr_conv.is_owned = false;
41297 LDKCounterpartyChannelTransactionParameters val_conv;
41298 val_conv.inner = untag_ptr(val);
41299 val_conv.is_owned = ptr_is_owned(val);
41300 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41301 val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv);
41302 ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv);
41305 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
41306 LDKChannelTransactionParameters this_ptr_conv;
41307 this_ptr_conv.inner = untag_ptr(this_ptr);
41308 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41309 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41310 this_ptr_conv.is_owned = false;
41311 LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
41312 int64_t ret_ref = 0;
41313 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41314 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41319 LDKChannelTransactionParameters this_ptr_conv;
41320 this_ptr_conv.inner = untag_ptr(this_ptr);
41321 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41323 this_ptr_conv.is_owned = false;
41324 LDKOutPoint val_conv;
41325 val_conv.inner = untag_ptr(val);
41326 val_conv.is_owned = ptr_is_owned(val);
41327 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41328 val_conv = OutPoint_clone(&val_conv);
41329 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
41332 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) {
41333 LDKChannelTransactionParameters this_ptr_conv;
41334 this_ptr_conv.inner = untag_ptr(this_ptr);
41335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41337 this_ptr_conv.is_owned = false;
41338 jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
41342 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
41343 LDKChannelTransactionParameters this_ptr_conv;
41344 this_ptr_conv.inner = untag_ptr(this_ptr);
41345 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41346 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41347 this_ptr_conv.is_owned = false;
41348 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val);
41349 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
41352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg, jclass opt_anchors_arg) {
41353 LDKChannelPublicKeys holder_pubkeys_arg_conv;
41354 holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg);
41355 holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg);
41356 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv);
41357 holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv);
41358 LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv;
41359 counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg);
41360 counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg);
41361 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv);
41362 counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv);
41363 LDKOutPoint funding_outpoint_arg_conv;
41364 funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg);
41365 funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_arg);
41366 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
41367 funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
41368 LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_anchors_arg);
41369 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv);
41370 int64_t ret_ref = 0;
41371 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41372 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41376 static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) {
41377 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg);
41378 int64_t ret_ref = 0;
41379 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41380 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41384 LDKChannelTransactionParameters arg_conv;
41385 arg_conv.inner = untag_ptr(arg);
41386 arg_conv.is_owned = ptr_is_owned(arg);
41387 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41388 arg_conv.is_owned = false;
41389 int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv);
41393 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41394 LDKChannelTransactionParameters orig_conv;
41395 orig_conv.inner = untag_ptr(orig);
41396 orig_conv.is_owned = ptr_is_owned(orig);
41397 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41398 orig_conv.is_owned = false;
41399 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv);
41400 int64_t ret_ref = 0;
41401 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41402 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41406 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41407 LDKCounterpartyChannelTransactionParameters this_obj_conv;
41408 this_obj_conv.inner = untag_ptr(this_obj);
41409 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41410 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41411 CounterpartyChannelTransactionParameters_free(this_obj_conv);
41414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) {
41415 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
41416 this_ptr_conv.inner = untag_ptr(this_ptr);
41417 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41419 this_ptr_conv.is_owned = false;
41420 LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv);
41421 int64_t ret_ref = 0;
41422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41423 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41427 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41428 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
41429 this_ptr_conv.inner = untag_ptr(this_ptr);
41430 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41431 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41432 this_ptr_conv.is_owned = false;
41433 LDKChannelPublicKeys val_conv;
41434 val_conv.inner = untag_ptr(val);
41435 val_conv.is_owned = ptr_is_owned(val);
41436 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41437 val_conv = ChannelPublicKeys_clone(&val_conv);
41438 CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv);
41441 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
41442 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
41443 this_ptr_conv.inner = untag_ptr(this_ptr);
41444 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41446 this_ptr_conv.is_owned = false;
41447 int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv);
41451 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
41452 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
41453 this_ptr_conv.inner = untag_ptr(this_ptr);
41454 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41455 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41456 this_ptr_conv.is_owned = false;
41457 CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val);
41460 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t pubkeys_arg, int16_t selected_contest_delay_arg) {
41461 LDKChannelPublicKeys pubkeys_arg_conv;
41462 pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg);
41463 pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg);
41464 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv);
41465 pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
41466 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg);
41467 int64_t ret_ref = 0;
41468 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41469 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41473 static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) {
41474 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg);
41475 int64_t ret_ref = 0;
41476 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41477 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41481 LDKCounterpartyChannelTransactionParameters arg_conv;
41482 arg_conv.inner = untag_ptr(arg);
41483 arg_conv.is_owned = ptr_is_owned(arg);
41484 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41485 arg_conv.is_owned = false;
41486 int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv);
41490 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41491 LDKCounterpartyChannelTransactionParameters orig_conv;
41492 orig_conv.inner = untag_ptr(orig);
41493 orig_conv.is_owned = ptr_is_owned(orig);
41494 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41495 orig_conv.is_owned = false;
41496 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv);
41497 int64_t ret_ref = 0;
41498 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41499 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41503 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1is_1populated(JNIEnv *env, jclass clz, int64_t this_arg) {
41504 LDKChannelTransactionParameters this_arg_conv;
41505 this_arg_conv.inner = untag_ptr(this_arg);
41506 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41507 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41508 this_arg_conv.is_owned = false;
41509 jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv);
41513 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1holder_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) {
41514 LDKChannelTransactionParameters this_arg_conv;
41515 this_arg_conv.inner = untag_ptr(this_arg);
41516 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41518 this_arg_conv.is_owned = false;
41519 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv);
41520 int64_t ret_ref = 0;
41521 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41522 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1counterparty_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) {
41527 LDKChannelTransactionParameters this_arg_conv;
41528 this_arg_conv.inner = untag_ptr(this_arg);
41529 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41530 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41531 this_arg_conv.is_owned = false;
41532 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv);
41533 int64_t ret_ref = 0;
41534 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41535 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41539 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
41540 LDKCounterpartyChannelTransactionParameters obj_conv;
41541 obj_conv.inner = untag_ptr(obj);
41542 obj_conv.is_owned = ptr_is_owned(obj);
41543 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41544 obj_conv.is_owned = false;
41545 LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
41546 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41547 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41548 CVec_u8Z_free(ret_var);
41552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41553 LDKu8slice ser_ref;
41554 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41555 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41556 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
41557 *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
41558 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41559 return tag_ptr(ret_conv, true);
41562 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
41563 LDKChannelTransactionParameters obj_conv;
41564 obj_conv.inner = untag_ptr(obj);
41565 obj_conv.is_owned = ptr_is_owned(obj);
41566 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41567 obj_conv.is_owned = false;
41568 LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
41569 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41570 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41571 CVec_u8Z_free(ret_var);
41575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41576 LDKu8slice ser_ref;
41577 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41578 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41579 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
41580 *ret_conv = ChannelTransactionParameters_read(ser_ref);
41581 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41582 return tag_ptr(ret_conv, true);
41585 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41586 LDKDirectedChannelTransactionParameters this_obj_conv;
41587 this_obj_conv.inner = untag_ptr(this_obj);
41588 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41590 DirectedChannelTransactionParameters_free(this_obj_conv);
41593 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
41594 LDKDirectedChannelTransactionParameters this_arg_conv;
41595 this_arg_conv.inner = untag_ptr(this_arg);
41596 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41598 this_arg_conv.is_owned = false;
41599 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv);
41600 int64_t ret_ref = 0;
41601 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41602 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41606 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
41607 LDKDirectedChannelTransactionParameters this_arg_conv;
41608 this_arg_conv.inner = untag_ptr(this_arg);
41609 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41611 this_arg_conv.is_owned = false;
41612 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv);
41613 int64_t ret_ref = 0;
41614 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41615 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41619 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
41620 LDKDirectedChannelTransactionParameters this_arg_conv;
41621 this_arg_conv.inner = untag_ptr(this_arg);
41622 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41624 this_arg_conv.is_owned = false;
41625 int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv);
41629 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) {
41630 LDKDirectedChannelTransactionParameters this_arg_conv;
41631 this_arg_conv.inner = untag_ptr(this_arg);
41632 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41634 this_arg_conv.is_owned = false;
41635 jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv);
41639 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) {
41640 LDKDirectedChannelTransactionParameters this_arg_conv;
41641 this_arg_conv.inner = untag_ptr(this_arg);
41642 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41644 this_arg_conv.is_owned = false;
41645 LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv);
41646 int64_t ret_ref = 0;
41647 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41648 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41652 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
41653 LDKDirectedChannelTransactionParameters this_arg_conv;
41654 this_arg_conv.inner = untag_ptr(this_arg);
41655 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41657 this_arg_conv.is_owned = false;
41658 jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
41662 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41663 LDKHolderCommitmentTransaction this_obj_conv;
41664 this_obj_conv.inner = untag_ptr(this_obj);
41665 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41667 HolderCommitmentTransaction_free(this_obj_conv);
41670 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) {
41671 LDKHolderCommitmentTransaction this_ptr_conv;
41672 this_ptr_conv.inner = untag_ptr(this_ptr);
41673 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41675 this_ptr_conv.is_owned = false;
41676 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
41677 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form);
41681 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
41682 LDKHolderCommitmentTransaction this_ptr_conv;
41683 this_ptr_conv.inner = untag_ptr(this_ptr);
41684 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41685 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41686 this_ptr_conv.is_owned = false;
41687 LDKSignature val_ref;
41688 CHECK((*env)->GetArrayLength(env, val) == 64);
41689 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
41690 HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref);
41693 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr) {
41694 LDKHolderCommitmentTransaction this_ptr_conv;
41695 this_ptr_conv.inner = untag_ptr(this_ptr);
41696 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41698 this_ptr_conv.is_owned = false;
41699 LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_conv);
41700 jobjectArray ret_arr = NULL;
41701 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
41703 for (size_t i = 0; i < ret_var.datalen; i++) {
41704 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
41705 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
41706 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
41709 FREE(ret_var.data);
41713 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
41714 LDKHolderCommitmentTransaction this_ptr_conv;
41715 this_ptr_conv.inner = untag_ptr(this_ptr);
41716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41718 this_ptr_conv.is_owned = false;
41719 LDKCVec_SignatureZ val_constr;
41720 val_constr.datalen = (*env)->GetArrayLength(env, val);
41721 if (val_constr.datalen > 0)
41722 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
41724 val_constr.data = NULL;
41725 for (size_t i = 0; i < val_constr.datalen; i++) {
41726 int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
41727 LDKSignature val_conv_8_ref;
41728 CHECK((*env)->GetArrayLength(env, val_conv_8) == 64);
41729 (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form);
41730 val_constr.data[i] = val_conv_8_ref;
41732 HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
41735 static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) {
41736 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg);
41737 int64_t ret_ref = 0;
41738 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41739 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41742 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41743 LDKHolderCommitmentTransaction arg_conv;
41744 arg_conv.inner = untag_ptr(arg);
41745 arg_conv.is_owned = ptr_is_owned(arg);
41746 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41747 arg_conv.is_owned = false;
41748 int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv);
41752 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41753 LDKHolderCommitmentTransaction orig_conv;
41754 orig_conv.inner = untag_ptr(orig);
41755 orig_conv.is_owned = ptr_is_owned(orig);
41756 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41757 orig_conv.is_owned = false;
41758 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
41759 int64_t ret_ref = 0;
41760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41765 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
41766 LDKHolderCommitmentTransaction obj_conv;
41767 obj_conv.inner = untag_ptr(obj);
41768 obj_conv.is_owned = ptr_is_owned(obj);
41769 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41770 obj_conv.is_owned = false;
41771 LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
41772 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41773 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41774 CVec_u8Z_free(ret_var);
41778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41779 LDKu8slice ser_ref;
41780 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41781 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41782 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
41783 *ret_conv = HolderCommitmentTransaction_read(ser_ref);
41784 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41785 return tag_ptr(ret_conv, true);
41788 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new(JNIEnv *env, jclass clz, int64_t commitment_tx, int8_tArray counterparty_sig, jobjectArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) {
41789 LDKCommitmentTransaction commitment_tx_conv;
41790 commitment_tx_conv.inner = untag_ptr(commitment_tx);
41791 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
41792 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
41793 commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv);
41794 LDKSignature counterparty_sig_ref;
41795 CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64);
41796 (*env)->GetByteArrayRegion(env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form);
41797 LDKCVec_SignatureZ counterparty_htlc_sigs_constr;
41798 counterparty_htlc_sigs_constr.datalen = (*env)->GetArrayLength(env, counterparty_htlc_sigs);
41799 if (counterparty_htlc_sigs_constr.datalen > 0)
41800 counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
41802 counterparty_htlc_sigs_constr.data = NULL;
41803 for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) {
41804 int8_tArray counterparty_htlc_sigs_conv_8 = (*env)->GetObjectArrayElement(env, counterparty_htlc_sigs, i);
41805 LDKSignature counterparty_htlc_sigs_conv_8_ref;
41806 CHECK((*env)->GetArrayLength(env, counterparty_htlc_sigs_conv_8) == 64);
41807 (*env)->GetByteArrayRegion(env, counterparty_htlc_sigs_conv_8, 0, 64, counterparty_htlc_sigs_conv_8_ref.compact_form);
41808 counterparty_htlc_sigs_constr.data[i] = counterparty_htlc_sigs_conv_8_ref;
41810 LDKPublicKey holder_funding_key_ref;
41811 CHECK((*env)->GetArrayLength(env, holder_funding_key) == 33);
41812 (*env)->GetByteArrayRegion(env, holder_funding_key, 0, 33, holder_funding_key_ref.compressed_form);
41813 LDKPublicKey counterparty_funding_key_ref;
41814 CHECK((*env)->GetArrayLength(env, counterparty_funding_key) == 33);
41815 (*env)->GetByteArrayRegion(env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form);
41816 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
41817 int64_t ret_ref = 0;
41818 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41819 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41823 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41824 LDKBuiltCommitmentTransaction this_obj_conv;
41825 this_obj_conv.inner = untag_ptr(this_obj);
41826 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41828 BuiltCommitmentTransaction_free(this_obj_conv);
41831 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr) {
41832 LDKBuiltCommitmentTransaction this_ptr_conv;
41833 this_ptr_conv.inner = untag_ptr(this_ptr);
41834 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41836 this_ptr_conv.is_owned = false;
41837 LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
41838 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41839 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41840 Transaction_free(ret_var);
41844 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
41845 LDKBuiltCommitmentTransaction this_ptr_conv;
41846 this_ptr_conv.inner = untag_ptr(this_ptr);
41847 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41849 this_ptr_conv.is_owned = false;
41850 LDKTransaction val_ref;
41851 val_ref.datalen = (*env)->GetArrayLength(env, val);
41852 val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
41853 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
41854 val_ref.data_is_owned = true;
41855 BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref);
41858 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
41859 LDKBuiltCommitmentTransaction this_ptr_conv;
41860 this_ptr_conv.inner = untag_ptr(this_ptr);
41861 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41862 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41863 this_ptr_conv.is_owned = false;
41864 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
41865 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv));
41869 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
41870 LDKBuiltCommitmentTransaction this_ptr_conv;
41871 this_ptr_conv.inner = untag_ptr(this_ptr);
41872 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41874 this_ptr_conv.is_owned = false;
41875 LDKThirtyTwoBytes val_ref;
41876 CHECK((*env)->GetArrayLength(env, val) == 32);
41877 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
41878 BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref);
41881 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new(JNIEnv *env, jclass clz, int8_tArray transaction_arg, int8_tArray txid_arg) {
41882 LDKTransaction transaction_arg_ref;
41883 transaction_arg_ref.datalen = (*env)->GetArrayLength(env, transaction_arg);
41884 transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes");
41885 (*env)->GetByteArrayRegion(env, transaction_arg, 0, transaction_arg_ref.datalen, transaction_arg_ref.data);
41886 transaction_arg_ref.data_is_owned = true;
41887 LDKThirtyTwoBytes txid_arg_ref;
41888 CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
41889 (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
41890 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
41891 int64_t ret_ref = 0;
41892 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41893 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41897 static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) {
41898 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg);
41899 int64_t ret_ref = 0;
41900 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41901 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41904 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41905 LDKBuiltCommitmentTransaction arg_conv;
41906 arg_conv.inner = untag_ptr(arg);
41907 arg_conv.is_owned = ptr_is_owned(arg);
41908 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41909 arg_conv.is_owned = false;
41910 int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv);
41914 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41915 LDKBuiltCommitmentTransaction orig_conv;
41916 orig_conv.inner = untag_ptr(orig);
41917 orig_conv.is_owned = ptr_is_owned(orig);
41918 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41919 orig_conv.is_owned = false;
41920 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv);
41921 int64_t ret_ref = 0;
41922 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41923 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41927 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
41928 LDKBuiltCommitmentTransaction obj_conv;
41929 obj_conv.inner = untag_ptr(obj);
41930 obj_conv.is_owned = ptr_is_owned(obj);
41931 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41932 obj_conv.is_owned = false;
41933 LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
41934 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41935 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41936 CVec_u8Z_free(ret_var);
41940 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41941 LDKu8slice ser_ref;
41942 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41943 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41944 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
41945 *ret_conv = BuiltCommitmentTransaction_read(ser_ref);
41946 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41947 return tag_ptr(ret_conv, true);
41950 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1sighash_1all(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
41951 LDKBuiltCommitmentTransaction this_arg_conv;
41952 this_arg_conv.inner = untag_ptr(this_arg);
41953 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41955 this_arg_conv.is_owned = false;
41956 LDKu8slice funding_redeemscript_ref;
41957 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
41958 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
41959 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
41960 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data);
41961 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
41965 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
41966 LDKBuiltCommitmentTransaction this_arg_conv;
41967 this_arg_conv.inner = untag_ptr(this_arg);
41968 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41970 this_arg_conv.is_owned = false;
41971 unsigned char funding_key_arr[32];
41972 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
41973 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
41974 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
41975 LDKu8slice funding_redeemscript_ref;
41976 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
41977 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
41978 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
41979 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
41980 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
41984 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41985 LDKClosingTransaction this_obj_conv;
41986 this_obj_conv.inner = untag_ptr(this_obj);
41987 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41989 ClosingTransaction_free(this_obj_conv);
41992 static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) {
41993 LDKClosingTransaction ret_var = ClosingTransaction_clone(arg);
41994 int64_t ret_ref = 0;
41995 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41996 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41999 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42000 LDKClosingTransaction arg_conv;
42001 arg_conv.inner = untag_ptr(arg);
42002 arg_conv.is_owned = ptr_is_owned(arg);
42003 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42004 arg_conv.is_owned = false;
42005 int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv);
42009 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42010 LDKClosingTransaction orig_conv;
42011 orig_conv.inner = untag_ptr(orig);
42012 orig_conv.is_owned = ptr_is_owned(orig);
42013 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42014 orig_conv.is_owned = false;
42015 LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
42016 int64_t ret_ref = 0;
42017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42018 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42022 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JNIEnv *env, jclass clz, int64_t o) {
42023 LDKClosingTransaction o_conv;
42024 o_conv.inner = untag_ptr(o);
42025 o_conv.is_owned = ptr_is_owned(o);
42026 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42027 o_conv.is_owned = false;
42028 int64_t ret_conv = ClosingTransaction_hash(&o_conv);
42032 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42033 LDKClosingTransaction a_conv;
42034 a_conv.inner = untag_ptr(a);
42035 a_conv.is_owned = ptr_is_owned(a);
42036 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42037 a_conv.is_owned = false;
42038 LDKClosingTransaction b_conv;
42039 b_conv.inner = untag_ptr(b);
42040 b_conv.is_owned = ptr_is_owned(b);
42041 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42042 b_conv.is_owned = false;
42043 jboolean ret_conv = ClosingTransaction_eq(&a_conv, &b_conv);
42047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) {
42048 LDKCVec_u8Z to_holder_script_ref;
42049 to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
42050 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
42051 (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data);
42052 LDKCVec_u8Z to_counterparty_script_ref;
42053 to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script);
42054 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
42055 (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data);
42056 LDKOutPoint funding_outpoint_conv;
42057 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
42058 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
42059 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
42060 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
42061 LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
42062 int64_t ret_ref = 0;
42063 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42064 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42068 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) {
42069 LDKClosingTransaction this_arg_conv;
42070 this_arg_conv.inner = untag_ptr(this_arg);
42071 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42073 this_arg_conv.is_owned = false;
42074 LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv);
42075 int64_t ret_ref = 0;
42076 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42077 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42081 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_outpoint) {
42082 LDKClosingTransaction this_arg_conv;
42083 this_arg_conv.inner = untag_ptr(this_arg);
42084 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42086 this_arg_conv.is_owned = false;
42087 LDKOutPoint funding_outpoint_conv;
42088 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
42089 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
42090 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
42091 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
42092 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
42093 *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv);
42094 return tag_ptr(ret_conv, true);
42097 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
42098 LDKClosingTransaction this_arg_conv;
42099 this_arg_conv.inner = untag_ptr(this_arg);
42100 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42101 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42102 this_arg_conv.is_owned = false;
42103 int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv);
42107 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
42108 LDKClosingTransaction this_arg_conv;
42109 this_arg_conv.inner = untag_ptr(this_arg);
42110 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42112 this_arg_conv.is_owned = false;
42113 int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv);
42117 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
42118 LDKClosingTransaction this_arg_conv;
42119 this_arg_conv.inner = untag_ptr(this_arg);
42120 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42122 this_arg_conv.is_owned = false;
42123 LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv);
42124 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42125 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42129 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
42130 LDKClosingTransaction this_arg_conv;
42131 this_arg_conv.inner = untag_ptr(this_arg);
42132 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42134 this_arg_conv.is_owned = false;
42135 LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv);
42136 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42137 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42141 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42142 LDKTrustedClosingTransaction this_obj_conv;
42143 this_obj_conv.inner = untag_ptr(this_obj);
42144 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42146 TrustedClosingTransaction_free(this_obj_conv);
42149 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) {
42150 LDKTrustedClosingTransaction this_arg_conv;
42151 this_arg_conv.inner = untag_ptr(this_arg);
42152 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42153 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42154 this_arg_conv.is_owned = false;
42155 LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv);
42156 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42157 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42158 Transaction_free(ret_var);
42162 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1get_1sighash_1all(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
42163 LDKTrustedClosingTransaction this_arg_conv;
42164 this_arg_conv.inner = untag_ptr(this_arg);
42165 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42166 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42167 this_arg_conv.is_owned = false;
42168 LDKu8slice funding_redeemscript_ref;
42169 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
42170 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
42171 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42172 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data);
42173 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
42177 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
42178 LDKTrustedClosingTransaction this_arg_conv;
42179 this_arg_conv.inner = untag_ptr(this_arg);
42180 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42181 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42182 this_arg_conv.is_owned = false;
42183 unsigned char funding_key_arr[32];
42184 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
42185 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
42186 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
42187 LDKu8slice funding_redeemscript_ref;
42188 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
42189 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
42190 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
42191 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
42192 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
42196 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42197 LDKCommitmentTransaction this_obj_conv;
42198 this_obj_conv.inner = untag_ptr(this_obj);
42199 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42201 CommitmentTransaction_free(this_obj_conv);
42204 static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) {
42205 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg);
42206 int64_t ret_ref = 0;
42207 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42208 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42211 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42212 LDKCommitmentTransaction arg_conv;
42213 arg_conv.inner = untag_ptr(arg);
42214 arg_conv.is_owned = ptr_is_owned(arg);
42215 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42216 arg_conv.is_owned = false;
42217 int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv);
42221 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42222 LDKCommitmentTransaction orig_conv;
42223 orig_conv.inner = untag_ptr(orig);
42224 orig_conv.is_owned = ptr_is_owned(orig);
42225 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42226 orig_conv.is_owned = false;
42227 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv);
42228 int64_t ret_ref = 0;
42229 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42230 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42234 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
42235 LDKCommitmentTransaction obj_conv;
42236 obj_conv.inner = untag_ptr(obj);
42237 obj_conv.is_owned = ptr_is_owned(obj);
42238 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42239 obj_conv.is_owned = false;
42240 LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
42241 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42242 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42243 CVec_u8Z_free(ret_var);
42247 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42248 LDKu8slice ser_ref;
42249 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42250 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42251 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
42252 *ret_conv = CommitmentTransaction_read(ser_ref);
42253 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42254 return tag_ptr(ret_conv, true);
42257 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_arg) {
42258 LDKCommitmentTransaction this_arg_conv;
42259 this_arg_conv.inner = untag_ptr(this_arg);
42260 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42261 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42262 this_arg_conv.is_owned = false;
42263 int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv);
42267 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
42268 LDKCommitmentTransaction this_arg_conv;
42269 this_arg_conv.inner = untag_ptr(this_arg);
42270 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42272 this_arg_conv.is_owned = false;
42273 int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv);
42277 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
42278 LDKCommitmentTransaction this_arg_conv;
42279 this_arg_conv.inner = untag_ptr(this_arg);
42280 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42281 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42282 this_arg_conv.is_owned = false;
42283 int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv);
42287 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_arg) {
42288 LDKCommitmentTransaction this_arg_conv;
42289 this_arg_conv.inner = untag_ptr(this_arg);
42290 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42291 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42292 this_arg_conv.is_owned = false;
42293 int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv);
42297 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) {
42298 LDKCommitmentTransaction this_arg_conv;
42299 this_arg_conv.inner = untag_ptr(this_arg);
42300 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42301 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42302 this_arg_conv.is_owned = false;
42303 LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv);
42304 int64_t ret_ref = 0;
42305 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42306 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42310 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters, int64_t broadcaster_keys, int64_t countersignatory_keys) {
42311 LDKCommitmentTransaction this_arg_conv;
42312 this_arg_conv.inner = untag_ptr(this_arg);
42313 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42314 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42315 this_arg_conv.is_owned = false;
42316 LDKDirectedChannelTransactionParameters channel_parameters_conv;
42317 channel_parameters_conv.inner = untag_ptr(channel_parameters);
42318 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
42319 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
42320 channel_parameters_conv.is_owned = false;
42321 LDKChannelPublicKeys broadcaster_keys_conv;
42322 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
42323 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
42324 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
42325 broadcaster_keys_conv.is_owned = false;
42326 LDKChannelPublicKeys countersignatory_keys_conv;
42327 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
42328 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
42329 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
42330 countersignatory_keys_conv.is_owned = false;
42331 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
42332 *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv);
42333 return tag_ptr(ret_conv, true);
42336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42337 LDKTrustedCommitmentTransaction this_obj_conv;
42338 this_obj_conv.inner = untag_ptr(this_obj);
42339 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42340 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42341 TrustedCommitmentTransaction_free(this_obj_conv);
42344 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid(JNIEnv *env, jclass clz, int64_t this_arg) {
42345 LDKTrustedCommitmentTransaction this_arg_conv;
42346 this_arg_conv.inner = untag_ptr(this_arg);
42347 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42349 this_arg_conv.is_owned = false;
42350 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42351 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data);
42355 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) {
42356 LDKTrustedCommitmentTransaction this_arg_conv;
42357 this_arg_conv.inner = untag_ptr(this_arg);
42358 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42359 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42360 this_arg_conv.is_owned = false;
42361 LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv);
42362 int64_t ret_ref = 0;
42363 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42364 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys(JNIEnv *env, jclass clz, int64_t this_arg) {
42369 LDKTrustedCommitmentTransaction this_arg_conv;
42370 this_arg_conv.inner = untag_ptr(this_arg);
42371 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42373 this_arg_conv.is_owned = false;
42374 LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv);
42375 int64_t ret_ref = 0;
42376 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42377 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42381 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
42382 LDKTrustedCommitmentTransaction this_arg_conv;
42383 this_arg_conv.inner = untag_ptr(this_arg);
42384 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42386 this_arg_conv.is_owned = false;
42387 jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
42391 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_base_key, int64_t channel_parameters) {
42392 LDKTrustedCommitmentTransaction this_arg_conv;
42393 this_arg_conv.inner = untag_ptr(this_arg);
42394 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42396 this_arg_conv.is_owned = false;
42397 unsigned char htlc_base_key_arr[32];
42398 CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32);
42399 (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr);
42400 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
42401 LDKDirectedChannelTransactionParameters channel_parameters_conv;
42402 channel_parameters_conv.inner = untag_ptr(channel_parameters);
42403 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
42404 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
42405 channel_parameters_conv.is_owned = false;
42406 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
42407 *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv);
42408 return tag_ptr(ret_conv, true);
42411 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transaction_1number_1obscure_1factor(JNIEnv *env, jclass clz, int8_tArray broadcaster_payment_basepoint, int8_tArray countersignatory_payment_basepoint, jboolean outbound_from_broadcaster) {
42412 LDKPublicKey broadcaster_payment_basepoint_ref;
42413 CHECK((*env)->GetArrayLength(env, broadcaster_payment_basepoint) == 33);
42414 (*env)->GetByteArrayRegion(env, broadcaster_payment_basepoint, 0, 33, broadcaster_payment_basepoint_ref.compressed_form);
42415 LDKPublicKey countersignatory_payment_basepoint_ref;
42416 CHECK((*env)->GetArrayLength(env, countersignatory_payment_basepoint) == 33);
42417 (*env)->GetByteArrayRegion(env, countersignatory_payment_basepoint, 0, 33, countersignatory_payment_basepoint_ref.compressed_form);
42418 int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster);
42422 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42423 LDKInitFeatures a_conv;
42424 a_conv.inner = untag_ptr(a);
42425 a_conv.is_owned = ptr_is_owned(a);
42426 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42427 a_conv.is_owned = false;
42428 LDKInitFeatures b_conv;
42429 b_conv.inner = untag_ptr(b);
42430 b_conv.is_owned = ptr_is_owned(b);
42431 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42432 b_conv.is_owned = false;
42433 jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv);
42437 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42438 LDKNodeFeatures a_conv;
42439 a_conv.inner = untag_ptr(a);
42440 a_conv.is_owned = ptr_is_owned(a);
42441 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42442 a_conv.is_owned = false;
42443 LDKNodeFeatures b_conv;
42444 b_conv.inner = untag_ptr(b);
42445 b_conv.is_owned = ptr_is_owned(b);
42446 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42447 b_conv.is_owned = false;
42448 jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv);
42452 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42453 LDKChannelFeatures a_conv;
42454 a_conv.inner = untag_ptr(a);
42455 a_conv.is_owned = ptr_is_owned(a);
42456 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42457 a_conv.is_owned = false;
42458 LDKChannelFeatures b_conv;
42459 b_conv.inner = untag_ptr(b);
42460 b_conv.is_owned = ptr_is_owned(b);
42461 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42462 b_conv.is_owned = false;
42463 jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv);
42467 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42468 LDKInvoiceFeatures a_conv;
42469 a_conv.inner = untag_ptr(a);
42470 a_conv.is_owned = ptr_is_owned(a);
42471 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42472 a_conv.is_owned = false;
42473 LDKInvoiceFeatures b_conv;
42474 b_conv.inner = untag_ptr(b);
42475 b_conv.is_owned = ptr_is_owned(b);
42476 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42477 b_conv.is_owned = false;
42478 jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv);
42482 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42483 LDKChannelTypeFeatures a_conv;
42484 a_conv.inner = untag_ptr(a);
42485 a_conv.is_owned = ptr_is_owned(a);
42486 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42487 a_conv.is_owned = false;
42488 LDKChannelTypeFeatures b_conv;
42489 b_conv.inner = untag_ptr(b);
42490 b_conv.is_owned = ptr_is_owned(b);
42491 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42492 b_conv.is_owned = false;
42493 jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv);
42497 static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
42498 LDKInitFeatures ret_var = InitFeatures_clone(arg);
42499 int64_t ret_ref = 0;
42500 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42501 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42504 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42505 LDKInitFeatures arg_conv;
42506 arg_conv.inner = untag_ptr(arg);
42507 arg_conv.is_owned = ptr_is_owned(arg);
42508 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42509 arg_conv.is_owned = false;
42510 int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv);
42514 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42515 LDKInitFeatures orig_conv;
42516 orig_conv.inner = untag_ptr(orig);
42517 orig_conv.is_owned = ptr_is_owned(orig);
42518 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42519 orig_conv.is_owned = false;
42520 LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv);
42521 int64_t ret_ref = 0;
42522 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42523 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42527 static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) {
42528 LDKNodeFeatures ret_var = NodeFeatures_clone(arg);
42529 int64_t ret_ref = 0;
42530 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42531 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42535 LDKNodeFeatures arg_conv;
42536 arg_conv.inner = untag_ptr(arg);
42537 arg_conv.is_owned = ptr_is_owned(arg);
42538 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42539 arg_conv.is_owned = false;
42540 int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv);
42544 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42545 LDKNodeFeatures orig_conv;
42546 orig_conv.inner = untag_ptr(orig);
42547 orig_conv.is_owned = ptr_is_owned(orig);
42548 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42549 orig_conv.is_owned = false;
42550 LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv);
42551 int64_t ret_ref = 0;
42552 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42553 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42557 static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) {
42558 LDKChannelFeatures ret_var = ChannelFeatures_clone(arg);
42559 int64_t ret_ref = 0;
42560 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42561 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42564 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42565 LDKChannelFeatures arg_conv;
42566 arg_conv.inner = untag_ptr(arg);
42567 arg_conv.is_owned = ptr_is_owned(arg);
42568 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42569 arg_conv.is_owned = false;
42570 int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv);
42574 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42575 LDKChannelFeatures orig_conv;
42576 orig_conv.inner = untag_ptr(orig);
42577 orig_conv.is_owned = ptr_is_owned(orig);
42578 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42579 orig_conv.is_owned = false;
42580 LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv);
42581 int64_t ret_ref = 0;
42582 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42583 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42587 static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) {
42588 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg);
42589 int64_t ret_ref = 0;
42590 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42591 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42594 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42595 LDKInvoiceFeatures arg_conv;
42596 arg_conv.inner = untag_ptr(arg);
42597 arg_conv.is_owned = ptr_is_owned(arg);
42598 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42599 arg_conv.is_owned = false;
42600 int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv);
42604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42605 LDKInvoiceFeatures orig_conv;
42606 orig_conv.inner = untag_ptr(orig);
42607 orig_conv.is_owned = ptr_is_owned(orig);
42608 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42609 orig_conv.is_owned = false;
42610 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
42611 int64_t ret_ref = 0;
42612 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42613 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42617 static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
42618 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
42619 int64_t ret_ref = 0;
42620 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42621 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42624 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42625 LDKChannelTypeFeatures arg_conv;
42626 arg_conv.inner = untag_ptr(arg);
42627 arg_conv.is_owned = ptr_is_owned(arg);
42628 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42629 arg_conv.is_owned = false;
42630 int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv);
42634 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42635 LDKChannelTypeFeatures orig_conv;
42636 orig_conv.inner = untag_ptr(orig);
42637 orig_conv.is_owned = ptr_is_owned(orig);
42638 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42639 orig_conv.is_owned = false;
42640 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
42641 int64_t ret_ref = 0;
42642 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42643 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42647 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42648 LDKInitFeatures this_obj_conv;
42649 this_obj_conv.inner = untag_ptr(this_obj);
42650 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42651 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42652 InitFeatures_free(this_obj_conv);
42655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42656 LDKNodeFeatures this_obj_conv;
42657 this_obj_conv.inner = untag_ptr(this_obj);
42658 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42659 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42660 NodeFeatures_free(this_obj_conv);
42663 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42664 LDKChannelFeatures this_obj_conv;
42665 this_obj_conv.inner = untag_ptr(this_obj);
42666 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42668 ChannelFeatures_free(this_obj_conv);
42671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42672 LDKInvoiceFeatures this_obj_conv;
42673 this_obj_conv.inner = untag_ptr(this_obj);
42674 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42676 InvoiceFeatures_free(this_obj_conv);
42679 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42680 LDKChannelTypeFeatures this_obj_conv;
42681 this_obj_conv.inner = untag_ptr(this_obj);
42682 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42684 ChannelTypeFeatures_free(this_obj_conv);
42687 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) {
42688 LDKInitFeatures ret_var = InitFeatures_empty();
42689 int64_t ret_ref = 0;
42690 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42691 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42695 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
42696 LDKInitFeatures this_arg_conv;
42697 this_arg_conv.inner = untag_ptr(this_arg);
42698 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42700 this_arg_conv.is_owned = false;
42701 jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv);
42705 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) {
42706 LDKNodeFeatures ret_var = NodeFeatures_empty();
42707 int64_t ret_ref = 0;
42708 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42709 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42713 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
42714 LDKNodeFeatures this_arg_conv;
42715 this_arg_conv.inner = untag_ptr(this_arg);
42716 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42718 this_arg_conv.is_owned = false;
42719 jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
42723 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) {
42724 LDKChannelFeatures ret_var = ChannelFeatures_empty();
42725 int64_t ret_ref = 0;
42726 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42727 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42731 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
42732 LDKChannelFeatures this_arg_conv;
42733 this_arg_conv.inner = untag_ptr(this_arg);
42734 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42735 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42736 this_arg_conv.is_owned = false;
42737 jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
42741 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) {
42742 LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
42743 int64_t ret_ref = 0;
42744 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42745 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42749 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
42750 LDKInvoiceFeatures this_arg_conv;
42751 this_arg_conv.inner = untag_ptr(this_arg);
42752 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42754 this_arg_conv.is_owned = false;
42755 jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
42759 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) {
42760 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
42761 int64_t ret_ref = 0;
42762 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42763 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42767 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
42768 LDKChannelTypeFeatures this_arg_conv;
42769 this_arg_conv.inner = untag_ptr(this_arg);
42770 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42772 this_arg_conv.is_owned = false;
42773 jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
42777 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
42778 LDKInitFeatures obj_conv;
42779 obj_conv.inner = untag_ptr(obj);
42780 obj_conv.is_owned = ptr_is_owned(obj);
42781 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42782 obj_conv.is_owned = false;
42783 LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
42784 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42785 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42786 CVec_u8Z_free(ret_var);
42790 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42791 LDKu8slice ser_ref;
42792 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42793 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42794 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
42795 *ret_conv = InitFeatures_read(ser_ref);
42796 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42797 return tag_ptr(ret_conv, true);
42800 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
42801 LDKChannelFeatures obj_conv;
42802 obj_conv.inner = untag_ptr(obj);
42803 obj_conv.is_owned = ptr_is_owned(obj);
42804 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42805 obj_conv.is_owned = false;
42806 LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
42807 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42808 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42809 CVec_u8Z_free(ret_var);
42813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42814 LDKu8slice ser_ref;
42815 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42816 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42817 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
42818 *ret_conv = ChannelFeatures_read(ser_ref);
42819 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42820 return tag_ptr(ret_conv, true);
42823 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
42824 LDKNodeFeatures obj_conv;
42825 obj_conv.inner = untag_ptr(obj);
42826 obj_conv.is_owned = ptr_is_owned(obj);
42827 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42828 obj_conv.is_owned = false;
42829 LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
42830 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42831 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42832 CVec_u8Z_free(ret_var);
42836 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42837 LDKu8slice ser_ref;
42838 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42839 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42840 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
42841 *ret_conv = NodeFeatures_read(ser_ref);
42842 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42843 return tag_ptr(ret_conv, true);
42846 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
42847 LDKInvoiceFeatures obj_conv;
42848 obj_conv.inner = untag_ptr(obj);
42849 obj_conv.is_owned = ptr_is_owned(obj);
42850 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42851 obj_conv.is_owned = false;
42852 LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
42853 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42854 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42855 CVec_u8Z_free(ret_var);
42859 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42860 LDKu8slice ser_ref;
42861 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42862 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42863 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
42864 *ret_conv = InvoiceFeatures_read(ser_ref);
42865 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42866 return tag_ptr(ret_conv, true);
42869 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
42870 LDKChannelTypeFeatures obj_conv;
42871 obj_conv.inner = untag_ptr(obj);
42872 obj_conv.is_owned = ptr_is_owned(obj);
42873 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42874 obj_conv.is_owned = false;
42875 LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
42876 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42877 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42878 CVec_u8Z_free(ret_var);
42882 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42883 LDKu8slice ser_ref;
42884 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42885 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42886 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
42887 *ret_conv = ChannelTypeFeatures_read(ser_ref);
42888 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42889 return tag_ptr(ret_conv, true);
42892 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
42893 LDKInitFeatures this_arg_conv;
42894 this_arg_conv.inner = untag_ptr(this_arg);
42895 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42897 this_arg_conv.is_owned = false;
42898 InitFeatures_set_data_loss_protect_optional(&this_arg_conv);
42901 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
42902 LDKInitFeatures this_arg_conv;
42903 this_arg_conv.inner = untag_ptr(this_arg);
42904 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42906 this_arg_conv.is_owned = false;
42907 InitFeatures_set_data_loss_protect_required(&this_arg_conv);
42910 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
42911 LDKInitFeatures this_arg_conv;
42912 this_arg_conv.inner = untag_ptr(this_arg);
42913 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42915 this_arg_conv.is_owned = false;
42916 jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv);
42920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
42921 LDKNodeFeatures this_arg_conv;
42922 this_arg_conv.inner = untag_ptr(this_arg);
42923 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42925 this_arg_conv.is_owned = false;
42926 NodeFeatures_set_data_loss_protect_optional(&this_arg_conv);
42929 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
42930 LDKNodeFeatures this_arg_conv;
42931 this_arg_conv.inner = untag_ptr(this_arg);
42932 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42934 this_arg_conv.is_owned = false;
42935 NodeFeatures_set_data_loss_protect_required(&this_arg_conv);
42938 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
42939 LDKNodeFeatures this_arg_conv;
42940 this_arg_conv.inner = untag_ptr(this_arg);
42941 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42943 this_arg_conv.is_owned = false;
42944 jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv);
42948 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
42949 LDKInitFeatures this_arg_conv;
42950 this_arg_conv.inner = untag_ptr(this_arg);
42951 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42953 this_arg_conv.is_owned = false;
42954 jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv);
42958 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
42959 LDKNodeFeatures this_arg_conv;
42960 this_arg_conv.inner = untag_ptr(this_arg);
42961 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42963 this_arg_conv.is_owned = false;
42964 jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv);
42968 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
42969 LDKInitFeatures this_arg_conv;
42970 this_arg_conv.inner = untag_ptr(this_arg);
42971 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42973 this_arg_conv.is_owned = false;
42974 InitFeatures_set_initial_routing_sync_optional(&this_arg_conv);
42977 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
42978 LDKInitFeatures this_arg_conv;
42979 this_arg_conv.inner = untag_ptr(this_arg);
42980 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42982 this_arg_conv.is_owned = false;
42983 InitFeatures_set_initial_routing_sync_required(&this_arg_conv);
42986 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync(JNIEnv *env, jclass clz, int64_t this_arg) {
42987 LDKInitFeatures this_arg_conv;
42988 this_arg_conv.inner = untag_ptr(this_arg);
42989 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42990 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42991 this_arg_conv.is_owned = false;
42992 jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv);
42996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
42997 LDKInitFeatures this_arg_conv;
42998 this_arg_conv.inner = untag_ptr(this_arg);
42999 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43001 this_arg_conv.is_owned = false;
43002 InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
43005 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43006 LDKInitFeatures this_arg_conv;
43007 this_arg_conv.inner = untag_ptr(this_arg);
43008 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43010 this_arg_conv.is_owned = false;
43011 InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
43014 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
43015 LDKInitFeatures this_arg_conv;
43016 this_arg_conv.inner = untag_ptr(this_arg);
43017 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43019 this_arg_conv.is_owned = false;
43020 jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv);
43024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43025 LDKNodeFeatures this_arg_conv;
43026 this_arg_conv.inner = untag_ptr(this_arg);
43027 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43029 this_arg_conv.is_owned = false;
43030 NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
43033 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43034 LDKNodeFeatures this_arg_conv;
43035 this_arg_conv.inner = untag_ptr(this_arg);
43036 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43038 this_arg_conv.is_owned = false;
43039 NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
43042 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
43043 LDKNodeFeatures this_arg_conv;
43044 this_arg_conv.inner = untag_ptr(this_arg);
43045 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43046 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43047 this_arg_conv.is_owned = false;
43048 jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv);
43052 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
43053 LDKInitFeatures this_arg_conv;
43054 this_arg_conv.inner = untag_ptr(this_arg);
43055 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43057 this_arg_conv.is_owned = false;
43058 jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv);
43062 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
43063 LDKNodeFeatures this_arg_conv;
43064 this_arg_conv.inner = untag_ptr(this_arg);
43065 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43066 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43067 this_arg_conv.is_owned = false;
43068 jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv);
43072 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43073 LDKInitFeatures this_arg_conv;
43074 this_arg_conv.inner = untag_ptr(this_arg);
43075 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43077 this_arg_conv.is_owned = false;
43078 InitFeatures_set_gossip_queries_optional(&this_arg_conv);
43081 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43082 LDKInitFeatures this_arg_conv;
43083 this_arg_conv.inner = untag_ptr(this_arg);
43084 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43086 this_arg_conv.is_owned = false;
43087 InitFeatures_set_gossip_queries_required(&this_arg_conv);
43090 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
43091 LDKInitFeatures this_arg_conv;
43092 this_arg_conv.inner = untag_ptr(this_arg);
43093 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43095 this_arg_conv.is_owned = false;
43096 jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv);
43100 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43101 LDKNodeFeatures this_arg_conv;
43102 this_arg_conv.inner = untag_ptr(this_arg);
43103 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43105 this_arg_conv.is_owned = false;
43106 NodeFeatures_set_gossip_queries_optional(&this_arg_conv);
43109 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43110 LDKNodeFeatures this_arg_conv;
43111 this_arg_conv.inner = untag_ptr(this_arg);
43112 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43114 this_arg_conv.is_owned = false;
43115 NodeFeatures_set_gossip_queries_required(&this_arg_conv);
43118 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
43119 LDKNodeFeatures this_arg_conv;
43120 this_arg_conv.inner = untag_ptr(this_arg);
43121 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43122 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43123 this_arg_conv.is_owned = false;
43124 jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv);
43128 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
43129 LDKInitFeatures this_arg_conv;
43130 this_arg_conv.inner = untag_ptr(this_arg);
43131 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43133 this_arg_conv.is_owned = false;
43134 jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv);
43138 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
43139 LDKNodeFeatures this_arg_conv;
43140 this_arg_conv.inner = untag_ptr(this_arg);
43141 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43143 this_arg_conv.is_owned = false;
43144 jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv);
43148 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43149 LDKInitFeatures this_arg_conv;
43150 this_arg_conv.inner = untag_ptr(this_arg);
43151 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43153 this_arg_conv.is_owned = false;
43154 InitFeatures_set_variable_length_onion_optional(&this_arg_conv);
43157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43158 LDKInitFeatures this_arg_conv;
43159 this_arg_conv.inner = untag_ptr(this_arg);
43160 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43162 this_arg_conv.is_owned = false;
43163 InitFeatures_set_variable_length_onion_required(&this_arg_conv);
43166 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
43167 LDKInitFeatures this_arg_conv;
43168 this_arg_conv.inner = untag_ptr(this_arg);
43169 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43171 this_arg_conv.is_owned = false;
43172 jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv);
43176 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43177 LDKNodeFeatures this_arg_conv;
43178 this_arg_conv.inner = untag_ptr(this_arg);
43179 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43181 this_arg_conv.is_owned = false;
43182 NodeFeatures_set_variable_length_onion_optional(&this_arg_conv);
43185 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43186 LDKNodeFeatures this_arg_conv;
43187 this_arg_conv.inner = untag_ptr(this_arg);
43188 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43190 this_arg_conv.is_owned = false;
43191 NodeFeatures_set_variable_length_onion_required(&this_arg_conv);
43194 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
43195 LDKNodeFeatures this_arg_conv;
43196 this_arg_conv.inner = untag_ptr(this_arg);
43197 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43198 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43199 this_arg_conv.is_owned = false;
43200 jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv);
43204 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43205 LDKInvoiceFeatures this_arg_conv;
43206 this_arg_conv.inner = untag_ptr(this_arg);
43207 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43208 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43209 this_arg_conv.is_owned = false;
43210 InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv);
43213 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43214 LDKInvoiceFeatures this_arg_conv;
43215 this_arg_conv.inner = untag_ptr(this_arg);
43216 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43218 this_arg_conv.is_owned = false;
43219 InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv);
43222 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
43223 LDKInvoiceFeatures this_arg_conv;
43224 this_arg_conv.inner = untag_ptr(this_arg);
43225 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43227 this_arg_conv.is_owned = false;
43228 jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv);
43232 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
43233 LDKInitFeatures this_arg_conv;
43234 this_arg_conv.inner = untag_ptr(this_arg);
43235 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43237 this_arg_conv.is_owned = false;
43238 jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv);
43242 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
43243 LDKNodeFeatures this_arg_conv;
43244 this_arg_conv.inner = untag_ptr(this_arg);
43245 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43247 this_arg_conv.is_owned = false;
43248 jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv);
43252 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
43253 LDKInvoiceFeatures this_arg_conv;
43254 this_arg_conv.inner = untag_ptr(this_arg);
43255 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43257 this_arg_conv.is_owned = false;
43258 jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv);
43262 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43263 LDKInitFeatures this_arg_conv;
43264 this_arg_conv.inner = untag_ptr(this_arg);
43265 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43267 this_arg_conv.is_owned = false;
43268 InitFeatures_set_static_remote_key_optional(&this_arg_conv);
43271 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43272 LDKInitFeatures this_arg_conv;
43273 this_arg_conv.inner = untag_ptr(this_arg);
43274 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43276 this_arg_conv.is_owned = false;
43277 InitFeatures_set_static_remote_key_required(&this_arg_conv);
43280 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
43281 LDKInitFeatures this_arg_conv;
43282 this_arg_conv.inner = untag_ptr(this_arg);
43283 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43285 this_arg_conv.is_owned = false;
43286 jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv);
43290 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43291 LDKNodeFeatures this_arg_conv;
43292 this_arg_conv.inner = untag_ptr(this_arg);
43293 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43295 this_arg_conv.is_owned = false;
43296 NodeFeatures_set_static_remote_key_optional(&this_arg_conv);
43299 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43300 LDKNodeFeatures this_arg_conv;
43301 this_arg_conv.inner = untag_ptr(this_arg);
43302 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43304 this_arg_conv.is_owned = false;
43305 NodeFeatures_set_static_remote_key_required(&this_arg_conv);
43308 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
43309 LDKNodeFeatures this_arg_conv;
43310 this_arg_conv.inner = untag_ptr(this_arg);
43311 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43313 this_arg_conv.is_owned = false;
43314 jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv);
43318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43319 LDKChannelTypeFeatures this_arg_conv;
43320 this_arg_conv.inner = untag_ptr(this_arg);
43321 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43323 this_arg_conv.is_owned = false;
43324 ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv);
43327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43328 LDKChannelTypeFeatures this_arg_conv;
43329 this_arg_conv.inner = untag_ptr(this_arg);
43330 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43332 this_arg_conv.is_owned = false;
43333 ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv);
43336 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
43337 LDKChannelTypeFeatures this_arg_conv;
43338 this_arg_conv.inner = untag_ptr(this_arg);
43339 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43340 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43341 this_arg_conv.is_owned = false;
43342 jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv);
43346 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
43347 LDKInitFeatures this_arg_conv;
43348 this_arg_conv.inner = untag_ptr(this_arg);
43349 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43351 this_arg_conv.is_owned = false;
43352 jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv);
43356 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
43357 LDKNodeFeatures this_arg_conv;
43358 this_arg_conv.inner = untag_ptr(this_arg);
43359 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43361 this_arg_conv.is_owned = false;
43362 jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv);
43366 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
43367 LDKChannelTypeFeatures this_arg_conv;
43368 this_arg_conv.inner = untag_ptr(this_arg);
43369 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43371 this_arg_conv.is_owned = false;
43372 jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv);
43376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43377 LDKInitFeatures this_arg_conv;
43378 this_arg_conv.inner = untag_ptr(this_arg);
43379 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43381 this_arg_conv.is_owned = false;
43382 InitFeatures_set_payment_secret_optional(&this_arg_conv);
43385 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43386 LDKInitFeatures this_arg_conv;
43387 this_arg_conv.inner = untag_ptr(this_arg);
43388 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43390 this_arg_conv.is_owned = false;
43391 InitFeatures_set_payment_secret_required(&this_arg_conv);
43394 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
43395 LDKInitFeatures this_arg_conv;
43396 this_arg_conv.inner = untag_ptr(this_arg);
43397 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43399 this_arg_conv.is_owned = false;
43400 jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv);
43404 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43405 LDKNodeFeatures this_arg_conv;
43406 this_arg_conv.inner = untag_ptr(this_arg);
43407 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43408 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43409 this_arg_conv.is_owned = false;
43410 NodeFeatures_set_payment_secret_optional(&this_arg_conv);
43413 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43414 LDKNodeFeatures this_arg_conv;
43415 this_arg_conv.inner = untag_ptr(this_arg);
43416 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43418 this_arg_conv.is_owned = false;
43419 NodeFeatures_set_payment_secret_required(&this_arg_conv);
43422 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
43423 LDKNodeFeatures this_arg_conv;
43424 this_arg_conv.inner = untag_ptr(this_arg);
43425 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43427 this_arg_conv.is_owned = false;
43428 jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv);
43432 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43433 LDKInvoiceFeatures this_arg_conv;
43434 this_arg_conv.inner = untag_ptr(this_arg);
43435 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43437 this_arg_conv.is_owned = false;
43438 InvoiceFeatures_set_payment_secret_optional(&this_arg_conv);
43441 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43442 LDKInvoiceFeatures this_arg_conv;
43443 this_arg_conv.inner = untag_ptr(this_arg);
43444 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43446 this_arg_conv.is_owned = false;
43447 InvoiceFeatures_set_payment_secret_required(&this_arg_conv);
43450 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
43451 LDKInvoiceFeatures this_arg_conv;
43452 this_arg_conv.inner = untag_ptr(this_arg);
43453 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43455 this_arg_conv.is_owned = false;
43456 jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
43460 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
43461 LDKInitFeatures this_arg_conv;
43462 this_arg_conv.inner = untag_ptr(this_arg);
43463 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43464 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43465 this_arg_conv.is_owned = false;
43466 jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv);
43470 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
43471 LDKNodeFeatures this_arg_conv;
43472 this_arg_conv.inner = untag_ptr(this_arg);
43473 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43474 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43475 this_arg_conv.is_owned = false;
43476 jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv);
43480 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
43481 LDKInvoiceFeatures this_arg_conv;
43482 this_arg_conv.inner = untag_ptr(this_arg);
43483 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43485 this_arg_conv.is_owned = false;
43486 jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv);
43490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43491 LDKInitFeatures this_arg_conv;
43492 this_arg_conv.inner = untag_ptr(this_arg);
43493 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43495 this_arg_conv.is_owned = false;
43496 InitFeatures_set_basic_mpp_optional(&this_arg_conv);
43499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43500 LDKInitFeatures this_arg_conv;
43501 this_arg_conv.inner = untag_ptr(this_arg);
43502 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43504 this_arg_conv.is_owned = false;
43505 InitFeatures_set_basic_mpp_required(&this_arg_conv);
43508 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
43509 LDKInitFeatures this_arg_conv;
43510 this_arg_conv.inner = untag_ptr(this_arg);
43511 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43513 this_arg_conv.is_owned = false;
43514 jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv);
43518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43519 LDKNodeFeatures this_arg_conv;
43520 this_arg_conv.inner = untag_ptr(this_arg);
43521 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43523 this_arg_conv.is_owned = false;
43524 NodeFeatures_set_basic_mpp_optional(&this_arg_conv);
43527 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43528 LDKNodeFeatures this_arg_conv;
43529 this_arg_conv.inner = untag_ptr(this_arg);
43530 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43532 this_arg_conv.is_owned = false;
43533 NodeFeatures_set_basic_mpp_required(&this_arg_conv);
43536 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
43537 LDKNodeFeatures this_arg_conv;
43538 this_arg_conv.inner = untag_ptr(this_arg);
43539 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43541 this_arg_conv.is_owned = false;
43542 jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv);
43546 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43547 LDKInvoiceFeatures this_arg_conv;
43548 this_arg_conv.inner = untag_ptr(this_arg);
43549 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43551 this_arg_conv.is_owned = false;
43552 InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
43555 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43556 LDKInvoiceFeatures this_arg_conv;
43557 this_arg_conv.inner = untag_ptr(this_arg);
43558 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43560 this_arg_conv.is_owned = false;
43561 InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
43564 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
43565 LDKInvoiceFeatures this_arg_conv;
43566 this_arg_conv.inner = untag_ptr(this_arg);
43567 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43568 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43569 this_arg_conv.is_owned = false;
43570 jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
43574 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
43575 LDKInitFeatures this_arg_conv;
43576 this_arg_conv.inner = untag_ptr(this_arg);
43577 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43579 this_arg_conv.is_owned = false;
43580 jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv);
43584 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
43585 LDKNodeFeatures this_arg_conv;
43586 this_arg_conv.inner = untag_ptr(this_arg);
43587 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43589 this_arg_conv.is_owned = false;
43590 jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv);
43594 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
43595 LDKInvoiceFeatures this_arg_conv;
43596 this_arg_conv.inner = untag_ptr(this_arg);
43597 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43599 this_arg_conv.is_owned = false;
43600 jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
43604 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43605 LDKInitFeatures this_arg_conv;
43606 this_arg_conv.inner = untag_ptr(this_arg);
43607 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43608 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43609 this_arg_conv.is_owned = false;
43610 InitFeatures_set_wumbo_optional(&this_arg_conv);
43613 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43614 LDKInitFeatures this_arg_conv;
43615 this_arg_conv.inner = untag_ptr(this_arg);
43616 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43618 this_arg_conv.is_owned = false;
43619 InitFeatures_set_wumbo_required(&this_arg_conv);
43622 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
43623 LDKInitFeatures this_arg_conv;
43624 this_arg_conv.inner = untag_ptr(this_arg);
43625 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43626 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43627 this_arg_conv.is_owned = false;
43628 jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv);
43632 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43633 LDKNodeFeatures this_arg_conv;
43634 this_arg_conv.inner = untag_ptr(this_arg);
43635 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43637 this_arg_conv.is_owned = false;
43638 NodeFeatures_set_wumbo_optional(&this_arg_conv);
43641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43642 LDKNodeFeatures this_arg_conv;
43643 this_arg_conv.inner = untag_ptr(this_arg);
43644 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43646 this_arg_conv.is_owned = false;
43647 NodeFeatures_set_wumbo_required(&this_arg_conv);
43650 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
43651 LDKNodeFeatures this_arg_conv;
43652 this_arg_conv.inner = untag_ptr(this_arg);
43653 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43655 this_arg_conv.is_owned = false;
43656 jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv);
43660 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
43661 LDKInitFeatures this_arg_conv;
43662 this_arg_conv.inner = untag_ptr(this_arg);
43663 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43665 this_arg_conv.is_owned = false;
43666 jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv);
43670 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
43671 LDKNodeFeatures this_arg_conv;
43672 this_arg_conv.inner = untag_ptr(this_arg);
43673 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43675 this_arg_conv.is_owned = false;
43676 jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv);
43680 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43681 LDKInitFeatures this_arg_conv;
43682 this_arg_conv.inner = untag_ptr(this_arg);
43683 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43685 this_arg_conv.is_owned = false;
43686 InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
43689 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43690 LDKInitFeatures this_arg_conv;
43691 this_arg_conv.inner = untag_ptr(this_arg);
43692 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43694 this_arg_conv.is_owned = false;
43695 InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
43698 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
43699 LDKInitFeatures this_arg_conv;
43700 this_arg_conv.inner = untag_ptr(this_arg);
43701 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43703 this_arg_conv.is_owned = false;
43704 jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv);
43708 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43709 LDKNodeFeatures this_arg_conv;
43710 this_arg_conv.inner = untag_ptr(this_arg);
43711 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43712 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43713 this_arg_conv.is_owned = false;
43714 NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
43717 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43718 LDKNodeFeatures this_arg_conv;
43719 this_arg_conv.inner = untag_ptr(this_arg);
43720 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43722 this_arg_conv.is_owned = false;
43723 NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
43726 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
43727 LDKNodeFeatures this_arg_conv;
43728 this_arg_conv.inner = untag_ptr(this_arg);
43729 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43731 this_arg_conv.is_owned = false;
43732 jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv);
43736 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
43737 LDKInitFeatures this_arg_conv;
43738 this_arg_conv.inner = untag_ptr(this_arg);
43739 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43741 this_arg_conv.is_owned = false;
43742 jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv);
43746 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
43747 LDKNodeFeatures this_arg_conv;
43748 this_arg_conv.inner = untag_ptr(this_arg);
43749 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43750 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43751 this_arg_conv.is_owned = false;
43752 jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv);
43756 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43757 LDKInitFeatures this_arg_conv;
43758 this_arg_conv.inner = untag_ptr(this_arg);
43759 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43760 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43761 this_arg_conv.is_owned = false;
43762 InitFeatures_set_onion_messages_optional(&this_arg_conv);
43765 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43766 LDKInitFeatures this_arg_conv;
43767 this_arg_conv.inner = untag_ptr(this_arg);
43768 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43769 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43770 this_arg_conv.is_owned = false;
43771 InitFeatures_set_onion_messages_required(&this_arg_conv);
43774 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
43775 LDKInitFeatures this_arg_conv;
43776 this_arg_conv.inner = untag_ptr(this_arg);
43777 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43779 this_arg_conv.is_owned = false;
43780 jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv);
43784 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43785 LDKNodeFeatures this_arg_conv;
43786 this_arg_conv.inner = untag_ptr(this_arg);
43787 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43789 this_arg_conv.is_owned = false;
43790 NodeFeatures_set_onion_messages_optional(&this_arg_conv);
43793 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43794 LDKNodeFeatures this_arg_conv;
43795 this_arg_conv.inner = untag_ptr(this_arg);
43796 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43798 this_arg_conv.is_owned = false;
43799 NodeFeatures_set_onion_messages_required(&this_arg_conv);
43802 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
43803 LDKNodeFeatures this_arg_conv;
43804 this_arg_conv.inner = untag_ptr(this_arg);
43805 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43807 this_arg_conv.is_owned = false;
43808 jboolean ret_conv = NodeFeatures_supports_onion_messages(&this_arg_conv);
43812 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
43813 LDKInitFeatures this_arg_conv;
43814 this_arg_conv.inner = untag_ptr(this_arg);
43815 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43817 this_arg_conv.is_owned = false;
43818 jboolean ret_conv = InitFeatures_requires_onion_messages(&this_arg_conv);
43822 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
43823 LDKNodeFeatures this_arg_conv;
43824 this_arg_conv.inner = untag_ptr(this_arg);
43825 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43827 this_arg_conv.is_owned = false;
43828 jboolean ret_conv = NodeFeatures_requires_onion_messages(&this_arg_conv);
43832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43833 LDKInitFeatures this_arg_conv;
43834 this_arg_conv.inner = untag_ptr(this_arg);
43835 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43837 this_arg_conv.is_owned = false;
43838 InitFeatures_set_channel_type_optional(&this_arg_conv);
43841 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43842 LDKInitFeatures this_arg_conv;
43843 this_arg_conv.inner = untag_ptr(this_arg);
43844 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43845 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43846 this_arg_conv.is_owned = false;
43847 InitFeatures_set_channel_type_required(&this_arg_conv);
43850 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
43851 LDKInitFeatures this_arg_conv;
43852 this_arg_conv.inner = untag_ptr(this_arg);
43853 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43854 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43855 this_arg_conv.is_owned = false;
43856 jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv);
43860 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43861 LDKNodeFeatures this_arg_conv;
43862 this_arg_conv.inner = untag_ptr(this_arg);
43863 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43864 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43865 this_arg_conv.is_owned = false;
43866 NodeFeatures_set_channel_type_optional(&this_arg_conv);
43869 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43870 LDKNodeFeatures this_arg_conv;
43871 this_arg_conv.inner = untag_ptr(this_arg);
43872 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43874 this_arg_conv.is_owned = false;
43875 NodeFeatures_set_channel_type_required(&this_arg_conv);
43878 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
43879 LDKNodeFeatures this_arg_conv;
43880 this_arg_conv.inner = untag_ptr(this_arg);
43881 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43882 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43883 this_arg_conv.is_owned = false;
43884 jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv);
43888 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
43889 LDKInitFeatures this_arg_conv;
43890 this_arg_conv.inner = untag_ptr(this_arg);
43891 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43893 this_arg_conv.is_owned = false;
43894 jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv);
43898 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
43899 LDKNodeFeatures this_arg_conv;
43900 this_arg_conv.inner = untag_ptr(this_arg);
43901 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43903 this_arg_conv.is_owned = false;
43904 jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv);
43908 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43909 LDKInitFeatures this_arg_conv;
43910 this_arg_conv.inner = untag_ptr(this_arg);
43911 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43913 this_arg_conv.is_owned = false;
43914 InitFeatures_set_scid_privacy_optional(&this_arg_conv);
43917 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43918 LDKInitFeatures this_arg_conv;
43919 this_arg_conv.inner = untag_ptr(this_arg);
43920 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43921 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43922 this_arg_conv.is_owned = false;
43923 InitFeatures_set_scid_privacy_required(&this_arg_conv);
43926 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
43927 LDKInitFeatures this_arg_conv;
43928 this_arg_conv.inner = untag_ptr(this_arg);
43929 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43931 this_arg_conv.is_owned = false;
43932 jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv);
43936 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43937 LDKNodeFeatures this_arg_conv;
43938 this_arg_conv.inner = untag_ptr(this_arg);
43939 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43940 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43941 this_arg_conv.is_owned = false;
43942 NodeFeatures_set_scid_privacy_optional(&this_arg_conv);
43945 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43946 LDKNodeFeatures this_arg_conv;
43947 this_arg_conv.inner = untag_ptr(this_arg);
43948 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43950 this_arg_conv.is_owned = false;
43951 NodeFeatures_set_scid_privacy_required(&this_arg_conv);
43954 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
43955 LDKNodeFeatures this_arg_conv;
43956 this_arg_conv.inner = untag_ptr(this_arg);
43957 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43959 this_arg_conv.is_owned = false;
43960 jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv);
43964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
43965 LDKChannelTypeFeatures this_arg_conv;
43966 this_arg_conv.inner = untag_ptr(this_arg);
43967 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43969 this_arg_conv.is_owned = false;
43970 ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv);
43973 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
43974 LDKChannelTypeFeatures this_arg_conv;
43975 this_arg_conv.inner = untag_ptr(this_arg);
43976 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43978 this_arg_conv.is_owned = false;
43979 ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv);
43982 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
43983 LDKChannelTypeFeatures this_arg_conv;
43984 this_arg_conv.inner = untag_ptr(this_arg);
43985 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43986 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43987 this_arg_conv.is_owned = false;
43988 jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv);
43992 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
43993 LDKInitFeatures this_arg_conv;
43994 this_arg_conv.inner = untag_ptr(this_arg);
43995 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43997 this_arg_conv.is_owned = false;
43998 jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv);
44002 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
44003 LDKNodeFeatures this_arg_conv;
44004 this_arg_conv.inner = untag_ptr(this_arg);
44005 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44007 this_arg_conv.is_owned = false;
44008 jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv);
44012 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
44013 LDKChannelTypeFeatures this_arg_conv;
44014 this_arg_conv.inner = untag_ptr(this_arg);
44015 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44017 this_arg_conv.is_owned = false;
44018 jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv);
44022 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
44023 LDKInitFeatures this_arg_conv;
44024 this_arg_conv.inner = untag_ptr(this_arg);
44025 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44027 this_arg_conv.is_owned = false;
44028 InitFeatures_set_zero_conf_optional(&this_arg_conv);
44031 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
44032 LDKInitFeatures this_arg_conv;
44033 this_arg_conv.inner = untag_ptr(this_arg);
44034 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44036 this_arg_conv.is_owned = false;
44037 InitFeatures_set_zero_conf_required(&this_arg_conv);
44040 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
44041 LDKInitFeatures this_arg_conv;
44042 this_arg_conv.inner = untag_ptr(this_arg);
44043 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44044 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44045 this_arg_conv.is_owned = false;
44046 jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv);
44050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
44051 LDKNodeFeatures this_arg_conv;
44052 this_arg_conv.inner = untag_ptr(this_arg);
44053 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44055 this_arg_conv.is_owned = false;
44056 NodeFeatures_set_zero_conf_optional(&this_arg_conv);
44059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
44060 LDKNodeFeatures this_arg_conv;
44061 this_arg_conv.inner = untag_ptr(this_arg);
44062 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44064 this_arg_conv.is_owned = false;
44065 NodeFeatures_set_zero_conf_required(&this_arg_conv);
44068 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
44069 LDKNodeFeatures this_arg_conv;
44070 this_arg_conv.inner = untag_ptr(this_arg);
44071 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44073 this_arg_conv.is_owned = false;
44074 jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv);
44078 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
44079 LDKChannelTypeFeatures this_arg_conv;
44080 this_arg_conv.inner = untag_ptr(this_arg);
44081 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44083 this_arg_conv.is_owned = false;
44084 ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv);
44087 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
44088 LDKChannelTypeFeatures this_arg_conv;
44089 this_arg_conv.inner = untag_ptr(this_arg);
44090 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44092 this_arg_conv.is_owned = false;
44093 ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv);
44096 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
44097 LDKChannelTypeFeatures this_arg_conv;
44098 this_arg_conv.inner = untag_ptr(this_arg);
44099 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44100 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44101 this_arg_conv.is_owned = false;
44102 jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv);
44106 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
44107 LDKInitFeatures this_arg_conv;
44108 this_arg_conv.inner = untag_ptr(this_arg);
44109 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44110 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44111 this_arg_conv.is_owned = false;
44112 jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv);
44116 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
44117 LDKNodeFeatures this_arg_conv;
44118 this_arg_conv.inner = untag_ptr(this_arg);
44119 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44120 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44121 this_arg_conv.is_owned = false;
44122 jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv);
44126 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
44127 LDKChannelTypeFeatures this_arg_conv;
44128 this_arg_conv.inner = untag_ptr(this_arg);
44129 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44130 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44131 this_arg_conv.is_owned = false;
44132 jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv);
44136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
44137 LDKNodeFeatures this_arg_conv;
44138 this_arg_conv.inner = untag_ptr(this_arg);
44139 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44141 this_arg_conv.is_owned = false;
44142 NodeFeatures_set_keysend_optional(&this_arg_conv);
44145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
44146 LDKNodeFeatures this_arg_conv;
44147 this_arg_conv.inner = untag_ptr(this_arg);
44148 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44149 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44150 this_arg_conv.is_owned = false;
44151 NodeFeatures_set_keysend_required(&this_arg_conv);
44154 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) {
44155 LDKNodeFeatures this_arg_conv;
44156 this_arg_conv.inner = untag_ptr(this_arg);
44157 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44158 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44159 this_arg_conv.is_owned = false;
44160 jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv);
44164 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) {
44165 LDKNodeFeatures this_arg_conv;
44166 this_arg_conv.inner = untag_ptr(this_arg);
44167 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44168 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44169 this_arg_conv.is_owned = false;
44170 jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv);
44174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44175 LDKShutdownScript this_obj_conv;
44176 this_obj_conv.inner = untag_ptr(this_obj);
44177 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44179 ShutdownScript_free(this_obj_conv);
44182 static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) {
44183 LDKShutdownScript ret_var = ShutdownScript_clone(arg);
44184 int64_t ret_ref = 0;
44185 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44186 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44189 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44190 LDKShutdownScript arg_conv;
44191 arg_conv.inner = untag_ptr(arg);
44192 arg_conv.is_owned = ptr_is_owned(arg);
44193 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44194 arg_conv.is_owned = false;
44195 int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv);
44199 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44200 LDKShutdownScript orig_conv;
44201 orig_conv.inner = untag_ptr(orig);
44202 orig_conv.is_owned = ptr_is_owned(orig);
44203 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44204 orig_conv.is_owned = false;
44205 LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
44206 int64_t ret_ref = 0;
44207 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44208 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44212 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44213 LDKShutdownScript a_conv;
44214 a_conv.inner = untag_ptr(a);
44215 a_conv.is_owned = ptr_is_owned(a);
44216 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44217 a_conv.is_owned = false;
44218 LDKShutdownScript b_conv;
44219 b_conv.inner = untag_ptr(b);
44220 b_conv.is_owned = ptr_is_owned(b);
44221 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44222 b_conv.is_owned = false;
44223 jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv);
44227 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44228 LDKInvalidShutdownScript this_obj_conv;
44229 this_obj_conv.inner = untag_ptr(this_obj);
44230 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44232 InvalidShutdownScript_free(this_obj_conv);
44235 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1get_1script(JNIEnv *env, jclass clz, int64_t this_ptr) {
44236 LDKInvalidShutdownScript this_ptr_conv;
44237 this_ptr_conv.inner = untag_ptr(this_ptr);
44238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44240 this_ptr_conv.is_owned = false;
44241 LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
44242 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44243 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44247 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1script(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
44248 LDKInvalidShutdownScript this_ptr_conv;
44249 this_ptr_conv.inner = untag_ptr(this_ptr);
44250 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44251 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44252 this_ptr_conv.is_owned = false;
44253 LDKCVec_u8Z val_ref;
44254 val_ref.datalen = (*env)->GetArrayLength(env, val);
44255 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
44256 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
44257 InvalidShutdownScript_set_script(&this_ptr_conv, val_ref);
44260 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new(JNIEnv *env, jclass clz, int8_tArray script_arg) {
44261 LDKCVec_u8Z script_arg_ref;
44262 script_arg_ref.datalen = (*env)->GetArrayLength(env, script_arg);
44263 script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
44264 (*env)->GetByteArrayRegion(env, script_arg, 0, script_arg_ref.datalen, script_arg_ref.data);
44265 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
44266 int64_t ret_ref = 0;
44267 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44268 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44272 static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) {
44273 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg);
44274 int64_t ret_ref = 0;
44275 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44276 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44279 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44280 LDKInvalidShutdownScript arg_conv;
44281 arg_conv.inner = untag_ptr(arg);
44282 arg_conv.is_owned = ptr_is_owned(arg);
44283 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44284 arg_conv.is_owned = false;
44285 int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv);
44289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44290 LDKInvalidShutdownScript orig_conv;
44291 orig_conv.inner = untag_ptr(orig);
44292 orig_conv.is_owned = ptr_is_owned(orig);
44293 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44294 orig_conv.is_owned = false;
44295 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
44296 int64_t ret_ref = 0;
44297 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44298 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44302 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(JNIEnv *env, jclass clz, int64_t obj) {
44303 LDKShutdownScript obj_conv;
44304 obj_conv.inner = untag_ptr(obj);
44305 obj_conv.is_owned = ptr_is_owned(obj);
44306 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44307 obj_conv.is_owned = false;
44308 LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
44309 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44310 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44311 CVec_u8Z_free(ret_var);
44315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
44316 LDKu8slice ser_ref;
44317 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
44318 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
44319 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
44320 *ret_conv = ShutdownScript_read(ser_ref);
44321 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
44322 return tag_ptr(ret_conv, true);
44325 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh(JNIEnv *env, jclass clz, int8_tArray pubkey_hash) {
44326 unsigned char pubkey_hash_arr[20];
44327 CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20);
44328 (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr);
44329 unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
44330 LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
44331 int64_t ret_ref = 0;
44332 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44333 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44337 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh(JNIEnv *env, jclass clz, int8_tArray script_hash) {
44338 unsigned char script_hash_arr[32];
44339 CHECK((*env)->GetArrayLength(env, script_hash) == 32);
44340 (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr);
44341 unsigned char (*script_hash_ref)[32] = &script_hash_arr;
44342 LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
44343 int64_t ret_ref = 0;
44344 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44345 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44349 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) {
44351 LDKu8slice program_ref;
44352 program_ref.datalen = (*env)->GetArrayLength(env, program);
44353 program_ref.data = (*env)->GetByteArrayElements (env, program, NULL);
44354 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
44355 *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
44356 (*env)->ReleaseByteArrayElements(env, program, (int8_t*)program_ref.data, 0);
44357 return tag_ptr(ret_conv, true);
44360 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
44361 LDKShutdownScript this_arg_conv;
44362 this_arg_conv.inner = untag_ptr(this_arg);
44363 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44365 this_arg_conv = ShutdownScript_clone(&this_arg_conv);
44366 LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
44367 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44368 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44369 CVec_u8Z_free(ret_var);
44373 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1legacy_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
44374 LDKShutdownScript this_arg_conv;
44375 this_arg_conv.inner = untag_ptr(this_arg);
44376 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44378 this_arg_conv.is_owned = false;
44379 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
44380 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form);
44384 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compatible(JNIEnv *env, jclass clz, int64_t this_arg, int64_t features) {
44385 LDKShutdownScript this_arg_conv;
44386 this_arg_conv.inner = untag_ptr(this_arg);
44387 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44388 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44389 this_arg_conv.is_owned = false;
44390 LDKInitFeatures features_conv;
44391 features_conv.inner = untag_ptr(features);
44392 features_conv.is_owned = ptr_is_owned(features);
44393 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
44394 features_conv.is_owned = false;
44395 jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
44399 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
44400 if (!ptr_is_owned(this_ptr)) return;
44401 void* this_ptr_ptr = untag_ptr(this_ptr);
44402 CHECK_ACCESS(this_ptr_ptr);
44403 LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
44404 FREE(untag_ptr(this_ptr));
44405 CustomMessageReader_free(this_ptr_conv);
44408 static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) {
44409 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
44410 *ret_ret = Type_clone(arg);
44411 return tag_ptr(ret_ret, true);
44413 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44414 void* arg_ptr = untag_ptr(arg);
44415 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
44416 LDKType* arg_conv = (LDKType*)arg_ptr;
44417 int64_t ret_conv = Type_clone_ptr(arg_conv);
44421 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44422 void* orig_ptr = untag_ptr(orig);
44423 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
44424 LDKType* orig_conv = (LDKType*)orig_ptr;
44425 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
44426 *ret_ret = Type_clone(orig_conv);
44427 return tag_ptr(ret_ret, true);
44430 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
44431 if (!ptr_is_owned(this_ptr)) return;
44432 void* this_ptr_ptr = untag_ptr(this_ptr);
44433 CHECK_ACCESS(this_ptr_ptr);
44434 LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
44435 FREE(untag_ptr(this_ptr));
44436 Type_free(this_ptr_conv);
44439 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44440 LDKNodeId this_obj_conv;
44441 this_obj_conv.inner = untag_ptr(this_obj);
44442 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44444 NodeId_free(this_obj_conv);
44447 static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) {
44448 LDKNodeId ret_var = NodeId_clone(arg);
44449 int64_t ret_ref = 0;
44450 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44451 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44454 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44455 LDKNodeId arg_conv;
44456 arg_conv.inner = untag_ptr(arg);
44457 arg_conv.is_owned = ptr_is_owned(arg);
44458 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44459 arg_conv.is_owned = false;
44460 int64_t ret_conv = NodeId_clone_ptr(&arg_conv);
44464 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44465 LDKNodeId orig_conv;
44466 orig_conv.inner = untag_ptr(orig);
44467 orig_conv.is_owned = ptr_is_owned(orig);
44468 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44469 orig_conv.is_owned = false;
44470 LDKNodeId ret_var = NodeId_clone(&orig_conv);
44471 int64_t ret_ref = 0;
44472 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44473 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44477 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv *env, jclass clz, int8_tArray pubkey) {
44478 LDKPublicKey pubkey_ref;
44479 CHECK((*env)->GetArrayLength(env, pubkey) == 33);
44480 (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
44481 LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
44482 int64_t ret_ref = 0;
44483 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44484 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44488 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEnv *env, jclass clz, int64_t this_arg) {
44489 LDKNodeId this_arg_conv;
44490 this_arg_conv.inner = untag_ptr(this_arg);
44491 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44493 this_arg_conv.is_owned = false;
44494 LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv);
44495 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44496 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, jclass clz, int64_t o) {
44502 o_conv.inner = untag_ptr(o);
44503 o_conv.is_owned = ptr_is_owned(o);
44504 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44505 o_conv.is_owned = false;
44506 int64_t ret_conv = NodeId_hash(&o_conv);
44510 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *env, jclass clz, int64_t obj) {
44511 LDKNodeId obj_conv;
44512 obj_conv.inner = untag_ptr(obj);
44513 obj_conv.is_owned = ptr_is_owned(obj);
44514 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44515 obj_conv.is_owned = false;
44516 LDKCVec_u8Z ret_var = NodeId_write(&obj_conv);
44517 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44518 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44519 CVec_u8Z_free(ret_var);
44523 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
44524 LDKu8slice ser_ref;
44525 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
44526 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
44527 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
44528 *ret_conv = NodeId_read(ser_ref);
44529 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
44530 return tag_ptr(ret_conv, true);
44533 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44534 LDKNetworkGraph this_obj_conv;
44535 this_obj_conv.inner = untag_ptr(this_obj);
44536 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44537 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44538 NetworkGraph_free(this_obj_conv);
44541 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44542 LDKReadOnlyNetworkGraph this_obj_conv;
44543 this_obj_conv.inner = untag_ptr(this_obj);
44544 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44545 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44546 ReadOnlyNetworkGraph_free(this_obj_conv);
44549 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
44550 if (!ptr_is_owned(this_ptr)) return;
44551 void* this_ptr_ptr = untag_ptr(this_ptr);
44552 CHECK_ACCESS(this_ptr_ptr);
44553 LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
44554 FREE(untag_ptr(this_ptr));
44555 NetworkUpdate_free(this_ptr_conv);
44558 static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) {
44559 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
44560 *ret_copy = NetworkUpdate_clone(arg);
44561 int64_t ret_ref = tag_ptr(ret_copy, true);
44564 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44565 LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg);
44566 int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv);
44570 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44571 LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig);
44572 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
44573 *ret_copy = NetworkUpdate_clone(orig_conv);
44574 int64_t ret_ref = tag_ptr(ret_copy, true);
44578 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1update_1message(JNIEnv *env, jclass clz, int64_t msg) {
44579 LDKChannelUpdate msg_conv;
44580 msg_conv.inner = untag_ptr(msg);
44581 msg_conv.is_owned = ptr_is_owned(msg);
44582 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
44583 msg_conv = ChannelUpdate_clone(&msg_conv);
44584 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
44585 *ret_copy = NetworkUpdate_channel_update_message(msg_conv);
44586 int64_t ret_ref = tag_ptr(ret_copy, true);
44590 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) {
44591 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
44592 *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent);
44593 int64_t ret_ref = tag_ptr(ret_copy, true);
44597 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure(JNIEnv *env, jclass clz, int8_tArray node_id, jboolean is_permanent) {
44598 LDKPublicKey node_id_ref;
44599 CHECK((*env)->GetArrayLength(env, node_id) == 33);
44600 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
44601 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
44602 *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent);
44603 int64_t ret_ref = tag_ptr(ret_copy, true);
44607 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44608 LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a);
44609 LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b);
44610 jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv);
44614 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
44615 LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
44616 LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
44617 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44618 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44619 CVec_u8Z_free(ret_var);
44623 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
44624 LDKu8slice ser_ref;
44625 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
44626 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
44627 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
44628 *ret_conv = NetworkUpdate_read(ser_ref);
44629 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
44630 return tag_ptr(ret_conv, true);
44633 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44634 LDKP2PGossipSync this_obj_conv;
44635 this_obj_conv.inner = untag_ptr(this_obj);
44636 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44638 P2PGossipSync_free(this_obj_conv);
44641 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t chain_access, int64_t logger) {
44642 LDKNetworkGraph network_graph_conv;
44643 network_graph_conv.inner = untag_ptr(network_graph);
44644 network_graph_conv.is_owned = ptr_is_owned(network_graph);
44645 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
44646 network_graph_conv.is_owned = false;
44647 void* chain_access_ptr = untag_ptr(chain_access);
44648 CHECK_ACCESS(chain_access_ptr);
44649 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
44650 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
44651 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
44652 // Manually implement clone for Java trait instances
44653 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
44654 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44655 LDKAccess_JCalls_cloned(&chain_access_conv.some);
44658 void* logger_ptr = untag_ptr(logger);
44659 CHECK_ACCESS(logger_ptr);
44660 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
44661 if (logger_conv.free == LDKLogger_JCalls_free) {
44662 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44663 LDKLogger_JCalls_cloned(&logger_conv);
44665 LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, chain_access_conv, logger_conv);
44666 int64_t ret_ref = 0;
44667 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44668 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44672 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1chain_1access(JNIEnv *env, jclass clz, int64_t this_arg, int64_t chain_access) {
44673 LDKP2PGossipSync this_arg_conv;
44674 this_arg_conv.inner = untag_ptr(this_arg);
44675 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44676 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44677 this_arg_conv.is_owned = false;
44678 void* chain_access_ptr = untag_ptr(chain_access);
44679 CHECK_ACCESS(chain_access_ptr);
44680 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
44681 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
44682 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
44683 // Manually implement clone for Java trait instances
44684 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
44685 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44686 LDKAccess_JCalls_cloned(&chain_access_conv.some);
44689 P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv);
44692 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
44693 LDKNetworkGraph this_arg_conv;
44694 this_arg_conv.inner = untag_ptr(this_arg);
44695 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44697 this_arg_conv.is_owned = false;
44698 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
44699 *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv);
44700 return tag_ptr(ret_ret, true);
44703 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
44704 LDKP2PGossipSync this_arg_conv;
44705 this_arg_conv.inner = untag_ptr(this_arg);
44706 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44708 this_arg_conv.is_owned = false;
44709 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
44710 *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv);
44711 return tag_ptr(ret_ret, true);
44714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
44715 LDKP2PGossipSync this_arg_conv;
44716 this_arg_conv.inner = untag_ptr(this_arg);
44717 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44719 this_arg_conv.is_owned = false;
44720 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
44721 *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv);
44722 return tag_ptr(ret_ret, true);
44725 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44726 LDKChannelUpdateInfo this_obj_conv;
44727 this_obj_conv.inner = untag_ptr(this_obj);
44728 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44730 ChannelUpdateInfo_free(this_obj_conv);
44733 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) {
44734 LDKChannelUpdateInfo this_ptr_conv;
44735 this_ptr_conv.inner = untag_ptr(this_ptr);
44736 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44738 this_ptr_conv.is_owned = false;
44739 int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv);
44743 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
44744 LDKChannelUpdateInfo this_ptr_conv;
44745 this_ptr_conv.inner = untag_ptr(this_ptr);
44746 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44747 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44748 this_ptr_conv.is_owned = false;
44749 ChannelUpdateInfo_set_last_update(&this_ptr_conv, val);
44752 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr) {
44753 LDKChannelUpdateInfo this_ptr_conv;
44754 this_ptr_conv.inner = untag_ptr(this_ptr);
44755 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44756 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44757 this_ptr_conv.is_owned = false;
44758 jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv);
44762 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
44763 LDKChannelUpdateInfo this_ptr_conv;
44764 this_ptr_conv.inner = untag_ptr(this_ptr);
44765 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44766 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44767 this_ptr_conv.is_owned = false;
44768 ChannelUpdateInfo_set_enabled(&this_ptr_conv, val);
44771 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
44772 LDKChannelUpdateInfo this_ptr_conv;
44773 this_ptr_conv.inner = untag_ptr(this_ptr);
44774 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44775 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44776 this_ptr_conv.is_owned = false;
44777 int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv);
44781 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
44782 LDKChannelUpdateInfo this_ptr_conv;
44783 this_ptr_conv.inner = untag_ptr(this_ptr);
44784 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44786 this_ptr_conv.is_owned = false;
44787 ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
44790 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44791 LDKChannelUpdateInfo this_ptr_conv;
44792 this_ptr_conv.inner = untag_ptr(this_ptr);
44793 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44794 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44795 this_ptr_conv.is_owned = false;
44796 int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv);
44800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44801 LDKChannelUpdateInfo this_ptr_conv;
44802 this_ptr_conv.inner = untag_ptr(this_ptr);
44803 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44805 this_ptr_conv.is_owned = false;
44806 ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
44809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44810 LDKChannelUpdateInfo this_ptr_conv;
44811 this_ptr_conv.inner = untag_ptr(this_ptr);
44812 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44814 this_ptr_conv.is_owned = false;
44815 int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv);
44819 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44820 LDKChannelUpdateInfo this_ptr_conv;
44821 this_ptr_conv.inner = untag_ptr(this_ptr);
44822 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44823 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44824 this_ptr_conv.is_owned = false;
44825 ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val);
44828 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) {
44829 LDKChannelUpdateInfo this_ptr_conv;
44830 this_ptr_conv.inner = untag_ptr(this_ptr);
44831 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44832 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44833 this_ptr_conv.is_owned = false;
44834 LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv);
44835 int64_t ret_ref = 0;
44836 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44837 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44841 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44842 LDKChannelUpdateInfo this_ptr_conv;
44843 this_ptr_conv.inner = untag_ptr(this_ptr);
44844 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44845 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44846 this_ptr_conv.is_owned = false;
44847 LDKRoutingFees val_conv;
44848 val_conv.inner = untag_ptr(val);
44849 val_conv.is_owned = ptr_is_owned(val);
44850 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
44851 val_conv = RoutingFees_clone(&val_conv);
44852 ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv);
44855 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
44856 LDKChannelUpdateInfo this_ptr_conv;
44857 this_ptr_conv.inner = untag_ptr(this_ptr);
44858 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44860 this_ptr_conv.is_owned = false;
44861 LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv);
44862 int64_t ret_ref = 0;
44863 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44864 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44868 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44869 LDKChannelUpdateInfo this_ptr_conv;
44870 this_ptr_conv.inner = untag_ptr(this_ptr);
44871 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44873 this_ptr_conv.is_owned = false;
44874 LDKChannelUpdate val_conv;
44875 val_conv.inner = untag_ptr(val);
44876 val_conv.is_owned = ptr_is_owned(val);
44877 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
44878 val_conv = ChannelUpdate_clone(&val_conv);
44879 ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv);
44882 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1new(JNIEnv *env, jclass clz, int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int64_t last_update_message_arg) {
44883 LDKRoutingFees fees_arg_conv;
44884 fees_arg_conv.inner = untag_ptr(fees_arg);
44885 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
44886 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
44887 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
44888 LDKChannelUpdate last_update_message_arg_conv;
44889 last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg);
44890 last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg);
44891 CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv);
44892 last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
44893 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_message_arg_conv);
44894 int64_t ret_ref = 0;
44895 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44896 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44900 static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) {
44901 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg);
44902 int64_t ret_ref = 0;
44903 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44904 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44907 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44908 LDKChannelUpdateInfo arg_conv;
44909 arg_conv.inner = untag_ptr(arg);
44910 arg_conv.is_owned = ptr_is_owned(arg);
44911 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44912 arg_conv.is_owned = false;
44913 int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv);
44917 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44918 LDKChannelUpdateInfo orig_conv;
44919 orig_conv.inner = untag_ptr(orig);
44920 orig_conv.is_owned = ptr_is_owned(orig);
44921 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44922 orig_conv.is_owned = false;
44923 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv);
44924 int64_t ret_ref = 0;
44925 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44926 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44930 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44931 LDKChannelUpdateInfo a_conv;
44932 a_conv.inner = untag_ptr(a);
44933 a_conv.is_owned = ptr_is_owned(a);
44934 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44935 a_conv.is_owned = false;
44936 LDKChannelUpdateInfo b_conv;
44937 b_conv.inner = untag_ptr(b);
44938 b_conv.is_owned = ptr_is_owned(b);
44939 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44940 b_conv.is_owned = false;
44941 jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv);
44945 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
44946 LDKChannelUpdateInfo obj_conv;
44947 obj_conv.inner = untag_ptr(obj);
44948 obj_conv.is_owned = ptr_is_owned(obj);
44949 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44950 obj_conv.is_owned = false;
44951 LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv);
44952 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44953 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44954 CVec_u8Z_free(ret_var);
44958 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
44959 LDKu8slice ser_ref;
44960 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
44961 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
44962 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
44963 *ret_conv = ChannelUpdateInfo_read(ser_ref);
44964 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
44965 return tag_ptr(ret_conv, true);
44968 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44969 LDKChannelInfo this_obj_conv;
44970 this_obj_conv.inner = untag_ptr(this_obj);
44971 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44973 ChannelInfo_free(this_obj_conv);
44976 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
44977 LDKChannelInfo this_ptr_conv;
44978 this_ptr_conv.inner = untag_ptr(this_ptr);
44979 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44980 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44981 this_ptr_conv.is_owned = false;
44982 LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
44983 int64_t ret_ref = 0;
44984 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44985 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44989 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44990 LDKChannelInfo this_ptr_conv;
44991 this_ptr_conv.inner = untag_ptr(this_ptr);
44992 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44994 this_ptr_conv.is_owned = false;
44995 LDKChannelFeatures val_conv;
44996 val_conv.inner = untag_ptr(val);
44997 val_conv.is_owned = ptr_is_owned(val);
44998 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
44999 val_conv = ChannelFeatures_clone(&val_conv);
45000 ChannelInfo_set_features(&this_ptr_conv, val_conv);
45003 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr) {
45004 LDKChannelInfo this_ptr_conv;
45005 this_ptr_conv.inner = untag_ptr(this_ptr);
45006 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45007 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45008 this_ptr_conv.is_owned = false;
45009 LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv);
45010 int64_t ret_ref = 0;
45011 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45012 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45017 LDKChannelInfo this_ptr_conv;
45018 this_ptr_conv.inner = untag_ptr(this_ptr);
45019 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45021 this_ptr_conv.is_owned = false;
45022 LDKNodeId val_conv;
45023 val_conv.inner = untag_ptr(val);
45024 val_conv.is_owned = ptr_is_owned(val);
45025 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45026 val_conv = NodeId_clone(&val_conv);
45027 ChannelInfo_set_node_one(&this_ptr_conv, val_conv);
45030 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr) {
45031 LDKChannelInfo this_ptr_conv;
45032 this_ptr_conv.inner = untag_ptr(this_ptr);
45033 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45035 this_ptr_conv.is_owned = false;
45036 LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
45037 int64_t ret_ref = 0;
45038 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45039 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45043 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45044 LDKChannelInfo this_ptr_conv;
45045 this_ptr_conv.inner = untag_ptr(this_ptr);
45046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45048 this_ptr_conv.is_owned = false;
45049 LDKChannelUpdateInfo val_conv;
45050 val_conv.inner = untag_ptr(val);
45051 val_conv.is_owned = ptr_is_owned(val);
45052 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45053 val_conv = ChannelUpdateInfo_clone(&val_conv);
45054 ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv);
45057 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr) {
45058 LDKChannelInfo this_ptr_conv;
45059 this_ptr_conv.inner = untag_ptr(this_ptr);
45060 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45061 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45062 this_ptr_conv.is_owned = false;
45063 LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv);
45064 int64_t ret_ref = 0;
45065 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45066 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45071 LDKChannelInfo this_ptr_conv;
45072 this_ptr_conv.inner = untag_ptr(this_ptr);
45073 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45074 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45075 this_ptr_conv.is_owned = false;
45076 LDKNodeId val_conv;
45077 val_conv.inner = untag_ptr(val);
45078 val_conv.is_owned = ptr_is_owned(val);
45079 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45080 val_conv = NodeId_clone(&val_conv);
45081 ChannelInfo_set_node_two(&this_ptr_conv, val_conv);
45084 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr) {
45085 LDKChannelInfo this_ptr_conv;
45086 this_ptr_conv.inner = untag_ptr(this_ptr);
45087 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45088 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45089 this_ptr_conv.is_owned = false;
45090 LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
45091 int64_t ret_ref = 0;
45092 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45093 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45097 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45098 LDKChannelInfo this_ptr_conv;
45099 this_ptr_conv.inner = untag_ptr(this_ptr);
45100 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45101 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45102 this_ptr_conv.is_owned = false;
45103 LDKChannelUpdateInfo val_conv;
45104 val_conv.inner = untag_ptr(val);
45105 val_conv.is_owned = ptr_is_owned(val);
45106 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45107 val_conv = ChannelUpdateInfo_clone(&val_conv);
45108 ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv);
45111 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr) {
45112 LDKChannelInfo this_ptr_conv;
45113 this_ptr_conv.inner = untag_ptr(this_ptr);
45114 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45116 this_ptr_conv.is_owned = false;
45117 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
45118 *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv);
45119 int64_t ret_ref = tag_ptr(ret_copy, true);
45123 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45124 LDKChannelInfo this_ptr_conv;
45125 this_ptr_conv.inner = untag_ptr(this_ptr);
45126 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45127 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45128 this_ptr_conv.is_owned = false;
45129 void* val_ptr = untag_ptr(val);
45130 CHECK_ACCESS(val_ptr);
45131 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
45132 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
45133 ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
45136 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
45137 LDKChannelInfo this_ptr_conv;
45138 this_ptr_conv.inner = untag_ptr(this_ptr);
45139 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45141 this_ptr_conv.is_owned = false;
45142 LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
45143 int64_t ret_ref = 0;
45144 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45145 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45149 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45150 LDKChannelInfo this_ptr_conv;
45151 this_ptr_conv.inner = untag_ptr(this_ptr);
45152 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45153 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45154 this_ptr_conv.is_owned = false;
45155 LDKChannelAnnouncement val_conv;
45156 val_conv.inner = untag_ptr(val);
45157 val_conv.is_owned = ptr_is_owned(val);
45158 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45159 val_conv = ChannelAnnouncement_clone(&val_conv);
45160 ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
45163 static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
45164 LDKChannelInfo ret_var = ChannelInfo_clone(arg);
45165 int64_t ret_ref = 0;
45166 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45167 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45171 LDKChannelInfo arg_conv;
45172 arg_conv.inner = untag_ptr(arg);
45173 arg_conv.is_owned = ptr_is_owned(arg);
45174 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45175 arg_conv.is_owned = false;
45176 int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv);
45180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45181 LDKChannelInfo orig_conv;
45182 orig_conv.inner = untag_ptr(orig);
45183 orig_conv.is_owned = ptr_is_owned(orig);
45184 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45185 orig_conv.is_owned = false;
45186 LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
45187 int64_t ret_ref = 0;
45188 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45189 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45193 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
45194 LDKChannelInfo a_conv;
45195 a_conv.inner = untag_ptr(a);
45196 a_conv.is_owned = ptr_is_owned(a);
45197 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45198 a_conv.is_owned = false;
45199 LDKChannelInfo b_conv;
45200 b_conv.inner = untag_ptr(b);
45201 b_conv.is_owned = ptr_is_owned(b);
45202 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45203 b_conv.is_owned = false;
45204 jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv);
45208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info(JNIEnv *env, jclass clz, int64_t this_arg, int8_t channel_flags) {
45209 LDKChannelInfo this_arg_conv;
45210 this_arg_conv.inner = untag_ptr(this_arg);
45211 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45213 this_arg_conv.is_owned = false;
45214 LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags);
45215 int64_t ret_ref = 0;
45216 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45217 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45221 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
45222 LDKChannelInfo obj_conv;
45223 obj_conv.inner = untag_ptr(obj);
45224 obj_conv.is_owned = ptr_is_owned(obj);
45225 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45226 obj_conv.is_owned = false;
45227 LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
45228 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45229 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45230 CVec_u8Z_free(ret_var);
45234 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45235 LDKu8slice ser_ref;
45236 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45237 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45238 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
45239 *ret_conv = ChannelInfo_read(ser_ref);
45240 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45241 return tag_ptr(ret_conv, true);
45244 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45245 LDKDirectedChannelInfo this_obj_conv;
45246 this_obj_conv.inner = untag_ptr(this_obj);
45247 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45248 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45249 DirectedChannelInfo_free(this_obj_conv);
45252 static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) {
45253 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg);
45254 int64_t ret_ref = 0;
45255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45259 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45260 LDKDirectedChannelInfo arg_conv;
45261 arg_conv.inner = untag_ptr(arg);
45262 arg_conv.is_owned = ptr_is_owned(arg);
45263 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45264 arg_conv.is_owned = false;
45265 int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv);
45269 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45270 LDKDirectedChannelInfo orig_conv;
45271 orig_conv.inner = untag_ptr(orig);
45272 orig_conv.is_owned = ptr_is_owned(orig);
45273 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45274 orig_conv.is_owned = false;
45275 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv);
45276 int64_t ret_ref = 0;
45277 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45278 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45282 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel(JNIEnv *env, jclass clz, int64_t this_arg) {
45283 LDKDirectedChannelInfo this_arg_conv;
45284 this_arg_conv.inner = untag_ptr(this_arg);
45285 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45287 this_arg_conv.is_owned = false;
45288 LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv);
45289 int64_t ret_ref = 0;
45290 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45291 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45295 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1direction(JNIEnv *env, jclass clz, int64_t this_arg) {
45296 LDKDirectedChannelInfo this_arg_conv;
45297 this_arg_conv.inner = untag_ptr(this_arg);
45298 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45300 this_arg_conv.is_owned = false;
45301 LDKChannelUpdateInfo ret_var = DirectedChannelInfo_direction(&this_arg_conv);
45302 int64_t ret_ref = 0;
45303 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45304 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45308 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) {
45309 LDKDirectedChannelInfo this_arg_conv;
45310 this_arg_conv.inner = untag_ptr(this_arg);
45311 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45313 this_arg_conv.is_owned = false;
45314 int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv);
45318 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_arg) {
45319 LDKDirectedChannelInfo this_arg_conv;
45320 this_arg_conv.inner = untag_ptr(this_arg);
45321 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45323 this_arg_conv.is_owned = false;
45324 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
45325 *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv);
45326 int64_t ret_ref = tag_ptr(ret_copy, true);
45330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
45331 if (!ptr_is_owned(this_ptr)) return;
45332 void* this_ptr_ptr = untag_ptr(this_ptr);
45333 CHECK_ACCESS(this_ptr_ptr);
45334 LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr);
45335 FREE(untag_ptr(this_ptr));
45336 EffectiveCapacity_free(this_ptr_conv);
45339 static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) {
45340 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
45341 *ret_copy = EffectiveCapacity_clone(arg);
45342 int64_t ret_ref = tag_ptr(ret_copy, true);
45345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45346 LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg);
45347 int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv);
45351 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45352 LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig);
45353 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
45354 *ret_copy = EffectiveCapacity_clone(orig_conv);
45355 int64_t ret_ref = tag_ptr(ret_copy, true);
45359 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1exact_1liquidity(JNIEnv *env, jclass clz, int64_t liquidity_msat) {
45360 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
45361 *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat);
45362 int64_t ret_ref = tag_ptr(ret_copy, true);
45366 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1maximum_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) {
45367 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
45368 *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat);
45369 int64_t ret_ref = tag_ptr(ret_copy, true);
45373 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total(JNIEnv *env, jclass clz, int64_t capacity_msat, int64_t htlc_maximum_msat) {
45374 void* htlc_maximum_msat_ptr = untag_ptr(htlc_maximum_msat);
45375 CHECK_ACCESS(htlc_maximum_msat_ptr);
45376 LDKCOption_u64Z htlc_maximum_msat_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_ptr);
45377 htlc_maximum_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat));
45378 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
45379 *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat_conv);
45380 int64_t ret_ref = tag_ptr(ret_copy, true);
45384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1infinite(JNIEnv *env, jclass clz) {
45385 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
45386 *ret_copy = EffectiveCapacity_infinite();
45387 int64_t ret_ref = tag_ptr(ret_copy, true);
45391 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1unknown(JNIEnv *env, jclass clz) {
45392 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
45393 *ret_copy = EffectiveCapacity_unknown();
45394 int64_t ret_ref = tag_ptr(ret_copy, true);
45398 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1as_1msat(JNIEnv *env, jclass clz, int64_t this_arg) {
45399 LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg);
45400 int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv);
45404 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45405 LDKRoutingFees this_obj_conv;
45406 this_obj_conv.inner = untag_ptr(this_obj);
45407 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45408 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45409 RoutingFees_free(this_obj_conv);
45412 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
45413 LDKRoutingFees this_ptr_conv;
45414 this_ptr_conv.inner = untag_ptr(this_ptr);
45415 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45417 this_ptr_conv.is_owned = false;
45418 int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv);
45422 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
45423 LDKRoutingFees this_ptr_conv;
45424 this_ptr_conv.inner = untag_ptr(this_ptr);
45425 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45427 this_ptr_conv.is_owned = false;
45428 RoutingFees_set_base_msat(&this_ptr_conv, val);
45431 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
45432 LDKRoutingFees this_ptr_conv;
45433 this_ptr_conv.inner = untag_ptr(this_ptr);
45434 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45436 this_ptr_conv.is_owned = false;
45437 int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv);
45441 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
45442 LDKRoutingFees this_ptr_conv;
45443 this_ptr_conv.inner = untag_ptr(this_ptr);
45444 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45446 this_ptr_conv.is_owned = false;
45447 RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
45450 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *env, jclass clz, int32_t base_msat_arg, int32_t proportional_millionths_arg) {
45451 LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
45452 int64_t ret_ref = 0;
45453 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45454 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45458 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
45459 LDKRoutingFees a_conv;
45460 a_conv.inner = untag_ptr(a);
45461 a_conv.is_owned = ptr_is_owned(a);
45462 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45463 a_conv.is_owned = false;
45464 LDKRoutingFees b_conv;
45465 b_conv.inner = untag_ptr(b);
45466 b_conv.is_owned = ptr_is_owned(b);
45467 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45468 b_conv.is_owned = false;
45469 jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv);
45473 static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) {
45474 LDKRoutingFees ret_var = RoutingFees_clone(arg);
45475 int64_t ret_ref = 0;
45476 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45477 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45481 LDKRoutingFees arg_conv;
45482 arg_conv.inner = untag_ptr(arg);
45483 arg_conv.is_owned = ptr_is_owned(arg);
45484 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45485 arg_conv.is_owned = false;
45486 int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv);
45490 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45491 LDKRoutingFees orig_conv;
45492 orig_conv.inner = untag_ptr(orig);
45493 orig_conv.is_owned = ptr_is_owned(orig);
45494 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45495 orig_conv.is_owned = false;
45496 LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
45497 int64_t ret_ref = 0;
45498 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45499 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45503 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *env, jclass clz, int64_t o) {
45504 LDKRoutingFees o_conv;
45505 o_conv.inner = untag_ptr(o);
45506 o_conv.is_owned = ptr_is_owned(o);
45507 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
45508 o_conv.is_owned = false;
45509 int64_t ret_conv = RoutingFees_hash(&o_conv);
45513 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv *env, jclass clz, int64_t obj) {
45514 LDKRoutingFees obj_conv;
45515 obj_conv.inner = untag_ptr(obj);
45516 obj_conv.is_owned = ptr_is_owned(obj);
45517 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45518 obj_conv.is_owned = false;
45519 LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
45520 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45521 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45522 CVec_u8Z_free(ret_var);
45526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45527 LDKu8slice ser_ref;
45528 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45529 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45530 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
45531 *ret_conv = RoutingFees_read(ser_ref);
45532 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45533 return tag_ptr(ret_conv, true);
45536 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45537 LDKNodeAnnouncementInfo this_obj_conv;
45538 this_obj_conv.inner = untag_ptr(this_obj);
45539 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45541 NodeAnnouncementInfo_free(this_obj_conv);
45544 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
45545 LDKNodeAnnouncementInfo this_ptr_conv;
45546 this_ptr_conv.inner = untag_ptr(this_ptr);
45547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45549 this_ptr_conv.is_owned = false;
45550 LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
45551 int64_t ret_ref = 0;
45552 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45553 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45557 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45558 LDKNodeAnnouncementInfo this_ptr_conv;
45559 this_ptr_conv.inner = untag_ptr(this_ptr);
45560 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45562 this_ptr_conv.is_owned = false;
45563 LDKNodeFeatures val_conv;
45564 val_conv.inner = untag_ptr(val);
45565 val_conv.is_owned = ptr_is_owned(val);
45566 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45567 val_conv = NodeFeatures_clone(&val_conv);
45568 NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv);
45571 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) {
45572 LDKNodeAnnouncementInfo this_ptr_conv;
45573 this_ptr_conv.inner = untag_ptr(this_ptr);
45574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45576 this_ptr_conv.is_owned = false;
45577 int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
45581 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
45582 LDKNodeAnnouncementInfo this_ptr_conv;
45583 this_ptr_conv.inner = untag_ptr(this_ptr);
45584 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45586 this_ptr_conv.is_owned = false;
45587 NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
45590 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) {
45591 LDKNodeAnnouncementInfo this_ptr_conv;
45592 this_ptr_conv.inner = untag_ptr(this_ptr);
45593 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45595 this_ptr_conv.is_owned = false;
45596 int8_tArray ret_arr = (*env)->NewByteArray(env, 3);
45597 (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv));
45601 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
45602 LDKNodeAnnouncementInfo this_ptr_conv;
45603 this_ptr_conv.inner = untag_ptr(this_ptr);
45604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45606 this_ptr_conv.is_owned = false;
45607 LDKThreeBytes val_ref;
45608 CHECK((*env)->GetArrayLength(env, val) == 3);
45609 (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data);
45610 NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref);
45613 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
45614 LDKNodeAnnouncementInfo this_ptr_conv;
45615 this_ptr_conv.inner = untag_ptr(this_ptr);
45616 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45618 this_ptr_conv.is_owned = false;
45619 LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv);
45620 int64_t ret_ref = 0;
45621 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45622 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45627 LDKNodeAnnouncementInfo this_ptr_conv;
45628 this_ptr_conv.inner = untag_ptr(this_ptr);
45629 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45630 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45631 this_ptr_conv.is_owned = false;
45632 LDKNodeAlias val_conv;
45633 val_conv.inner = untag_ptr(val);
45634 val_conv.is_owned = ptr_is_owned(val);
45635 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45636 val_conv = NodeAlias_clone(&val_conv);
45637 NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv);
45640 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) {
45641 LDKNodeAnnouncementInfo this_ptr_conv;
45642 this_ptr_conv.inner = untag_ptr(this_ptr);
45643 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45645 this_ptr_conv.is_owned = false;
45646 LDKCVec_NetAddressZ ret_var = NodeAnnouncementInfo_get_addresses(&this_ptr_conv);
45647 int64_tArray ret_arr = NULL;
45648 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
45649 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
45650 for (size_t m = 0; m < ret_var.datalen; m++) {
45651 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
45652 *ret_conv_12_copy = ret_var.data[m];
45653 int64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
45654 ret_arr_ptr[m] = ret_conv_12_ref;
45656 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
45657 FREE(ret_var.data);
45661 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
45662 LDKNodeAnnouncementInfo this_ptr_conv;
45663 this_ptr_conv.inner = untag_ptr(this_ptr);
45664 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45666 this_ptr_conv.is_owned = false;
45667 LDKCVec_NetAddressZ val_constr;
45668 val_constr.datalen = (*env)->GetArrayLength(env, val);
45669 if (val_constr.datalen > 0)
45670 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
45672 val_constr.data = NULL;
45673 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
45674 for (size_t m = 0; m < val_constr.datalen; m++) {
45675 int64_t val_conv_12 = val_vals[m];
45676 void* val_conv_12_ptr = untag_ptr(val_conv_12);
45677 CHECK_ACCESS(val_conv_12_ptr);
45678 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
45679 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
45680 val_constr.data[m] = val_conv_12_conv;
45682 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
45683 NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
45686 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
45687 LDKNodeAnnouncementInfo this_ptr_conv;
45688 this_ptr_conv.inner = untag_ptr(this_ptr);
45689 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45691 this_ptr_conv.is_owned = false;
45692 LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
45693 int64_t ret_ref = 0;
45694 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45695 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45699 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45700 LDKNodeAnnouncementInfo this_ptr_conv;
45701 this_ptr_conv.inner = untag_ptr(this_ptr);
45702 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45704 this_ptr_conv.is_owned = false;
45705 LDKNodeAnnouncement val_conv;
45706 val_conv.inner = untag_ptr(val);
45707 val_conv.is_owned = ptr_is_owned(val);
45708 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45709 val_conv = NodeAnnouncement_clone(&val_conv);
45710 NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv);
45713 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(JNIEnv *env, jclass clz, int64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_tArray addresses_arg, int64_t announcement_message_arg) {
45714 LDKNodeFeatures features_arg_conv;
45715 features_arg_conv.inner = untag_ptr(features_arg);
45716 features_arg_conv.is_owned = ptr_is_owned(features_arg);
45717 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
45718 features_arg_conv = NodeFeatures_clone(&features_arg_conv);
45719 LDKThreeBytes rgb_arg_ref;
45720 CHECK((*env)->GetArrayLength(env, rgb_arg) == 3);
45721 (*env)->GetByteArrayRegion(env, rgb_arg, 0, 3, rgb_arg_ref.data);
45722 LDKNodeAlias alias_arg_conv;
45723 alias_arg_conv.inner = untag_ptr(alias_arg);
45724 alias_arg_conv.is_owned = ptr_is_owned(alias_arg);
45725 CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv);
45726 alias_arg_conv = NodeAlias_clone(&alias_arg_conv);
45727 LDKCVec_NetAddressZ addresses_arg_constr;
45728 addresses_arg_constr.datalen = (*env)->GetArrayLength(env, addresses_arg);
45729 if (addresses_arg_constr.datalen > 0)
45730 addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
45732 addresses_arg_constr.data = NULL;
45733 int64_t* addresses_arg_vals = (*env)->GetLongArrayElements (env, addresses_arg, NULL);
45734 for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
45735 int64_t addresses_arg_conv_12 = addresses_arg_vals[m];
45736 void* addresses_arg_conv_12_ptr = untag_ptr(addresses_arg_conv_12);
45737 CHECK_ACCESS(addresses_arg_conv_12_ptr);
45738 LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
45739 addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
45741 (*env)->ReleaseLongArrayElements(env, addresses_arg, addresses_arg_vals, 0);
45742 LDKNodeAnnouncement announcement_message_arg_conv;
45743 announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg);
45744 announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg);
45745 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
45746 announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
45747 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, announcement_message_arg_conv);
45748 int64_t ret_ref = 0;
45749 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45750 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45754 static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) {
45755 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg);
45756 int64_t ret_ref = 0;
45757 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45758 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45761 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45762 LDKNodeAnnouncementInfo arg_conv;
45763 arg_conv.inner = untag_ptr(arg);
45764 arg_conv.is_owned = ptr_is_owned(arg);
45765 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45766 arg_conv.is_owned = false;
45767 int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv);
45771 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45772 LDKNodeAnnouncementInfo orig_conv;
45773 orig_conv.inner = untag_ptr(orig);
45774 orig_conv.is_owned = ptr_is_owned(orig);
45775 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45776 orig_conv.is_owned = false;
45777 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv);
45778 int64_t ret_ref = 0;
45779 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45780 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45784 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
45785 LDKNodeAnnouncementInfo a_conv;
45786 a_conv.inner = untag_ptr(a);
45787 a_conv.is_owned = ptr_is_owned(a);
45788 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45789 a_conv.is_owned = false;
45790 LDKNodeAnnouncementInfo b_conv;
45791 b_conv.inner = untag_ptr(b);
45792 b_conv.is_owned = ptr_is_owned(b);
45793 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45794 b_conv.is_owned = false;
45795 jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv);
45799 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
45800 LDKNodeAnnouncementInfo obj_conv;
45801 obj_conv.inner = untag_ptr(obj);
45802 obj_conv.is_owned = ptr_is_owned(obj);
45803 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45804 obj_conv.is_owned = false;
45805 LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
45806 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45807 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45808 CVec_u8Z_free(ret_var);
45812 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45813 LDKu8slice ser_ref;
45814 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45815 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45816 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
45817 *ret_conv = NodeAnnouncementInfo_read(ser_ref);
45818 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45819 return tag_ptr(ret_conv, true);
45822 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45823 LDKNodeAlias this_obj_conv;
45824 this_obj_conv.inner = untag_ptr(this_obj);
45825 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45827 NodeAlias_free(this_obj_conv);
45830 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
45831 LDKNodeAlias this_ptr_conv;
45832 this_ptr_conv.inner = untag_ptr(this_ptr);
45833 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45834 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45835 this_ptr_conv.is_owned = false;
45836 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
45837 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAlias_get_a(&this_ptr_conv));
45841 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
45842 LDKNodeAlias this_ptr_conv;
45843 this_ptr_conv.inner = untag_ptr(this_ptr);
45844 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45845 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45846 this_ptr_conv.is_owned = false;
45847 LDKThirtyTwoBytes val_ref;
45848 CHECK((*env)->GetArrayLength(env, val) == 32);
45849 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
45850 NodeAlias_set_a(&this_ptr_conv, val_ref);
45853 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) {
45854 LDKThirtyTwoBytes a_arg_ref;
45855 CHECK((*env)->GetArrayLength(env, a_arg) == 32);
45856 (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data);
45857 LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref);
45858 int64_t ret_ref = 0;
45859 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45860 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45864 static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) {
45865 LDKNodeAlias ret_var = NodeAlias_clone(arg);
45866 int64_t ret_ref = 0;
45867 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45868 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45871 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45872 LDKNodeAlias arg_conv;
45873 arg_conv.inner = untag_ptr(arg);
45874 arg_conv.is_owned = ptr_is_owned(arg);
45875 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45876 arg_conv.is_owned = false;
45877 int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv);
45881 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45882 LDKNodeAlias orig_conv;
45883 orig_conv.inner = untag_ptr(orig);
45884 orig_conv.is_owned = ptr_is_owned(orig);
45885 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45886 orig_conv.is_owned = false;
45887 LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv);
45888 int64_t ret_ref = 0;
45889 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45890 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45894 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
45895 LDKNodeAlias a_conv;
45896 a_conv.inner = untag_ptr(a);
45897 a_conv.is_owned = ptr_is_owned(a);
45898 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45899 a_conv.is_owned = false;
45900 LDKNodeAlias b_conv;
45901 b_conv.inner = untag_ptr(b);
45902 b_conv.is_owned = ptr_is_owned(b);
45903 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45904 b_conv.is_owned = false;
45905 jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv);
45909 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write(JNIEnv *env, jclass clz, int64_t obj) {
45910 LDKNodeAlias obj_conv;
45911 obj_conv.inner = untag_ptr(obj);
45912 obj_conv.is_owned = ptr_is_owned(obj);
45913 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45914 obj_conv.is_owned = false;
45915 LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv);
45916 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45917 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45918 CVec_u8Z_free(ret_var);
45922 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45923 LDKu8slice ser_ref;
45924 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45925 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45926 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
45927 *ret_conv = NodeAlias_read(ser_ref);
45928 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45929 return tag_ptr(ret_conv, true);
45932 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45933 LDKNodeInfo this_obj_conv;
45934 this_obj_conv.inner = untag_ptr(this_obj);
45935 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45936 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45937 NodeInfo_free(this_obj_conv);
45940 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
45941 LDKNodeInfo this_ptr_conv;
45942 this_ptr_conv.inner = untag_ptr(this_ptr);
45943 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45945 this_ptr_conv.is_owned = false;
45946 LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv);
45947 int64_tArray ret_arr = NULL;
45948 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
45949 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
45950 for (size_t g = 0; g < ret_var.datalen; g++) {
45951 int64_t ret_conv_6_conv = ret_var.data[g];
45952 ret_arr_ptr[g] = ret_conv_6_conv;
45954 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
45955 FREE(ret_var.data);
45959 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
45960 LDKNodeInfo this_ptr_conv;
45961 this_ptr_conv.inner = untag_ptr(this_ptr);
45962 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45964 this_ptr_conv.is_owned = false;
45965 LDKCVec_u64Z val_constr;
45966 val_constr.datalen = (*env)->GetArrayLength(env, val);
45967 if (val_constr.datalen > 0)
45968 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
45970 val_constr.data = NULL;
45971 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
45972 for (size_t g = 0; g < val_constr.datalen; g++) {
45973 int64_t val_conv_6 = val_vals[g];
45974 val_constr.data[g] = val_conv_6;
45976 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
45977 NodeInfo_set_channels(&this_ptr_conv, val_constr);
45980 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) {
45981 LDKNodeInfo this_ptr_conv;
45982 this_ptr_conv.inner = untag_ptr(this_ptr);
45983 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45985 this_ptr_conv.is_owned = false;
45986 LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
45987 int64_t ret_ref = 0;
45988 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45989 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45993 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45994 LDKNodeInfo this_ptr_conv;
45995 this_ptr_conv.inner = untag_ptr(this_ptr);
45996 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45998 this_ptr_conv.is_owned = false;
45999 LDKRoutingFees val_conv;
46000 val_conv.inner = untag_ptr(val);
46001 val_conv.is_owned = ptr_is_owned(val);
46002 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
46003 val_conv = RoutingFees_clone(&val_conv);
46004 NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv);
46007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr) {
46008 LDKNodeInfo this_ptr_conv;
46009 this_ptr_conv.inner = untag_ptr(this_ptr);
46010 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46012 this_ptr_conv.is_owned = false;
46013 LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
46014 int64_t ret_ref = 0;
46015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
46021 LDKNodeInfo this_ptr_conv;
46022 this_ptr_conv.inner = untag_ptr(this_ptr);
46023 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46025 this_ptr_conv.is_owned = false;
46026 LDKNodeAnnouncementInfo val_conv;
46027 val_conv.inner = untag_ptr(val);
46028 val_conv.is_owned = ptr_is_owned(val);
46029 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
46030 val_conv = NodeAnnouncementInfo_clone(&val_conv);
46031 NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
46034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, jclass clz, int64_tArray channels_arg, int64_t lowest_inbound_channel_fees_arg, int64_t announcement_info_arg) {
46035 LDKCVec_u64Z channels_arg_constr;
46036 channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg);
46037 if (channels_arg_constr.datalen > 0)
46038 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
46040 channels_arg_constr.data = NULL;
46041 int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL);
46042 for (size_t g = 0; g < channels_arg_constr.datalen; g++) {
46043 int64_t channels_arg_conv_6 = channels_arg_vals[g];
46044 channels_arg_constr.data[g] = channels_arg_conv_6;
46046 (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0);
46047 LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
46048 lowest_inbound_channel_fees_arg_conv.inner = untag_ptr(lowest_inbound_channel_fees_arg);
46049 lowest_inbound_channel_fees_arg_conv.is_owned = ptr_is_owned(lowest_inbound_channel_fees_arg);
46050 CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv);
46051 lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv);
46052 LDKNodeAnnouncementInfo announcement_info_arg_conv;
46053 announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg);
46054 announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg);
46055 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
46056 announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
46057 LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
46058 int64_t ret_ref = 0;
46059 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46060 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46064 static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) {
46065 LDKNodeInfo ret_var = NodeInfo_clone(arg);
46066 int64_t ret_ref = 0;
46067 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46068 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46071 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46072 LDKNodeInfo arg_conv;
46073 arg_conv.inner = untag_ptr(arg);
46074 arg_conv.is_owned = ptr_is_owned(arg);
46075 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46076 arg_conv.is_owned = false;
46077 int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv);
46081 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46082 LDKNodeInfo orig_conv;
46083 orig_conv.inner = untag_ptr(orig);
46084 orig_conv.is_owned = ptr_is_owned(orig);
46085 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46086 orig_conv.is_owned = false;
46087 LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv);
46088 int64_t ret_ref = 0;
46089 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46090 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46094 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46095 LDKNodeInfo a_conv;
46096 a_conv.inner = untag_ptr(a);
46097 a_conv.is_owned = ptr_is_owned(a);
46098 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46099 a_conv.is_owned = false;
46100 LDKNodeInfo b_conv;
46101 b_conv.inner = untag_ptr(b);
46102 b_conv.is_owned = ptr_is_owned(b);
46103 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46104 b_conv.is_owned = false;
46105 jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv);
46109 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
46110 LDKNodeInfo obj_conv;
46111 obj_conv.inner = untag_ptr(obj);
46112 obj_conv.is_owned = ptr_is_owned(obj);
46113 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
46114 obj_conv.is_owned = false;
46115 LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
46116 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
46117 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
46118 CVec_u8Z_free(ret_var);
46122 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
46123 LDKu8slice ser_ref;
46124 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
46125 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
46126 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
46127 *ret_conv = NodeInfo_read(ser_ref);
46128 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
46129 return tag_ptr(ret_conv, true);
46132 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv *env, jclass clz, int64_t obj) {
46133 LDKNetworkGraph obj_conv;
46134 obj_conv.inner = untag_ptr(obj);
46135 obj_conv.is_owned = ptr_is_owned(obj);
46136 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
46137 obj_conv.is_owned = false;
46138 LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
46139 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
46140 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
46141 CVec_u8Z_free(ret_var);
46145 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
46146 LDKu8slice ser_ref;
46147 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
46148 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
46149 void* arg_ptr = untag_ptr(arg);
46150 CHECK_ACCESS(arg_ptr);
46151 LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
46152 if (arg_conv.free == LDKLogger_JCalls_free) {
46153 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
46154 LDKLogger_JCalls_cloned(&arg_conv);
46156 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
46157 *ret_conv = NetworkGraph_read(ser_ref, arg_conv);
46158 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
46159 return tag_ptr(ret_conv, true);
46162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, int8_tArray genesis_hash, int64_t logger) {
46163 LDKThirtyTwoBytes genesis_hash_ref;
46164 CHECK((*env)->GetArrayLength(env, genesis_hash) == 32);
46165 (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_ref.data);
46166 void* logger_ptr = untag_ptr(logger);
46167 CHECK_ACCESS(logger_ptr);
46168 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
46169 if (logger_conv.free == LDKLogger_JCalls_free) {
46170 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
46171 LDKLogger_JCalls_cloned(&logger_conv);
46173 LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref, logger_conv);
46174 int64_t ret_ref = 0;
46175 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46176 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JNIEnv *env, jclass clz, int64_t this_arg) {
46181 LDKNetworkGraph this_arg_conv;
46182 this_arg_conv.inner = untag_ptr(this_arg);
46183 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46185 this_arg_conv.is_owned = false;
46186 LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv);
46187 int64_t ret_ref = 0;
46188 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46189 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
46194 LDKNetworkGraph this_arg_conv;
46195 this_arg_conv.inner = untag_ptr(this_arg);
46196 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46198 this_arg_conv.is_owned = false;
46199 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
46200 *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv);
46201 int64_t ret_ref = tag_ptr(ret_copy, true);
46205 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1set_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) {
46206 LDKNetworkGraph this_arg_conv;
46207 this_arg_conv.inner = untag_ptr(this_arg);
46208 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46209 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46210 this_arg_conv.is_owned = false;
46211 NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp);
46214 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
46215 LDKNetworkGraph this_arg_conv;
46216 this_arg_conv.inner = untag_ptr(this_arg);
46217 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46219 this_arg_conv.is_owned = false;
46220 LDKNodeAnnouncement msg_conv;
46221 msg_conv.inner = untag_ptr(msg);
46222 msg_conv.is_owned = ptr_is_owned(msg);
46223 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
46224 msg_conv.is_owned = false;
46225 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
46226 *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv);
46227 return tag_ptr(ret_conv, true);
46230 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1unsigned_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
46231 LDKNetworkGraph this_arg_conv;
46232 this_arg_conv.inner = untag_ptr(this_arg);
46233 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46235 this_arg_conv.is_owned = false;
46236 LDKUnsignedNodeAnnouncement msg_conv;
46237 msg_conv.inner = untag_ptr(msg);
46238 msg_conv.is_owned = ptr_is_owned(msg);
46239 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
46240 msg_conv.is_owned = false;
46241 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
46242 *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv);
46243 return tag_ptr(ret_conv, true);
46246 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t chain_access) {
46247 LDKNetworkGraph this_arg_conv;
46248 this_arg_conv.inner = untag_ptr(this_arg);
46249 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46250 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46251 this_arg_conv.is_owned = false;
46252 LDKChannelAnnouncement msg_conv;
46253 msg_conv.inner = untag_ptr(msg);
46254 msg_conv.is_owned = ptr_is_owned(msg);
46255 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
46256 msg_conv.is_owned = false;
46257 void* chain_access_ptr = untag_ptr(chain_access);
46258 CHECK_ACCESS(chain_access_ptr);
46259 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
46260 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
46261 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
46262 // Manually implement clone for Java trait instances
46263 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
46264 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
46265 LDKAccess_JCalls_cloned(&chain_access_conv.some);
46268 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
46269 *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
46270 return tag_ptr(ret_conv, true);
46273 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1unsigned_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t chain_access) {
46274 LDKNetworkGraph this_arg_conv;
46275 this_arg_conv.inner = untag_ptr(this_arg);
46276 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46278 this_arg_conv.is_owned = false;
46279 LDKUnsignedChannelAnnouncement msg_conv;
46280 msg_conv.inner = untag_ptr(msg);
46281 msg_conv.is_owned = ptr_is_owned(msg);
46282 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
46283 msg_conv.is_owned = false;
46284 void* chain_access_ptr = untag_ptr(chain_access);
46285 CHECK_ACCESS(chain_access_ptr);
46286 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
46287 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
46288 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
46289 // Manually implement clone for Java trait instances
46290 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
46291 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
46292 LDKAccess_JCalls_cloned(&chain_access_conv.some);
46295 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
46296 *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
46297 return tag_ptr(ret_conv, true);
46300 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1add_1channel_1from_1partial_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) {
46301 LDKNetworkGraph this_arg_conv;
46302 this_arg_conv.inner = untag_ptr(this_arg);
46303 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46304 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46305 this_arg_conv.is_owned = false;
46306 LDKChannelFeatures features_conv;
46307 features_conv.inner = untag_ptr(features);
46308 features_conv.is_owned = ptr_is_owned(features);
46309 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
46310 features_conv = ChannelFeatures_clone(&features_conv);
46311 LDKPublicKey node_id_1_ref;
46312 CHECK((*env)->GetArrayLength(env, node_id_1) == 33);
46313 (*env)->GetByteArrayRegion(env, node_id_1, 0, 33, node_id_1_ref.compressed_form);
46314 LDKPublicKey node_id_2_ref;
46315 CHECK((*env)->GetArrayLength(env, node_id_2) == 33);
46316 (*env)->GetByteArrayRegion(env, node_id_2, 0, 33, node_id_2_ref.compressed_form);
46317 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
46318 *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref);
46319 return tag_ptr(ret_conv, true);
46322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, jboolean is_permanent) {
46323 LDKNetworkGraph this_arg_conv;
46324 this_arg_conv.inner = untag_ptr(this_arg);
46325 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46326 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46327 this_arg_conv.is_owned = false;
46328 NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
46331 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id) {
46332 LDKNetworkGraph this_arg_conv;
46333 this_arg_conv.inner = untag_ptr(this_arg);
46334 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46335 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46336 this_arg_conv.is_owned = false;
46337 LDKPublicKey node_id_ref;
46338 CHECK((*env)->GetArrayLength(env, node_id) == 33);
46339 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
46340 NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref);
46343 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking(JNIEnv *env, jclass clz, int64_t this_arg) {
46344 LDKNetworkGraph this_arg_conv;
46345 this_arg_conv.inner = untag_ptr(this_arg);
46346 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46348 this_arg_conv.is_owned = false;
46349 NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv);
46352 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) {
46353 LDKNetworkGraph this_arg_conv;
46354 this_arg_conv.inner = untag_ptr(this_arg);
46355 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46356 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46357 this_arg_conv.is_owned = false;
46358 NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix);
46361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
46362 LDKNetworkGraph this_arg_conv;
46363 this_arg_conv.inner = untag_ptr(this_arg);
46364 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46365 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46366 this_arg_conv.is_owned = false;
46367 LDKChannelUpdate msg_conv;
46368 msg_conv.inner = untag_ptr(msg);
46369 msg_conv.is_owned = ptr_is_owned(msg);
46370 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
46371 msg_conv.is_owned = false;
46372 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
46373 *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv);
46374 return tag_ptr(ret_conv, true);
46377 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
46378 LDKNetworkGraph this_arg_conv;
46379 this_arg_conv.inner = untag_ptr(this_arg);
46380 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46381 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46382 this_arg_conv.is_owned = false;
46383 LDKUnsignedChannelUpdate msg_conv;
46384 msg_conv.inner = untag_ptr(msg);
46385 msg_conv.is_owned = ptr_is_owned(msg);
46386 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
46387 msg_conv.is_owned = false;
46388 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
46389 *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv);
46390 return tag_ptr(ret_conv, true);
46393 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) {
46394 LDKReadOnlyNetworkGraph this_arg_conv;
46395 this_arg_conv.inner = untag_ptr(this_arg);
46396 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46398 this_arg_conv.is_owned = false;
46399 LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id);
46400 int64_t ret_ref = 0;
46401 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46402 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46406 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
46407 LDKReadOnlyNetworkGraph this_arg_conv;
46408 this_arg_conv.inner = untag_ptr(this_arg);
46409 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46410 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46411 this_arg_conv.is_owned = false;
46412 LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv);
46413 int64_tArray ret_arr = NULL;
46414 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
46415 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
46416 for (size_t g = 0; g < ret_var.datalen; g++) {
46417 int64_t ret_conv_6_conv = ret_var.data[g];
46418 ret_arr_ptr[g] = ret_conv_6_conv;
46420 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
46421 FREE(ret_var.data);
46425 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1node(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
46426 LDKReadOnlyNetworkGraph this_arg_conv;
46427 this_arg_conv.inner = untag_ptr(this_arg);
46428 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46430 this_arg_conv.is_owned = false;
46431 LDKNodeId node_id_conv;
46432 node_id_conv.inner = untag_ptr(node_id);
46433 node_id_conv.is_owned = ptr_is_owned(node_id);
46434 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
46435 node_id_conv.is_owned = false;
46436 LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv);
46437 int64_t ret_ref = 0;
46438 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46439 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46443 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1nodes(JNIEnv *env, jclass clz, int64_t this_arg) {
46444 LDKReadOnlyNetworkGraph this_arg_conv;
46445 this_arg_conv.inner = untag_ptr(this_arg);
46446 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46448 this_arg_conv.is_owned = false;
46449 LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv);
46450 int64_tArray ret_arr = NULL;
46451 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
46452 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
46453 for (size_t i = 0; i < ret_var.datalen; i++) {
46454 LDKNodeId ret_conv_8_var = ret_var.data[i];
46455 int64_t ret_conv_8_ref = 0;
46456 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var);
46457 ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned);
46458 ret_arr_ptr[i] = ret_conv_8_ref;
46460 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
46461 FREE(ret_var.data);
46465 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey) {
46466 LDKReadOnlyNetworkGraph this_arg_conv;
46467 this_arg_conv.inner = untag_ptr(this_arg);
46468 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46469 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46470 this_arg_conv.is_owned = false;
46471 LDKPublicKey pubkey_ref;
46472 CHECK((*env)->GetArrayLength(env, pubkey) == 33);
46473 (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
46474 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
46475 *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref);
46476 int64_t ret_ref = tag_ptr(ret_copy, true);
46480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46481 LDKRouteHop this_obj_conv;
46482 this_obj_conv.inner = untag_ptr(this_obj);
46483 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46485 RouteHop_free(this_obj_conv);
46488 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
46489 LDKRouteHop this_ptr_conv;
46490 this_ptr_conv.inner = untag_ptr(this_ptr);
46491 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46493 this_ptr_conv.is_owned = false;
46494 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
46495 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form);
46499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
46500 LDKRouteHop this_ptr_conv;
46501 this_ptr_conv.inner = untag_ptr(this_ptr);
46502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46504 this_ptr_conv.is_owned = false;
46505 LDKPublicKey val_ref;
46506 CHECK((*env)->GetArrayLength(env, val) == 33);
46507 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
46508 RouteHop_set_pubkey(&this_ptr_conv, val_ref);
46511 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
46512 LDKRouteHop this_ptr_conv;
46513 this_ptr_conv.inner = untag_ptr(this_ptr);
46514 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46516 this_ptr_conv.is_owned = false;
46517 LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
46518 int64_t ret_ref = 0;
46519 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46520 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
46525 LDKRouteHop this_ptr_conv;
46526 this_ptr_conv.inner = untag_ptr(this_ptr);
46527 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46528 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46529 this_ptr_conv.is_owned = false;
46530 LDKNodeFeatures val_conv;
46531 val_conv.inner = untag_ptr(val);
46532 val_conv.is_owned = ptr_is_owned(val);
46533 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
46534 val_conv = NodeFeatures_clone(&val_conv);
46535 RouteHop_set_node_features(&this_ptr_conv, val_conv);
46538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
46539 LDKRouteHop this_ptr_conv;
46540 this_ptr_conv.inner = untag_ptr(this_ptr);
46541 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46543 this_ptr_conv.is_owned = false;
46544 int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv);
46548 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
46549 LDKRouteHop this_ptr_conv;
46550 this_ptr_conv.inner = untag_ptr(this_ptr);
46551 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46553 this_ptr_conv.is_owned = false;
46554 RouteHop_set_short_channel_id(&this_ptr_conv, val);
46557 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
46558 LDKRouteHop this_ptr_conv;
46559 this_ptr_conv.inner = untag_ptr(this_ptr);
46560 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46562 this_ptr_conv.is_owned = false;
46563 LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
46564 int64_t ret_ref = 0;
46565 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46566 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46570 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
46571 LDKRouteHop this_ptr_conv;
46572 this_ptr_conv.inner = untag_ptr(this_ptr);
46573 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46574 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46575 this_ptr_conv.is_owned = false;
46576 LDKChannelFeatures val_conv;
46577 val_conv.inner = untag_ptr(val);
46578 val_conv.is_owned = ptr_is_owned(val);
46579 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
46580 val_conv = ChannelFeatures_clone(&val_conv);
46581 RouteHop_set_channel_features(&this_ptr_conv, val_conv);
46584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
46585 LDKRouteHop this_ptr_conv;
46586 this_ptr_conv.inner = untag_ptr(this_ptr);
46587 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46589 this_ptr_conv.is_owned = false;
46590 int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv);
46594 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
46595 LDKRouteHop this_ptr_conv;
46596 this_ptr_conv.inner = untag_ptr(this_ptr);
46597 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46599 this_ptr_conv.is_owned = false;
46600 RouteHop_set_fee_msat(&this_ptr_conv, val);
46603 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
46604 LDKRouteHop this_ptr_conv;
46605 this_ptr_conv.inner = untag_ptr(this_ptr);
46606 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46608 this_ptr_conv.is_owned = false;
46609 int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
46613 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
46614 LDKRouteHop this_ptr_conv;
46615 this_ptr_conv.inner = untag_ptr(this_ptr);
46616 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46618 this_ptr_conv.is_owned = false;
46619 RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
46622 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, jclass clz, int8_tArray pubkey_arg, int64_t node_features_arg, int64_t short_channel_id_arg, int64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg) {
46623 LDKPublicKey pubkey_arg_ref;
46624 CHECK((*env)->GetArrayLength(env, pubkey_arg) == 33);
46625 (*env)->GetByteArrayRegion(env, pubkey_arg, 0, 33, pubkey_arg_ref.compressed_form);
46626 LDKNodeFeatures node_features_arg_conv;
46627 node_features_arg_conv.inner = untag_ptr(node_features_arg);
46628 node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg);
46629 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv);
46630 node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv);
46631 LDKChannelFeatures channel_features_arg_conv;
46632 channel_features_arg_conv.inner = untag_ptr(channel_features_arg);
46633 channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg);
46634 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv);
46635 channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
46636 LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg);
46637 int64_t ret_ref = 0;
46638 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46639 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46643 static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) {
46644 LDKRouteHop ret_var = RouteHop_clone(arg);
46645 int64_t ret_ref = 0;
46646 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46647 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46650 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46651 LDKRouteHop arg_conv;
46652 arg_conv.inner = untag_ptr(arg);
46653 arg_conv.is_owned = ptr_is_owned(arg);
46654 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46655 arg_conv.is_owned = false;
46656 int64_t ret_conv = RouteHop_clone_ptr(&arg_conv);
46660 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46661 LDKRouteHop orig_conv;
46662 orig_conv.inner = untag_ptr(orig);
46663 orig_conv.is_owned = ptr_is_owned(orig);
46664 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46665 orig_conv.is_owned = false;
46666 LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
46667 int64_t ret_ref = 0;
46668 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46669 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46673 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, jclass clz, int64_t o) {
46674 LDKRouteHop o_conv;
46675 o_conv.inner = untag_ptr(o);
46676 o_conv.is_owned = ptr_is_owned(o);
46677 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46678 o_conv.is_owned = false;
46679 int64_t ret_conv = RouteHop_hash(&o_conv);
46683 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46684 LDKRouteHop a_conv;
46685 a_conv.inner = untag_ptr(a);
46686 a_conv.is_owned = ptr_is_owned(a);
46687 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46688 a_conv.is_owned = false;
46689 LDKRouteHop b_conv;
46690 b_conv.inner = untag_ptr(b);
46691 b_conv.is_owned = ptr_is_owned(b);
46692 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46693 b_conv.is_owned = false;
46694 jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv);
46698 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
46699 LDKRouteHop obj_conv;
46700 obj_conv.inner = untag_ptr(obj);
46701 obj_conv.is_owned = ptr_is_owned(obj);
46702 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
46703 obj_conv.is_owned = false;
46704 LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv);
46705 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
46706 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
46707 CVec_u8Z_free(ret_var);
46711 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
46712 LDKu8slice ser_ref;
46713 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
46714 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
46715 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
46716 *ret_conv = RouteHop_read(ser_ref);
46717 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
46718 return tag_ptr(ret_conv, true);
46721 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46722 LDKRoute this_obj_conv;
46723 this_obj_conv.inner = untag_ptr(this_obj);
46724 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46725 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46726 Route_free(this_obj_conv);
46729 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIEnv *env, jclass clz, int64_t this_ptr) {
46730 LDKRoute this_ptr_conv;
46731 this_ptr_conv.inner = untag_ptr(this_ptr);
46732 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46734 this_ptr_conv.is_owned = false;
46735 LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
46736 jobjectArray ret_arr = NULL;
46737 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL);
46739 for (size_t m = 0; m < ret_var.datalen; m++) {
46740 LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
46741 int64_tArray ret_conv_12_arr = NULL;
46742 ret_conv_12_arr = (*env)->NewLongArray(env, ret_conv_12_var.datalen);
46743 int64_t *ret_conv_12_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_conv_12_arr, NULL);
46744 for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
46745 LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
46746 int64_t ret_conv_12_conv_10_ref = 0;
46747 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var);
46748 ret_conv_12_conv_10_ref = tag_ptr(ret_conv_12_conv_10_var.inner, ret_conv_12_conv_10_var.is_owned);
46749 ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref;
46751 (*env)->ReleasePrimitiveArrayCritical(env, ret_conv_12_arr, ret_conv_12_arr_ptr, 0);
46752 FREE(ret_conv_12_var.data);
46753 (*env)->SetObjectArrayElement(env, ret_arr, m, ret_conv_12_arr);
46756 FREE(ret_var.data);
46760 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
46761 LDKRoute this_ptr_conv;
46762 this_ptr_conv.inner = untag_ptr(this_ptr);
46763 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46765 this_ptr_conv.is_owned = false;
46766 LDKCVec_CVec_RouteHopZZ val_constr;
46767 val_constr.datalen = (*env)->GetArrayLength(env, val);
46768 if (val_constr.datalen > 0)
46769 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
46771 val_constr.data = NULL;
46772 for (size_t m = 0; m < val_constr.datalen; m++) {
46773 int64_tArray val_conv_12 = (*env)->GetObjectArrayElement(env, val, m);
46774 LDKCVec_RouteHopZ val_conv_12_constr;
46775 val_conv_12_constr.datalen = (*env)->GetArrayLength(env, val_conv_12);
46776 if (val_conv_12_constr.datalen > 0)
46777 val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
46779 val_conv_12_constr.data = NULL;
46780 int64_t* val_conv_12_vals = (*env)->GetLongArrayElements (env, val_conv_12, NULL);
46781 for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
46782 int64_t val_conv_12_conv_10 = val_conv_12_vals[k];
46783 LDKRouteHop val_conv_12_conv_10_conv;
46784 val_conv_12_conv_10_conv.inner = untag_ptr(val_conv_12_conv_10);
46785 val_conv_12_conv_10_conv.is_owned = ptr_is_owned(val_conv_12_conv_10);
46786 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv);
46787 val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
46788 val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
46790 (*env)->ReleaseLongArrayElements(env, val_conv_12, val_conv_12_vals, 0);
46791 val_constr.data[m] = val_conv_12_constr;
46793 Route_set_paths(&this_ptr_conv, val_constr);
46796 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) {
46797 LDKRoute this_ptr_conv;
46798 this_ptr_conv.inner = untag_ptr(this_ptr);
46799 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46800 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46801 this_ptr_conv.is_owned = false;
46802 LDKPaymentParameters ret_var = Route_get_payment_params(&this_ptr_conv);
46803 int64_t ret_ref = 0;
46804 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46805 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46809 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
46810 LDKRoute this_ptr_conv;
46811 this_ptr_conv.inner = untag_ptr(this_ptr);
46812 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46814 this_ptr_conv.is_owned = false;
46815 LDKPaymentParameters val_conv;
46816 val_conv.inner = untag_ptr(val);
46817 val_conv.is_owned = ptr_is_owned(val);
46818 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
46819 val_conv = PaymentParameters_clone(&val_conv);
46820 Route_set_payment_params(&this_ptr_conv, val_conv);
46823 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, jobjectArray paths_arg, int64_t payment_params_arg) {
46824 LDKCVec_CVec_RouteHopZZ paths_arg_constr;
46825 paths_arg_constr.datalen = (*env)->GetArrayLength(env, paths_arg);
46826 if (paths_arg_constr.datalen > 0)
46827 paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
46829 paths_arg_constr.data = NULL;
46830 for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
46831 int64_tArray paths_arg_conv_12 = (*env)->GetObjectArrayElement(env, paths_arg, m);
46832 LDKCVec_RouteHopZ paths_arg_conv_12_constr;
46833 paths_arg_conv_12_constr.datalen = (*env)->GetArrayLength(env, paths_arg_conv_12);
46834 if (paths_arg_conv_12_constr.datalen > 0)
46835 paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
46837 paths_arg_conv_12_constr.data = NULL;
46838 int64_t* paths_arg_conv_12_vals = (*env)->GetLongArrayElements (env, paths_arg_conv_12, NULL);
46839 for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
46840 int64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
46841 LDKRouteHop paths_arg_conv_12_conv_10_conv;
46842 paths_arg_conv_12_conv_10_conv.inner = untag_ptr(paths_arg_conv_12_conv_10);
46843 paths_arg_conv_12_conv_10_conv.is_owned = ptr_is_owned(paths_arg_conv_12_conv_10);
46844 CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv);
46845 paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
46846 paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
46848 (*env)->ReleaseLongArrayElements(env, paths_arg_conv_12, paths_arg_conv_12_vals, 0);
46849 paths_arg_constr.data[m] = paths_arg_conv_12_constr;
46851 LDKPaymentParameters payment_params_arg_conv;
46852 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
46853 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
46854 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
46855 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
46856 LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_arg_conv);
46857 int64_t ret_ref = 0;
46858 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46859 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46863 static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) {
46864 LDKRoute ret_var = Route_clone(arg);
46865 int64_t ret_ref = 0;
46866 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46867 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46870 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46872 arg_conv.inner = untag_ptr(arg);
46873 arg_conv.is_owned = ptr_is_owned(arg);
46874 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46875 arg_conv.is_owned = false;
46876 int64_t ret_conv = Route_clone_ptr(&arg_conv);
46880 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46881 LDKRoute orig_conv;
46882 orig_conv.inner = untag_ptr(orig);
46883 orig_conv.is_owned = ptr_is_owned(orig);
46884 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46885 orig_conv.is_owned = false;
46886 LDKRoute ret_var = Route_clone(&orig_conv);
46887 int64_t ret_ref = 0;
46888 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46889 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46893 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jclass clz, int64_t o) {
46895 o_conv.inner = untag_ptr(o);
46896 o_conv.is_owned = ptr_is_owned(o);
46897 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46898 o_conv.is_owned = false;
46899 int64_t ret_conv = Route_hash(&o_conv);
46903 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46905 a_conv.inner = untag_ptr(a);
46906 a_conv.is_owned = ptr_is_owned(a);
46907 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46908 a_conv.is_owned = false;
46910 b_conv.inner = untag_ptr(b);
46911 b_conv.is_owned = ptr_is_owned(b);
46912 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46913 b_conv.is_owned = false;
46914 jboolean ret_conv = Route_eq(&a_conv, &b_conv);
46918 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) {
46919 LDKRoute this_arg_conv;
46920 this_arg_conv.inner = untag_ptr(this_arg);
46921 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46922 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46923 this_arg_conv.is_owned = false;
46924 int64_t ret_conv = Route_get_total_fees(&this_arg_conv);
46928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) {
46929 LDKRoute this_arg_conv;
46930 this_arg_conv.inner = untag_ptr(this_arg);
46931 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46932 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46933 this_arg_conv.is_owned = false;
46934 int64_t ret_conv = Route_get_total_amount(&this_arg_conv);
46938 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) {
46940 obj_conv.inner = untag_ptr(obj);
46941 obj_conv.is_owned = ptr_is_owned(obj);
46942 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
46943 obj_conv.is_owned = false;
46944 LDKCVec_u8Z ret_var = Route_write(&obj_conv);
46945 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
46946 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
46947 CVec_u8Z_free(ret_var);
46951 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
46952 LDKu8slice ser_ref;
46953 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
46954 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
46955 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
46956 *ret_conv = Route_read(ser_ref);
46957 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
46958 return tag_ptr(ret_conv, true);
46961 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46962 LDKRouteParameters this_obj_conv;
46963 this_obj_conv.inner = untag_ptr(this_obj);
46964 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46966 RouteParameters_free(this_obj_conv);
46969 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) {
46970 LDKRouteParameters this_ptr_conv;
46971 this_ptr_conv.inner = untag_ptr(this_ptr);
46972 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46974 this_ptr_conv.is_owned = false;
46975 LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv);
46976 int64_t ret_ref = 0;
46977 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46978 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46982 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
46983 LDKRouteParameters this_ptr_conv;
46984 this_ptr_conv.inner = untag_ptr(this_ptr);
46985 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46986 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46987 this_ptr_conv.is_owned = false;
46988 LDKPaymentParameters val_conv;
46989 val_conv.inner = untag_ptr(val);
46990 val_conv.is_owned = ptr_is_owned(val);
46991 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
46992 val_conv = PaymentParameters_clone(&val_conv);
46993 RouteParameters_set_payment_params(&this_ptr_conv, val_conv);
46996 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
46997 LDKRouteParameters this_ptr_conv;
46998 this_ptr_conv.inner = untag_ptr(this_ptr);
46999 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47001 this_ptr_conv.is_owned = false;
47002 int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv);
47006 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47007 LDKRouteParameters this_ptr_conv;
47008 this_ptr_conv.inner = untag_ptr(this_ptr);
47009 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47010 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47011 this_ptr_conv.is_owned = false;
47012 RouteParameters_set_final_value_msat(&this_ptr_conv, val);
47015 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
47016 LDKRouteParameters this_ptr_conv;
47017 this_ptr_conv.inner = untag_ptr(this_ptr);
47018 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47020 this_ptr_conv.is_owned = false;
47021 int32_t ret_conv = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
47025 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
47026 LDKRouteParameters this_ptr_conv;
47027 this_ptr_conv.inner = untag_ptr(this_ptr);
47028 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47030 this_ptr_conv.is_owned = false;
47031 RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
47034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv *env, jclass clz, int64_t payment_params_arg, int64_t final_value_msat_arg, int32_t final_cltv_expiry_delta_arg) {
47035 LDKPaymentParameters payment_params_arg_conv;
47036 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
47037 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
47038 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
47039 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
47040 LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg);
47041 int64_t ret_ref = 0;
47042 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47043 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47047 static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) {
47048 LDKRouteParameters ret_var = RouteParameters_clone(arg);
47049 int64_t ret_ref = 0;
47050 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47051 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47054 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47055 LDKRouteParameters arg_conv;
47056 arg_conv.inner = untag_ptr(arg);
47057 arg_conv.is_owned = ptr_is_owned(arg);
47058 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47059 arg_conv.is_owned = false;
47060 int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv);
47064 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47065 LDKRouteParameters orig_conv;
47066 orig_conv.inner = untag_ptr(orig);
47067 orig_conv.is_owned = ptr_is_owned(orig);
47068 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47069 orig_conv.is_owned = false;
47070 LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv);
47071 int64_t ret_ref = 0;
47072 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47073 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47077 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
47078 LDKRouteParameters obj_conv;
47079 obj_conv.inner = untag_ptr(obj);
47080 obj_conv.is_owned = ptr_is_owned(obj);
47081 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47082 obj_conv.is_owned = false;
47083 LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv);
47084 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47085 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47086 CVec_u8Z_free(ret_var);
47090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
47091 LDKu8slice ser_ref;
47092 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
47093 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
47094 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
47095 *ret_conv = RouteParameters_read(ser_ref);
47096 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
47097 return tag_ptr(ret_conv, true);
47100 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47101 LDKPaymentParameters this_obj_conv;
47102 this_obj_conv.inner = untag_ptr(this_obj);
47103 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47105 PaymentParameters_free(this_obj_conv);
47108 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1payee_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
47109 LDKPaymentParameters this_ptr_conv;
47110 this_ptr_conv.inner = untag_ptr(this_ptr);
47111 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47112 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47113 this_ptr_conv.is_owned = false;
47114 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
47115 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form);
47119 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1payee_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
47120 LDKPaymentParameters this_ptr_conv;
47121 this_ptr_conv.inner = untag_ptr(this_ptr);
47122 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47124 this_ptr_conv.is_owned = false;
47125 LDKPublicKey val_ref;
47126 CHECK((*env)->GetArrayLength(env, val) == 33);
47127 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
47128 PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref);
47131 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
47132 LDKPaymentParameters this_ptr_conv;
47133 this_ptr_conv.inner = untag_ptr(this_ptr);
47134 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47136 this_ptr_conv.is_owned = false;
47137 LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&this_ptr_conv);
47138 int64_t ret_ref = 0;
47139 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47140 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47144 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47145 LDKPaymentParameters this_ptr_conv;
47146 this_ptr_conv.inner = untag_ptr(this_ptr);
47147 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47149 this_ptr_conv.is_owned = false;
47150 LDKInvoiceFeatures val_conv;
47151 val_conv.inner = untag_ptr(val);
47152 val_conv.is_owned = ptr_is_owned(val);
47153 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47154 val_conv = InvoiceFeatures_clone(&val_conv);
47155 PaymentParameters_set_features(&this_ptr_conv, val_conv);
47158 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr) {
47159 LDKPaymentParameters this_ptr_conv;
47160 this_ptr_conv.inner = untag_ptr(this_ptr);
47161 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47162 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47163 this_ptr_conv.is_owned = false;
47164 LDKCVec_RouteHintZ ret_var = PaymentParameters_get_route_hints(&this_ptr_conv);
47165 int64_tArray ret_arr = NULL;
47166 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
47167 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
47168 for (size_t l = 0; l < ret_var.datalen; l++) {
47169 LDKRouteHint ret_conv_11_var = ret_var.data[l];
47170 int64_t ret_conv_11_ref = 0;
47171 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
47172 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
47173 ret_arr_ptr[l] = ret_conv_11_ref;
47175 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
47176 FREE(ret_var.data);
47180 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
47181 LDKPaymentParameters this_ptr_conv;
47182 this_ptr_conv.inner = untag_ptr(this_ptr);
47183 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47185 this_ptr_conv.is_owned = false;
47186 LDKCVec_RouteHintZ val_constr;
47187 val_constr.datalen = (*env)->GetArrayLength(env, val);
47188 if (val_constr.datalen > 0)
47189 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
47191 val_constr.data = NULL;
47192 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
47193 for (size_t l = 0; l < val_constr.datalen; l++) {
47194 int64_t val_conv_11 = val_vals[l];
47195 LDKRouteHint val_conv_11_conv;
47196 val_conv_11_conv.inner = untag_ptr(val_conv_11);
47197 val_conv_11_conv.is_owned = ptr_is_owned(val_conv_11);
47198 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv);
47199 val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
47200 val_constr.data[l] = val_conv_11_conv;
47202 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
47203 PaymentParameters_set_route_hints(&this_ptr_conv, val_constr);
47206 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr) {
47207 LDKPaymentParameters this_ptr_conv;
47208 this_ptr_conv.inner = untag_ptr(this_ptr);
47209 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47211 this_ptr_conv.is_owned = false;
47212 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
47213 *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv);
47214 int64_t ret_ref = tag_ptr(ret_copy, true);
47218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47219 LDKPaymentParameters this_ptr_conv;
47220 this_ptr_conv.inner = untag_ptr(this_ptr);
47221 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47223 this_ptr_conv.is_owned = false;
47224 void* val_ptr = untag_ptr(val);
47225 CHECK_ACCESS(val_ptr);
47226 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
47227 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
47228 PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv);
47231 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
47232 LDKPaymentParameters this_ptr_conv;
47233 this_ptr_conv.inner = untag_ptr(this_ptr);
47234 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47236 this_ptr_conv.is_owned = false;
47237 int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv);
47241 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
47242 LDKPaymentParameters this_ptr_conv;
47243 this_ptr_conv.inner = untag_ptr(this_ptr);
47244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47246 this_ptr_conv.is_owned = false;
47247 PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val);
47250 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr) {
47251 LDKPaymentParameters this_ptr_conv;
47252 this_ptr_conv.inner = untag_ptr(this_ptr);
47253 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47255 this_ptr_conv.is_owned = false;
47256 int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv);
47260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
47261 LDKPaymentParameters this_ptr_conv;
47262 this_ptr_conv.inner = untag_ptr(this_ptr);
47263 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47265 this_ptr_conv.is_owned = false;
47266 PaymentParameters_set_max_path_count(&this_ptr_conv, val);
47269 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1channel_1saturation_1power_1of_1half(JNIEnv *env, jclass clz, int64_t this_ptr) {
47270 LDKPaymentParameters this_ptr_conv;
47271 this_ptr_conv.inner = untag_ptr(this_ptr);
47272 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47273 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47274 this_ptr_conv.is_owned = false;
47275 int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv);
47279 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1channel_1saturation_1power_1of_1half(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
47280 LDKPaymentParameters this_ptr_conv;
47281 this_ptr_conv.inner = untag_ptr(this_ptr);
47282 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47284 this_ptr_conv.is_owned = false;
47285 PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val);
47288 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
47289 LDKPaymentParameters this_ptr_conv;
47290 this_ptr_conv.inner = untag_ptr(this_ptr);
47291 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47293 this_ptr_conv.is_owned = false;
47294 LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv);
47295 int64_tArray ret_arr = NULL;
47296 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
47297 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
47298 for (size_t g = 0; g < ret_var.datalen; g++) {
47299 int64_t ret_conv_6_conv = ret_var.data[g];
47300 ret_arr_ptr[g] = ret_conv_6_conv;
47302 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
47303 FREE(ret_var.data);
47307 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
47308 LDKPaymentParameters this_ptr_conv;
47309 this_ptr_conv.inner = untag_ptr(this_ptr);
47310 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47312 this_ptr_conv.is_owned = false;
47313 LDKCVec_u64Z val_constr;
47314 val_constr.datalen = (*env)->GetArrayLength(env, val);
47315 if (val_constr.datalen > 0)
47316 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
47318 val_constr.data = NULL;
47319 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
47320 for (size_t g = 0; g < val_constr.datalen; g++) {
47321 int64_t val_conv_6 = val_vals[g];
47322 val_constr.data[g] = val_conv_6;
47324 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
47325 PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr);
47328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1new(JNIEnv *env, jclass clz, int8_tArray payee_pubkey_arg, int64_t features_arg, int64_tArray route_hints_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg) {
47329 LDKPublicKey payee_pubkey_arg_ref;
47330 CHECK((*env)->GetArrayLength(env, payee_pubkey_arg) == 33);
47331 (*env)->GetByteArrayRegion(env, payee_pubkey_arg, 0, 33, payee_pubkey_arg_ref.compressed_form);
47332 LDKInvoiceFeatures features_arg_conv;
47333 features_arg_conv.inner = untag_ptr(features_arg);
47334 features_arg_conv.is_owned = ptr_is_owned(features_arg);
47335 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
47336 features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
47337 LDKCVec_RouteHintZ route_hints_arg_constr;
47338 route_hints_arg_constr.datalen = (*env)->GetArrayLength(env, route_hints_arg);
47339 if (route_hints_arg_constr.datalen > 0)
47340 route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
47342 route_hints_arg_constr.data = NULL;
47343 int64_t* route_hints_arg_vals = (*env)->GetLongArrayElements (env, route_hints_arg, NULL);
47344 for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
47345 int64_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
47346 LDKRouteHint route_hints_arg_conv_11_conv;
47347 route_hints_arg_conv_11_conv.inner = untag_ptr(route_hints_arg_conv_11);
47348 route_hints_arg_conv_11_conv.is_owned = ptr_is_owned(route_hints_arg_conv_11);
47349 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv);
47350 route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
47351 route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
47353 (*env)->ReleaseLongArrayElements(env, route_hints_arg, route_hints_arg_vals, 0);
47354 void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg);
47355 CHECK_ACCESS(expiry_time_arg_ptr);
47356 LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
47357 expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg));
47358 LDKCVec_u64Z previously_failed_channels_arg_constr;
47359 previously_failed_channels_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_channels_arg);
47360 if (previously_failed_channels_arg_constr.datalen > 0)
47361 previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
47363 previously_failed_channels_arg_constr.data = NULL;
47364 int64_t* previously_failed_channels_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_channels_arg, NULL);
47365 for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) {
47366 int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g];
47367 previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6;
47369 (*env)->ReleaseLongArrayElements(env, previously_failed_channels_arg, previously_failed_channels_arg_vals, 0);
47370 LDKPaymentParameters ret_var = PaymentParameters_new(payee_pubkey_arg_ref, features_arg_conv, route_hints_arg_constr, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr);
47371 int64_t ret_ref = 0;
47372 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47373 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47377 static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) {
47378 LDKPaymentParameters ret_var = PaymentParameters_clone(arg);
47379 int64_t ret_ref = 0;
47380 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47381 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47385 LDKPaymentParameters arg_conv;
47386 arg_conv.inner = untag_ptr(arg);
47387 arg_conv.is_owned = ptr_is_owned(arg);
47388 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47389 arg_conv.is_owned = false;
47390 int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv);
47394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47395 LDKPaymentParameters orig_conv;
47396 orig_conv.inner = untag_ptr(orig);
47397 orig_conv.is_owned = ptr_is_owned(orig);
47398 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47399 orig_conv.is_owned = false;
47400 LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv);
47401 int64_t ret_ref = 0;
47402 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47403 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47407 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1hash(JNIEnv *env, jclass clz, int64_t o) {
47408 LDKPaymentParameters o_conv;
47409 o_conv.inner = untag_ptr(o);
47410 o_conv.is_owned = ptr_is_owned(o);
47411 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
47412 o_conv.is_owned = false;
47413 int64_t ret_conv = PaymentParameters_hash(&o_conv);
47417 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47418 LDKPaymentParameters a_conv;
47419 a_conv.inner = untag_ptr(a);
47420 a_conv.is_owned = ptr_is_owned(a);
47421 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
47422 a_conv.is_owned = false;
47423 LDKPaymentParameters b_conv;
47424 b_conv.inner = untag_ptr(b);
47425 b_conv.is_owned = ptr_is_owned(b);
47426 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
47427 b_conv.is_owned = false;
47428 jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv);
47432 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
47433 LDKPaymentParameters obj_conv;
47434 obj_conv.inner = untag_ptr(obj);
47435 obj_conv.is_owned = ptr_is_owned(obj);
47436 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47437 obj_conv.is_owned = false;
47438 LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv);
47439 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47440 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47441 CVec_u8Z_free(ret_var);
47445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
47446 LDKu8slice ser_ref;
47447 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
47448 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
47449 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
47450 *ret_conv = PaymentParameters_read(ser_ref);
47451 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
47452 return tag_ptr(ret_conv, true);
47455 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1node_1id(JNIEnv *env, jclass clz, int8_tArray payee_pubkey) {
47456 LDKPublicKey payee_pubkey_ref;
47457 CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33);
47458 (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form);
47459 LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref);
47460 int64_t ret_ref = 0;
47461 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47462 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47466 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1for_1keysend(JNIEnv *env, jclass clz, int8_tArray payee_pubkey) {
47467 LDKPublicKey payee_pubkey_ref;
47468 CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33);
47469 (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form);
47470 LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref);
47471 int64_t ret_ref = 0;
47472 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47473 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47477 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47478 LDKRouteHint this_obj_conv;
47479 this_obj_conv.inner = untag_ptr(this_obj);
47480 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47482 RouteHint_free(this_obj_conv);
47485 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
47486 LDKRouteHint this_ptr_conv;
47487 this_ptr_conv.inner = untag_ptr(this_ptr);
47488 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47489 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47490 this_ptr_conv.is_owned = false;
47491 LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
47492 int64_tArray ret_arr = NULL;
47493 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
47494 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
47495 for (size_t o = 0; o < ret_var.datalen; o++) {
47496 LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
47497 int64_t ret_conv_14_ref = 0;
47498 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
47499 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
47500 ret_arr_ptr[o] = ret_conv_14_ref;
47502 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
47503 FREE(ret_var.data);
47507 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
47508 LDKRouteHint this_ptr_conv;
47509 this_ptr_conv.inner = untag_ptr(this_ptr);
47510 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47511 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47512 this_ptr_conv.is_owned = false;
47513 LDKCVec_RouteHintHopZ val_constr;
47514 val_constr.datalen = (*env)->GetArrayLength(env, val);
47515 if (val_constr.datalen > 0)
47516 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
47518 val_constr.data = NULL;
47519 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
47520 for (size_t o = 0; o < val_constr.datalen; o++) {
47521 int64_t val_conv_14 = val_vals[o];
47522 LDKRouteHintHop val_conv_14_conv;
47523 val_conv_14_conv.inner = untag_ptr(val_conv_14);
47524 val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14);
47525 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv);
47526 val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
47527 val_constr.data[o] = val_conv_14_conv;
47529 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
47530 RouteHint_set_a(&this_ptr_conv, val_constr);
47533 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int64_tArray a_arg) {
47534 LDKCVec_RouteHintHopZ a_arg_constr;
47535 a_arg_constr.datalen = (*env)->GetArrayLength(env, a_arg);
47536 if (a_arg_constr.datalen > 0)
47537 a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
47539 a_arg_constr.data = NULL;
47540 int64_t* a_arg_vals = (*env)->GetLongArrayElements (env, a_arg, NULL);
47541 for (size_t o = 0; o < a_arg_constr.datalen; o++) {
47542 int64_t a_arg_conv_14 = a_arg_vals[o];
47543 LDKRouteHintHop a_arg_conv_14_conv;
47544 a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14);
47545 a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14);
47546 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv);
47547 a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
47548 a_arg_constr.data[o] = a_arg_conv_14_conv;
47550 (*env)->ReleaseLongArrayElements(env, a_arg, a_arg_vals, 0);
47551 LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
47552 int64_t ret_ref = 0;
47553 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47554 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47558 static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) {
47559 LDKRouteHint ret_var = RouteHint_clone(arg);
47560 int64_t ret_ref = 0;
47561 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47562 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47566 LDKRouteHint arg_conv;
47567 arg_conv.inner = untag_ptr(arg);
47568 arg_conv.is_owned = ptr_is_owned(arg);
47569 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47570 arg_conv.is_owned = false;
47571 int64_t ret_conv = RouteHint_clone_ptr(&arg_conv);
47575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47576 LDKRouteHint orig_conv;
47577 orig_conv.inner = untag_ptr(orig);
47578 orig_conv.is_owned = ptr_is_owned(orig);
47579 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47580 orig_conv.is_owned = false;
47581 LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
47582 int64_t ret_ref = 0;
47583 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47584 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47588 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env, jclass clz, int64_t o) {
47589 LDKRouteHint o_conv;
47590 o_conv.inner = untag_ptr(o);
47591 o_conv.is_owned = ptr_is_owned(o);
47592 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
47593 o_conv.is_owned = false;
47594 int64_t ret_conv = RouteHint_hash(&o_conv);
47598 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47599 LDKRouteHint a_conv;
47600 a_conv.inner = untag_ptr(a);
47601 a_conv.is_owned = ptr_is_owned(a);
47602 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
47603 a_conv.is_owned = false;
47604 LDKRouteHint b_conv;
47605 b_conv.inner = untag_ptr(b);
47606 b_conv.is_owned = ptr_is_owned(b);
47607 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
47608 b_conv.is_owned = false;
47609 jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv);
47613 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv *env, jclass clz, int64_t obj) {
47614 LDKRouteHint obj_conv;
47615 obj_conv.inner = untag_ptr(obj);
47616 obj_conv.is_owned = ptr_is_owned(obj);
47617 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47618 obj_conv.is_owned = false;
47619 LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv);
47620 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47621 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47622 CVec_u8Z_free(ret_var);
47626 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
47627 LDKu8slice ser_ref;
47628 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
47629 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
47630 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
47631 *ret_conv = RouteHint_read(ser_ref);
47632 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
47633 return tag_ptr(ret_conv, true);
47636 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47637 LDKRouteHintHop this_obj_conv;
47638 this_obj_conv.inner = untag_ptr(this_obj);
47639 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47640 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47641 RouteHintHop_free(this_obj_conv);
47644 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
47645 LDKRouteHintHop this_ptr_conv;
47646 this_ptr_conv.inner = untag_ptr(this_ptr);
47647 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47649 this_ptr_conv.is_owned = false;
47650 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
47651 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form);
47655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
47656 LDKRouteHintHop this_ptr_conv;
47657 this_ptr_conv.inner = untag_ptr(this_ptr);
47658 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47659 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47660 this_ptr_conv.is_owned = false;
47661 LDKPublicKey val_ref;
47662 CHECK((*env)->GetArrayLength(env, val) == 33);
47663 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
47664 RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref);
47667 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
47668 LDKRouteHintHop this_ptr_conv;
47669 this_ptr_conv.inner = untag_ptr(this_ptr);
47670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47672 this_ptr_conv.is_owned = false;
47673 int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv);
47677 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47678 LDKRouteHintHop this_ptr_conv;
47679 this_ptr_conv.inner = untag_ptr(this_ptr);
47680 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47681 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47682 this_ptr_conv.is_owned = false;
47683 RouteHintHop_set_short_channel_id(&this_ptr_conv, val);
47686 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) {
47687 LDKRouteHintHop this_ptr_conv;
47688 this_ptr_conv.inner = untag_ptr(this_ptr);
47689 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47691 this_ptr_conv.is_owned = false;
47692 LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv);
47693 int64_t ret_ref = 0;
47694 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47695 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47699 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47700 LDKRouteHintHop this_ptr_conv;
47701 this_ptr_conv.inner = untag_ptr(this_ptr);
47702 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47704 this_ptr_conv.is_owned = false;
47705 LDKRoutingFees val_conv;
47706 val_conv.inner = untag_ptr(val);
47707 val_conv.is_owned = ptr_is_owned(val);
47708 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47709 val_conv = RoutingFees_clone(&val_conv);
47710 RouteHintHop_set_fees(&this_ptr_conv, val_conv);
47713 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
47714 LDKRouteHintHop this_ptr_conv;
47715 this_ptr_conv.inner = untag_ptr(this_ptr);
47716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47718 this_ptr_conv.is_owned = false;
47719 int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv);
47723 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
47724 LDKRouteHintHop this_ptr_conv;
47725 this_ptr_conv.inner = untag_ptr(this_ptr);
47726 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47728 this_ptr_conv.is_owned = false;
47729 RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val);
47732 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
47733 LDKRouteHintHop this_ptr_conv;
47734 this_ptr_conv.inner = untag_ptr(this_ptr);
47735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47737 this_ptr_conv.is_owned = false;
47738 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
47739 *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv);
47740 int64_t ret_ref = tag_ptr(ret_copy, true);
47744 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47745 LDKRouteHintHop this_ptr_conv;
47746 this_ptr_conv.inner = untag_ptr(this_ptr);
47747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47749 this_ptr_conv.is_owned = false;
47750 void* val_ptr = untag_ptr(val);
47751 CHECK_ACCESS(val_ptr);
47752 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
47753 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
47754 RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
47757 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
47758 LDKRouteHintHop this_ptr_conv;
47759 this_ptr_conv.inner = untag_ptr(this_ptr);
47760 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47762 this_ptr_conv.is_owned = false;
47763 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
47764 *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv);
47765 int64_t ret_ref = tag_ptr(ret_copy, true);
47769 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47770 LDKRouteHintHop this_ptr_conv;
47771 this_ptr_conv.inner = untag_ptr(this_ptr);
47772 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47774 this_ptr_conv.is_owned = false;
47775 void* val_ptr = untag_ptr(val);
47776 CHECK_ACCESS(val_ptr);
47777 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
47778 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
47779 RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
47782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *env, jclass clz, int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg) {
47783 LDKPublicKey src_node_id_arg_ref;
47784 CHECK((*env)->GetArrayLength(env, src_node_id_arg) == 33);
47785 (*env)->GetByteArrayRegion(env, src_node_id_arg, 0, 33, src_node_id_arg_ref.compressed_form);
47786 LDKRoutingFees fees_arg_conv;
47787 fees_arg_conv.inner = untag_ptr(fees_arg);
47788 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
47789 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
47790 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
47791 void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg);
47792 CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
47793 LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
47794 htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg));
47795 void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg);
47796 CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
47797 LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
47798 htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg));
47799 LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv);
47800 int64_t ret_ref = 0;
47801 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47802 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47806 static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) {
47807 LDKRouteHintHop ret_var = RouteHintHop_clone(arg);
47808 int64_t ret_ref = 0;
47809 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47810 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47814 LDKRouteHintHop arg_conv;
47815 arg_conv.inner = untag_ptr(arg);
47816 arg_conv.is_owned = ptr_is_owned(arg);
47817 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47818 arg_conv.is_owned = false;
47819 int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv);
47823 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47824 LDKRouteHintHop orig_conv;
47825 orig_conv.inner = untag_ptr(orig);
47826 orig_conv.is_owned = ptr_is_owned(orig);
47827 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47828 orig_conv.is_owned = false;
47829 LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv);
47830 int64_t ret_ref = 0;
47831 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47832 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47836 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv *env, jclass clz, int64_t o) {
47837 LDKRouteHintHop o_conv;
47838 o_conv.inner = untag_ptr(o);
47839 o_conv.is_owned = ptr_is_owned(o);
47840 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
47841 o_conv.is_owned = false;
47842 int64_t ret_conv = RouteHintHop_hash(&o_conv);
47846 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47847 LDKRouteHintHop a_conv;
47848 a_conv.inner = untag_ptr(a);
47849 a_conv.is_owned = ptr_is_owned(a);
47850 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
47851 a_conv.is_owned = false;
47852 LDKRouteHintHop b_conv;
47853 b_conv.inner = untag_ptr(b);
47854 b_conv.is_owned = ptr_is_owned(b);
47855 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
47856 b_conv.is_owned = false;
47857 jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv);
47861 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
47862 LDKRouteHintHop obj_conv;
47863 obj_conv.inner = untag_ptr(obj);
47864 obj_conv.is_owned = ptr_is_owned(obj);
47865 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47866 obj_conv.is_owned = false;
47867 LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv);
47868 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47869 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47870 CVec_u8Z_free(ret_var);
47874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
47875 LDKu8slice ser_ref;
47876 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
47877 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
47878 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
47879 *ret_conv = RouteHintHop_read(ser_ref);
47880 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
47881 return tag_ptr(ret_conv, true);
47884 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int8_tArray random_seed_bytes) {
47885 LDKPublicKey our_node_pubkey_ref;
47886 CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
47887 (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
47888 LDKRouteParameters route_params_conv;
47889 route_params_conv.inner = untag_ptr(route_params);
47890 route_params_conv.is_owned = ptr_is_owned(route_params);
47891 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
47892 route_params_conv.is_owned = false;
47893 LDKNetworkGraph network_graph_conv;
47894 network_graph_conv.inner = untag_ptr(network_graph);
47895 network_graph_conv.is_owned = ptr_is_owned(network_graph);
47896 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
47897 network_graph_conv.is_owned = false;
47898 LDKCVec_ChannelDetailsZ first_hops_constr;
47899 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
47900 if (first_hops != NULL) {
47901 first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
47902 if (first_hops_constr.datalen > 0)
47903 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
47905 first_hops_constr.data = NULL;
47906 int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
47907 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
47908 int64_t first_hops_conv_16 = first_hops_vals[q];
47909 LDKChannelDetails first_hops_conv_16_conv;
47910 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
47911 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
47912 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
47913 first_hops_conv_16_conv.is_owned = false;
47914 first_hops_constr.data[q] = first_hops_conv_16_conv;
47916 (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
47917 first_hops_ptr = &first_hops_constr;
47919 void* logger_ptr = untag_ptr(logger);
47920 CHECK_ACCESS(logger_ptr);
47921 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
47922 if (logger_conv.free == LDKLogger_JCalls_free) {
47923 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47924 LDKLogger_JCalls_cloned(&logger_conv);
47926 void* scorer_ptr = untag_ptr(scorer);
47927 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
47928 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
47929 unsigned char random_seed_bytes_arr[32];
47930 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
47931 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr);
47932 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
47933 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
47934 *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, random_seed_bytes_ref);
47935 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
47936 return tag_ptr(ret_conv, true);
47939 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_build_1route_1from_1hops(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, jobjectArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) {
47940 LDKPublicKey our_node_pubkey_ref;
47941 CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
47942 (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
47943 LDKCVec_PublicKeyZ hops_constr;
47944 hops_constr.datalen = (*env)->GetArrayLength(env, hops);
47945 if (hops_constr.datalen > 0)
47946 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
47948 hops_constr.data = NULL;
47949 for (size_t i = 0; i < hops_constr.datalen; i++) {
47950 int8_tArray hops_conv_8 = (*env)->GetObjectArrayElement(env, hops, i);
47951 LDKPublicKey hops_conv_8_ref;
47952 CHECK((*env)->GetArrayLength(env, hops_conv_8) == 33);
47953 (*env)->GetByteArrayRegion(env, hops_conv_8, 0, 33, hops_conv_8_ref.compressed_form);
47954 hops_constr.data[i] = hops_conv_8_ref;
47956 LDKRouteParameters route_params_conv;
47957 route_params_conv.inner = untag_ptr(route_params);
47958 route_params_conv.is_owned = ptr_is_owned(route_params);
47959 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
47960 route_params_conv.is_owned = false;
47961 LDKNetworkGraph network_graph_conv;
47962 network_graph_conv.inner = untag_ptr(network_graph);
47963 network_graph_conv.is_owned = ptr_is_owned(network_graph);
47964 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
47965 network_graph_conv.is_owned = false;
47966 void* logger_ptr = untag_ptr(logger);
47967 CHECK_ACCESS(logger_ptr);
47968 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
47969 if (logger_conv.free == LDKLogger_JCalls_free) {
47970 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47971 LDKLogger_JCalls_cloned(&logger_conv);
47973 unsigned char random_seed_bytes_arr[32];
47974 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
47975 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr);
47976 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
47977 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
47978 *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref);
47979 return tag_ptr(ret_conv, true);
47982 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47983 if (!ptr_is_owned(this_ptr)) return;
47984 void* this_ptr_ptr = untag_ptr(this_ptr);
47985 CHECK_ACCESS(this_ptr_ptr);
47986 LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
47987 FREE(untag_ptr(this_ptr));
47988 Score_free(this_ptr_conv);
47991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47992 if (!ptr_is_owned(this_ptr)) return;
47993 void* this_ptr_ptr = untag_ptr(this_ptr);
47994 CHECK_ACCESS(this_ptr_ptr);
47995 LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
47996 FREE(untag_ptr(this_ptr));
47997 LockableScore_free(this_ptr_conv);
48000 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
48001 if (!ptr_is_owned(this_ptr)) return;
48002 void* this_ptr_ptr = untag_ptr(this_ptr);
48003 CHECK_ACCESS(this_ptr_ptr);
48004 LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr);
48005 FREE(untag_ptr(this_ptr));
48006 WriteableScore_free(this_ptr_conv);
48009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48010 LDKMultiThreadedLockableScore this_obj_conv;
48011 this_obj_conv.inner = untag_ptr(this_obj);
48012 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48014 MultiThreadedLockableScore_free(this_obj_conv);
48017 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLock_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48018 LDKMultiThreadedScoreLock this_obj_conv;
48019 this_obj_conv.inner = untag_ptr(this_obj);
48020 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48022 MultiThreadedScoreLock_free(this_obj_conv);
48025 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLock_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
48026 LDKMultiThreadedScoreLock this_arg_conv;
48027 this_arg_conv.inner = untag_ptr(this_arg);
48028 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48030 this_arg_conv.is_owned = false;
48031 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
48032 *ret_ret = MultiThreadedScoreLock_as_Score(&this_arg_conv);
48033 return tag_ptr(ret_ret, true);
48036 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLock_1write(JNIEnv *env, jclass clz, int64_t obj) {
48037 LDKMultiThreadedScoreLock obj_conv;
48038 obj_conv.inner = untag_ptr(obj);
48039 obj_conv.is_owned = ptr_is_owned(obj);
48040 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48041 obj_conv.is_owned = false;
48042 LDKCVec_u8Z ret_var = MultiThreadedScoreLock_write(&obj_conv);
48043 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48044 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48045 CVec_u8Z_free(ret_var);
48049 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1LockableScore(JNIEnv *env, jclass clz, int64_t this_arg) {
48050 LDKMultiThreadedLockableScore this_arg_conv;
48051 this_arg_conv.inner = untag_ptr(this_arg);
48052 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48053 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48054 this_arg_conv.is_owned = false;
48055 LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
48056 *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv);
48057 return tag_ptr(ret_ret, true);
48060 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) {
48061 LDKMultiThreadedLockableScore obj_conv;
48062 obj_conv.inner = untag_ptr(obj);
48063 obj_conv.is_owned = ptr_is_owned(obj);
48064 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48065 obj_conv.is_owned = false;
48066 LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv);
48067 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48068 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48069 CVec_u8Z_free(ret_var);
48073 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1WriteableScore(JNIEnv *env, jclass clz, int64_t this_arg) {
48074 LDKMultiThreadedLockableScore this_arg_conv;
48075 this_arg_conv.inner = untag_ptr(this_arg);
48076 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48077 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48078 this_arg_conv.is_owned = false;
48079 LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
48080 *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv);
48081 return tag_ptr(ret_ret, true);
48084 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) {
48085 void* score_ptr = untag_ptr(score);
48086 CHECK_ACCESS(score_ptr);
48087 LDKScore score_conv = *(LDKScore*)(score_ptr);
48088 if (score_conv.free == LDKScore_JCalls_free) {
48089 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48090 LDKScore_JCalls_cloned(&score_conv);
48092 LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
48093 int64_t ret_ref = 0;
48094 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48095 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48099 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48100 LDKChannelUsage this_obj_conv;
48101 this_obj_conv.inner = untag_ptr(this_obj);
48102 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48103 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48104 ChannelUsage_free(this_obj_conv);
48107 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48108 LDKChannelUsage this_ptr_conv;
48109 this_ptr_conv.inner = untag_ptr(this_ptr);
48110 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48112 this_ptr_conv.is_owned = false;
48113 int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv);
48117 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48118 LDKChannelUsage this_ptr_conv;
48119 this_ptr_conv.inner = untag_ptr(this_ptr);
48120 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48122 this_ptr_conv.is_owned = false;
48123 ChannelUsage_set_amount_msat(&this_ptr_conv, val);
48126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48127 LDKChannelUsage this_ptr_conv;
48128 this_ptr_conv.inner = untag_ptr(this_ptr);
48129 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48130 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48131 this_ptr_conv.is_owned = false;
48132 int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv);
48136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48137 LDKChannelUsage this_ptr_conv;
48138 this_ptr_conv.inner = untag_ptr(this_ptr);
48139 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48141 this_ptr_conv.is_owned = false;
48142 ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val);
48145 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr) {
48146 LDKChannelUsage this_ptr_conv;
48147 this_ptr_conv.inner = untag_ptr(this_ptr);
48148 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48149 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48150 this_ptr_conv.is_owned = false;
48151 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
48152 *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv);
48153 int64_t ret_ref = tag_ptr(ret_copy, true);
48157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48158 LDKChannelUsage this_ptr_conv;
48159 this_ptr_conv.inner = untag_ptr(this_ptr);
48160 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48162 this_ptr_conv.is_owned = false;
48163 void* val_ptr = untag_ptr(val);
48164 CHECK_ACCESS(val_ptr);
48165 LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr);
48166 val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val));
48167 ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv);
48170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1new(JNIEnv *env, jclass clz, int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) {
48171 void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg);
48172 CHECK_ACCESS(effective_capacity_arg_ptr);
48173 LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr);
48174 effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg));
48175 LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv);
48176 int64_t ret_ref = 0;
48177 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48178 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48182 static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) {
48183 LDKChannelUsage ret_var = ChannelUsage_clone(arg);
48184 int64_t ret_ref = 0;
48185 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48186 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48189 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48190 LDKChannelUsage arg_conv;
48191 arg_conv.inner = untag_ptr(arg);
48192 arg_conv.is_owned = ptr_is_owned(arg);
48193 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48194 arg_conv.is_owned = false;
48195 int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv);
48199 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48200 LDKChannelUsage orig_conv;
48201 orig_conv.inner = untag_ptr(orig);
48202 orig_conv.is_owned = ptr_is_owned(orig);
48203 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48204 orig_conv.is_owned = false;
48205 LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv);
48206 int64_t ret_ref = 0;
48207 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48208 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48212 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48213 LDKFixedPenaltyScorer this_obj_conv;
48214 this_obj_conv.inner = untag_ptr(this_obj);
48215 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48216 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48217 FixedPenaltyScorer_free(this_obj_conv);
48220 static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) {
48221 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg);
48222 int64_t ret_ref = 0;
48223 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48224 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48227 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48228 LDKFixedPenaltyScorer arg_conv;
48229 arg_conv.inner = untag_ptr(arg);
48230 arg_conv.is_owned = ptr_is_owned(arg);
48231 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48232 arg_conv.is_owned = false;
48233 int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv);
48237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48238 LDKFixedPenaltyScorer orig_conv;
48239 orig_conv.inner = untag_ptr(orig);
48240 orig_conv.is_owned = ptr_is_owned(orig);
48241 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48242 orig_conv.is_owned = false;
48243 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv);
48244 int64_t ret_ref = 0;
48245 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48246 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48250 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) {
48251 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat);
48252 int64_t ret_ref = 0;
48253 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48254 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48258 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
48259 LDKFixedPenaltyScorer this_arg_conv;
48260 this_arg_conv.inner = untag_ptr(this_arg);
48261 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48262 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48263 this_arg_conv.is_owned = false;
48264 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
48265 *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv);
48266 return tag_ptr(ret_ret, true);
48269 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) {
48270 LDKFixedPenaltyScorer obj_conv;
48271 obj_conv.inner = untag_ptr(obj);
48272 obj_conv.is_owned = ptr_is_owned(obj);
48273 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48274 obj_conv.is_owned = false;
48275 LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv);
48276 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48277 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48278 CVec_u8Z_free(ret_var);
48282 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
48283 LDKu8slice ser_ref;
48284 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48285 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48286 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
48287 *ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
48288 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48289 return tag_ptr(ret_conv, true);
48292 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48293 LDKProbabilisticScorer this_obj_conv;
48294 this_obj_conv.inner = untag_ptr(this_obj);
48295 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48296 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48297 ProbabilisticScorer_free(this_obj_conv);
48300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48301 LDKProbabilisticScoringParameters this_obj_conv;
48302 this_obj_conv.inner = untag_ptr(this_obj);
48303 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48304 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48305 ProbabilisticScoringParameters_free(this_obj_conv);
48308 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48309 LDKProbabilisticScoringParameters this_ptr_conv;
48310 this_ptr_conv.inner = untag_ptr(this_ptr);
48311 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48313 this_ptr_conv.is_owned = false;
48314 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_msat(&this_ptr_conv);
48318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48319 LDKProbabilisticScoringParameters this_ptr_conv;
48320 this_ptr_conv.inner = untag_ptr(this_ptr);
48321 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48323 this_ptr_conv.is_owned = false;
48324 ProbabilisticScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
48327 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48328 LDKProbabilisticScoringParameters this_ptr_conv;
48329 this_ptr_conv.inner = untag_ptr(this_ptr);
48330 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48332 this_ptr_conv.is_owned = false;
48333 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv);
48337 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48338 LDKProbabilisticScoringParameters this_ptr_conv;
48339 this_ptr_conv.inner = untag_ptr(this_ptr);
48340 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48342 this_ptr_conv.is_owned = false;
48343 ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val);
48346 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48347 LDKProbabilisticScoringParameters this_ptr_conv;
48348 this_ptr_conv.inner = untag_ptr(this_ptr);
48349 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48351 this_ptr_conv.is_owned = false;
48352 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv);
48356 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48357 LDKProbabilisticScoringParameters this_ptr_conv;
48358 this_ptr_conv.inner = untag_ptr(this_ptr);
48359 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48361 this_ptr_conv.is_owned = false;
48362 ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
48365 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
48366 LDKProbabilisticScoringParameters this_ptr_conv;
48367 this_ptr_conv.inner = untag_ptr(this_ptr);
48368 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48369 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48370 this_ptr_conv.is_owned = false;
48371 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_offset_half_life(&this_ptr_conv);
48375 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48376 LDKProbabilisticScoringParameters this_ptr_conv;
48377 this_ptr_conv.inner = untag_ptr(this_ptr);
48378 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48380 this_ptr_conv.is_owned = false;
48381 ProbabilisticScoringParameters_set_liquidity_offset_half_life(&this_ptr_conv, val);
48384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48385 LDKProbabilisticScoringParameters this_ptr_conv;
48386 this_ptr_conv.inner = untag_ptr(this_ptr);
48387 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48388 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48389 this_ptr_conv.is_owned = false;
48390 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
48394 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48395 LDKProbabilisticScoringParameters this_ptr_conv;
48396 this_ptr_conv.inner = untag_ptr(this_ptr);
48397 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48399 this_ptr_conv.is_owned = false;
48400 ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
48403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48404 LDKProbabilisticScoringParameters this_ptr_conv;
48405 this_ptr_conv.inner = untag_ptr(this_ptr);
48406 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48408 this_ptr_conv.is_owned = false;
48409 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv);
48413 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48414 LDKProbabilisticScoringParameters this_ptr_conv;
48415 this_ptr_conv.inner = untag_ptr(this_ptr);
48416 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48418 this_ptr_conv.is_owned = false;
48419 ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
48422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48423 LDKProbabilisticScoringParameters this_ptr_conv;
48424 this_ptr_conv.inner = untag_ptr(this_ptr);
48425 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48427 this_ptr_conv.is_owned = false;
48428 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
48432 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48433 LDKProbabilisticScoringParameters this_ptr_conv;
48434 this_ptr_conv.inner = untag_ptr(this_ptr);
48435 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48437 this_ptr_conv.is_owned = false;
48438 ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
48441 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
48442 LDKProbabilisticScoringParameters this_ptr_conv;
48443 this_ptr_conv.inner = untag_ptr(this_ptr);
48444 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48446 this_ptr_conv.is_owned = false;
48447 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_no_updates_half_life(&this_ptr_conv);
48451 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48452 LDKProbabilisticScoringParameters this_ptr_conv;
48453 this_ptr_conv.inner = untag_ptr(this_ptr);
48454 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48455 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48456 this_ptr_conv.is_owned = false;
48457 ProbabilisticScoringParameters_set_historical_no_updates_half_life(&this_ptr_conv, val);
48460 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48461 LDKProbabilisticScoringParameters this_ptr_conv;
48462 this_ptr_conv.inner = untag_ptr(this_ptr);
48463 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48464 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48465 this_ptr_conv.is_owned = false;
48466 int64_t ret_conv = ProbabilisticScoringParameters_get_anti_probing_penalty_msat(&this_ptr_conv);
48470 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48471 LDKProbabilisticScoringParameters this_ptr_conv;
48472 this_ptr_conv.inner = untag_ptr(this_ptr);
48473 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48474 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48475 this_ptr_conv.is_owned = false;
48476 ProbabilisticScoringParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val);
48479 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48480 LDKProbabilisticScoringParameters this_ptr_conv;
48481 this_ptr_conv.inner = untag_ptr(this_ptr);
48482 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48484 this_ptr_conv.is_owned = false;
48485 int64_t ret_conv = ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(&this_ptr_conv);
48489 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48490 LDKProbabilisticScoringParameters this_ptr_conv;
48491 this_ptr_conv.inner = untag_ptr(this_ptr);
48492 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48494 this_ptr_conv.is_owned = false;
48495 ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val);
48498 static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) {
48499 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(arg);
48500 int64_t ret_ref = 0;
48501 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48502 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48505 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48506 LDKProbabilisticScoringParameters arg_conv;
48507 arg_conv.inner = untag_ptr(arg);
48508 arg_conv.is_owned = ptr_is_owned(arg);
48509 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48510 arg_conv.is_owned = false;
48511 int64_t ret_conv = ProbabilisticScoringParameters_clone_ptr(&arg_conv);
48515 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48516 LDKProbabilisticScoringParameters orig_conv;
48517 orig_conv.inner = untag_ptr(orig);
48518 orig_conv.is_owned = ptr_is_owned(orig);
48519 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48520 orig_conv.is_owned = false;
48521 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(&orig_conv);
48522 int64_t ret_ref = 0;
48523 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48524 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48528 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JNIEnv *env, jclass clz, int64_t params, int64_t network_graph, int64_t logger) {
48529 LDKProbabilisticScoringParameters params_conv;
48530 params_conv.inner = untag_ptr(params);
48531 params_conv.is_owned = ptr_is_owned(params);
48532 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
48533 params_conv = ProbabilisticScoringParameters_clone(¶ms_conv);
48534 LDKNetworkGraph network_graph_conv;
48535 network_graph_conv.inner = untag_ptr(network_graph);
48536 network_graph_conv.is_owned = ptr_is_owned(network_graph);
48537 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
48538 network_graph_conv.is_owned = false;
48539 void* logger_ptr = untag_ptr(logger);
48540 CHECK_ACCESS(logger_ptr);
48541 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
48542 if (logger_conv.free == LDKLogger_JCalls_free) {
48543 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48544 LDKLogger_JCalls_cloned(&logger_conv);
48546 LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv);
48547 int64_t ret_ref = 0;
48548 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48549 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48553 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats(JNIEnv *env, jclass clz, int64_t this_arg) {
48554 LDKProbabilisticScorer this_arg_conv;
48555 this_arg_conv.inner = untag_ptr(this_arg);
48556 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48557 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48558 this_arg_conv.is_owned = false;
48559 ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv);
48562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1estimated_1channel_1liquidity_1range(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target) {
48563 LDKProbabilisticScorer this_arg_conv;
48564 this_arg_conv.inner = untag_ptr(this_arg);
48565 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48566 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48567 this_arg_conv.is_owned = false;
48568 LDKNodeId target_conv;
48569 target_conv.inner = untag_ptr(target);
48570 target_conv.is_owned = ptr_is_owned(target);
48571 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
48572 target_conv.is_owned = false;
48573 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
48574 *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv);
48575 int64_t ret_ref = tag_ptr(ret_copy, true);
48579 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1add_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
48580 LDKProbabilisticScorer this_arg_conv;
48581 this_arg_conv.inner = untag_ptr(this_arg);
48582 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48584 this_arg_conv.is_owned = false;
48585 LDKNodeId node_id_conv;
48586 node_id_conv.inner = untag_ptr(node_id);
48587 node_id_conv.is_owned = ptr_is_owned(node_id);
48588 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
48589 node_id_conv.is_owned = false;
48590 ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv);
48593 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1remove_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
48594 LDKProbabilisticScorer this_arg_conv;
48595 this_arg_conv.inner = untag_ptr(this_arg);
48596 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48598 this_arg_conv.is_owned = false;
48599 LDKNodeId node_id_conv;
48600 node_id_conv.inner = untag_ptr(node_id);
48601 node_id_conv.is_owned = ptr_is_owned(node_id);
48602 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
48603 node_id_conv.is_owned = false;
48604 ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv);
48607 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1set_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id, int64_t penalty) {
48608 LDKProbabilisticScorer this_arg_conv;
48609 this_arg_conv.inner = untag_ptr(this_arg);
48610 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48612 this_arg_conv.is_owned = false;
48613 LDKNodeId node_id_conv;
48614 node_id_conv.inner = untag_ptr(node_id);
48615 node_id_conv.is_owned = ptr_is_owned(node_id);
48616 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
48617 node_id_conv.is_owned = false;
48618 ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty);
48621 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1remove_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
48622 LDKProbabilisticScorer this_arg_conv;
48623 this_arg_conv.inner = untag_ptr(this_arg);
48624 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48625 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48626 this_arg_conv.is_owned = false;
48627 LDKNodeId node_id_conv;
48628 node_id_conv.inner = untag_ptr(node_id);
48629 node_id_conv.is_owned = ptr_is_owned(node_id);
48630 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
48631 node_id_conv.is_owned = false;
48632 ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv);
48635 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1clear_1manual_1penalties(JNIEnv *env, jclass clz, int64_t this_arg) {
48636 LDKProbabilisticScorer this_arg_conv;
48637 this_arg_conv.inner = untag_ptr(this_arg);
48638 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48639 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48640 this_arg_conv.is_owned = false;
48641 ProbabilisticScorer_clear_manual_penalties(&this_arg_conv);
48644 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1add_1banned_1from_1list(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray node_ids) {
48645 LDKProbabilisticScoringParameters this_arg_conv;
48646 this_arg_conv.inner = untag_ptr(this_arg);
48647 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48649 this_arg_conv.is_owned = false;
48650 LDKCVec_NodeIdZ node_ids_constr;
48651 node_ids_constr.datalen = (*env)->GetArrayLength(env, node_ids);
48652 if (node_ids_constr.datalen > 0)
48653 node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
48655 node_ids_constr.data = NULL;
48656 int64_t* node_ids_vals = (*env)->GetLongArrayElements (env, node_ids, NULL);
48657 for (size_t i = 0; i < node_ids_constr.datalen; i++) {
48658 int64_t node_ids_conv_8 = node_ids_vals[i];
48659 LDKNodeId node_ids_conv_8_conv;
48660 node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8);
48661 node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8);
48662 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv);
48663 node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv);
48664 node_ids_constr.data[i] = node_ids_conv_8_conv;
48666 (*env)->ReleaseLongArrayElements(env, node_ids, node_ids_vals, 0);
48667 ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr);
48670 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1default(JNIEnv *env, jclass clz) {
48671 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default();
48672 int64_t ret_ref = 0;
48673 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48674 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48678 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
48679 LDKProbabilisticScorer this_arg_conv;
48680 this_arg_conv.inner = untag_ptr(this_arg);
48681 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48683 this_arg_conv.is_owned = false;
48684 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
48685 *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv);
48686 return tag_ptr(ret_ret, true);
48689 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1write(JNIEnv *env, jclass clz, int64_t obj) {
48690 LDKProbabilisticScorer obj_conv;
48691 obj_conv.inner = untag_ptr(obj);
48692 obj_conv.is_owned = ptr_is_owned(obj);
48693 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48694 obj_conv.is_owned = false;
48695 LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv);
48696 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48697 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48698 CVec_u8Z_free(ret_var);
48702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) {
48703 LDKu8slice ser_ref;
48704 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48705 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48706 LDKProbabilisticScoringParameters arg_a_conv;
48707 arg_a_conv.inner = untag_ptr(arg_a);
48708 arg_a_conv.is_owned = ptr_is_owned(arg_a);
48709 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv);
48710 arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv);
48711 LDKNetworkGraph arg_b_conv;
48712 arg_b_conv.inner = untag_ptr(arg_b);
48713 arg_b_conv.is_owned = ptr_is_owned(arg_b);
48714 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv);
48715 arg_b_conv.is_owned = false;
48716 void* arg_c_ptr = untag_ptr(arg_c);
48717 CHECK_ACCESS(arg_c_ptr);
48718 LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr);
48719 if (arg_c_conv.free == LDKLogger_JCalls_free) {
48720 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48721 LDKLogger_JCalls_cloned(&arg_c_conv);
48723 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
48724 *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
48725 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48726 return tag_ptr(ret_conv, true);
48729 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48730 LDKBlindedRoute this_obj_conv;
48731 this_obj_conv.inner = untag_ptr(this_obj);
48732 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48734 BlindedRoute_free(this_obj_conv);
48737 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48738 LDKBlindedHop this_obj_conv;
48739 this_obj_conv.inner = untag_ptr(this_obj);
48740 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48742 BlindedHop_free(this_obj_conv);
48745 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1new(JNIEnv *env, jclass clz, jobjectArray node_pks, int64_t keys_manager) {
48746 LDKCVec_PublicKeyZ node_pks_constr;
48747 node_pks_constr.datalen = (*env)->GetArrayLength(env, node_pks);
48748 if (node_pks_constr.datalen > 0)
48749 node_pks_constr.data = MALLOC(node_pks_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
48751 node_pks_constr.data = NULL;
48752 for (size_t i = 0; i < node_pks_constr.datalen; i++) {
48753 int8_tArray node_pks_conv_8 = (*env)->GetObjectArrayElement(env, node_pks, i);
48754 LDKPublicKey node_pks_conv_8_ref;
48755 CHECK((*env)->GetArrayLength(env, node_pks_conv_8) == 33);
48756 (*env)->GetByteArrayRegion(env, node_pks_conv_8, 0, 33, node_pks_conv_8_ref.compressed_form);
48757 node_pks_constr.data[i] = node_pks_conv_8_ref;
48759 void* keys_manager_ptr = untag_ptr(keys_manager);
48760 if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
48761 LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
48762 LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ");
48763 *ret_conv = BlindedRoute_new(node_pks_constr, keys_manager_conv);
48764 return tag_ptr(ret_conv, true);
48767 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1write(JNIEnv *env, jclass clz, int64_t obj) {
48768 LDKBlindedRoute obj_conv;
48769 obj_conv.inner = untag_ptr(obj);
48770 obj_conv.is_owned = ptr_is_owned(obj);
48771 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48772 obj_conv.is_owned = false;
48773 LDKCVec_u8Z ret_var = BlindedRoute_write(&obj_conv);
48774 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48775 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48776 CVec_u8Z_free(ret_var);
48780 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
48781 LDKu8slice ser_ref;
48782 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48783 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48784 LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
48785 *ret_conv = BlindedRoute_read(ser_ref);
48786 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48787 return tag_ptr(ret_conv, true);
48790 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
48791 LDKBlindedHop obj_conv;
48792 obj_conv.inner = untag_ptr(obj);
48793 obj_conv.is_owned = ptr_is_owned(obj);
48794 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48795 obj_conv.is_owned = false;
48796 LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv);
48797 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48798 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48799 CVec_u8Z_free(ret_var);
48803 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
48804 LDKu8slice ser_ref;
48805 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48806 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48807 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
48808 *ret_conv = BlindedHop_read(ser_ref);
48809 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48810 return tag_ptr(ret_conv, true);
48813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48814 LDKOnionMessenger this_obj_conv;
48815 this_obj_conv.inner = untag_ptr(this_obj);
48816 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48818 OnionMessenger_free(this_obj_conv);
48821 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
48822 if (!ptr_is_owned(this_ptr)) return;
48823 void* this_ptr_ptr = untag_ptr(this_ptr);
48824 CHECK_ACCESS(this_ptr_ptr);
48825 LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr);
48826 FREE(untag_ptr(this_ptr));
48827 Destination_free(this_ptr_conv);
48830 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *env, jclass clz, int8_tArray a) {
48831 LDKPublicKey a_ref;
48832 CHECK((*env)->GetArrayLength(env, a) == 33);
48833 (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
48834 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
48835 *ret_copy = Destination_node(a_ref);
48836 int64_t ret_ref = tag_ptr(ret_copy, true);
48840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1route(JNIEnv *env, jclass clz, int64_t a) {
48841 LDKBlindedRoute a_conv;
48842 a_conv.inner = untag_ptr(a);
48843 a_conv.is_owned = ptr_is_owned(a);
48844 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
48845 // WARNING: we need a move here but no clone is available for LDKBlindedRoute
48847 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
48848 *ret_copy = Destination_blinded_route(a_conv);
48849 int64_t ret_ref = tag_ptr(ret_copy, true);
48853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
48854 if (!ptr_is_owned(this_ptr)) return;
48855 void* this_ptr_ptr = untag_ptr(this_ptr);
48856 CHECK_ACCESS(this_ptr_ptr);
48857 LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr);
48858 FREE(untag_ptr(this_ptr));
48859 SendError_free(this_ptr_conv);
48862 static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) {
48863 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
48864 *ret_copy = SendError_clone(arg);
48865 int64_t ret_ref = tag_ptr(ret_copy, true);
48868 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48869 LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg);
48870 int64_t ret_conv = SendError_clone_ptr(arg_conv);
48874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48875 LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig);
48876 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
48877 *ret_copy = SendError_clone(orig_conv);
48878 int64_t ret_ref = tag_ptr(ret_copy, true);
48882 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1secp256k1(JNIEnv *env, jclass clz, jclass a) {
48883 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a);
48884 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
48885 *ret_copy = SendError_secp256k1(a_conv);
48886 int64_t ret_ref = tag_ptr(ret_copy, true);
48890 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1big_1packet(JNIEnv *env, jclass clz) {
48891 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
48892 *ret_copy = SendError_too_big_packet();
48893 int64_t ret_ref = tag_ptr(ret_copy, true);
48897 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1few_1blinded_1hops(JNIEnv *env, jclass clz) {
48898 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
48899 *ret_copy = SendError_too_few_blinded_hops();
48900 int64_t ret_ref = tag_ptr(ret_copy, true);
48904 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1first_1hop(JNIEnv *env, jclass clz) {
48905 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
48906 *ret_copy = SendError_invalid_first_hop();
48907 int64_t ret_ref = tag_ptr(ret_copy, true);
48911 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message(JNIEnv *env, jclass clz) {
48912 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
48913 *ret_copy = SendError_invalid_message();
48914 int64_t ret_ref = tag_ptr(ret_copy, true);
48918 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNIEnv *env, jclass clz) {
48919 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
48920 *ret_copy = SendError_buffer_full();
48921 int64_t ret_ref = tag_ptr(ret_copy, true);
48925 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
48926 LDKSendError* a_conv = (LDKSendError*)untag_ptr(a);
48927 LDKSendError* b_conv = (LDKSendError*)untag_ptr(b);
48928 jboolean ret_conv = SendError_eq(a_conv, b_conv);
48932 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
48933 if (!ptr_is_owned(this_ptr)) return;
48934 void* this_ptr_ptr = untag_ptr(this_ptr);
48935 CHECK_ACCESS(this_ptr_ptr);
48936 LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr);
48937 FREE(untag_ptr(this_ptr));
48938 CustomOnionMessageHandler_free(this_ptr_conv);
48941 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t logger, int64_t custom_handler) {
48942 void* keys_manager_ptr = untag_ptr(keys_manager);
48943 CHECK_ACCESS(keys_manager_ptr);
48944 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
48945 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
48946 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48947 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
48949 void* logger_ptr = untag_ptr(logger);
48950 CHECK_ACCESS(logger_ptr);
48951 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
48952 if (logger_conv.free == LDKLogger_JCalls_free) {
48953 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48954 LDKLogger_JCalls_cloned(&logger_conv);
48956 void* custom_handler_ptr = untag_ptr(custom_handler);
48957 CHECK_ACCESS(custom_handler_ptr);
48958 LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr);
48959 if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) {
48960 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48961 LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv);
48963 LDKOnionMessenger ret_var = OnionMessenger_new(keys_manager_conv, logger_conv, custom_handler_conv);
48964 int64_t ret_ref = 0;
48965 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48966 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48970 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1custom_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, jobjectArray intermediate_nodes, int64_t destination, int64_t msg, int64_t reply_path) {
48971 LDKOnionMessenger this_arg_conv;
48972 this_arg_conv.inner = untag_ptr(this_arg);
48973 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48975 this_arg_conv.is_owned = false;
48976 LDKCVec_PublicKeyZ intermediate_nodes_constr;
48977 intermediate_nodes_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes);
48978 if (intermediate_nodes_constr.datalen > 0)
48979 intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
48981 intermediate_nodes_constr.data = NULL;
48982 for (size_t i = 0; i < intermediate_nodes_constr.datalen; i++) {
48983 int8_tArray intermediate_nodes_conv_8 = (*env)->GetObjectArrayElement(env, intermediate_nodes, i);
48984 LDKPublicKey intermediate_nodes_conv_8_ref;
48985 CHECK((*env)->GetArrayLength(env, intermediate_nodes_conv_8) == 33);
48986 (*env)->GetByteArrayRegion(env, intermediate_nodes_conv_8, 0, 33, intermediate_nodes_conv_8_ref.compressed_form);
48987 intermediate_nodes_constr.data[i] = intermediate_nodes_conv_8_ref;
48989 void* destination_ptr = untag_ptr(destination);
48990 CHECK_ACCESS(destination_ptr);
48991 LDKDestination destination_conv = *(LDKDestination*)(destination_ptr);
48992 // WARNING: we may need a move here but no clone is available for LDKDestination
48993 void* msg_ptr = untag_ptr(msg);
48994 CHECK_ACCESS(msg_ptr);
48995 LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
48996 if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
48997 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48998 LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
49000 LDKBlindedRoute reply_path_conv;
49001 reply_path_conv.inner = untag_ptr(reply_path);
49002 reply_path_conv.is_owned = ptr_is_owned(reply_path);
49003 CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv);
49004 reply_path_conv.is_owned = false;
49005 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
49006 *ret_conv = OnionMessenger_send_custom_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, msg_conv, reply_path_conv);
49007 return tag_ptr(ret_conv, true);
49010 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
49011 LDKOnionMessenger this_arg_conv;
49012 this_arg_conv.inner = untag_ptr(this_arg);
49013 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49014 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49015 this_arg_conv.is_owned = false;
49016 LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
49017 *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv);
49018 return tag_ptr(ret_ret, true);
49021 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
49022 LDKOnionMessenger this_arg_conv;
49023 this_arg_conv.inner = untag_ptr(this_arg);
49024 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49025 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49026 this_arg_conv.is_owned = false;
49027 LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
49028 *ret_ret = OnionMessenger_as_OnionMessageProvider(&this_arg_conv);
49029 return tag_ptr(ret_ret, true);
49032 static inline uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg) {
49033 LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
49034 *ret_ret = CustomOnionMessageContents_clone(arg);
49035 return tag_ptr(ret_ret, true);
49037 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49038 void* arg_ptr = untag_ptr(arg);
49039 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
49040 LDKCustomOnionMessageContents* arg_conv = (LDKCustomOnionMessageContents*)arg_ptr;
49041 int64_t ret_conv = CustomOnionMessageContents_clone_ptr(arg_conv);
49045 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49046 void* orig_ptr = untag_ptr(orig);
49047 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
49048 LDKCustomOnionMessageContents* orig_conv = (LDKCustomOnionMessageContents*)orig_ptr;
49049 LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
49050 *ret_ret = CustomOnionMessageContents_clone(orig_conv);
49051 return tag_ptr(ret_ret, true);
49054 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
49055 if (!ptr_is_owned(this_ptr)) return;
49056 void* this_ptr_ptr = untag_ptr(this_ptr);
49057 CHECK_ACCESS(this_ptr_ptr);
49058 LDKCustomOnionMessageContents this_ptr_conv = *(LDKCustomOnionMessageContents*)(this_ptr_ptr);
49059 FREE(untag_ptr(this_ptr));
49060 CustomOnionMessageContents_free(this_ptr_conv);
49063 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49064 LDKFilesystemPersister this_obj_conv;
49065 this_obj_conv.inner = untag_ptr(this_obj);
49066 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49067 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49068 FilesystemPersister_free(this_obj_conv);
49071 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1new(JNIEnv *env, jclass clz, jstring path_to_channel_data) {
49072 LDKStr path_to_channel_data_conv = java_to_owned_str(env, path_to_channel_data);
49073 LDKFilesystemPersister ret_var = FilesystemPersister_new(path_to_channel_data_conv);
49074 int64_t ret_ref = 0;
49075 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49076 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49080 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1data_1dir(JNIEnv *env, jclass clz, int64_t this_arg) {
49081 LDKFilesystemPersister this_arg_conv;
49082 this_arg_conv.inner = untag_ptr(this_arg);
49083 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49085 this_arg_conv.is_owned = false;
49086 LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv);
49087 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
49092 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1channelmonitors(JNIEnv *env, jclass clz, int64_t this_arg, int64_t keys_manager) {
49093 LDKFilesystemPersister this_arg_conv;
49094 this_arg_conv.inner = untag_ptr(this_arg);
49095 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49096 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49097 this_arg_conv.is_owned = false;
49098 void* keys_manager_ptr = untag_ptr(keys_manager);
49099 CHECK_ACCESS(keys_manager_ptr);
49100 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
49101 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
49102 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
49103 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
49105 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
49106 *ret_conv = FilesystemPersister_read_channelmonitors(&this_arg_conv, keys_manager_conv);
49107 return tag_ptr(ret_conv, true);
49110 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49111 LDKBackgroundProcessor this_obj_conv;
49112 this_obj_conv.inner = untag_ptr(this_obj);
49113 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49114 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49115 BackgroundProcessor_free(this_obj_conv);
49118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipSync_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
49119 if (!ptr_is_owned(this_ptr)) return;
49120 void* this_ptr_ptr = untag_ptr(this_ptr);
49121 CHECK_ACCESS(this_ptr_ptr);
49122 LDKGossipSync this_ptr_conv = *(LDKGossipSync*)(this_ptr_ptr);
49123 FREE(untag_ptr(this_ptr));
49124 GossipSync_free(this_ptr_conv);
49127 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1p2_1p(JNIEnv *env, jclass clz, int64_t a) {
49128 LDKP2PGossipSync a_conv;
49129 a_conv.inner = untag_ptr(a);
49130 a_conv.is_owned = ptr_is_owned(a);
49131 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49132 a_conv.is_owned = false;
49133 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
49134 *ret_copy = GossipSync_p2_p(&a_conv);
49135 int64_t ret_ref = tag_ptr(ret_copy, true);
49139 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1rapid(JNIEnv *env, jclass clz, int64_t a) {
49140 LDKRapidGossipSync a_conv;
49141 a_conv.inner = untag_ptr(a);
49142 a_conv.is_owned = ptr_is_owned(a);
49143 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49144 a_conv.is_owned = false;
49145 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
49146 *ret_copy = GossipSync_rapid(&a_conv);
49147 int64_t ret_ref = tag_ptr(ret_copy, true);
49151 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1none(JNIEnv *env, jclass clz) {
49152 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
49153 *ret_copy = GossipSync_none();
49154 int64_t ret_ref = tag_ptr(ret_copy, true);
49158 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) {
49159 void* persister_ptr = untag_ptr(persister);
49160 CHECK_ACCESS(persister_ptr);
49161 LDKPersister persister_conv = *(LDKPersister*)(persister_ptr);
49162 if (persister_conv.free == LDKPersister_JCalls_free) {
49163 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
49164 LDKPersister_JCalls_cloned(&persister_conv);
49166 void* event_handler_ptr = untag_ptr(event_handler);
49167 CHECK_ACCESS(event_handler_ptr);
49168 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
49169 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
49170 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
49171 LDKEventHandler_JCalls_cloned(&event_handler_conv);
49173 LDKChainMonitor chain_monitor_conv;
49174 chain_monitor_conv.inner = untag_ptr(chain_monitor);
49175 chain_monitor_conv.is_owned = ptr_is_owned(chain_monitor);
49176 CHECK_INNER_FIELD_ACCESS_OR_NULL(chain_monitor_conv);
49177 chain_monitor_conv.is_owned = false;
49178 LDKChannelManager channel_manager_conv;
49179 channel_manager_conv.inner = untag_ptr(channel_manager);
49180 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
49181 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
49182 channel_manager_conv.is_owned = false;
49183 void* gossip_sync_ptr = untag_ptr(gossip_sync);
49184 CHECK_ACCESS(gossip_sync_ptr);
49185 LDKGossipSync gossip_sync_conv = *(LDKGossipSync*)(gossip_sync_ptr);
49186 // WARNING: we may need a move here but no clone is available for LDKGossipSync
49187 LDKPeerManager peer_manager_conv;
49188 peer_manager_conv.inner = untag_ptr(peer_manager);
49189 peer_manager_conv.is_owned = ptr_is_owned(peer_manager);
49190 CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_manager_conv);
49191 peer_manager_conv.is_owned = false;
49192 void* logger_ptr = untag_ptr(logger);
49193 CHECK_ACCESS(logger_ptr);
49194 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
49195 if (logger_conv.free == LDKLogger_JCalls_free) {
49196 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
49197 LDKLogger_JCalls_cloned(&logger_conv);
49199 void* scorer_ptr = untag_ptr(scorer);
49200 CHECK_ACCESS(scorer_ptr);
49201 LDKCOption_WriteableScoreZ scorer_conv = *(LDKCOption_WriteableScoreZ*)(scorer_ptr);
49202 // WARNING: we may need a move here but no clone is available for LDKCOption_WriteableScoreZ
49203 if (scorer_conv.tag == LDKCOption_WriteableScoreZ_Some) {
49204 // Manually implement clone for Java trait instances
49205 if (scorer_conv.some.free == LDKWriteableScore_JCalls_free) {
49206 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
49207 LDKWriteableScore_JCalls_cloned(&scorer_conv.some);
49210 LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv);
49211 int64_t ret_ref = 0;
49212 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49213 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49217 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1join(JNIEnv *env, jclass clz, int64_t this_arg) {
49218 LDKBackgroundProcessor this_arg_conv;
49219 this_arg_conv.inner = untag_ptr(this_arg);
49220 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49222 // WARNING: we need a move here but no clone is available for LDKBackgroundProcessor
49224 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
49225 *ret_conv = BackgroundProcessor_join(this_arg_conv);
49226 return tag_ptr(ret_conv, true);
49229 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1stop(JNIEnv *env, jclass clz, int64_t this_arg) {
49230 LDKBackgroundProcessor this_arg_conv;
49231 this_arg_conv.inner = untag_ptr(this_arg);
49232 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49233 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49234 // WARNING: we need a move here but no clone is available for LDKBackgroundProcessor
49236 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
49237 *ret_conv = BackgroundProcessor_stop(this_arg_conv);
49238 return tag_ptr(ret_conv, true);
49241 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
49242 if (!ptr_is_owned(this_ptr)) return;
49243 void* this_ptr_ptr = untag_ptr(this_ptr);
49244 CHECK_ACCESS(this_ptr_ptr);
49245 LDKParseError this_ptr_conv = *(LDKParseError*)(this_ptr_ptr);
49246 FREE(untag_ptr(this_ptr));
49247 ParseError_free(this_ptr_conv);
49250 static inline uint64_t ParseError_clone_ptr(LDKParseError *NONNULL_PTR arg) {
49251 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49252 *ret_copy = ParseError_clone(arg);
49253 int64_t ret_ref = tag_ptr(ret_copy, true);
49256 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49257 LDKParseError* arg_conv = (LDKParseError*)untag_ptr(arg);
49258 int64_t ret_conv = ParseError_clone_ptr(arg_conv);
49262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49263 LDKParseError* orig_conv = (LDKParseError*)untag_ptr(orig);
49264 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49265 *ret_copy = ParseError_clone(orig_conv);
49266 int64_t ret_ref = tag_ptr(ret_copy, true);
49270 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1bech32_1error(JNIEnv *env, jclass clz, int64_t a) {
49271 void* a_ptr = untag_ptr(a);
49272 CHECK_ACCESS(a_ptr);
49273 LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr);
49274 a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a));
49275 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49276 *ret_copy = ParseError_bech32_error(a_conv);
49277 int64_t ret_ref = tag_ptr(ret_copy, true);
49281 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1parse_1amount_1error(JNIEnv *env, jclass clz, int32_t a) {
49283 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49284 *ret_copy = ParseError_parse_amount_error((LDKError){ ._dummy = 0 });
49285 int64_t ret_ref = tag_ptr(ret_copy, true);
49289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1malformed_1signature(JNIEnv *env, jclass clz, jclass a) {
49290 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a);
49291 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49292 *ret_copy = ParseError_malformed_signature(a_conv);
49293 int64_t ret_ref = tag_ptr(ret_copy, true);
49297 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1bad_1prefix(JNIEnv *env, jclass clz) {
49298 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49299 *ret_copy = ParseError_bad_prefix();
49300 int64_t ret_ref = tag_ptr(ret_copy, true);
49304 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unknown_1currency(JNIEnv *env, jclass clz) {
49305 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49306 *ret_copy = ParseError_unknown_currency();
49307 int64_t ret_ref = tag_ptr(ret_copy, true);
49311 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unknown_1si_1prefix(JNIEnv *env, jclass clz) {
49312 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49313 *ret_copy = ParseError_unknown_si_prefix();
49314 int64_t ret_ref = tag_ptr(ret_copy, true);
49318 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1malformed_1hrp(JNIEnv *env, jclass clz) {
49319 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49320 *ret_copy = ParseError_malformed_hrp();
49321 int64_t ret_ref = tag_ptr(ret_copy, true);
49325 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1too_1short_1data_1part(JNIEnv *env, jclass clz) {
49326 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49327 *ret_copy = ParseError_too_short_data_part();
49328 int64_t ret_ref = tag_ptr(ret_copy, true);
49332 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unexpected_1end_1of_1tagged_1fields(JNIEnv *env, jclass clz) {
49333 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49334 *ret_copy = ParseError_unexpected_end_of_tagged_fields();
49335 int64_t ret_ref = tag_ptr(ret_copy, true);
49339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1description_1decode_1error(JNIEnv *env, jclass clz, int32_t a) {
49341 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49342 *ret_copy = ParseError_description_decode_error((LDKError){ ._dummy = 0 });
49343 int64_t ret_ref = tag_ptr(ret_copy, true);
49347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1padding_1error(JNIEnv *env, jclass clz) {
49348 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49349 *ret_copy = ParseError_padding_error();
49350 int64_t ret_ref = tag_ptr(ret_copy, true);
49354 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1integer_1overflow_1error(JNIEnv *env, jclass clz) {
49355 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49356 *ret_copy = ParseError_integer_overflow_error();
49357 int64_t ret_ref = tag_ptr(ret_copy, true);
49361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1seg_1wit_1program_1length(JNIEnv *env, jclass clz) {
49362 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49363 *ret_copy = ParseError_invalid_seg_wit_program_length();
49364 int64_t ret_ref = tag_ptr(ret_copy, true);
49368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1pub_1key_1hash_1length(JNIEnv *env, jclass clz) {
49369 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49370 *ret_copy = ParseError_invalid_pub_key_hash_length();
49371 int64_t ret_ref = tag_ptr(ret_copy, true);
49375 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1script_1hash_1length(JNIEnv *env, jclass clz) {
49376 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49377 *ret_copy = ParseError_invalid_script_hash_length();
49378 int64_t ret_ref = tag_ptr(ret_copy, true);
49382 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) {
49383 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49384 *ret_copy = ParseError_invalid_recovery_id();
49385 int64_t ret_ref = tag_ptr(ret_copy, true);
49389 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1slice_1length(JNIEnv *env, jclass clz, jstring a) {
49390 LDKStr a_conv = java_to_owned_str(env, a);
49391 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49392 *ret_copy = ParseError_invalid_slice_length(a_conv);
49393 int64_t ret_ref = tag_ptr(ret_copy, true);
49397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1skip(JNIEnv *env, jclass clz) {
49398 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
49399 *ret_copy = ParseError_skip();
49400 int64_t ret_ref = tag_ptr(ret_copy, true);
49404 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49405 LDKParseError* a_conv = (LDKParseError*)untag_ptr(a);
49406 LDKParseError* b_conv = (LDKParseError*)untag_ptr(b);
49407 jboolean ret_conv = ParseError_eq(a_conv, b_conv);
49411 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
49412 if (!ptr_is_owned(this_ptr)) return;
49413 void* this_ptr_ptr = untag_ptr(this_ptr);
49414 CHECK_ACCESS(this_ptr_ptr);
49415 LDKParseOrSemanticError this_ptr_conv = *(LDKParseOrSemanticError*)(this_ptr_ptr);
49416 FREE(untag_ptr(this_ptr));
49417 ParseOrSemanticError_free(this_ptr_conv);
49420 static inline uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg) {
49421 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
49422 *ret_copy = ParseOrSemanticError_clone(arg);
49423 int64_t ret_ref = tag_ptr(ret_copy, true);
49426 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49427 LDKParseOrSemanticError* arg_conv = (LDKParseOrSemanticError*)untag_ptr(arg);
49428 int64_t ret_conv = ParseOrSemanticError_clone_ptr(arg_conv);
49432 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49433 LDKParseOrSemanticError* orig_conv = (LDKParseOrSemanticError*)untag_ptr(orig);
49434 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
49435 *ret_copy = ParseOrSemanticError_clone(orig_conv);
49436 int64_t ret_ref = tag_ptr(ret_copy, true);
49440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1parse_1error(JNIEnv *env, jclass clz, int64_t a) {
49441 void* a_ptr = untag_ptr(a);
49442 CHECK_ACCESS(a_ptr);
49443 LDKParseError a_conv = *(LDKParseError*)(a_ptr);
49444 a_conv = ParseError_clone((LDKParseError*)untag_ptr(a));
49445 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
49446 *ret_copy = ParseOrSemanticError_parse_error(a_conv);
49447 int64_t ret_ref = tag_ptr(ret_copy, true);
49451 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1semantic_1error(JNIEnv *env, jclass clz, jclass a) {
49452 LDKSemanticError a_conv = LDKSemanticError_from_java(env, a);
49453 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
49454 *ret_copy = ParseOrSemanticError_semantic_error(a_conv);
49455 int64_t ret_ref = tag_ptr(ret_copy, true);
49459 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49460 LDKParseOrSemanticError* a_conv = (LDKParseOrSemanticError*)untag_ptr(a);
49461 LDKParseOrSemanticError* b_conv = (LDKParseOrSemanticError*)untag_ptr(b);
49462 jboolean ret_conv = ParseOrSemanticError_eq(a_conv, b_conv);
49466 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49467 LDKInvoice this_obj_conv;
49468 this_obj_conv.inner = untag_ptr(this_obj);
49469 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49471 Invoice_free(this_obj_conv);
49474 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49476 a_conv.inner = untag_ptr(a);
49477 a_conv.is_owned = ptr_is_owned(a);
49478 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49479 a_conv.is_owned = false;
49481 b_conv.inner = untag_ptr(b);
49482 b_conv.is_owned = ptr_is_owned(b);
49483 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49484 b_conv.is_owned = false;
49485 jboolean ret_conv = Invoice_eq(&a_conv, &b_conv);
49489 static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) {
49490 LDKInvoice ret_var = Invoice_clone(arg);
49491 int64_t ret_ref = 0;
49492 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49493 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49496 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49497 LDKInvoice arg_conv;
49498 arg_conv.inner = untag_ptr(arg);
49499 arg_conv.is_owned = ptr_is_owned(arg);
49500 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49501 arg_conv.is_owned = false;
49502 int64_t ret_conv = Invoice_clone_ptr(&arg_conv);
49506 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49507 LDKInvoice orig_conv;
49508 orig_conv.inner = untag_ptr(orig);
49509 orig_conv.is_owned = ptr_is_owned(orig);
49510 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49511 orig_conv.is_owned = false;
49512 LDKInvoice ret_var = Invoice_clone(&orig_conv);
49513 int64_t ret_ref = 0;
49514 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49515 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49519 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1hash(JNIEnv *env, jclass clz, int64_t o) {
49521 o_conv.inner = untag_ptr(o);
49522 o_conv.is_owned = ptr_is_owned(o);
49523 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
49524 o_conv.is_owned = false;
49525 int64_t ret_conv = Invoice_hash(&o_conv);
49529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49530 LDKSignedRawInvoice this_obj_conv;
49531 this_obj_conv.inner = untag_ptr(this_obj);
49532 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49533 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49534 SignedRawInvoice_free(this_obj_conv);
49537 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49538 LDKSignedRawInvoice a_conv;
49539 a_conv.inner = untag_ptr(a);
49540 a_conv.is_owned = ptr_is_owned(a);
49541 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49542 a_conv.is_owned = false;
49543 LDKSignedRawInvoice b_conv;
49544 b_conv.inner = untag_ptr(b);
49545 b_conv.is_owned = ptr_is_owned(b);
49546 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49547 b_conv.is_owned = false;
49548 jboolean ret_conv = SignedRawInvoice_eq(&a_conv, &b_conv);
49552 static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) {
49553 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg);
49554 int64_t ret_ref = 0;
49555 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49556 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49559 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49560 LDKSignedRawInvoice arg_conv;
49561 arg_conv.inner = untag_ptr(arg);
49562 arg_conv.is_owned = ptr_is_owned(arg);
49563 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49564 arg_conv.is_owned = false;
49565 int64_t ret_conv = SignedRawInvoice_clone_ptr(&arg_conv);
49569 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49570 LDKSignedRawInvoice orig_conv;
49571 orig_conv.inner = untag_ptr(orig);
49572 orig_conv.is_owned = ptr_is_owned(orig);
49573 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49574 orig_conv.is_owned = false;
49575 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv);
49576 int64_t ret_ref = 0;
49577 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49578 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49582 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1hash(JNIEnv *env, jclass clz, int64_t o) {
49583 LDKSignedRawInvoice o_conv;
49584 o_conv.inner = untag_ptr(o);
49585 o_conv.is_owned = ptr_is_owned(o);
49586 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
49587 o_conv.is_owned = false;
49588 int64_t ret_conv = SignedRawInvoice_hash(&o_conv);
49592 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49593 LDKRawInvoice this_obj_conv;
49594 this_obj_conv.inner = untag_ptr(this_obj);
49595 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49596 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49597 RawInvoice_free(this_obj_conv);
49600 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
49601 LDKRawInvoice this_ptr_conv;
49602 this_ptr_conv.inner = untag_ptr(this_ptr);
49603 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49604 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49605 this_ptr_conv.is_owned = false;
49606 LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv);
49607 int64_t ret_ref = 0;
49608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49613 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49614 LDKRawInvoice this_ptr_conv;
49615 this_ptr_conv.inner = untag_ptr(this_ptr);
49616 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49618 this_ptr_conv.is_owned = false;
49619 LDKRawDataPart val_conv;
49620 val_conv.inner = untag_ptr(val);
49621 val_conv.is_owned = ptr_is_owned(val);
49622 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49623 val_conv = RawDataPart_clone(&val_conv);
49624 RawInvoice_set_data(&this_ptr_conv, val_conv);
49627 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawInvoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49628 LDKRawInvoice a_conv;
49629 a_conv.inner = untag_ptr(a);
49630 a_conv.is_owned = ptr_is_owned(a);
49631 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49632 a_conv.is_owned = false;
49633 LDKRawInvoice b_conv;
49634 b_conv.inner = untag_ptr(b);
49635 b_conv.is_owned = ptr_is_owned(b);
49636 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49637 b_conv.is_owned = false;
49638 jboolean ret_conv = RawInvoice_eq(&a_conv, &b_conv);
49642 static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) {
49643 LDKRawInvoice ret_var = RawInvoice_clone(arg);
49644 int64_t ret_ref = 0;
49645 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49646 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49650 LDKRawInvoice arg_conv;
49651 arg_conv.inner = untag_ptr(arg);
49652 arg_conv.is_owned = ptr_is_owned(arg);
49653 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49654 arg_conv.is_owned = false;
49655 int64_t ret_conv = RawInvoice_clone_ptr(&arg_conv);
49659 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49660 LDKRawInvoice orig_conv;
49661 orig_conv.inner = untag_ptr(orig);
49662 orig_conv.is_owned = ptr_is_owned(orig);
49663 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49664 orig_conv.is_owned = false;
49665 LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv);
49666 int64_t ret_ref = 0;
49667 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49668 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1hash(JNIEnv *env, jclass clz, int64_t o) {
49673 LDKRawInvoice o_conv;
49674 o_conv.inner = untag_ptr(o);
49675 o_conv.is_owned = ptr_is_owned(o);
49676 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
49677 o_conv.is_owned = false;
49678 int64_t ret_conv = RawInvoice_hash(&o_conv);
49682 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49683 LDKRawDataPart this_obj_conv;
49684 this_obj_conv.inner = untag_ptr(this_obj);
49685 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49687 RawDataPart_free(this_obj_conv);
49690 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
49691 LDKRawDataPart this_ptr_conv;
49692 this_ptr_conv.inner = untag_ptr(this_ptr);
49693 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49695 this_ptr_conv.is_owned = false;
49696 LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv);
49697 int64_t ret_ref = 0;
49698 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49699 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49703 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49704 LDKRawDataPart this_ptr_conv;
49705 this_ptr_conv.inner = untag_ptr(this_ptr);
49706 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49708 this_ptr_conv.is_owned = false;
49709 LDKPositiveTimestamp val_conv;
49710 val_conv.inner = untag_ptr(val);
49711 val_conv.is_owned = ptr_is_owned(val);
49712 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49713 val_conv = PositiveTimestamp_clone(&val_conv);
49714 RawDataPart_set_timestamp(&this_ptr_conv, val_conv);
49717 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawDataPart_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49718 LDKRawDataPart a_conv;
49719 a_conv.inner = untag_ptr(a);
49720 a_conv.is_owned = ptr_is_owned(a);
49721 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49722 a_conv.is_owned = false;
49723 LDKRawDataPart b_conv;
49724 b_conv.inner = untag_ptr(b);
49725 b_conv.is_owned = ptr_is_owned(b);
49726 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49727 b_conv.is_owned = false;
49728 jboolean ret_conv = RawDataPart_eq(&a_conv, &b_conv);
49732 static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) {
49733 LDKRawDataPart ret_var = RawDataPart_clone(arg);
49734 int64_t ret_ref = 0;
49735 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49736 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49739 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49740 LDKRawDataPart arg_conv;
49741 arg_conv.inner = untag_ptr(arg);
49742 arg_conv.is_owned = ptr_is_owned(arg);
49743 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49744 arg_conv.is_owned = false;
49745 int64_t ret_conv = RawDataPart_clone_ptr(&arg_conv);
49749 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49750 LDKRawDataPart orig_conv;
49751 orig_conv.inner = untag_ptr(orig);
49752 orig_conv.is_owned = ptr_is_owned(orig);
49753 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49754 orig_conv.is_owned = false;
49755 LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv);
49756 int64_t ret_ref = 0;
49757 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49758 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49762 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1hash(JNIEnv *env, jclass clz, int64_t o) {
49763 LDKRawDataPart o_conv;
49764 o_conv.inner = untag_ptr(o);
49765 o_conv.is_owned = ptr_is_owned(o);
49766 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
49767 o_conv.is_owned = false;
49768 int64_t ret_conv = RawDataPart_hash(&o_conv);
49772 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49773 LDKPositiveTimestamp this_obj_conv;
49774 this_obj_conv.inner = untag_ptr(this_obj);
49775 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49776 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49777 PositiveTimestamp_free(this_obj_conv);
49780 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49781 LDKPositiveTimestamp a_conv;
49782 a_conv.inner = untag_ptr(a);
49783 a_conv.is_owned = ptr_is_owned(a);
49784 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49785 a_conv.is_owned = false;
49786 LDKPositiveTimestamp b_conv;
49787 b_conv.inner = untag_ptr(b);
49788 b_conv.is_owned = ptr_is_owned(b);
49789 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49790 b_conv.is_owned = false;
49791 jboolean ret_conv = PositiveTimestamp_eq(&a_conv, &b_conv);
49795 static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) {
49796 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg);
49797 int64_t ret_ref = 0;
49798 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49799 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49803 LDKPositiveTimestamp arg_conv;
49804 arg_conv.inner = untag_ptr(arg);
49805 arg_conv.is_owned = ptr_is_owned(arg);
49806 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49807 arg_conv.is_owned = false;
49808 int64_t ret_conv = PositiveTimestamp_clone_ptr(&arg_conv);
49812 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49813 LDKPositiveTimestamp orig_conv;
49814 orig_conv.inner = untag_ptr(orig);
49815 orig_conv.is_owned = ptr_is_owned(orig);
49816 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49817 orig_conv.is_owned = false;
49818 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv);
49819 int64_t ret_ref = 0;
49820 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49821 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1hash(JNIEnv *env, jclass clz, int64_t o) {
49826 LDKPositiveTimestamp o_conv;
49827 o_conv.inner = untag_ptr(o);
49828 o_conv.is_owned = ptr_is_owned(o);
49829 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
49830 o_conv.is_owned = false;
49831 int64_t ret_conv = PositiveTimestamp_hash(&o_conv);
49835 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49836 LDKSiPrefix* orig_conv = (LDKSiPrefix*)untag_ptr(orig);
49837 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_clone(orig_conv));
49841 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1milli(JNIEnv *env, jclass clz) {
49842 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_milli());
49846 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1micro(JNIEnv *env, jclass clz) {
49847 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_micro());
49851 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1nano(JNIEnv *env, jclass clz) {
49852 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_nano());
49856 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1pico(JNIEnv *env, jclass clz) {
49857 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_pico());
49861 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SiPrefix_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49862 LDKSiPrefix* a_conv = (LDKSiPrefix*)untag_ptr(a);
49863 LDKSiPrefix* b_conv = (LDKSiPrefix*)untag_ptr(b);
49864 jboolean ret_conv = SiPrefix_eq(a_conv, b_conv);
49868 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1hash(JNIEnv *env, jclass clz, int64_t o) {
49869 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
49870 int64_t ret_conv = SiPrefix_hash(o_conv);
49874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1multiplier(JNIEnv *env, jclass clz, int64_t this_arg) {
49875 LDKSiPrefix* this_arg_conv = (LDKSiPrefix*)untag_ptr(this_arg);
49876 int64_t ret_conv = SiPrefix_multiplier(this_arg_conv);
49880 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49881 LDKCurrency* orig_conv = (LDKCurrency*)untag_ptr(orig);
49882 jclass ret_conv = LDKCurrency_to_java(env, Currency_clone(orig_conv));
49886 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin(JNIEnv *env, jclass clz) {
49887 jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin());
49891 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin_1testnet(JNIEnv *env, jclass clz) {
49892 jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin_testnet());
49896 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1regtest(JNIEnv *env, jclass clz) {
49897 jclass ret_conv = LDKCurrency_to_java(env, Currency_regtest());
49901 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1simnet(JNIEnv *env, jclass clz) {
49902 jclass ret_conv = LDKCurrency_to_java(env, Currency_simnet());
49906 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1signet(JNIEnv *env, jclass clz) {
49907 jclass ret_conv = LDKCurrency_to_java(env, Currency_signet());
49911 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Currency_1hash(JNIEnv *env, jclass clz, int64_t o) {
49912 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
49913 int64_t ret_conv = Currency_hash(o_conv);
49917 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Currency_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49918 LDKCurrency* a_conv = (LDKCurrency*)untag_ptr(a);
49919 LDKCurrency* b_conv = (LDKCurrency*)untag_ptr(b);
49920 jboolean ret_conv = Currency_eq(a_conv, b_conv);
49924 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sha256_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49925 LDKSha256 this_obj_conv;
49926 this_obj_conv.inner = untag_ptr(this_obj);
49927 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49929 Sha256_free(this_obj_conv);
49932 static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) {
49933 LDKSha256 ret_var = Sha256_clone(arg);
49934 int64_t ret_ref = 0;
49935 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49936 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49939 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49940 LDKSha256 arg_conv;
49941 arg_conv.inner = untag_ptr(arg);
49942 arg_conv.is_owned = ptr_is_owned(arg);
49943 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49944 arg_conv.is_owned = false;
49945 int64_t ret_conv = Sha256_clone_ptr(&arg_conv);
49949 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49950 LDKSha256 orig_conv;
49951 orig_conv.inner = untag_ptr(orig);
49952 orig_conv.is_owned = ptr_is_owned(orig);
49953 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49954 orig_conv.is_owned = false;
49955 LDKSha256 ret_var = Sha256_clone(&orig_conv);
49956 int64_t ret_ref = 0;
49957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49962 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1hash(JNIEnv *env, jclass clz, int64_t o) {
49964 o_conv.inner = untag_ptr(o);
49965 o_conv.is_owned = ptr_is_owned(o);
49966 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
49967 o_conv.is_owned = false;
49968 int64_t ret_conv = Sha256_hash(&o_conv);
49972 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Sha256_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49974 a_conv.inner = untag_ptr(a);
49975 a_conv.is_owned = ptr_is_owned(a);
49976 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49977 a_conv.is_owned = false;
49979 b_conv.inner = untag_ptr(b);
49980 b_conv.is_owned = ptr_is_owned(b);
49981 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49982 b_conv.is_owned = false;
49983 jboolean ret_conv = Sha256_eq(&a_conv, &b_conv);
49987 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Description_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49988 LDKDescription this_obj_conv;
49989 this_obj_conv.inner = untag_ptr(this_obj);
49990 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49992 Description_free(this_obj_conv);
49995 static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) {
49996 LDKDescription ret_var = Description_clone(arg);
49997 int64_t ret_ref = 0;
49998 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49999 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50002 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50003 LDKDescription arg_conv;
50004 arg_conv.inner = untag_ptr(arg);
50005 arg_conv.is_owned = ptr_is_owned(arg);
50006 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50007 arg_conv.is_owned = false;
50008 int64_t ret_conv = Description_clone_ptr(&arg_conv);
50012 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50013 LDKDescription orig_conv;
50014 orig_conv.inner = untag_ptr(orig);
50015 orig_conv.is_owned = ptr_is_owned(orig);
50016 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50017 orig_conv.is_owned = false;
50018 LDKDescription ret_var = Description_clone(&orig_conv);
50019 int64_t ret_ref = 0;
50020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50021 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50025 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1hash(JNIEnv *env, jclass clz, int64_t o) {
50026 LDKDescription o_conv;
50027 o_conv.inner = untag_ptr(o);
50028 o_conv.is_owned = ptr_is_owned(o);
50029 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
50030 o_conv.is_owned = false;
50031 int64_t ret_conv = Description_hash(&o_conv);
50035 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Description_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50036 LDKDescription a_conv;
50037 a_conv.inner = untag_ptr(a);
50038 a_conv.is_owned = ptr_is_owned(a);
50039 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50040 a_conv.is_owned = false;
50041 LDKDescription b_conv;
50042 b_conv.inner = untag_ptr(b);
50043 b_conv.is_owned = ptr_is_owned(b);
50044 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50045 b_conv.is_owned = false;
50046 jboolean ret_conv = Description_eq(&a_conv, &b_conv);
50050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50051 LDKPayeePubKey this_obj_conv;
50052 this_obj_conv.inner = untag_ptr(this_obj);
50053 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50055 PayeePubKey_free(this_obj_conv);
50058 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
50059 LDKPayeePubKey this_ptr_conv;
50060 this_ptr_conv.inner = untag_ptr(this_ptr);
50061 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50062 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50063 this_ptr_conv.is_owned = false;
50064 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
50065 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PayeePubKey_get_a(&this_ptr_conv).compressed_form);
50069 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
50070 LDKPayeePubKey this_ptr_conv;
50071 this_ptr_conv.inner = untag_ptr(this_ptr);
50072 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50074 this_ptr_conv.is_owned = false;
50075 LDKPublicKey val_ref;
50076 CHECK((*env)->GetArrayLength(env, val) == 33);
50077 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
50078 PayeePubKey_set_a(&this_ptr_conv, val_ref);
50081 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) {
50082 LDKPublicKey a_arg_ref;
50083 CHECK((*env)->GetArrayLength(env, a_arg) == 33);
50084 (*env)->GetByteArrayRegion(env, a_arg, 0, 33, a_arg_ref.compressed_form);
50085 LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
50086 int64_t ret_ref = 0;
50087 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50088 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50092 static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) {
50093 LDKPayeePubKey ret_var = PayeePubKey_clone(arg);
50094 int64_t ret_ref = 0;
50095 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50096 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50099 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50100 LDKPayeePubKey arg_conv;
50101 arg_conv.inner = untag_ptr(arg);
50102 arg_conv.is_owned = ptr_is_owned(arg);
50103 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50104 arg_conv.is_owned = false;
50105 int64_t ret_conv = PayeePubKey_clone_ptr(&arg_conv);
50109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50110 LDKPayeePubKey orig_conv;
50111 orig_conv.inner = untag_ptr(orig);
50112 orig_conv.is_owned = ptr_is_owned(orig);
50113 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50114 orig_conv.is_owned = false;
50115 LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv);
50116 int64_t ret_ref = 0;
50117 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50118 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50122 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1hash(JNIEnv *env, jclass clz, int64_t o) {
50123 LDKPayeePubKey o_conv;
50124 o_conv.inner = untag_ptr(o);
50125 o_conv.is_owned = ptr_is_owned(o);
50126 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
50127 o_conv.is_owned = false;
50128 int64_t ret_conv = PayeePubKey_hash(&o_conv);
50132 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50133 LDKPayeePubKey a_conv;
50134 a_conv.inner = untag_ptr(a);
50135 a_conv.is_owned = ptr_is_owned(a);
50136 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50137 a_conv.is_owned = false;
50138 LDKPayeePubKey b_conv;
50139 b_conv.inner = untag_ptr(b);
50140 b_conv.is_owned = ptr_is_owned(b);
50141 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50142 b_conv.is_owned = false;
50143 jboolean ret_conv = PayeePubKey_eq(&a_conv, &b_conv);
50147 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50148 LDKExpiryTime this_obj_conv;
50149 this_obj_conv.inner = untag_ptr(this_obj);
50150 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50152 ExpiryTime_free(this_obj_conv);
50155 static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) {
50156 LDKExpiryTime ret_var = ExpiryTime_clone(arg);
50157 int64_t ret_ref = 0;
50158 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50159 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50163 LDKExpiryTime arg_conv;
50164 arg_conv.inner = untag_ptr(arg);
50165 arg_conv.is_owned = ptr_is_owned(arg);
50166 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50167 arg_conv.is_owned = false;
50168 int64_t ret_conv = ExpiryTime_clone_ptr(&arg_conv);
50172 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50173 LDKExpiryTime orig_conv;
50174 orig_conv.inner = untag_ptr(orig);
50175 orig_conv.is_owned = ptr_is_owned(orig);
50176 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50177 orig_conv.is_owned = false;
50178 LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv);
50179 int64_t ret_ref = 0;
50180 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50181 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1hash(JNIEnv *env, jclass clz, int64_t o) {
50186 LDKExpiryTime o_conv;
50187 o_conv.inner = untag_ptr(o);
50188 o_conv.is_owned = ptr_is_owned(o);
50189 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
50190 o_conv.is_owned = false;
50191 int64_t ret_conv = ExpiryTime_hash(&o_conv);
50195 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50196 LDKExpiryTime a_conv;
50197 a_conv.inner = untag_ptr(a);
50198 a_conv.is_owned = ptr_is_owned(a);
50199 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50200 a_conv.is_owned = false;
50201 LDKExpiryTime b_conv;
50202 b_conv.inner = untag_ptr(b);
50203 b_conv.is_owned = ptr_is_owned(b);
50204 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50205 b_conv.is_owned = false;
50206 jboolean ret_conv = ExpiryTime_eq(&a_conv, &b_conv);
50210 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50211 LDKMinFinalCltvExpiry this_obj_conv;
50212 this_obj_conv.inner = untag_ptr(this_obj);
50213 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50215 MinFinalCltvExpiry_free(this_obj_conv);
50218 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
50219 LDKMinFinalCltvExpiry this_ptr_conv;
50220 this_ptr_conv.inner = untag_ptr(this_ptr);
50221 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50223 this_ptr_conv.is_owned = false;
50224 int64_t ret_conv = MinFinalCltvExpiry_get_a(&this_ptr_conv);
50228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50229 LDKMinFinalCltvExpiry this_ptr_conv;
50230 this_ptr_conv.inner = untag_ptr(this_ptr);
50231 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50232 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50233 this_ptr_conv.is_owned = false;
50234 MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
50237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
50238 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_arg);
50239 int64_t ret_ref = 0;
50240 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50241 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50245 static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) {
50246 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg);
50247 int64_t ret_ref = 0;
50248 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50249 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50252 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50253 LDKMinFinalCltvExpiry arg_conv;
50254 arg_conv.inner = untag_ptr(arg);
50255 arg_conv.is_owned = ptr_is_owned(arg);
50256 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50257 arg_conv.is_owned = false;
50258 int64_t ret_conv = MinFinalCltvExpiry_clone_ptr(&arg_conv);
50262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50263 LDKMinFinalCltvExpiry orig_conv;
50264 orig_conv.inner = untag_ptr(orig);
50265 orig_conv.is_owned = ptr_is_owned(orig);
50266 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50267 orig_conv.is_owned = false;
50268 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv);
50269 int64_t ret_ref = 0;
50270 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50271 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50275 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1hash(JNIEnv *env, jclass clz, int64_t o) {
50276 LDKMinFinalCltvExpiry o_conv;
50277 o_conv.inner = untag_ptr(o);
50278 o_conv.is_owned = ptr_is_owned(o);
50279 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
50280 o_conv.is_owned = false;
50281 int64_t ret_conv = MinFinalCltvExpiry_hash(&o_conv);
50285 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50286 LDKMinFinalCltvExpiry a_conv;
50287 a_conv.inner = untag_ptr(a);
50288 a_conv.is_owned = ptr_is_owned(a);
50289 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50290 a_conv.is_owned = false;
50291 LDKMinFinalCltvExpiry b_conv;
50292 b_conv.inner = untag_ptr(b);
50293 b_conv.is_owned = ptr_is_owned(b);
50294 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50295 b_conv.is_owned = false;
50296 jboolean ret_conv = MinFinalCltvExpiry_eq(&a_conv, &b_conv);
50300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
50301 if (!ptr_is_owned(this_ptr)) return;
50302 void* this_ptr_ptr = untag_ptr(this_ptr);
50303 CHECK_ACCESS(this_ptr_ptr);
50304 LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
50305 FREE(untag_ptr(this_ptr));
50306 Fallback_free(this_ptr_conv);
50309 static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) {
50310 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
50311 *ret_copy = Fallback_clone(arg);
50312 int64_t ret_ref = tag_ptr(ret_copy, true);
50315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50316 LDKFallback* arg_conv = (LDKFallback*)untag_ptr(arg);
50317 int64_t ret_conv = Fallback_clone_ptr(arg_conv);
50321 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50322 LDKFallback* orig_conv = (LDKFallback*)untag_ptr(orig);
50323 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
50324 *ret_copy = Fallback_clone(orig_conv);
50325 int64_t ret_ref = tag_ptr(ret_copy, true);
50329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1seg_1wit_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) {
50331 LDKCVec_u8Z program_ref;
50332 program_ref.datalen = (*env)->GetArrayLength(env, program);
50333 program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
50334 (*env)->GetByteArrayRegion(env, program, 0, program_ref.datalen, program_ref.data);
50335 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
50336 *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
50337 int64_t ret_ref = tag_ptr(ret_copy, true);
50341 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1pub_1key_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
50342 LDKTwentyBytes a_ref;
50343 CHECK((*env)->GetArrayLength(env, a) == 20);
50344 (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
50345 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
50346 *ret_copy = Fallback_pub_key_hash(a_ref);
50347 int64_t ret_ref = tag_ptr(ret_copy, true);
50351 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1script_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
50352 LDKTwentyBytes a_ref;
50353 CHECK((*env)->GetArrayLength(env, a) == 20);
50354 (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
50355 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
50356 *ret_copy = Fallback_script_hash(a_ref);
50357 int64_t ret_ref = tag_ptr(ret_copy, true);
50361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1hash(JNIEnv *env, jclass clz, int64_t o) {
50362 LDKFallback* o_conv = (LDKFallback*)untag_ptr(o);
50363 int64_t ret_conv = Fallback_hash(o_conv);
50367 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Fallback_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50368 LDKFallback* a_conv = (LDKFallback*)untag_ptr(a);
50369 LDKFallback* b_conv = (LDKFallback*)untag_ptr(b);
50370 jboolean ret_conv = Fallback_eq(a_conv, b_conv);
50374 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50375 LDKInvoiceSignature this_obj_conv;
50376 this_obj_conv.inner = untag_ptr(this_obj);
50377 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50379 InvoiceSignature_free(this_obj_conv);
50382 static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) {
50383 LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg);
50384 int64_t ret_ref = 0;
50385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50386 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50389 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50390 LDKInvoiceSignature arg_conv;
50391 arg_conv.inner = untag_ptr(arg);
50392 arg_conv.is_owned = ptr_is_owned(arg);
50393 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50394 arg_conv.is_owned = false;
50395 int64_t ret_conv = InvoiceSignature_clone_ptr(&arg_conv);
50399 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50400 LDKInvoiceSignature orig_conv;
50401 orig_conv.inner = untag_ptr(orig);
50402 orig_conv.is_owned = ptr_is_owned(orig);
50403 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50404 orig_conv.is_owned = false;
50405 LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv);
50406 int64_t ret_ref = 0;
50407 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50408 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50412 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1hash(JNIEnv *env, jclass clz, int64_t o) {
50413 LDKInvoiceSignature o_conv;
50414 o_conv.inner = untag_ptr(o);
50415 o_conv.is_owned = ptr_is_owned(o);
50416 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
50417 o_conv.is_owned = false;
50418 int64_t ret_conv = InvoiceSignature_hash(&o_conv);
50422 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50423 LDKInvoiceSignature a_conv;
50424 a_conv.inner = untag_ptr(a);
50425 a_conv.is_owned = ptr_is_owned(a);
50426 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50427 a_conv.is_owned = false;
50428 LDKInvoiceSignature b_conv;
50429 b_conv.inner = untag_ptr(b);
50430 b_conv.is_owned = ptr_is_owned(b);
50431 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50432 b_conv.is_owned = false;
50433 jboolean ret_conv = InvoiceSignature_eq(&a_conv, &b_conv);
50437 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50438 LDKPrivateRoute this_obj_conv;
50439 this_obj_conv.inner = untag_ptr(this_obj);
50440 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50442 PrivateRoute_free(this_obj_conv);
50445 static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) {
50446 LDKPrivateRoute ret_var = PrivateRoute_clone(arg);
50447 int64_t ret_ref = 0;
50448 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50449 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50453 LDKPrivateRoute arg_conv;
50454 arg_conv.inner = untag_ptr(arg);
50455 arg_conv.is_owned = ptr_is_owned(arg);
50456 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50457 arg_conv.is_owned = false;
50458 int64_t ret_conv = PrivateRoute_clone_ptr(&arg_conv);
50462 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50463 LDKPrivateRoute orig_conv;
50464 orig_conv.inner = untag_ptr(orig);
50465 orig_conv.is_owned = ptr_is_owned(orig);
50466 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50467 orig_conv.is_owned = false;
50468 LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv);
50469 int64_t ret_ref = 0;
50470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50471 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50475 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1hash(JNIEnv *env, jclass clz, int64_t o) {
50476 LDKPrivateRoute o_conv;
50477 o_conv.inner = untag_ptr(o);
50478 o_conv.is_owned = ptr_is_owned(o);
50479 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
50480 o_conv.is_owned = false;
50481 int64_t ret_conv = PrivateRoute_hash(&o_conv);
50485 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50486 LDKPrivateRoute a_conv;
50487 a_conv.inner = untag_ptr(a);
50488 a_conv.is_owned = ptr_is_owned(a);
50489 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50490 a_conv.is_owned = false;
50491 LDKPrivateRoute b_conv;
50492 b_conv.inner = untag_ptr(b);
50493 b_conv.is_owned = ptr_is_owned(b);
50494 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50495 b_conv.is_owned = false;
50496 jboolean ret_conv = PrivateRoute_eq(&a_conv, &b_conv);
50500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1into_1parts(JNIEnv *env, jclass clz, int64_t this_arg) {
50501 LDKSignedRawInvoice this_arg_conv;
50502 this_arg_conv.inner = untag_ptr(this_arg);
50503 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50505 this_arg_conv = SignedRawInvoice_clone(&this_arg_conv);
50506 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
50507 *ret_conv = SignedRawInvoice_into_parts(this_arg_conv);
50508 return tag_ptr(ret_conv, true);
50511 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1raw_1invoice(JNIEnv *env, jclass clz, int64_t this_arg) {
50512 LDKSignedRawInvoice this_arg_conv;
50513 this_arg_conv.inner = untag_ptr(this_arg);
50514 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50516 this_arg_conv.is_owned = false;
50517 LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv);
50518 int64_t ret_ref = 0;
50519 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50520 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50524 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
50525 LDKSignedRawInvoice this_arg_conv;
50526 this_arg_conv.inner = untag_ptr(this_arg);
50527 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50528 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50529 this_arg_conv.is_owned = false;
50530 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
50531 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SignedRawInvoice_signable_hash(&this_arg_conv));
50535 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
50536 LDKSignedRawInvoice this_arg_conv;
50537 this_arg_conv.inner = untag_ptr(this_arg);
50538 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50540 this_arg_conv.is_owned = false;
50541 LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv);
50542 int64_t ret_ref = 0;
50543 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50544 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50548 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1recover_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
50549 LDKSignedRawInvoice this_arg_conv;
50550 this_arg_conv.inner = untag_ptr(this_arg);
50551 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50553 this_arg_conv.is_owned = false;
50554 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
50555 *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv);
50556 return tag_ptr(ret_conv, true);
50559 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1check_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
50560 LDKSignedRawInvoice this_arg_conv;
50561 this_arg_conv.inner = untag_ptr(this_arg);
50562 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50564 this_arg_conv.is_owned = false;
50565 jboolean ret_conv = SignedRawInvoice_check_signature(&this_arg_conv);
50569 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
50570 LDKRawInvoice this_arg_conv;
50571 this_arg_conv.inner = untag_ptr(this_arg);
50572 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50574 this_arg_conv.is_owned = false;
50575 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
50576 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_signable_hash(&this_arg_conv).data);
50580 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
50581 LDKRawInvoice this_arg_conv;
50582 this_arg_conv.inner = untag_ptr(this_arg);
50583 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50584 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50585 this_arg_conv.is_owned = false;
50586 LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
50587 int64_t ret_ref = 0;
50588 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50589 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50593 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) {
50594 LDKRawInvoice this_arg_conv;
50595 this_arg_conv.inner = untag_ptr(this_arg);
50596 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50598 this_arg_conv.is_owned = false;
50599 LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
50600 int64_t ret_ref = 0;
50601 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50602 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50606 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
50607 LDKRawInvoice this_arg_conv;
50608 this_arg_conv.inner = untag_ptr(this_arg);
50609 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50611 this_arg_conv.is_owned = false;
50612 LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
50613 int64_t ret_ref = 0;
50614 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50615 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50619 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
50620 LDKRawInvoice this_arg_conv;
50621 this_arg_conv.inner = untag_ptr(this_arg);
50622 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50624 this_arg_conv.is_owned = false;
50625 LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
50626 int64_t ret_ref = 0;
50627 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50628 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50632 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
50633 LDKRawInvoice this_arg_conv;
50634 this_arg_conv.inner = untag_ptr(this_arg);
50635 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50637 this_arg_conv.is_owned = false;
50638 LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
50639 int64_t ret_ref = 0;
50640 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50641 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50645 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1min_1final_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) {
50646 LDKRawInvoice this_arg_conv;
50647 this_arg_conv.inner = untag_ptr(this_arg);
50648 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50649 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50650 this_arg_conv.is_owned = false;
50651 LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
50652 int64_t ret_ref = 0;
50653 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50654 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50658 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
50659 LDKRawInvoice this_arg_conv;
50660 this_arg_conv.inner = untag_ptr(this_arg);
50661 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50663 this_arg_conv.is_owned = false;
50664 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
50665 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_payment_secret(&this_arg_conv).data);
50669 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
50670 LDKRawInvoice this_arg_conv;
50671 this_arg_conv.inner = untag_ptr(this_arg);
50672 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50674 this_arg_conv.is_owned = false;
50675 LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
50676 int64_t ret_ref = 0;
50677 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50678 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50682 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1routes(JNIEnv *env, jclass clz, int64_t this_arg) {
50683 LDKRawInvoice this_arg_conv;
50684 this_arg_conv.inner = untag_ptr(this_arg);
50685 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50687 this_arg_conv.is_owned = false;
50688 LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
50689 int64_tArray ret_arr = NULL;
50690 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
50691 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
50692 for (size_t o = 0; o < ret_var.datalen; o++) {
50693 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
50694 int64_t ret_conv_14_ref = 0;
50695 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
50696 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
50697 ret_arr_ptr[o] = ret_conv_14_ref;
50699 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
50700 FREE(ret_var.data);
50704 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1amount_1pico_1btc(JNIEnv *env, jclass clz, int64_t this_arg) {
50705 LDKRawInvoice this_arg_conv;
50706 this_arg_conv.inner = untag_ptr(this_arg);
50707 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50709 this_arg_conv.is_owned = false;
50710 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
50711 *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv);
50712 int64_t ret_ref = tag_ptr(ret_copy, true);
50716 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RawInvoice_1currency(JNIEnv *env, jclass clz, int64_t this_arg) {
50717 LDKRawInvoice this_arg_conv;
50718 this_arg_conv.inner = untag_ptr(this_arg);
50719 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50720 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50721 this_arg_conv.is_owned = false;
50722 jclass ret_conv = LDKCurrency_to_java(env, RawInvoice_currency(&this_arg_conv));
50726 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1unix_1timestamp(JNIEnv *env, jclass clz, int64_t unix_seconds) {
50727 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
50728 *ret_conv = PositiveTimestamp_from_unix_timestamp(unix_seconds);
50729 return tag_ptr(ret_conv, true);
50732 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1system_1time(JNIEnv *env, jclass clz, int64_t time) {
50733 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
50734 *ret_conv = PositiveTimestamp_from_system_time(time);
50735 return tag_ptr(ret_conv, true);
50738 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t duration) {
50739 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
50740 *ret_conv = PositiveTimestamp_from_duration_since_epoch(duration);
50741 return tag_ptr(ret_conv, true);
50744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1unix_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
50745 LDKPositiveTimestamp this_arg_conv;
50746 this_arg_conv.inner = untag_ptr(this_arg);
50747 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50749 this_arg_conv.is_owned = false;
50750 int64_t ret_conv = PositiveTimestamp_as_unix_timestamp(&this_arg_conv);
50754 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t this_arg) {
50755 LDKPositiveTimestamp this_arg_conv;
50756 this_arg_conv.inner = untag_ptr(this_arg);
50757 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50759 this_arg_conv.is_owned = false;
50760 int64_t ret_conv = PositiveTimestamp_as_duration_since_epoch(&this_arg_conv);
50764 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
50765 LDKPositiveTimestamp this_arg_conv;
50766 this_arg_conv.inner = untag_ptr(this_arg);
50767 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50769 this_arg_conv.is_owned = false;
50770 int64_t ret_conv = PositiveTimestamp_as_time(&this_arg_conv);
50774 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1into_1signed_1raw(JNIEnv *env, jclass clz, int64_t this_arg) {
50775 LDKInvoice this_arg_conv;
50776 this_arg_conv.inner = untag_ptr(this_arg);
50777 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50779 this_arg_conv = Invoice_clone(&this_arg_conv);
50780 LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv);
50781 int64_t ret_ref = 0;
50782 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50783 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50787 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1check_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
50788 LDKInvoice this_arg_conv;
50789 this_arg_conv.inner = untag_ptr(this_arg);
50790 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50791 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50792 this_arg_conv.is_owned = false;
50793 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
50794 *ret_conv = Invoice_check_signature(&this_arg_conv);
50795 return tag_ptr(ret_conv, true);
50798 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1signed(JNIEnv *env, jclass clz, int64_t signed_invoice) {
50799 LDKSignedRawInvoice signed_invoice_conv;
50800 signed_invoice_conv.inner = untag_ptr(signed_invoice);
50801 signed_invoice_conv.is_owned = ptr_is_owned(signed_invoice);
50802 CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv);
50803 signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv);
50804 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
50805 *ret_conv = Invoice_from_signed(signed_invoice_conv);
50806 return tag_ptr(ret_conv, true);
50809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
50810 LDKInvoice this_arg_conv;
50811 this_arg_conv.inner = untag_ptr(this_arg);
50812 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50814 this_arg_conv.is_owned = false;
50815 int64_t ret_conv = Invoice_timestamp(&this_arg_conv);
50819 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t this_arg) {
50820 LDKInvoice this_arg_conv;
50821 this_arg_conv.inner = untag_ptr(this_arg);
50822 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50823 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50824 this_arg_conv.is_owned = false;
50825 int64_t ret_conv = Invoice_duration_since_epoch(&this_arg_conv);
50829 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
50830 LDKInvoice this_arg_conv;
50831 this_arg_conv.inner = untag_ptr(this_arg);
50832 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50833 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50834 this_arg_conv.is_owned = false;
50835 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
50836 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_hash(&this_arg_conv));
50840 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
50841 LDKInvoice this_arg_conv;
50842 this_arg_conv.inner = untag_ptr(this_arg);
50843 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50845 this_arg_conv.is_owned = false;
50846 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
50847 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_payee_pub_key(&this_arg_conv).compressed_form);
50851 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
50852 LDKInvoice this_arg_conv;
50853 this_arg_conv.inner = untag_ptr(this_arg);
50854 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50856 this_arg_conv.is_owned = false;
50857 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
50858 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_secret(&this_arg_conv));
50862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
50863 LDKInvoice this_arg_conv;
50864 this_arg_conv.inner = untag_ptr(this_arg);
50865 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50867 this_arg_conv.is_owned = false;
50868 LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
50869 int64_t ret_ref = 0;
50870 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50871 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50875 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1recover_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
50876 LDKInvoice this_arg_conv;
50877 this_arg_conv.inner = untag_ptr(this_arg);
50878 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50880 this_arg_conv.is_owned = false;
50881 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
50882 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form);
50886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
50887 LDKInvoice this_arg_conv;
50888 this_arg_conv.inner = untag_ptr(this_arg);
50889 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50891 this_arg_conv.is_owned = false;
50892 int64_t ret_conv = Invoice_expiry_time(&this_arg_conv);
50896 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) {
50897 LDKInvoice this_arg_conv;
50898 this_arg_conv.inner = untag_ptr(this_arg);
50899 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50900 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50901 this_arg_conv.is_owned = false;
50902 jboolean ret_conv = Invoice_is_expired(&this_arg_conv);
50906 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1would_1expire(JNIEnv *env, jclass clz, int64_t this_arg, int64_t at_time) {
50907 LDKInvoice this_arg_conv;
50908 this_arg_conv.inner = untag_ptr(this_arg);
50909 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50910 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50911 this_arg_conv.is_owned = false;
50912 jboolean ret_conv = Invoice_would_expire(&this_arg_conv, at_time);
50916 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1min_1final_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) {
50917 LDKInvoice this_arg_conv;
50918 this_arg_conv.inner = untag_ptr(this_arg);
50919 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50920 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50921 this_arg_conv.is_owned = false;
50922 int64_t ret_conv = Invoice_min_final_cltv_expiry(&this_arg_conv);
50926 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1routes(JNIEnv *env, jclass clz, int64_t this_arg) {
50927 LDKInvoice this_arg_conv;
50928 this_arg_conv.inner = untag_ptr(this_arg);
50929 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50931 this_arg_conv.is_owned = false;
50932 LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
50933 int64_tArray ret_arr = NULL;
50934 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
50935 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
50936 for (size_t o = 0; o < ret_var.datalen; o++) {
50937 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
50938 int64_t ret_conv_14_ref = 0;
50939 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
50940 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
50941 ret_arr_ptr[o] = ret_conv_14_ref;
50943 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
50944 FREE(ret_var.data);
50948 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) {
50949 LDKInvoice this_arg_conv;
50950 this_arg_conv.inner = untag_ptr(this_arg);
50951 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50953 this_arg_conv.is_owned = false;
50954 LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
50955 int64_tArray ret_arr = NULL;
50956 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
50957 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
50958 for (size_t l = 0; l < ret_var.datalen; l++) {
50959 LDKRouteHint ret_conv_11_var = ret_var.data[l];
50960 int64_t ret_conv_11_ref = 0;
50961 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
50962 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
50963 ret_arr_ptr[l] = ret_conv_11_ref;
50965 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
50966 FREE(ret_var.data);
50970 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Invoice_1currency(JNIEnv *env, jclass clz, int64_t this_arg) {
50971 LDKInvoice this_arg_conv;
50972 this_arg_conv.inner = untag_ptr(this_arg);
50973 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50975 this_arg_conv.is_owned = false;
50976 jclass ret_conv = LDKCurrency_to_java(env, Invoice_currency(&this_arg_conv));
50980 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1satoshis(JNIEnv *env, jclass clz, int64_t this_arg) {
50981 LDKInvoice this_arg_conv;
50982 this_arg_conv.inner = untag_ptr(this_arg);
50983 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50985 this_arg_conv.is_owned = false;
50986 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
50987 *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
50988 int64_t ret_ref = tag_ptr(ret_copy, true);
50992 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1new(JNIEnv *env, jclass clz, jstring description) {
50993 LDKStr description_conv = java_to_owned_str(env, description);
50994 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
50995 *ret_conv = Description_new(description_conv);
50996 return tag_ptr(ret_conv, true);
50999 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
51000 LDKDescription this_arg_conv;
51001 this_arg_conv.inner = untag_ptr(this_arg);
51002 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51004 this_arg_conv = Description_clone(&this_arg_conv);
51005 LDKStr ret_str = Description_into_inner(this_arg_conv);
51006 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
51011 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1from_1seconds(JNIEnv *env, jclass clz, int64_t seconds) {
51012 LDKExpiryTime ret_var = ExpiryTime_from_seconds(seconds);
51013 int64_t ret_ref = 0;
51014 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51015 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51019 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1from_1duration(JNIEnv *env, jclass clz, int64_t duration) {
51020 LDKExpiryTime ret_var = ExpiryTime_from_duration(duration);
51021 int64_t ret_ref = 0;
51022 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51023 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51027 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1seconds(JNIEnv *env, jclass clz, int64_t this_arg) {
51028 LDKExpiryTime this_arg_conv;
51029 this_arg_conv.inner = untag_ptr(this_arg);
51030 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51032 this_arg_conv.is_owned = false;
51033 int64_t ret_conv = ExpiryTime_as_seconds(&this_arg_conv);
51037 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1duration(JNIEnv *env, jclass clz, int64_t this_arg) {
51038 LDKExpiryTime this_arg_conv;
51039 this_arg_conv.inner = untag_ptr(this_arg);
51040 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51041 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51042 this_arg_conv.is_owned = false;
51043 int64_t ret_conv = ExpiryTime_as_duration(&this_arg_conv);
51047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1new(JNIEnv *env, jclass clz, int64_t hops) {
51048 LDKRouteHint hops_conv;
51049 hops_conv.inner = untag_ptr(hops);
51050 hops_conv.is_owned = ptr_is_owned(hops);
51051 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv);
51052 hops_conv = RouteHint_clone(&hops_conv);
51053 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
51054 *ret_conv = PrivateRoute_new(hops_conv);
51055 return tag_ptr(ret_conv, true);
51058 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
51059 LDKPrivateRoute this_arg_conv;
51060 this_arg_conv.inner = untag_ptr(this_arg);
51061 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51062 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51063 this_arg_conv = PrivateRoute_clone(&this_arg_conv);
51064 LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv);
51065 int64_t ret_ref = 0;
51066 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51067 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51071 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51072 LDKCreationError* orig_conv = (LDKCreationError*)untag_ptr(orig);
51073 jclass ret_conv = LDKCreationError_to_java(env, CreationError_clone(orig_conv));
51077 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1description_1too_1long(JNIEnv *env, jclass clz) {
51078 jclass ret_conv = LDKCreationError_to_java(env, CreationError_description_too_long());
51082 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1route_1too_1long(JNIEnv *env, jclass clz) {
51083 jclass ret_conv = LDKCreationError_to_java(env, CreationError_route_too_long());
51087 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1timestamp_1out_1of_1bounds(JNIEnv *env, jclass clz) {
51088 jclass ret_conv = LDKCreationError_to_java(env, CreationError_timestamp_out_of_bounds());
51092 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1invalid_1amount(JNIEnv *env, jclass clz) {
51093 jclass ret_conv = LDKCreationError_to_java(env, CreationError_invalid_amount());
51097 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1missing_1route_1hints(JNIEnv *env, jclass clz) {
51098 jclass ret_conv = LDKCreationError_to_java(env, CreationError_missing_route_hints());
51102 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
51103 LDKCreationError* a_conv = (LDKCreationError*)untag_ptr(a);
51104 LDKCreationError* b_conv = (LDKCreationError*)untag_ptr(b);
51105 jboolean ret_conv = CreationError_eq(a_conv, b_conv);
51109 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CreationError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
51110 LDKCreationError* o_conv = (LDKCreationError*)untag_ptr(o);
51111 LDKStr ret_str = CreationError_to_str(o_conv);
51112 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
51117 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51118 LDKSemanticError* orig_conv = (LDKSemanticError*)untag_ptr(orig);
51119 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_clone(orig_conv));
51123 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1hash(JNIEnv *env, jclass clz) {
51124 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_payment_hash());
51128 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1hashes(JNIEnv *env, jclass clz) {
51129 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_hashes());
51133 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1description(JNIEnv *env, jclass clz) {
51134 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_description());
51138 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1descriptions(JNIEnv *env, jclass clz) {
51139 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_descriptions());
51143 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1secret(JNIEnv *env, jclass clz) {
51144 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_payment_secret());
51148 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1secrets(JNIEnv *env, jclass clz) {
51149 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_secrets());
51153 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1features(JNIEnv *env, jclass clz) {
51154 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_features());
51158 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) {
51159 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_recovery_id());
51163 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1signature(JNIEnv *env, jclass clz) {
51164 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_signature());
51168 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1imprecise_1amount(JNIEnv *env, jclass clz) {
51169 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_imprecise_amount());
51173 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
51174 LDKSemanticError* a_conv = (LDKSemanticError*)untag_ptr(a);
51175 LDKSemanticError* b_conv = (LDKSemanticError*)untag_ptr(b);
51176 jboolean ret_conv = SemanticError_eq(a_conv, b_conv);
51180 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SemanticError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
51181 LDKSemanticError* o_conv = (LDKSemanticError*)untag_ptr(o);
51182 LDKStr ret_str = SemanticError_to_str(o_conv);
51183 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
51188 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
51189 if (!ptr_is_owned(this_ptr)) return;
51190 void* this_ptr_ptr = untag_ptr(this_ptr);
51191 CHECK_ACCESS(this_ptr_ptr);
51192 LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
51193 FREE(untag_ptr(this_ptr));
51194 SignOrCreationError_free(this_ptr_conv);
51197 static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) {
51198 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
51199 *ret_copy = SignOrCreationError_clone(arg);
51200 int64_t ret_ref = tag_ptr(ret_copy, true);
51203 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51204 LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)untag_ptr(arg);
51205 int64_t ret_conv = SignOrCreationError_clone_ptr(arg_conv);
51209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51210 LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)untag_ptr(orig);
51211 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
51212 *ret_copy = SignOrCreationError_clone(orig_conv);
51213 int64_t ret_ref = tag_ptr(ret_copy, true);
51217 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1sign_1error(JNIEnv *env, jclass clz) {
51218 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
51219 *ret_copy = SignOrCreationError_sign_error();
51220 int64_t ret_ref = tag_ptr(ret_copy, true);
51224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1creation_1error(JNIEnv *env, jclass clz, jclass a) {
51225 LDKCreationError a_conv = LDKCreationError_from_java(env, a);
51226 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
51227 *ret_copy = SignOrCreationError_creation_error(a_conv);
51228 int64_t ret_ref = tag_ptr(ret_copy, true);
51232 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
51233 LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)untag_ptr(a);
51234 LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)untag_ptr(b);
51235 jboolean ret_conv = SignOrCreationError_eq(a_conv, b_conv);
51239 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
51240 LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)untag_ptr(o);
51241 LDKStr ret_str = SignOrCreationError_to_str(o_conv);
51242 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
51247 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51248 LDKInvoicePayer this_obj_conv;
51249 this_obj_conv.inner = untag_ptr(this_obj);
51250 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51251 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51252 InvoicePayer_free(this_obj_conv);
51255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
51256 if (!ptr_is_owned(this_ptr)) return;
51257 void* this_ptr_ptr = untag_ptr(this_ptr);
51258 CHECK_ACCESS(this_ptr_ptr);
51259 LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
51260 FREE(untag_ptr(this_ptr));
51261 Payer_free(this_ptr_conv);
51264 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
51265 if (!ptr_is_owned(this_ptr)) return;
51266 void* this_ptr_ptr = untag_ptr(this_ptr);
51267 CHECK_ACCESS(this_ptr_ptr);
51268 LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
51269 FREE(untag_ptr(this_ptr));
51270 Router_free(this_ptr_conv);
51273 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
51274 if (!ptr_is_owned(this_ptr)) return;
51275 void* this_ptr_ptr = untag_ptr(this_ptr);
51276 CHECK_ACCESS(this_ptr_ptr);
51277 LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
51278 FREE(untag_ptr(this_ptr));
51279 Retry_free(this_ptr_conv);
51282 static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
51283 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
51284 *ret_copy = Retry_clone(arg);
51285 int64_t ret_ref = tag_ptr(ret_copy, true);
51288 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51289 LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
51290 int64_t ret_conv = Retry_clone_ptr(arg_conv);
51294 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51295 LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
51296 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
51297 *ret_copy = Retry_clone(orig_conv);
51298 int64_t ret_ref = tag_ptr(ret_copy, true);
51302 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1attempts(JNIEnv *env, jclass clz, int64_t a) {
51303 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
51304 *ret_copy = Retry_attempts(a);
51305 int64_t ret_ref = tag_ptr(ret_copy, true);
51309 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1timeout(JNIEnv *env, jclass clz, int64_t a) {
51310 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
51311 *ret_copy = Retry_timeout(a);
51312 int64_t ret_ref = tag_ptr(ret_copy, true);
51316 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
51317 LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
51318 LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
51319 jboolean ret_conv = Retry_eq(a_conv, b_conv);
51323 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1hash(JNIEnv *env, jclass clz, int64_t o) {
51324 LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
51325 int64_t ret_conv = Retry_hash(o_conv);
51329 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
51330 if (!ptr_is_owned(this_ptr)) return;
51331 void* this_ptr_ptr = untag_ptr(this_ptr);
51332 CHECK_ACCESS(this_ptr_ptr);
51333 LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
51334 FREE(untag_ptr(this_ptr));
51335 PaymentError_free(this_ptr_conv);
51338 static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) {
51339 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
51340 *ret_copy = PaymentError_clone(arg);
51341 int64_t ret_ref = tag_ptr(ret_copy, true);
51344 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51345 LDKPaymentError* arg_conv = (LDKPaymentError*)untag_ptr(arg);
51346 int64_t ret_conv = PaymentError_clone_ptr(arg_conv);
51350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51351 LDKPaymentError* orig_conv = (LDKPaymentError*)untag_ptr(orig);
51352 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
51353 *ret_copy = PaymentError_clone(orig_conv);
51354 int64_t ret_ref = tag_ptr(ret_copy, true);
51358 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1invoice(JNIEnv *env, jclass clz, jstring a) {
51359 LDKStr a_conv = java_to_owned_str(env, a);
51360 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
51361 *ret_copy = PaymentError_invoice(a_conv);
51362 int64_t ret_ref = tag_ptr(ret_copy, true);
51366 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1routing(JNIEnv *env, jclass clz, int64_t a) {
51367 LDKLightningError a_conv;
51368 a_conv.inner = untag_ptr(a);
51369 a_conv.is_owned = ptr_is_owned(a);
51370 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
51371 a_conv = LightningError_clone(&a_conv);
51372 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
51373 *ret_copy = PaymentError_routing(a_conv);
51374 int64_t ret_ref = tag_ptr(ret_copy, true);
51378 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1sending(JNIEnv *env, jclass clz, int64_t a) {
51379 void* a_ptr = untag_ptr(a);
51380 CHECK_ACCESS(a_ptr);
51381 LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
51382 a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a));
51383 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
51384 *ret_copy = PaymentError_sending(a_conv);
51385 int64_t ret_ref = tag_ptr(ret_copy, true);
51389 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *env, jclass clz, int64_t payer, int64_t router, int64_t logger, int64_t event_handler, int64_t retry) {
51390 void* payer_ptr = untag_ptr(payer);
51391 CHECK_ACCESS(payer_ptr);
51392 LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
51393 if (payer_conv.free == LDKPayer_JCalls_free) {
51394 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51395 LDKPayer_JCalls_cloned(&payer_conv);
51397 void* router_ptr = untag_ptr(router);
51398 CHECK_ACCESS(router_ptr);
51399 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
51400 if (router_conv.free == LDKRouter_JCalls_free) {
51401 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51402 LDKRouter_JCalls_cloned(&router_conv);
51404 void* logger_ptr = untag_ptr(logger);
51405 CHECK_ACCESS(logger_ptr);
51406 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
51407 if (logger_conv.free == LDKLogger_JCalls_free) {
51408 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51409 LDKLogger_JCalls_cloned(&logger_conv);
51411 void* event_handler_ptr = untag_ptr(event_handler);
51412 CHECK_ACCESS(event_handler_ptr);
51413 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
51414 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
51415 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51416 LDKEventHandler_JCalls_cloned(&event_handler_conv);
51418 void* retry_ptr = untag_ptr(retry);
51419 CHECK_ACCESS(retry_ptr);
51420 LDKRetry retry_conv = *(LDKRetry*)(retry_ptr);
51421 retry_conv = Retry_clone((LDKRetry*)untag_ptr(retry));
51422 LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, logger_conv, event_handler_conv, retry_conv);
51423 int64_t ret_ref = 0;
51424 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51425 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51429 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice) {
51430 LDKInvoicePayer this_arg_conv;
51431 this_arg_conv.inner = untag_ptr(this_arg);
51432 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51434 this_arg_conv.is_owned = false;
51435 LDKInvoice invoice_conv;
51436 invoice_conv.inner = untag_ptr(invoice);
51437 invoice_conv.is_owned = ptr_is_owned(invoice);
51438 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
51439 invoice_conv.is_owned = false;
51440 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
51441 *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
51442 return tag_ptr(ret_conv, true);
51445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1value_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int64_t amount_msats) {
51446 LDKInvoicePayer this_arg_conv;
51447 this_arg_conv.inner = untag_ptr(this_arg);
51448 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51450 this_arg_conv.is_owned = false;
51451 LDKInvoice invoice_conv;
51452 invoice_conv.inner = untag_ptr(invoice);
51453 invoice_conv.is_owned = ptr_is_owned(invoice);
51454 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
51455 invoice_conv.is_owned = false;
51456 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
51457 *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
51458 return tag_ptr(ret_conv, true);
51461 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int64_t amount_msats, int32_t final_cltv_expiry_delta) {
51462 LDKInvoicePayer this_arg_conv;
51463 this_arg_conv.inner = untag_ptr(this_arg);
51464 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51466 this_arg_conv.is_owned = false;
51467 LDKPublicKey pubkey_ref;
51468 CHECK((*env)->GetArrayLength(env, pubkey) == 33);
51469 (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
51470 LDKThirtyTwoBytes payment_preimage_ref;
51471 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
51472 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
51473 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
51474 *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
51475 return tag_ptr(ret_conv, true);
51478 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) {
51479 LDKInvoicePayer this_arg_conv;
51480 this_arg_conv.inner = untag_ptr(this_arg);
51481 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51482 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51483 this_arg_conv.is_owned = false;
51484 unsigned char payment_hash_arr[32];
51485 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
51486 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
51487 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
51488 InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
51491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
51492 LDKInvoicePayer this_arg_conv;
51493 this_arg_conv.inner = untag_ptr(this_arg);
51494 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51496 this_arg_conv.is_owned = false;
51497 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
51498 *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
51499 return tag_ptr(ret_ret, true);
51502 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51503 LDKInFlightHtlcs this_obj_conv;
51504 this_obj_conv.inner = untag_ptr(this_obj);
51505 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51507 InFlightHtlcs_free(this_obj_conv);
51510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) {
51511 LDKInFlightHtlcs this_arg_conv;
51512 this_arg_conv.inner = untag_ptr(this_arg);
51513 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51514 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51515 this_arg_conv.is_owned = false;
51516 LDKNodeId source_conv;
51517 source_conv.inner = untag_ptr(source);
51518 source_conv.is_owned = ptr_is_owned(source);
51519 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
51520 source_conv.is_owned = false;
51521 LDKNodeId target_conv;
51522 target_conv.inner = untag_ptr(target);
51523 target_conv.is_owned = ptr_is_owned(target);
51524 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
51525 target_conv.is_owned = false;
51526 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
51527 *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid);
51528 int64_t ret_ref = tag_ptr(ret_copy, true);
51532 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) {
51533 LDKInFlightHtlcs obj_conv;
51534 obj_conv.inner = untag_ptr(obj);
51535 obj_conv.is_owned = ptr_is_owned(obj);
51536 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
51537 obj_conv.is_owned = false;
51538 LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv);
51539 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
51540 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
51541 CVec_u8Z_free(ret_var);
51545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
51546 LDKu8slice ser_ref;
51547 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
51548 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
51549 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
51550 *ret_conv = InFlightHtlcs_read(ser_ref);
51551 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
51552 return tag_ptr(ret_conv, true);
51555 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t keys_manager, int64_t logger, jclass network) {
51556 void* amt_msat_ptr = untag_ptr(amt_msat);
51557 CHECK_ACCESS(amt_msat_ptr);
51558 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
51559 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
51560 LDKThirtyTwoBytes payment_hash_ref;
51561 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
51562 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
51563 LDKStr description_conv = java_to_owned_str(env, description);
51564 LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr;
51565 phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints);
51566 if (phantom_route_hints_constr.datalen > 0)
51567 phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
51569 phantom_route_hints_constr.data = NULL;
51570 int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL);
51571 for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) {
51572 int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t];
51573 LDKPhantomRouteHints phantom_route_hints_conv_19_conv;
51574 phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19);
51575 phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19);
51576 CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv);
51577 phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv);
51578 phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv;
51580 (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0);
51581 void* keys_manager_ptr = untag_ptr(keys_manager);
51582 CHECK_ACCESS(keys_manager_ptr);
51583 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
51584 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
51585 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51586 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
51588 void* logger_ptr = untag_ptr(logger);
51589 CHECK_ACCESS(logger_ptr);
51590 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
51591 if (logger_conv.free == LDKLogger_JCalls_free) {
51592 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51593 LDKLogger_JCalls_cloned(&logger_conv);
51595 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
51596 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
51597 *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_ref, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, keys_manager_conv, logger_conv, network_conv);
51598 return tag_ptr(ret_conv, true);
51601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t keys_manager, int64_t logger, jclass network) {
51602 void* amt_msat_ptr = untag_ptr(amt_msat);
51603 CHECK_ACCESS(amt_msat_ptr);
51604 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
51605 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
51606 LDKThirtyTwoBytes payment_hash_ref;
51607 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
51608 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
51609 LDKSha256 description_hash_conv;
51610 description_hash_conv.inner = untag_ptr(description_hash);
51611 description_hash_conv.is_owned = ptr_is_owned(description_hash);
51612 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
51613 description_hash_conv = Sha256_clone(&description_hash_conv);
51614 LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr;
51615 phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints);
51616 if (phantom_route_hints_constr.datalen > 0)
51617 phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
51619 phantom_route_hints_constr.data = NULL;
51620 int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL);
51621 for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) {
51622 int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t];
51623 LDKPhantomRouteHints phantom_route_hints_conv_19_conv;
51624 phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19);
51625 phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19);
51626 CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv);
51627 phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv);
51628 phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv;
51630 (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0);
51631 void* keys_manager_ptr = untag_ptr(keys_manager);
51632 CHECK_ACCESS(keys_manager_ptr);
51633 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
51634 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
51635 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51636 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
51638 void* logger_ptr = untag_ptr(logger);
51639 CHECK_ACCESS(logger_ptr);
51640 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
51641 if (logger_conv.free == LDKLogger_JCalls_free) {
51642 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51643 LDKLogger_JCalls_cloned(&logger_conv);
51645 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
51646 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
51647 *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, keys_manager_conv, logger_conv, network_conv);
51648 return tag_ptr(ret_conv, true);
51651 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs) {
51652 LDKChannelManager channelmanager_conv;
51653 channelmanager_conv.inner = untag_ptr(channelmanager);
51654 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
51655 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
51656 channelmanager_conv.is_owned = false;
51657 void* keys_manager_ptr = untag_ptr(keys_manager);
51658 CHECK_ACCESS(keys_manager_ptr);
51659 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
51660 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
51661 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51662 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
51664 void* logger_ptr = untag_ptr(logger);
51665 CHECK_ACCESS(logger_ptr);
51666 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
51667 if (logger_conv.free == LDKLogger_JCalls_free) {
51668 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51669 LDKLogger_JCalls_cloned(&logger_conv);
51671 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
51672 void* amt_msat_ptr = untag_ptr(amt_msat);
51673 CHECK_ACCESS(amt_msat_ptr);
51674 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
51675 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
51676 LDKStr description_conv = java_to_owned_str(env, description);
51677 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
51678 *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs);
51679 return tag_ptr(ret_conv, true);
51682 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs) {
51683 LDKChannelManager channelmanager_conv;
51684 channelmanager_conv.inner = untag_ptr(channelmanager);
51685 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
51686 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
51687 channelmanager_conv.is_owned = false;
51688 void* keys_manager_ptr = untag_ptr(keys_manager);
51689 CHECK_ACCESS(keys_manager_ptr);
51690 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
51691 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
51692 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51693 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
51695 void* logger_ptr = untag_ptr(logger);
51696 CHECK_ACCESS(logger_ptr);
51697 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
51698 if (logger_conv.free == LDKLogger_JCalls_free) {
51699 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51700 LDKLogger_JCalls_cloned(&logger_conv);
51702 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
51703 void* amt_msat_ptr = untag_ptr(amt_msat);
51704 CHECK_ACCESS(amt_msat_ptr);
51705 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
51706 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
51707 LDKSha256 description_hash_conv;
51708 description_hash_conv.inner = untag_ptr(description_hash);
51709 description_hash_conv.is_owned = ptr_is_owned(description_hash);
51710 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
51711 description_hash_conv = Sha256_clone(&description_hash_conv);
51712 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
51713 *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs);
51714 return tag_ptr(ret_conv, true);
51717 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
51718 LDKChannelManager channelmanager_conv;
51719 channelmanager_conv.inner = untag_ptr(channelmanager);
51720 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
51721 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
51722 channelmanager_conv.is_owned = false;
51723 void* keys_manager_ptr = untag_ptr(keys_manager);
51724 CHECK_ACCESS(keys_manager_ptr);
51725 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
51726 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
51727 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51728 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
51730 void* logger_ptr = untag_ptr(logger);
51731 CHECK_ACCESS(logger_ptr);
51732 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
51733 if (logger_conv.free == LDKLogger_JCalls_free) {
51734 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51735 LDKLogger_JCalls_cloned(&logger_conv);
51737 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
51738 void* amt_msat_ptr = untag_ptr(amt_msat);
51739 CHECK_ACCESS(amt_msat_ptr);
51740 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
51741 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
51742 LDKSha256 description_hash_conv;
51743 description_hash_conv.inner = untag_ptr(description_hash);
51744 description_hash_conv.is_owned = ptr_is_owned(description_hash);
51745 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
51746 description_hash_conv = Sha256_clone(&description_hash_conv);
51747 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
51748 *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs);
51749 return tag_ptr(ret_conv, true);
51752 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
51753 LDKChannelManager channelmanager_conv;
51754 channelmanager_conv.inner = untag_ptr(channelmanager);
51755 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
51756 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
51757 channelmanager_conv.is_owned = false;
51758 void* keys_manager_ptr = untag_ptr(keys_manager);
51759 CHECK_ACCESS(keys_manager_ptr);
51760 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
51761 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
51762 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51763 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
51765 void* logger_ptr = untag_ptr(logger);
51766 CHECK_ACCESS(logger_ptr);
51767 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
51768 if (logger_conv.free == LDKLogger_JCalls_free) {
51769 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51770 LDKLogger_JCalls_cloned(&logger_conv);
51772 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
51773 void* amt_msat_ptr = untag_ptr(amt_msat);
51774 CHECK_ACCESS(amt_msat_ptr);
51775 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
51776 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
51777 LDKStr description_conv = java_to_owned_str(env, description);
51778 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
51779 *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs);
51780 return tag_ptr(ret_conv, true);
51783 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51784 LDKDefaultRouter this_obj_conv;
51785 this_obj_conv.inner = untag_ptr(this_obj);
51786 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51787 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51788 DefaultRouter_free(this_obj_conv);
51791 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes, int64_t scorer) {
51792 LDKNetworkGraph network_graph_conv;
51793 network_graph_conv.inner = untag_ptr(network_graph);
51794 network_graph_conv.is_owned = ptr_is_owned(network_graph);
51795 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
51796 network_graph_conv.is_owned = false;
51797 void* logger_ptr = untag_ptr(logger);
51798 CHECK_ACCESS(logger_ptr);
51799 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
51800 if (logger_conv.free == LDKLogger_JCalls_free) {
51801 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51802 LDKLogger_JCalls_cloned(&logger_conv);
51804 LDKThirtyTwoBytes random_seed_bytes_ref;
51805 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
51806 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_ref.data);
51807 void* scorer_ptr = untag_ptr(scorer);
51808 CHECK_ACCESS(scorer_ptr);
51809 LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr);
51810 if (scorer_conv.free == LDKLockableScore_JCalls_free) {
51811 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51812 LDKLockableScore_JCalls_cloned(&scorer_conv);
51814 LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv);
51815 int64_t ret_ref = 0;
51816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51821 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) {
51822 LDKDefaultRouter this_arg_conv;
51823 this_arg_conv.inner = untag_ptr(this_arg);
51824 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51826 this_arg_conv.is_owned = false;
51827 LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
51828 *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
51829 return tag_ptr(ret_ret, true);
51832 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer(JNIEnv *env, jclass clz, int64_t this_arg) {
51833 LDKChannelManager this_arg_conv;
51834 this_arg_conv.inner = untag_ptr(this_arg);
51835 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51837 this_arg_conv.is_owned = false;
51838 LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
51839 *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
51840 return tag_ptr(ret_ret, true);
51843 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1from_1str(JNIEnv *env, jclass clz, jstring s) {
51844 LDKStr s_conv = java_to_owned_str(env, s);
51845 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
51846 *ret_conv = SiPrefix_from_str(s_conv);
51847 return tag_ptr(ret_conv, true);
51850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1str(JNIEnv *env, jclass clz, jstring s) {
51851 LDKStr s_conv = java_to_owned_str(env, s);
51852 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
51853 *ret_conv = Invoice_from_str(s_conv);
51854 return tag_ptr(ret_conv, true);
51857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1from_1str(JNIEnv *env, jclass clz, jstring s) {
51858 LDKStr s_conv = java_to_owned_str(env, s);
51859 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
51860 *ret_conv = SignedRawInvoice_from_str(s_conv);
51861 return tag_ptr(ret_conv, true);
51864 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ParseError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
51865 LDKParseError* o_conv = (LDKParseError*)untag_ptr(o);
51866 LDKStr ret_str = ParseError_to_str(o_conv);
51867 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
51872 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
51873 LDKParseOrSemanticError* o_conv = (LDKParseOrSemanticError*)untag_ptr(o);
51874 LDKStr ret_str = ParseOrSemanticError_to_str(o_conv);
51875 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
51880 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Invoice_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
51882 o_conv.inner = untag_ptr(o);
51883 o_conv.is_owned = ptr_is_owned(o);
51884 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
51885 o_conv.is_owned = false;
51886 LDKStr ret_str = Invoice_to_str(&o_conv);
51887 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
51892 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
51893 LDKSignedRawInvoice o_conv;
51894 o_conv.inner = untag_ptr(o);
51895 o_conv.is_owned = ptr_is_owned(o);
51896 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
51897 o_conv.is_owned = false;
51898 LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
51899 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
51904 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Currency_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
51905 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
51906 LDKStr ret_str = Currency_to_str(o_conv);
51907 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
51912 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SiPrefix_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
51913 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
51914 LDKStr ret_str = SiPrefix_to_str(o_conv);
51915 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
51920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51921 LDKRapidGossipSync this_obj_conv;
51922 this_obj_conv.inner = untag_ptr(this_obj);
51923 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51925 RapidGossipSync_free(this_obj_conv);
51928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph) {
51929 LDKNetworkGraph network_graph_conv;
51930 network_graph_conv.inner = untag_ptr(network_graph);
51931 network_graph_conv.is_owned = ptr_is_owned(network_graph);
51932 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
51933 network_graph_conv.is_owned = false;
51934 LDKRapidGossipSync ret_var = RapidGossipSync_new(&network_graph_conv);
51935 int64_t ret_ref = 0;
51936 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51937 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51941 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray update_data) {
51942 LDKRapidGossipSync this_arg_conv;
51943 this_arg_conv.inner = untag_ptr(this_arg);
51944 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51945 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51946 this_arg_conv.is_owned = false;
51947 LDKu8slice update_data_ref;
51948 update_data_ref.datalen = (*env)->GetArrayLength(env, update_data);
51949 update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL);
51950 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
51951 *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref);
51952 (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0);
51953 return tag_ptr(ret_conv, true);
51956 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1is_1initial_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_arg) {
51957 LDKRapidGossipSync this_arg_conv;
51958 this_arg_conv.inner = untag_ptr(this_arg);
51959 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51961 this_arg_conv.is_owned = false;
51962 jboolean ret_conv = RapidGossipSync_is_initial_sync_complete(&this_arg_conv);
51966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
51967 if (!ptr_is_owned(this_ptr)) return;
51968 void* this_ptr_ptr = untag_ptr(this_ptr);
51969 CHECK_ACCESS(this_ptr_ptr);
51970 LDKGraphSyncError this_ptr_conv = *(LDKGraphSyncError*)(this_ptr_ptr);
51971 FREE(untag_ptr(this_ptr));
51972 GraphSyncError_free(this_ptr_conv);
51975 static inline uint64_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg) {
51976 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
51977 *ret_copy = GraphSyncError_clone(arg);
51978 int64_t ret_ref = tag_ptr(ret_copy, true);
51981 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51982 LDKGraphSyncError* arg_conv = (LDKGraphSyncError*)untag_ptr(arg);
51983 int64_t ret_conv = GraphSyncError_clone_ptr(arg_conv);
51987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51988 LDKGraphSyncError* orig_conv = (LDKGraphSyncError*)untag_ptr(orig);
51989 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
51990 *ret_copy = GraphSyncError_clone(orig_conv);
51991 int64_t ret_ref = tag_ptr(ret_copy, true);
51995 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1decode_1error(JNIEnv *env, jclass clz, int64_t a) {
51996 void* a_ptr = untag_ptr(a);
51997 CHECK_ACCESS(a_ptr);
51998 LDKDecodeError a_conv = *(LDKDecodeError*)(a_ptr);
51999 a_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(a));
52000 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
52001 *ret_copy = GraphSyncError_decode_error(a_conv);
52002 int64_t ret_ref = tag_ptr(ret_copy, true);
52006 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1lightning_1error(JNIEnv *env, jclass clz, int64_t a) {
52007 LDKLightningError a_conv;
52008 a_conv.inner = untag_ptr(a);
52009 a_conv.is_owned = ptr_is_owned(a);
52010 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
52011 a_conv = LightningError_clone(&a_conv);
52012 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
52013 *ret_copy = GraphSyncError_lightning_error(a_conv);
52014 int64_t ret_ref = tag_ptr(ret_copy, true);