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 LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_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 ChannelMonitorUpdateErr.ordinal() from rust threw an exception.");
289 case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
290 case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
292 (*env)->FatalError(env, "A call to ChannelMonitorUpdateErr.ordinal() from rust returned an invalid value.");
293 abort(); // Unreachable, but will let the compiler know we don't return here
295 static jclass ChannelMonitorUpdateErr_class = NULL;
296 static jfieldID ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = NULL;
297 static jfieldID ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = NULL;
298 JNIEXPORT void JNICALL Java_org_ldk_enums_ChannelMonitorUpdateErr_init (JNIEnv *env, jclass clz) {
299 ChannelMonitorUpdateErr_class = (*env)->NewGlobalRef(env, clz);
300 CHECK(ChannelMonitorUpdateErr_class != NULL);
301 ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_TemporaryFailure", "Lorg/ldk/enums/ChannelMonitorUpdateErr;");
302 CHECK(ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure != NULL);
303 ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_PermanentFailure", "Lorg/ldk/enums/ChannelMonitorUpdateErr;");
304 CHECK(ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure != NULL);
306 static inline jclass LDKChannelMonitorUpdateErr_to_java(JNIEnv *env, LDKChannelMonitorUpdateErr val) {
308 case LDKChannelMonitorUpdateErr_TemporaryFailure:
309 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateErr_class, ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure);
310 case LDKChannelMonitorUpdateErr_PermanentFailure:
311 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateErr_class, ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure);
316 static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass clz) {
317 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
318 if (UNLIKELY((*env)->ExceptionCheck(env))) {
319 (*env)->ExceptionDescribe(env);
320 (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust threw an exception.");
323 case 0: return LDKConfirmationTarget_Background;
324 case 1: return LDKConfirmationTarget_Normal;
325 case 2: return LDKConfirmationTarget_HighPriority;
327 (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust returned an invalid value.");
328 abort(); // Unreachable, but will let the compiler know we don't return here
330 static jclass ConfirmationTarget_class = NULL;
331 static jfieldID ConfirmationTarget_LDKConfirmationTarget_Background = NULL;
332 static jfieldID ConfirmationTarget_LDKConfirmationTarget_Normal = NULL;
333 static jfieldID ConfirmationTarget_LDKConfirmationTarget_HighPriority = NULL;
334 JNIEXPORT void JNICALL Java_org_ldk_enums_ConfirmationTarget_init (JNIEnv *env, jclass clz) {
335 ConfirmationTarget_class = (*env)->NewGlobalRef(env, clz);
336 CHECK(ConfirmationTarget_class != NULL);
337 ConfirmationTarget_LDKConfirmationTarget_Background = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_Background", "Lorg/ldk/enums/ConfirmationTarget;");
338 CHECK(ConfirmationTarget_LDKConfirmationTarget_Background != NULL);
339 ConfirmationTarget_LDKConfirmationTarget_Normal = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_Normal", "Lorg/ldk/enums/ConfirmationTarget;");
340 CHECK(ConfirmationTarget_LDKConfirmationTarget_Normal != NULL);
341 ConfirmationTarget_LDKConfirmationTarget_HighPriority = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_HighPriority", "Lorg/ldk/enums/ConfirmationTarget;");
342 CHECK(ConfirmationTarget_LDKConfirmationTarget_HighPriority != NULL);
344 static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) {
346 case LDKConfirmationTarget_Background:
347 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_Background);
348 case LDKConfirmationTarget_Normal:
349 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_Normal);
350 case LDKConfirmationTarget_HighPriority:
351 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_HighPriority);
356 static inline LDKCreationError LDKCreationError_from_java(JNIEnv *env, jclass clz) {
357 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
358 if (UNLIKELY((*env)->ExceptionCheck(env))) {
359 (*env)->ExceptionDescribe(env);
360 (*env)->FatalError(env, "A call to CreationError.ordinal() from rust threw an exception.");
363 case 0: return LDKCreationError_DescriptionTooLong;
364 case 1: return LDKCreationError_RouteTooLong;
365 case 2: return LDKCreationError_TimestampOutOfBounds;
366 case 3: return LDKCreationError_InvalidAmount;
367 case 4: return LDKCreationError_MissingRouteHints;
369 (*env)->FatalError(env, "A call to CreationError.ordinal() from rust returned an invalid value.");
370 abort(); // Unreachable, but will let the compiler know we don't return here
372 static jclass CreationError_class = NULL;
373 static jfieldID CreationError_LDKCreationError_DescriptionTooLong = NULL;
374 static jfieldID CreationError_LDKCreationError_RouteTooLong = NULL;
375 static jfieldID CreationError_LDKCreationError_TimestampOutOfBounds = NULL;
376 static jfieldID CreationError_LDKCreationError_InvalidAmount = NULL;
377 static jfieldID CreationError_LDKCreationError_MissingRouteHints = NULL;
378 JNIEXPORT void JNICALL Java_org_ldk_enums_CreationError_init (JNIEnv *env, jclass clz) {
379 CreationError_class = (*env)->NewGlobalRef(env, clz);
380 CHECK(CreationError_class != NULL);
381 CreationError_LDKCreationError_DescriptionTooLong = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_DescriptionTooLong", "Lorg/ldk/enums/CreationError;");
382 CHECK(CreationError_LDKCreationError_DescriptionTooLong != NULL);
383 CreationError_LDKCreationError_RouteTooLong = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_RouteTooLong", "Lorg/ldk/enums/CreationError;");
384 CHECK(CreationError_LDKCreationError_RouteTooLong != NULL);
385 CreationError_LDKCreationError_TimestampOutOfBounds = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_TimestampOutOfBounds", "Lorg/ldk/enums/CreationError;");
386 CHECK(CreationError_LDKCreationError_TimestampOutOfBounds != NULL);
387 CreationError_LDKCreationError_InvalidAmount = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_InvalidAmount", "Lorg/ldk/enums/CreationError;");
388 CHECK(CreationError_LDKCreationError_InvalidAmount != NULL);
389 CreationError_LDKCreationError_MissingRouteHints = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_MissingRouteHints", "Lorg/ldk/enums/CreationError;");
390 CHECK(CreationError_LDKCreationError_MissingRouteHints != NULL);
392 static inline jclass LDKCreationError_to_java(JNIEnv *env, LDKCreationError val) {
394 case LDKCreationError_DescriptionTooLong:
395 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_DescriptionTooLong);
396 case LDKCreationError_RouteTooLong:
397 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_RouteTooLong);
398 case LDKCreationError_TimestampOutOfBounds:
399 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_TimestampOutOfBounds);
400 case LDKCreationError_InvalidAmount:
401 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_InvalidAmount);
402 case LDKCreationError_MissingRouteHints:
403 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_MissingRouteHints);
408 static inline LDKCurrency LDKCurrency_from_java(JNIEnv *env, jclass clz) {
409 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
410 if (UNLIKELY((*env)->ExceptionCheck(env))) {
411 (*env)->ExceptionDescribe(env);
412 (*env)->FatalError(env, "A call to Currency.ordinal() from rust threw an exception.");
415 case 0: return LDKCurrency_Bitcoin;
416 case 1: return LDKCurrency_BitcoinTestnet;
417 case 2: return LDKCurrency_Regtest;
418 case 3: return LDKCurrency_Simnet;
419 case 4: return LDKCurrency_Signet;
421 (*env)->FatalError(env, "A call to Currency.ordinal() from rust returned an invalid value.");
422 abort(); // Unreachable, but will let the compiler know we don't return here
424 static jclass Currency_class = NULL;
425 static jfieldID Currency_LDKCurrency_Bitcoin = NULL;
426 static jfieldID Currency_LDKCurrency_BitcoinTestnet = NULL;
427 static jfieldID Currency_LDKCurrency_Regtest = NULL;
428 static jfieldID Currency_LDKCurrency_Simnet = NULL;
429 static jfieldID Currency_LDKCurrency_Signet = NULL;
430 JNIEXPORT void JNICALL Java_org_ldk_enums_Currency_init (JNIEnv *env, jclass clz) {
431 Currency_class = (*env)->NewGlobalRef(env, clz);
432 CHECK(Currency_class != NULL);
433 Currency_LDKCurrency_Bitcoin = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Bitcoin", "Lorg/ldk/enums/Currency;");
434 CHECK(Currency_LDKCurrency_Bitcoin != NULL);
435 Currency_LDKCurrency_BitcoinTestnet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_BitcoinTestnet", "Lorg/ldk/enums/Currency;");
436 CHECK(Currency_LDKCurrency_BitcoinTestnet != NULL);
437 Currency_LDKCurrency_Regtest = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Regtest", "Lorg/ldk/enums/Currency;");
438 CHECK(Currency_LDKCurrency_Regtest != NULL);
439 Currency_LDKCurrency_Simnet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Simnet", "Lorg/ldk/enums/Currency;");
440 CHECK(Currency_LDKCurrency_Simnet != NULL);
441 Currency_LDKCurrency_Signet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Signet", "Lorg/ldk/enums/Currency;");
442 CHECK(Currency_LDKCurrency_Signet != NULL);
444 static inline jclass LDKCurrency_to_java(JNIEnv *env, LDKCurrency val) {
446 case LDKCurrency_Bitcoin:
447 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Bitcoin);
448 case LDKCurrency_BitcoinTestnet:
449 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_BitcoinTestnet);
450 case LDKCurrency_Regtest:
451 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Regtest);
452 case LDKCurrency_Simnet:
453 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Simnet);
454 case LDKCurrency_Signet:
455 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Signet);
460 static inline LDKIOError LDKIOError_from_java(JNIEnv *env, jclass clz) {
461 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
462 if (UNLIKELY((*env)->ExceptionCheck(env))) {
463 (*env)->ExceptionDescribe(env);
464 (*env)->FatalError(env, "A call to IOError.ordinal() from rust threw an exception.");
467 case 0: return LDKIOError_NotFound;
468 case 1: return LDKIOError_PermissionDenied;
469 case 2: return LDKIOError_ConnectionRefused;
470 case 3: return LDKIOError_ConnectionReset;
471 case 4: return LDKIOError_ConnectionAborted;
472 case 5: return LDKIOError_NotConnected;
473 case 6: return LDKIOError_AddrInUse;
474 case 7: return LDKIOError_AddrNotAvailable;
475 case 8: return LDKIOError_BrokenPipe;
476 case 9: return LDKIOError_AlreadyExists;
477 case 10: return LDKIOError_WouldBlock;
478 case 11: return LDKIOError_InvalidInput;
479 case 12: return LDKIOError_InvalidData;
480 case 13: return LDKIOError_TimedOut;
481 case 14: return LDKIOError_WriteZero;
482 case 15: return LDKIOError_Interrupted;
483 case 16: return LDKIOError_Other;
484 case 17: return LDKIOError_UnexpectedEof;
486 (*env)->FatalError(env, "A call to IOError.ordinal() from rust returned an invalid value.");
487 abort(); // Unreachable, but will let the compiler know we don't return here
489 static jclass IOError_class = NULL;
490 static jfieldID IOError_LDKIOError_NotFound = NULL;
491 static jfieldID IOError_LDKIOError_PermissionDenied = NULL;
492 static jfieldID IOError_LDKIOError_ConnectionRefused = NULL;
493 static jfieldID IOError_LDKIOError_ConnectionReset = NULL;
494 static jfieldID IOError_LDKIOError_ConnectionAborted = NULL;
495 static jfieldID IOError_LDKIOError_NotConnected = NULL;
496 static jfieldID IOError_LDKIOError_AddrInUse = NULL;
497 static jfieldID IOError_LDKIOError_AddrNotAvailable = NULL;
498 static jfieldID IOError_LDKIOError_BrokenPipe = NULL;
499 static jfieldID IOError_LDKIOError_AlreadyExists = NULL;
500 static jfieldID IOError_LDKIOError_WouldBlock = NULL;
501 static jfieldID IOError_LDKIOError_InvalidInput = NULL;
502 static jfieldID IOError_LDKIOError_InvalidData = NULL;
503 static jfieldID IOError_LDKIOError_TimedOut = NULL;
504 static jfieldID IOError_LDKIOError_WriteZero = NULL;
505 static jfieldID IOError_LDKIOError_Interrupted = NULL;
506 static jfieldID IOError_LDKIOError_Other = NULL;
507 static jfieldID IOError_LDKIOError_UnexpectedEof = NULL;
508 JNIEXPORT void JNICALL Java_org_ldk_enums_IOError_init (JNIEnv *env, jclass clz) {
509 IOError_class = (*env)->NewGlobalRef(env, clz);
510 CHECK(IOError_class != NULL);
511 IOError_LDKIOError_NotFound = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_NotFound", "Lorg/ldk/enums/IOError;");
512 CHECK(IOError_LDKIOError_NotFound != NULL);
513 IOError_LDKIOError_PermissionDenied = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_PermissionDenied", "Lorg/ldk/enums/IOError;");
514 CHECK(IOError_LDKIOError_PermissionDenied != NULL);
515 IOError_LDKIOError_ConnectionRefused = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionRefused", "Lorg/ldk/enums/IOError;");
516 CHECK(IOError_LDKIOError_ConnectionRefused != NULL);
517 IOError_LDKIOError_ConnectionReset = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionReset", "Lorg/ldk/enums/IOError;");
518 CHECK(IOError_LDKIOError_ConnectionReset != NULL);
519 IOError_LDKIOError_ConnectionAborted = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionAborted", "Lorg/ldk/enums/IOError;");
520 CHECK(IOError_LDKIOError_ConnectionAborted != NULL);
521 IOError_LDKIOError_NotConnected = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_NotConnected", "Lorg/ldk/enums/IOError;");
522 CHECK(IOError_LDKIOError_NotConnected != NULL);
523 IOError_LDKIOError_AddrInUse = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AddrInUse", "Lorg/ldk/enums/IOError;");
524 CHECK(IOError_LDKIOError_AddrInUse != NULL);
525 IOError_LDKIOError_AddrNotAvailable = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AddrNotAvailable", "Lorg/ldk/enums/IOError;");
526 CHECK(IOError_LDKIOError_AddrNotAvailable != NULL);
527 IOError_LDKIOError_BrokenPipe = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_BrokenPipe", "Lorg/ldk/enums/IOError;");
528 CHECK(IOError_LDKIOError_BrokenPipe != NULL);
529 IOError_LDKIOError_AlreadyExists = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AlreadyExists", "Lorg/ldk/enums/IOError;");
530 CHECK(IOError_LDKIOError_AlreadyExists != NULL);
531 IOError_LDKIOError_WouldBlock = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_WouldBlock", "Lorg/ldk/enums/IOError;");
532 CHECK(IOError_LDKIOError_WouldBlock != NULL);
533 IOError_LDKIOError_InvalidInput = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_InvalidInput", "Lorg/ldk/enums/IOError;");
534 CHECK(IOError_LDKIOError_InvalidInput != NULL);
535 IOError_LDKIOError_InvalidData = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_InvalidData", "Lorg/ldk/enums/IOError;");
536 CHECK(IOError_LDKIOError_InvalidData != NULL);
537 IOError_LDKIOError_TimedOut = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_TimedOut", "Lorg/ldk/enums/IOError;");
538 CHECK(IOError_LDKIOError_TimedOut != NULL);
539 IOError_LDKIOError_WriteZero = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_WriteZero", "Lorg/ldk/enums/IOError;");
540 CHECK(IOError_LDKIOError_WriteZero != NULL);
541 IOError_LDKIOError_Interrupted = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_Interrupted", "Lorg/ldk/enums/IOError;");
542 CHECK(IOError_LDKIOError_Interrupted != NULL);
543 IOError_LDKIOError_Other = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_Other", "Lorg/ldk/enums/IOError;");
544 CHECK(IOError_LDKIOError_Other != NULL);
545 IOError_LDKIOError_UnexpectedEof = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_UnexpectedEof", "Lorg/ldk/enums/IOError;");
546 CHECK(IOError_LDKIOError_UnexpectedEof != NULL);
548 static inline jclass LDKIOError_to_java(JNIEnv *env, LDKIOError val) {
550 case LDKIOError_NotFound:
551 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_NotFound);
552 case LDKIOError_PermissionDenied:
553 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_PermissionDenied);
554 case LDKIOError_ConnectionRefused:
555 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionRefused);
556 case LDKIOError_ConnectionReset:
557 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionReset);
558 case LDKIOError_ConnectionAborted:
559 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionAborted);
560 case LDKIOError_NotConnected:
561 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_NotConnected);
562 case LDKIOError_AddrInUse:
563 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AddrInUse);
564 case LDKIOError_AddrNotAvailable:
565 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AddrNotAvailable);
566 case LDKIOError_BrokenPipe:
567 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_BrokenPipe);
568 case LDKIOError_AlreadyExists:
569 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AlreadyExists);
570 case LDKIOError_WouldBlock:
571 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_WouldBlock);
572 case LDKIOError_InvalidInput:
573 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_InvalidInput);
574 case LDKIOError_InvalidData:
575 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_InvalidData);
576 case LDKIOError_TimedOut:
577 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_TimedOut);
578 case LDKIOError_WriteZero:
579 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_WriteZero);
580 case LDKIOError_Interrupted:
581 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_Interrupted);
582 case LDKIOError_Other:
583 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_Other);
584 case LDKIOError_UnexpectedEof:
585 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_UnexpectedEof);
590 static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass clz) {
591 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
592 if (UNLIKELY((*env)->ExceptionCheck(env))) {
593 (*env)->ExceptionDescribe(env);
594 (*env)->FatalError(env, "A call to Level.ordinal() from rust threw an exception.");
597 case 0: return LDKLevel_Gossip;
598 case 1: return LDKLevel_Trace;
599 case 2: return LDKLevel_Debug;
600 case 3: return LDKLevel_Info;
601 case 4: return LDKLevel_Warn;
602 case 5: return LDKLevel_Error;
604 (*env)->FatalError(env, "A call to Level.ordinal() from rust returned an invalid value.");
605 abort(); // Unreachable, but will let the compiler know we don't return here
607 static jclass Level_class = NULL;
608 static jfieldID Level_LDKLevel_Gossip = NULL;
609 static jfieldID Level_LDKLevel_Trace = NULL;
610 static jfieldID Level_LDKLevel_Debug = NULL;
611 static jfieldID Level_LDKLevel_Info = NULL;
612 static jfieldID Level_LDKLevel_Warn = NULL;
613 static jfieldID Level_LDKLevel_Error = NULL;
614 JNIEXPORT void JNICALL Java_org_ldk_enums_Level_init (JNIEnv *env, jclass clz) {
615 Level_class = (*env)->NewGlobalRef(env, clz);
616 CHECK(Level_class != NULL);
617 Level_LDKLevel_Gossip = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Gossip", "Lorg/ldk/enums/Level;");
618 CHECK(Level_LDKLevel_Gossip != NULL);
619 Level_LDKLevel_Trace = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Trace", "Lorg/ldk/enums/Level;");
620 CHECK(Level_LDKLevel_Trace != NULL);
621 Level_LDKLevel_Debug = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Debug", "Lorg/ldk/enums/Level;");
622 CHECK(Level_LDKLevel_Debug != NULL);
623 Level_LDKLevel_Info = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Info", "Lorg/ldk/enums/Level;");
624 CHECK(Level_LDKLevel_Info != NULL);
625 Level_LDKLevel_Warn = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Warn", "Lorg/ldk/enums/Level;");
626 CHECK(Level_LDKLevel_Warn != NULL);
627 Level_LDKLevel_Error = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Error", "Lorg/ldk/enums/Level;");
628 CHECK(Level_LDKLevel_Error != NULL);
630 static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
632 case LDKLevel_Gossip:
633 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Gossip);
635 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Trace);
637 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Debug);
639 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Info);
641 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Warn);
643 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Error);
648 static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass clz) {
649 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
650 if (UNLIKELY((*env)->ExceptionCheck(env))) {
651 (*env)->ExceptionDescribe(env);
652 (*env)->FatalError(env, "A call to Network.ordinal() from rust threw an exception.");
655 case 0: return LDKNetwork_Bitcoin;
656 case 1: return LDKNetwork_Testnet;
657 case 2: return LDKNetwork_Regtest;
658 case 3: return LDKNetwork_Signet;
660 (*env)->FatalError(env, "A call to Network.ordinal() from rust returned an invalid value.");
661 abort(); // Unreachable, but will let the compiler know we don't return here
663 static jclass Network_class = NULL;
664 static jfieldID Network_LDKNetwork_Bitcoin = NULL;
665 static jfieldID Network_LDKNetwork_Testnet = NULL;
666 static jfieldID Network_LDKNetwork_Regtest = NULL;
667 static jfieldID Network_LDKNetwork_Signet = NULL;
668 JNIEXPORT void JNICALL Java_org_ldk_enums_Network_init (JNIEnv *env, jclass clz) {
669 Network_class = (*env)->NewGlobalRef(env, clz);
670 CHECK(Network_class != NULL);
671 Network_LDKNetwork_Bitcoin = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Bitcoin", "Lorg/ldk/enums/Network;");
672 CHECK(Network_LDKNetwork_Bitcoin != NULL);
673 Network_LDKNetwork_Testnet = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Testnet", "Lorg/ldk/enums/Network;");
674 CHECK(Network_LDKNetwork_Testnet != NULL);
675 Network_LDKNetwork_Regtest = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Regtest", "Lorg/ldk/enums/Network;");
676 CHECK(Network_LDKNetwork_Regtest != NULL);
677 Network_LDKNetwork_Signet = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Signet", "Lorg/ldk/enums/Network;");
678 CHECK(Network_LDKNetwork_Signet != NULL);
680 static inline jclass LDKNetwork_to_java(JNIEnv *env, LDKNetwork val) {
682 case LDKNetwork_Bitcoin:
683 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Bitcoin);
684 case LDKNetwork_Testnet:
685 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Testnet);
686 case LDKNetwork_Regtest:
687 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Regtest);
688 case LDKNetwork_Signet:
689 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Signet);
694 static inline LDKRecipient LDKRecipient_from_java(JNIEnv *env, jclass clz) {
695 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
696 if (UNLIKELY((*env)->ExceptionCheck(env))) {
697 (*env)->ExceptionDescribe(env);
698 (*env)->FatalError(env, "A call to Recipient.ordinal() from rust threw an exception.");
701 case 0: return LDKRecipient_Node;
702 case 1: return LDKRecipient_PhantomNode;
704 (*env)->FatalError(env, "A call to Recipient.ordinal() from rust returned an invalid value.");
705 abort(); // Unreachable, but will let the compiler know we don't return here
707 static jclass Recipient_class = NULL;
708 static jfieldID Recipient_LDKRecipient_Node = NULL;
709 static jfieldID Recipient_LDKRecipient_PhantomNode = NULL;
710 JNIEXPORT void JNICALL Java_org_ldk_enums_Recipient_init (JNIEnv *env, jclass clz) {
711 Recipient_class = (*env)->NewGlobalRef(env, clz);
712 CHECK(Recipient_class != NULL);
713 Recipient_LDKRecipient_Node = (*env)->GetStaticFieldID(env, Recipient_class, "LDKRecipient_Node", "Lorg/ldk/enums/Recipient;");
714 CHECK(Recipient_LDKRecipient_Node != NULL);
715 Recipient_LDKRecipient_PhantomNode = (*env)->GetStaticFieldID(env, Recipient_class, "LDKRecipient_PhantomNode", "Lorg/ldk/enums/Recipient;");
716 CHECK(Recipient_LDKRecipient_PhantomNode != NULL);
718 static inline jclass LDKRecipient_to_java(JNIEnv *env, LDKRecipient val) {
720 case LDKRecipient_Node:
721 return (*env)->GetStaticObjectField(env, Recipient_class, Recipient_LDKRecipient_Node);
722 case LDKRecipient_PhantomNode:
723 return (*env)->GetStaticObjectField(env, Recipient_class, Recipient_LDKRecipient_PhantomNode);
728 static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass clz) {
729 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
730 if (UNLIKELY((*env)->ExceptionCheck(env))) {
731 (*env)->ExceptionDescribe(env);
732 (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust threw an exception.");
735 case 0: return LDKSecp256k1Error_IncorrectSignature;
736 case 1: return LDKSecp256k1Error_InvalidMessage;
737 case 2: return LDKSecp256k1Error_InvalidPublicKey;
738 case 3: return LDKSecp256k1Error_InvalidSignature;
739 case 4: return LDKSecp256k1Error_InvalidSecretKey;
740 case 5: return LDKSecp256k1Error_InvalidSharedSecret;
741 case 6: return LDKSecp256k1Error_InvalidRecoveryId;
742 case 7: return LDKSecp256k1Error_InvalidTweak;
743 case 8: return LDKSecp256k1Error_NotEnoughMemory;
744 case 9: return LDKSecp256k1Error_InvalidPublicKeySum;
745 case 10: return LDKSecp256k1Error_InvalidParityValue;
747 (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust returned an invalid value.");
748 abort(); // Unreachable, but will let the compiler know we don't return here
750 static jclass Secp256k1Error_class = NULL;
751 static jfieldID Secp256k1Error_LDKSecp256k1Error_IncorrectSignature = NULL;
752 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidMessage = NULL;
753 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey = NULL;
754 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSignature = NULL;
755 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = NULL;
756 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = NULL;
757 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = NULL;
758 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL;
759 static jfieldID Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL;
760 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = NULL;
761 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = NULL;
762 JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jclass clz) {
763 Secp256k1Error_class = (*env)->NewGlobalRef(env, clz);
764 CHECK(Secp256k1Error_class != NULL);
765 Secp256k1Error_LDKSecp256k1Error_IncorrectSignature = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_IncorrectSignature", "Lorg/ldk/enums/Secp256k1Error;");
766 CHECK(Secp256k1Error_LDKSecp256k1Error_IncorrectSignature != NULL);
767 Secp256k1Error_LDKSecp256k1Error_InvalidMessage = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidMessage", "Lorg/ldk/enums/Secp256k1Error;");
768 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidMessage != NULL);
769 Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKey", "Lorg/ldk/enums/Secp256k1Error;");
770 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey != NULL);
771 Secp256k1Error_LDKSecp256k1Error_InvalidSignature = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSignature", "Lorg/ldk/enums/Secp256k1Error;");
772 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSignature != NULL);
773 Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/enums/Secp256k1Error;");
774 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey != NULL);
775 Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSharedSecret", "Lorg/ldk/enums/Secp256k1Error;");
776 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret != NULL);
777 Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/enums/Secp256k1Error;");
778 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId != NULL);
779 Secp256k1Error_LDKSecp256k1Error_InvalidTweak = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/enums/Secp256k1Error;");
780 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidTweak != NULL);
781 Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/enums/Secp256k1Error;");
782 CHECK(Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory != NULL);
783 Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKeySum", "Lorg/ldk/enums/Secp256k1Error;");
784 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum != NULL);
785 Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidParityValue", "Lorg/ldk/enums/Secp256k1Error;");
786 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidParityValue != NULL);
788 static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) {
790 case LDKSecp256k1Error_IncorrectSignature:
791 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_IncorrectSignature);
792 case LDKSecp256k1Error_InvalidMessage:
793 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidMessage);
794 case LDKSecp256k1Error_InvalidPublicKey:
795 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey);
796 case LDKSecp256k1Error_InvalidSignature:
797 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSignature);
798 case LDKSecp256k1Error_InvalidSecretKey:
799 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey);
800 case LDKSecp256k1Error_InvalidSharedSecret:
801 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret);
802 case LDKSecp256k1Error_InvalidRecoveryId:
803 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId);
804 case LDKSecp256k1Error_InvalidTweak:
805 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidTweak);
806 case LDKSecp256k1Error_NotEnoughMemory:
807 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory);
808 case LDKSecp256k1Error_InvalidPublicKeySum:
809 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum);
810 case LDKSecp256k1Error_InvalidParityValue:
811 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidParityValue);
816 static inline LDKSemanticError LDKSemanticError_from_java(JNIEnv *env, jclass clz) {
817 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
818 if (UNLIKELY((*env)->ExceptionCheck(env))) {
819 (*env)->ExceptionDescribe(env);
820 (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust threw an exception.");
823 case 0: return LDKSemanticError_NoPaymentHash;
824 case 1: return LDKSemanticError_MultiplePaymentHashes;
825 case 2: return LDKSemanticError_NoDescription;
826 case 3: return LDKSemanticError_MultipleDescriptions;
827 case 4: return LDKSemanticError_NoPaymentSecret;
828 case 5: return LDKSemanticError_MultiplePaymentSecrets;
829 case 6: return LDKSemanticError_InvalidFeatures;
830 case 7: return LDKSemanticError_InvalidRecoveryId;
831 case 8: return LDKSemanticError_InvalidSignature;
832 case 9: return LDKSemanticError_ImpreciseAmount;
834 (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust returned an invalid value.");
835 abort(); // Unreachable, but will let the compiler know we don't return here
837 static jclass SemanticError_class = NULL;
838 static jfieldID SemanticError_LDKSemanticError_NoPaymentHash = NULL;
839 static jfieldID SemanticError_LDKSemanticError_MultiplePaymentHashes = NULL;
840 static jfieldID SemanticError_LDKSemanticError_NoDescription = NULL;
841 static jfieldID SemanticError_LDKSemanticError_MultipleDescriptions = NULL;
842 static jfieldID SemanticError_LDKSemanticError_NoPaymentSecret = NULL;
843 static jfieldID SemanticError_LDKSemanticError_MultiplePaymentSecrets = NULL;
844 static jfieldID SemanticError_LDKSemanticError_InvalidFeatures = NULL;
845 static jfieldID SemanticError_LDKSemanticError_InvalidRecoveryId = NULL;
846 static jfieldID SemanticError_LDKSemanticError_InvalidSignature = NULL;
847 static jfieldID SemanticError_LDKSemanticError_ImpreciseAmount = NULL;
848 JNIEXPORT void JNICALL Java_org_ldk_enums_SemanticError_init (JNIEnv *env, jclass clz) {
849 SemanticError_class = (*env)->NewGlobalRef(env, clz);
850 CHECK(SemanticError_class != NULL);
851 SemanticError_LDKSemanticError_NoPaymentHash = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoPaymentHash", "Lorg/ldk/enums/SemanticError;");
852 CHECK(SemanticError_LDKSemanticError_NoPaymentHash != NULL);
853 SemanticError_LDKSemanticError_MultiplePaymentHashes = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultiplePaymentHashes", "Lorg/ldk/enums/SemanticError;");
854 CHECK(SemanticError_LDKSemanticError_MultiplePaymentHashes != NULL);
855 SemanticError_LDKSemanticError_NoDescription = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoDescription", "Lorg/ldk/enums/SemanticError;");
856 CHECK(SemanticError_LDKSemanticError_NoDescription != NULL);
857 SemanticError_LDKSemanticError_MultipleDescriptions = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultipleDescriptions", "Lorg/ldk/enums/SemanticError;");
858 CHECK(SemanticError_LDKSemanticError_MultipleDescriptions != NULL);
859 SemanticError_LDKSemanticError_NoPaymentSecret = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoPaymentSecret", "Lorg/ldk/enums/SemanticError;");
860 CHECK(SemanticError_LDKSemanticError_NoPaymentSecret != NULL);
861 SemanticError_LDKSemanticError_MultiplePaymentSecrets = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultiplePaymentSecrets", "Lorg/ldk/enums/SemanticError;");
862 CHECK(SemanticError_LDKSemanticError_MultiplePaymentSecrets != NULL);
863 SemanticError_LDKSemanticError_InvalidFeatures = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidFeatures", "Lorg/ldk/enums/SemanticError;");
864 CHECK(SemanticError_LDKSemanticError_InvalidFeatures != NULL);
865 SemanticError_LDKSemanticError_InvalidRecoveryId = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidRecoveryId", "Lorg/ldk/enums/SemanticError;");
866 CHECK(SemanticError_LDKSemanticError_InvalidRecoveryId != NULL);
867 SemanticError_LDKSemanticError_InvalidSignature = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidSignature", "Lorg/ldk/enums/SemanticError;");
868 CHECK(SemanticError_LDKSemanticError_InvalidSignature != NULL);
869 SemanticError_LDKSemanticError_ImpreciseAmount = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_ImpreciseAmount", "Lorg/ldk/enums/SemanticError;");
870 CHECK(SemanticError_LDKSemanticError_ImpreciseAmount != NULL);
872 static inline jclass LDKSemanticError_to_java(JNIEnv *env, LDKSemanticError val) {
874 case LDKSemanticError_NoPaymentHash:
875 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoPaymentHash);
876 case LDKSemanticError_MultiplePaymentHashes:
877 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultiplePaymentHashes);
878 case LDKSemanticError_NoDescription:
879 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoDescription);
880 case LDKSemanticError_MultipleDescriptions:
881 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultipleDescriptions);
882 case LDKSemanticError_NoPaymentSecret:
883 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoPaymentSecret);
884 case LDKSemanticError_MultiplePaymentSecrets:
885 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultiplePaymentSecrets);
886 case LDKSemanticError_InvalidFeatures:
887 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidFeatures);
888 case LDKSemanticError_InvalidRecoveryId:
889 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidRecoveryId);
890 case LDKSemanticError_InvalidSignature:
891 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidSignature);
892 case LDKSemanticError_ImpreciseAmount:
893 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_ImpreciseAmount);
898 static inline LDKSiPrefix LDKSiPrefix_from_java(JNIEnv *env, jclass clz) {
899 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
900 if (UNLIKELY((*env)->ExceptionCheck(env))) {
901 (*env)->ExceptionDescribe(env);
902 (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust threw an exception.");
905 case 0: return LDKSiPrefix_Milli;
906 case 1: return LDKSiPrefix_Micro;
907 case 2: return LDKSiPrefix_Nano;
908 case 3: return LDKSiPrefix_Pico;
910 (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust returned an invalid value.");
911 abort(); // Unreachable, but will let the compiler know we don't return here
913 static jclass SiPrefix_class = NULL;
914 static jfieldID SiPrefix_LDKSiPrefix_Milli = NULL;
915 static jfieldID SiPrefix_LDKSiPrefix_Micro = NULL;
916 static jfieldID SiPrefix_LDKSiPrefix_Nano = NULL;
917 static jfieldID SiPrefix_LDKSiPrefix_Pico = NULL;
918 JNIEXPORT void JNICALL Java_org_ldk_enums_SiPrefix_init (JNIEnv *env, jclass clz) {
919 SiPrefix_class = (*env)->NewGlobalRef(env, clz);
920 CHECK(SiPrefix_class != NULL);
921 SiPrefix_LDKSiPrefix_Milli = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Milli", "Lorg/ldk/enums/SiPrefix;");
922 CHECK(SiPrefix_LDKSiPrefix_Milli != NULL);
923 SiPrefix_LDKSiPrefix_Micro = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Micro", "Lorg/ldk/enums/SiPrefix;");
924 CHECK(SiPrefix_LDKSiPrefix_Micro != NULL);
925 SiPrefix_LDKSiPrefix_Nano = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Nano", "Lorg/ldk/enums/SiPrefix;");
926 CHECK(SiPrefix_LDKSiPrefix_Nano != NULL);
927 SiPrefix_LDKSiPrefix_Pico = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Pico", "Lorg/ldk/enums/SiPrefix;");
928 CHECK(SiPrefix_LDKSiPrefix_Pico != NULL);
930 static inline jclass LDKSiPrefix_to_java(JNIEnv *env, LDKSiPrefix val) {
932 case LDKSiPrefix_Milli:
933 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Milli);
934 case LDKSiPrefix_Micro:
935 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Micro);
936 case LDKSiPrefix_Nano:
937 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Nano);
938 case LDKSiPrefix_Pico:
939 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Pico);
944 static jclass LDKBech32Error_MissingSeparator_class = NULL;
945 static jmethodID LDKBech32Error_MissingSeparator_meth = NULL;
946 static jclass LDKBech32Error_InvalidChecksum_class = NULL;
947 static jmethodID LDKBech32Error_InvalidChecksum_meth = NULL;
948 static jclass LDKBech32Error_InvalidLength_class = NULL;
949 static jmethodID LDKBech32Error_InvalidLength_meth = NULL;
950 static jclass LDKBech32Error_InvalidChar_class = NULL;
951 static jmethodID LDKBech32Error_InvalidChar_meth = NULL;
952 static jclass LDKBech32Error_InvalidData_class = NULL;
953 static jmethodID LDKBech32Error_InvalidData_meth = NULL;
954 static jclass LDKBech32Error_InvalidPadding_class = NULL;
955 static jmethodID LDKBech32Error_InvalidPadding_meth = NULL;
956 static jclass LDKBech32Error_MixedCase_class = NULL;
957 static jmethodID LDKBech32Error_MixedCase_meth = NULL;
958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBech32Error_init (JNIEnv *env, jclass clz) {
959 LDKBech32Error_MissingSeparator_class =
960 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$MissingSeparator"));
961 CHECK(LDKBech32Error_MissingSeparator_class != NULL);
962 LDKBech32Error_MissingSeparator_meth = (*env)->GetMethodID(env, LDKBech32Error_MissingSeparator_class, "<init>", "()V");
963 CHECK(LDKBech32Error_MissingSeparator_meth != NULL);
964 LDKBech32Error_InvalidChecksum_class =
965 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidChecksum"));
966 CHECK(LDKBech32Error_InvalidChecksum_class != NULL);
967 LDKBech32Error_InvalidChecksum_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidChecksum_class, "<init>", "()V");
968 CHECK(LDKBech32Error_InvalidChecksum_meth != NULL);
969 LDKBech32Error_InvalidLength_class =
970 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidLength"));
971 CHECK(LDKBech32Error_InvalidLength_class != NULL);
972 LDKBech32Error_InvalidLength_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidLength_class, "<init>", "()V");
973 CHECK(LDKBech32Error_InvalidLength_meth != NULL);
974 LDKBech32Error_InvalidChar_class =
975 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidChar"));
976 CHECK(LDKBech32Error_InvalidChar_class != NULL);
977 LDKBech32Error_InvalidChar_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidChar_class, "<init>", "(I)V");
978 CHECK(LDKBech32Error_InvalidChar_meth != NULL);
979 LDKBech32Error_InvalidData_class =
980 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidData"));
981 CHECK(LDKBech32Error_InvalidData_class != NULL);
982 LDKBech32Error_InvalidData_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidData_class, "<init>", "(B)V");
983 CHECK(LDKBech32Error_InvalidData_meth != NULL);
984 LDKBech32Error_InvalidPadding_class =
985 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidPadding"));
986 CHECK(LDKBech32Error_InvalidPadding_class != NULL);
987 LDKBech32Error_InvalidPadding_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidPadding_class, "<init>", "()V");
988 CHECK(LDKBech32Error_InvalidPadding_meth != NULL);
989 LDKBech32Error_MixedCase_class =
990 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$MixedCase"));
991 CHECK(LDKBech32Error_MixedCase_class != NULL);
992 LDKBech32Error_MixedCase_meth = (*env)->GetMethodID(env, LDKBech32Error_MixedCase_class, "<init>", "()V");
993 CHECK(LDKBech32Error_MixedCase_meth != NULL);
995 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBech32Error_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
996 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
998 case LDKBech32Error_MissingSeparator: {
999 return (*env)->NewObject(env, LDKBech32Error_MissingSeparator_class, LDKBech32Error_MissingSeparator_meth);
1001 case LDKBech32Error_InvalidChecksum: {
1002 return (*env)->NewObject(env, LDKBech32Error_InvalidChecksum_class, LDKBech32Error_InvalidChecksum_meth);
1004 case LDKBech32Error_InvalidLength: {
1005 return (*env)->NewObject(env, LDKBech32Error_InvalidLength_class, LDKBech32Error_InvalidLength_meth);
1007 case LDKBech32Error_InvalidChar: {
1008 int32_t invalid_char_conv = obj->invalid_char;
1009 return (*env)->NewObject(env, LDKBech32Error_InvalidChar_class, LDKBech32Error_InvalidChar_meth, invalid_char_conv);
1011 case LDKBech32Error_InvalidData: {
1012 int8_t invalid_data_conv = obj->invalid_data;
1013 return (*env)->NewObject(env, LDKBech32Error_InvalidData_class, LDKBech32Error_InvalidData_meth, invalid_data_conv);
1015 case LDKBech32Error_InvalidPadding: {
1016 return (*env)->NewObject(env, LDKBech32Error_InvalidPadding_class, LDKBech32Error_InvalidPadding_meth);
1018 case LDKBech32Error_MixedCase: {
1019 return (*env)->NewObject(env, LDKBech32Error_MixedCase_class, LDKBech32Error_MixedCase_meth);
1024 static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
1025 LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen };
1026 memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
1029 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) {
1030 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
1031 LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
1032 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
1033 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
1034 CVec_u8Z_free(ret_var);
1038 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) {
1039 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
1040 int64_t ret_conv = TxOut_get_value(thing_conv);
1044 static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
1045 CHECK(owner->result_ok);
1046 return *owner->contents.result;
1048 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1049 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
1050 CResult_NoneNoneZ_get_ok(owner_conv);
1053 static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
1054 CHECK(!owner->result_ok);
1055 return *owner->contents.err;
1057 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1058 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
1059 CResult_NoneNoneZ_get_err(owner_conv);
1062 static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
1063 CHECK(owner->result_ok);
1064 return CounterpartyCommitmentSecrets_clone(&*owner->contents.result);
1066 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1067 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
1068 LDKCounterpartyCommitmentSecrets ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(owner_conv);
1069 int64_t ret_ref = 0;
1070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1075 static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
1076 CHECK(!owner->result_ok);
1077 return DecodeError_clone(&*owner->contents.err);
1079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1080 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
1081 LDKDecodeError ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
1082 int64_t ret_ref = 0;
1083 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1084 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1088 static inline struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
1089 CHECK(owner->result_ok);
1090 return *owner->contents.result;
1092 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1093 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
1094 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
1095 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes);
1099 static inline enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
1100 CHECK(!owner->result_ok);
1101 return *owner->contents.err;
1103 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1104 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
1105 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_SecretKeyErrorZ_get_err(owner_conv));
1109 static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
1110 CHECK(owner->result_ok);
1111 return *owner->contents.result;
1113 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1114 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
1115 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
1116 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form);
1120 static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
1121 CHECK(!owner->result_ok);
1122 return *owner->contents.err;
1124 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1125 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
1126 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PublicKeyErrorZ_get_err(owner_conv));
1130 static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
1131 CHECK(owner->result_ok);
1132 return TxCreationKeys_clone(&*owner->contents.result);
1134 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1135 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
1136 LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv);
1137 int64_t ret_ref = 0;
1138 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1139 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1143 static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
1144 CHECK(!owner->result_ok);
1145 return DecodeError_clone(&*owner->contents.err);
1147 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1148 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
1149 LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
1150 int64_t ret_ref = 0;
1151 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1152 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1156 static inline struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
1157 CHECK(owner->result_ok);
1158 return ChannelPublicKeys_clone(&*owner->contents.result);
1160 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1161 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
1162 LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv);
1163 int64_t ret_ref = 0;
1164 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1165 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1169 static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
1170 CHECK(!owner->result_ok);
1171 return DecodeError_clone(&*owner->contents.err);
1173 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1174 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
1175 LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
1176 int64_t ret_ref = 0;
1177 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1178 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1182 static inline struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
1183 CHECK(owner->result_ok);
1184 return TxCreationKeys_clone(&*owner->contents.result);
1186 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1187 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
1188 LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv);
1189 int64_t ret_ref = 0;
1190 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1191 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1195 static inline enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
1196 CHECK(!owner->result_ok);
1197 return *owner->contents.err;
1199 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1200 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
1201 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_TxCreationKeysErrorZ_get_err(owner_conv));
1205 static jclass LDKCOption_u32Z_Some_class = NULL;
1206 static jmethodID LDKCOption_u32Z_Some_meth = NULL;
1207 static jclass LDKCOption_u32Z_None_class = NULL;
1208 static jmethodID LDKCOption_u32Z_None_meth = NULL;
1209 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u32Z_init (JNIEnv *env, jclass clz) {
1210 LDKCOption_u32Z_Some_class =
1211 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$Some"));
1212 CHECK(LDKCOption_u32Z_Some_class != NULL);
1213 LDKCOption_u32Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_Some_class, "<init>", "(I)V");
1214 CHECK(LDKCOption_u32Z_Some_meth != NULL);
1215 LDKCOption_u32Z_None_class =
1216 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$None"));
1217 CHECK(LDKCOption_u32Z_None_class != NULL);
1218 LDKCOption_u32Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_None_class, "<init>", "()V");
1219 CHECK(LDKCOption_u32Z_None_meth != NULL);
1221 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1222 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
1224 case LDKCOption_u32Z_Some: {
1225 int32_t some_conv = obj->some;
1226 return (*env)->NewObject(env, LDKCOption_u32Z_Some_class, LDKCOption_u32Z_Some_meth, some_conv);
1228 case LDKCOption_u32Z_None: {
1229 return (*env)->NewObject(env, LDKCOption_u32Z_None_class, LDKCOption_u32Z_None_meth);
1234 static inline struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
1235 CHECK(owner->result_ok);
1236 return HTLCOutputInCommitment_clone(&*owner->contents.result);
1238 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1239 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
1240 LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv);
1241 int64_t ret_ref = 0;
1242 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1243 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1247 static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
1248 CHECK(!owner->result_ok);
1249 return DecodeError_clone(&*owner->contents.err);
1251 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1252 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
1253 LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
1254 int64_t ret_ref = 0;
1255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1260 static inline struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1261 CHECK(owner->result_ok);
1262 return CounterpartyChannelTransactionParameters_clone(&*owner->contents.result);
1264 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1265 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1266 LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
1267 int64_t ret_ref = 0;
1268 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1269 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1273 static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1274 CHECK(!owner->result_ok);
1275 return DecodeError_clone(&*owner->contents.err);
1277 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1278 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1279 LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
1280 int64_t ret_ref = 0;
1281 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1282 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1286 static inline struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1287 CHECK(owner->result_ok);
1288 return ChannelTransactionParameters_clone(&*owner->contents.result);
1290 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1291 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1292 LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
1293 int64_t ret_ref = 0;
1294 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1295 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1299 static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1300 CHECK(!owner->result_ok);
1301 return DecodeError_clone(&*owner->contents.err);
1303 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1304 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1305 LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
1306 int64_t ret_ref = 0;
1307 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1308 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1312 static inline struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1313 CHECK(owner->result_ok);
1314 return HolderCommitmentTransaction_clone(&*owner->contents.result);
1316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1317 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1318 LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_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_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *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_1HolderCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1330 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1331 LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1332 int64_t ret_ref = 0;
1333 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1334 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1338 static inline struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1339 CHECK(owner->result_ok);
1340 return BuiltCommitmentTransaction_clone(&*owner->contents.result);
1342 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1343 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1344 LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_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_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *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_1BuiltCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1356 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1357 LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1358 int64_t ret_ref = 0;
1359 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1360 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1364 static inline struct LDKTrustedClosingTransaction *CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
1365 CHECK(owner->result_ok);
1366 return &*owner->contents.result;
1368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1369 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
1370 LDKTrustedClosingTransaction ret_var = *CResult_TrustedClosingTransactionNoneZ_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, false);
1377 static inline void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
1378 CHECK(!owner->result_ok);
1379 return *owner->contents.err;
1381 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1382 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
1383 CResult_TrustedClosingTransactionNoneZ_get_err(owner_conv);
1386 static inline struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1387 CHECK(owner->result_ok);
1388 return CommitmentTransaction_clone(&*owner->contents.result);
1390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1391 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1392 LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
1393 int64_t ret_ref = 0;
1394 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1395 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1399 static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1400 CHECK(!owner->result_ok);
1401 return DecodeError_clone(&*owner->contents.err);
1403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1404 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1405 LDKDecodeError ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1406 int64_t ret_ref = 0;
1407 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1408 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1412 static inline struct LDKTrustedCommitmentTransaction *CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
1413 CHECK(owner->result_ok);
1414 return &*owner->contents.result;
1416 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1417 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
1418 LDKTrustedCommitmentTransaction ret_var = *CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv);
1419 int64_t ret_ref = 0;
1420 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1421 ret_ref = tag_ptr(ret_var.inner, false);
1425 static inline void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
1426 CHECK(!owner->result_ok);
1427 return *owner->contents.err;
1429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1430 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
1431 CResult_TrustedCommitmentTransactionNoneZ_get_err(owner_conv);
1434 static inline struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
1435 CHECK(owner->result_ok);
1436 return *owner->contents.result;
1438 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1439 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
1440 LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv);
1441 jobjectArray ret_arr = NULL;
1442 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
1444 for (size_t i = 0; i < ret_var.datalen; i++) {
1445 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
1446 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
1447 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
1453 static inline void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
1454 CHECK(!owner->result_ok);
1455 return *owner->contents.err;
1457 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1458 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
1459 CResult_CVec_SignatureZNoneZ_get_err(owner_conv);
1462 static inline struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1463 CHECK(owner->result_ok);
1464 return ShutdownScript_clone(&*owner->contents.result);
1466 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1467 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1468 LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv);
1469 int64_t ret_ref = 0;
1470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1471 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1475 static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1476 CHECK(!owner->result_ok);
1477 return DecodeError_clone(&*owner->contents.err);
1479 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1480 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1481 LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
1482 int64_t ret_ref = 0;
1483 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1484 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1488 static inline struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1489 CHECK(owner->result_ok);
1490 return ShutdownScript_clone(&*owner->contents.result);
1492 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1493 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1494 LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv);
1495 int64_t ret_ref = 0;
1496 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1497 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1501 static inline struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1502 CHECK(!owner->result_ok);
1503 return InvalidShutdownScript_clone(&*owner->contents.err);
1505 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1506 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1507 LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv);
1508 int64_t ret_ref = 0;
1509 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1510 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1514 static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
1515 CHECK(owner->result_ok);
1516 return *owner->contents.result;
1518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1519 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
1520 CResult_NoneErrorZ_get_ok(owner_conv);
1523 static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
1524 CHECK(!owner->result_ok);
1525 return *owner->contents.err;
1527 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1528 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
1529 jclass ret_conv = LDKIOError_to_java(env, CResult_NoneErrorZ_get_err(owner_conv));
1533 static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
1534 CHECK(owner->result_ok);
1535 return RouteHop_clone(&*owner->contents.result);
1537 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1538 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
1539 LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
1540 int64_t ret_ref = 0;
1541 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1542 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1546 static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
1547 CHECK(!owner->result_ok);
1548 return DecodeError_clone(&*owner->contents.err);
1550 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1551 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
1552 LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
1553 int64_t ret_ref = 0;
1554 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1555 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1559 static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) {
1560 LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen };
1561 for (size_t i = 0; i < ret.datalen; i++) {
1562 ret.data[i] = RouteHop_clone(&orig->data[i]);
1566 static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) {
1567 LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen };
1568 for (size_t i = 0; i < ret.datalen; i++) {
1569 ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]);
1573 static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
1574 CHECK(owner->result_ok);
1575 return Route_clone(&*owner->contents.result);
1577 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1578 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
1579 LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv);
1580 int64_t ret_ref = 0;
1581 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1582 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1586 static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
1587 CHECK(!owner->result_ok);
1588 return DecodeError_clone(&*owner->contents.err);
1590 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1591 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
1592 LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv);
1593 int64_t ret_ref = 0;
1594 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1595 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1599 static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1600 CHECK(owner->result_ok);
1601 return RouteParameters_clone(&*owner->contents.result);
1603 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1604 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1605 LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv);
1606 int64_t ret_ref = 0;
1607 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1608 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1612 static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1613 CHECK(!owner->result_ok);
1614 return DecodeError_clone(&*owner->contents.err);
1616 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1617 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1618 LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
1619 int64_t ret_ref = 0;
1620 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1621 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1625 static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
1626 LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
1627 for (size_t i = 0; i < ret.datalen; i++) {
1628 ret.data[i] = RouteHint_clone(&orig->data[i]);
1632 static jclass LDKCOption_u64Z_Some_class = NULL;
1633 static jmethodID LDKCOption_u64Z_Some_meth = NULL;
1634 static jclass LDKCOption_u64Z_None_class = NULL;
1635 static jmethodID LDKCOption_u64Z_None_meth = NULL;
1636 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u64Z_init (JNIEnv *env, jclass clz) {
1637 LDKCOption_u64Z_Some_class =
1638 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$Some"));
1639 CHECK(LDKCOption_u64Z_Some_class != NULL);
1640 LDKCOption_u64Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_Some_class, "<init>", "(J)V");
1641 CHECK(LDKCOption_u64Z_Some_meth != NULL);
1642 LDKCOption_u64Z_None_class =
1643 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$None"));
1644 CHECK(LDKCOption_u64Z_None_class != NULL);
1645 LDKCOption_u64Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_None_class, "<init>", "()V");
1646 CHECK(LDKCOption_u64Z_None_meth != NULL);
1648 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1649 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1651 case LDKCOption_u64Z_Some: {
1652 int64_t some_conv = obj->some;
1653 return (*env)->NewObject(env, LDKCOption_u64Z_Some_class, LDKCOption_u64Z_Some_meth, some_conv);
1655 case LDKCOption_u64Z_None: {
1656 return (*env)->NewObject(env, LDKCOption_u64Z_None_class, LDKCOption_u64Z_None_meth);
1661 static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
1662 LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
1663 memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
1666 static inline struct LDKPaymentParameters CResult_PaymentParametersDecodeErrorZ_get_ok(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1667 CHECK(owner->result_ok);
1668 return PaymentParameters_clone(&*owner->contents.result);
1670 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1671 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1672 LDKPaymentParameters ret_var = CResult_PaymentParametersDecodeErrorZ_get_ok(owner_conv);
1673 int64_t ret_ref = 0;
1674 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1675 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1679 static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1680 CHECK(!owner->result_ok);
1681 return DecodeError_clone(&*owner->contents.err);
1683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1684 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1685 LDKDecodeError ret_var = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
1686 int64_t ret_ref = 0;
1687 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1688 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1692 static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
1693 LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
1694 for (size_t i = 0; i < ret.datalen; i++) {
1695 ret.data[i] = RouteHintHop_clone(&orig->data[i]);
1699 static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1700 CHECK(owner->result_ok);
1701 return RouteHint_clone(&*owner->contents.result);
1703 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1704 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1705 LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv);
1706 int64_t ret_ref = 0;
1707 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1708 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1712 static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1713 CHECK(!owner->result_ok);
1714 return DecodeError_clone(&*owner->contents.err);
1716 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1717 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1718 LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
1719 int64_t ret_ref = 0;
1720 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1721 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1725 static inline struct LDKRouteHintHop CResult_RouteHintHopDecodeErrorZ_get_ok(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1726 CHECK(owner->result_ok);
1727 return RouteHintHop_clone(&*owner->contents.result);
1729 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1730 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1731 LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv);
1732 int64_t ret_ref = 0;
1733 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1734 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1738 static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1739 CHECK(!owner->result_ok);
1740 return DecodeError_clone(&*owner->contents.err);
1742 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1743 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1744 LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
1745 int64_t ret_ref = 0;
1746 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1747 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1751 static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
1752 LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
1753 for (size_t i = 0; i < ret.datalen; i++) {
1754 ret.data[i] = ChannelDetails_clone(&orig->data[i]);
1758 static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1759 CHECK(owner->result_ok);
1760 return Route_clone(&*owner->contents.result);
1762 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1763 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1764 LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
1765 int64_t ret_ref = 0;
1766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1771 static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1772 CHECK(!owner->result_ok);
1773 return LightningError_clone(&*owner->contents.err);
1775 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1776 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1777 LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
1778 int64_t ret_ref = 0;
1779 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1780 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1784 static jclass LDKPaymentPurpose_InvoicePayment_class = NULL;
1785 static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL;
1786 static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL;
1787 static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL;
1788 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) {
1789 LDKPaymentPurpose_InvoicePayment_class =
1790 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment"));
1791 CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL);
1792 LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[B)V");
1793 CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL);
1794 LDKPaymentPurpose_SpontaneousPayment_class =
1795 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment"));
1796 CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL);
1797 LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "<init>", "([B)V");
1798 CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL);
1800 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1801 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1803 case LDKPaymentPurpose_InvoicePayment: {
1804 int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
1805 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data);
1806 int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
1807 (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data);
1808 return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr);
1810 case LDKPaymentPurpose_SpontaneousPayment: {
1811 int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32);
1812 (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data);
1813 return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr);
1818 static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1819 CHECK(owner->result_ok);
1820 return PaymentPurpose_clone(&*owner->contents.result);
1822 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1823 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1824 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
1825 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv);
1826 int64_t ret_ref = tag_ptr(ret_copy, true);
1830 static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1831 CHECK(!owner->result_ok);
1832 return DecodeError_clone(&*owner->contents.err);
1834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1835 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1836 LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
1837 int64_t ret_ref = 0;
1838 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1839 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1843 static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL;
1844 static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL;
1845 static jclass LDKClosureReason_HolderForceClosed_class = NULL;
1846 static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL;
1847 static jclass LDKClosureReason_CooperativeClosure_class = NULL;
1848 static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL;
1849 static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL;
1850 static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL;
1851 static jclass LDKClosureReason_FundingTimedOut_class = NULL;
1852 static jmethodID LDKClosureReason_FundingTimedOut_meth = NULL;
1853 static jclass LDKClosureReason_ProcessingError_class = NULL;
1854 static jmethodID LDKClosureReason_ProcessingError_meth = NULL;
1855 static jclass LDKClosureReason_DisconnectedPeer_class = NULL;
1856 static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL;
1857 static jclass LDKClosureReason_OutdatedChannelManager_class = NULL;
1858 static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL;
1859 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) {
1860 LDKClosureReason_CounterpartyForceClosed_class =
1861 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed"));
1862 CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL);
1863 LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "<init>", "(Ljava/lang/String;)V");
1864 CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL);
1865 LDKClosureReason_HolderForceClosed_class =
1866 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$HolderForceClosed"));
1867 CHECK(LDKClosureReason_HolderForceClosed_class != NULL);
1868 LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "<init>", "()V");
1869 CHECK(LDKClosureReason_HolderForceClosed_meth != NULL);
1870 LDKClosureReason_CooperativeClosure_class =
1871 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CooperativeClosure"));
1872 CHECK(LDKClosureReason_CooperativeClosure_class != NULL);
1873 LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "<init>", "()V");
1874 CHECK(LDKClosureReason_CooperativeClosure_meth != NULL);
1875 LDKClosureReason_CommitmentTxConfirmed_class =
1876 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed"));
1877 CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL);
1878 LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "<init>", "()V");
1879 CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL);
1880 LDKClosureReason_FundingTimedOut_class =
1881 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$FundingTimedOut"));
1882 CHECK(LDKClosureReason_FundingTimedOut_class != NULL);
1883 LDKClosureReason_FundingTimedOut_meth = (*env)->GetMethodID(env, LDKClosureReason_FundingTimedOut_class, "<init>", "()V");
1884 CHECK(LDKClosureReason_FundingTimedOut_meth != NULL);
1885 LDKClosureReason_ProcessingError_class =
1886 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$ProcessingError"));
1887 CHECK(LDKClosureReason_ProcessingError_class != NULL);
1888 LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "<init>", "(Ljava/lang/String;)V");
1889 CHECK(LDKClosureReason_ProcessingError_meth != NULL);
1890 LDKClosureReason_DisconnectedPeer_class =
1891 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer"));
1892 CHECK(LDKClosureReason_DisconnectedPeer_class != NULL);
1893 LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "<init>", "()V");
1894 CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL);
1895 LDKClosureReason_OutdatedChannelManager_class =
1896 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager"));
1897 CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL);
1898 LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "<init>", "()V");
1899 CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL);
1901 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1902 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1904 case LDKClosureReason_CounterpartyForceClosed: {
1905 LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg;
1906 jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len);
1907 return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv);
1909 case LDKClosureReason_HolderForceClosed: {
1910 return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth);
1912 case LDKClosureReason_CooperativeClosure: {
1913 return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth);
1915 case LDKClosureReason_CommitmentTxConfirmed: {
1916 return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth);
1918 case LDKClosureReason_FundingTimedOut: {
1919 return (*env)->NewObject(env, LDKClosureReason_FundingTimedOut_class, LDKClosureReason_FundingTimedOut_meth);
1921 case LDKClosureReason_ProcessingError: {
1922 LDKStr err_str = obj->processing_error.err;
1923 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
1924 return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv);
1926 case LDKClosureReason_DisconnectedPeer: {
1927 return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth);
1929 case LDKClosureReason_OutdatedChannelManager: {
1930 return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth);
1935 static jclass LDKCOption_ClosureReasonZ_Some_class = NULL;
1936 static jmethodID LDKCOption_ClosureReasonZ_Some_meth = NULL;
1937 static jclass LDKCOption_ClosureReasonZ_None_class = NULL;
1938 static jmethodID LDKCOption_ClosureReasonZ_None_meth = NULL;
1939 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init (JNIEnv *env, jclass clz) {
1940 LDKCOption_ClosureReasonZ_Some_class =
1941 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some"));
1942 CHECK(LDKCOption_ClosureReasonZ_Some_class != NULL);
1943 LDKCOption_ClosureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_Some_class, "<init>", "(J)V");
1944 CHECK(LDKCOption_ClosureReasonZ_Some_meth != NULL);
1945 LDKCOption_ClosureReasonZ_None_class =
1946 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None"));
1947 CHECK(LDKCOption_ClosureReasonZ_None_class != NULL);
1948 LDKCOption_ClosureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_None_class, "<init>", "()V");
1949 CHECK(LDKCOption_ClosureReasonZ_None_meth != NULL);
1951 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ClosureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1952 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1954 case LDKCOption_ClosureReasonZ_Some: {
1955 int64_t some_ref = tag_ptr(&obj->some, false);
1956 return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_Some_class, LDKCOption_ClosureReasonZ_Some_meth, some_ref);
1958 case LDKCOption_ClosureReasonZ_None: {
1959 return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_None_class, LDKCOption_ClosureReasonZ_None_meth);
1964 static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1965 CHECK(owner->result_ok);
1966 return COption_ClosureReasonZ_clone(&*owner->contents.result);
1968 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1969 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1970 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
1971 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv);
1972 int64_t ret_ref = tag_ptr(ret_copy, true);
1976 static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1977 CHECK(!owner->result_ok);
1978 return DecodeError_clone(&*owner->contents.err);
1980 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1981 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1982 LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
1983 int64_t ret_ref = 0;
1984 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1985 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1989 static jclass LDKHTLCDestination_NextHopChannel_class = NULL;
1990 static jmethodID LDKHTLCDestination_NextHopChannel_meth = NULL;
1991 static jclass LDKHTLCDestination_UnknownNextHop_class = NULL;
1992 static jmethodID LDKHTLCDestination_UnknownNextHop_meth = NULL;
1993 static jclass LDKHTLCDestination_FailedPayment_class = NULL;
1994 static jmethodID LDKHTLCDestination_FailedPayment_meth = NULL;
1995 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCDestination_init (JNIEnv *env, jclass clz) {
1996 LDKHTLCDestination_NextHopChannel_class =
1997 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$NextHopChannel"));
1998 CHECK(LDKHTLCDestination_NextHopChannel_class != NULL);
1999 LDKHTLCDestination_NextHopChannel_meth = (*env)->GetMethodID(env, LDKHTLCDestination_NextHopChannel_class, "<init>", "([B[B)V");
2000 CHECK(LDKHTLCDestination_NextHopChannel_meth != NULL);
2001 LDKHTLCDestination_UnknownNextHop_class =
2002 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$UnknownNextHop"));
2003 CHECK(LDKHTLCDestination_UnknownNextHop_class != NULL);
2004 LDKHTLCDestination_UnknownNextHop_meth = (*env)->GetMethodID(env, LDKHTLCDestination_UnknownNextHop_class, "<init>", "(J)V");
2005 CHECK(LDKHTLCDestination_UnknownNextHop_meth != NULL);
2006 LDKHTLCDestination_FailedPayment_class =
2007 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$FailedPayment"));
2008 CHECK(LDKHTLCDestination_FailedPayment_class != NULL);
2009 LDKHTLCDestination_FailedPayment_meth = (*env)->GetMethodID(env, LDKHTLCDestination_FailedPayment_class, "<init>", "([B)V");
2010 CHECK(LDKHTLCDestination_FailedPayment_meth != NULL);
2012 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2013 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
2015 case LDKHTLCDestination_NextHopChannel: {
2016 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2017 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->next_hop_channel.node_id.compressed_form);
2018 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
2019 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->next_hop_channel.channel_id.data);
2020 return (*env)->NewObject(env, LDKHTLCDestination_NextHopChannel_class, LDKHTLCDestination_NextHopChannel_meth, node_id_arr, channel_id_arr);
2022 case LDKHTLCDestination_UnknownNextHop: {
2023 int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid;
2024 return (*env)->NewObject(env, LDKHTLCDestination_UnknownNextHop_class, LDKHTLCDestination_UnknownNextHop_meth, requested_forward_scid_conv);
2026 case LDKHTLCDestination_FailedPayment: {
2027 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
2028 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->failed_payment.payment_hash.data);
2029 return (*env)->NewObject(env, LDKHTLCDestination_FailedPayment_class, LDKHTLCDestination_FailedPayment_meth, payment_hash_arr);
2034 static jclass LDKCOption_HTLCDestinationZ_Some_class = NULL;
2035 static jmethodID LDKCOption_HTLCDestinationZ_Some_meth = NULL;
2036 static jclass LDKCOption_HTLCDestinationZ_None_class = NULL;
2037 static jmethodID LDKCOption_HTLCDestinationZ_None_meth = NULL;
2038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1HTLCDestinationZ_init (JNIEnv *env, jclass clz) {
2039 LDKCOption_HTLCDestinationZ_Some_class =
2040 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCDestinationZ$Some"));
2041 CHECK(LDKCOption_HTLCDestinationZ_Some_class != NULL);
2042 LDKCOption_HTLCDestinationZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_HTLCDestinationZ_Some_class, "<init>", "(J)V");
2043 CHECK(LDKCOption_HTLCDestinationZ_Some_meth != NULL);
2044 LDKCOption_HTLCDestinationZ_None_class =
2045 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCDestinationZ$None"));
2046 CHECK(LDKCOption_HTLCDestinationZ_None_class != NULL);
2047 LDKCOption_HTLCDestinationZ_None_meth = (*env)->GetMethodID(env, LDKCOption_HTLCDestinationZ_None_class, "<init>", "()V");
2048 CHECK(LDKCOption_HTLCDestinationZ_None_meth != NULL);
2050 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1HTLCDestinationZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2051 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
2053 case LDKCOption_HTLCDestinationZ_Some: {
2054 int64_t some_ref = tag_ptr(&obj->some, false);
2055 return (*env)->NewObject(env, LDKCOption_HTLCDestinationZ_Some_class, LDKCOption_HTLCDestinationZ_Some_meth, some_ref);
2057 case LDKCOption_HTLCDestinationZ_None: {
2058 return (*env)->NewObject(env, LDKCOption_HTLCDestinationZ_None_class, LDKCOption_HTLCDestinationZ_None_meth);
2063 static inline struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
2064 CHECK(owner->result_ok);
2065 return COption_HTLCDestinationZ_clone(&*owner->contents.result);
2067 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2068 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
2069 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
2070 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(owner_conv);
2071 int64_t ret_ref = tag_ptr(ret_copy, true);
2075 static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
2076 CHECK(!owner->result_ok);
2077 return DecodeError_clone(&*owner->contents.err);
2079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2080 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
2081 LDKDecodeError ret_var = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
2082 int64_t ret_ref = 0;
2083 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2084 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2088 static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL;
2089 static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL;
2090 static jclass LDKNetworkUpdate_ChannelFailure_class = NULL;
2091 static jmethodID LDKNetworkUpdate_ChannelFailure_meth = NULL;
2092 static jclass LDKNetworkUpdate_NodeFailure_class = NULL;
2093 static jmethodID LDKNetworkUpdate_NodeFailure_meth = NULL;
2094 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JNIEnv *env, jclass clz) {
2095 LDKNetworkUpdate_ChannelUpdateMessage_class =
2096 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelUpdateMessage"));
2097 CHECK(LDKNetworkUpdate_ChannelUpdateMessage_class != NULL);
2098 LDKNetworkUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelUpdateMessage_class, "<init>", "(J)V");
2099 CHECK(LDKNetworkUpdate_ChannelUpdateMessage_meth != NULL);
2100 LDKNetworkUpdate_ChannelFailure_class =
2101 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelFailure"));
2102 CHECK(LDKNetworkUpdate_ChannelFailure_class != NULL);
2103 LDKNetworkUpdate_ChannelFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelFailure_class, "<init>", "(JZ)V");
2104 CHECK(LDKNetworkUpdate_ChannelFailure_meth != NULL);
2105 LDKNetworkUpdate_NodeFailure_class =
2106 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$NodeFailure"));
2107 CHECK(LDKNetworkUpdate_NodeFailure_class != NULL);
2108 LDKNetworkUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_NodeFailure_class, "<init>", "([BZ)V");
2109 CHECK(LDKNetworkUpdate_NodeFailure_meth != NULL);
2111 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2112 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
2114 case LDKNetworkUpdate_ChannelUpdateMessage: {
2115 LDKChannelUpdate msg_var = obj->channel_update_message.msg;
2116 int64_t msg_ref = 0;
2117 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2118 msg_ref = tag_ptr(msg_var.inner, false);
2119 return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref);
2121 case LDKNetworkUpdate_ChannelFailure: {
2122 int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
2123 jboolean is_permanent_conv = obj->channel_failure.is_permanent;
2124 return (*env)->NewObject(env, LDKNetworkUpdate_ChannelFailure_class, LDKNetworkUpdate_ChannelFailure_meth, short_channel_id_conv, is_permanent_conv);
2126 case LDKNetworkUpdate_NodeFailure: {
2127 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2128 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->node_failure.node_id.compressed_form);
2129 jboolean is_permanent_conv = obj->node_failure.is_permanent;
2130 return (*env)->NewObject(env, LDKNetworkUpdate_NodeFailure_class, LDKNetworkUpdate_NodeFailure_meth, node_id_arr, is_permanent_conv);
2135 static jclass LDKCOption_NetworkUpdateZ_Some_class = NULL;
2136 static jmethodID LDKCOption_NetworkUpdateZ_Some_meth = NULL;
2137 static jclass LDKCOption_NetworkUpdateZ_None_class = NULL;
2138 static jmethodID LDKCOption_NetworkUpdateZ_None_meth = NULL;
2139 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetworkUpdateZ_init (JNIEnv *env, jclass clz) {
2140 LDKCOption_NetworkUpdateZ_Some_class =
2141 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$Some"));
2142 CHECK(LDKCOption_NetworkUpdateZ_Some_class != NULL);
2143 LDKCOption_NetworkUpdateZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_Some_class, "<init>", "(J)V");
2144 CHECK(LDKCOption_NetworkUpdateZ_Some_meth != NULL);
2145 LDKCOption_NetworkUpdateZ_None_class =
2146 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$None"));
2147 CHECK(LDKCOption_NetworkUpdateZ_None_class != NULL);
2148 LDKCOption_NetworkUpdateZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_None_class, "<init>", "()V");
2149 CHECK(LDKCOption_NetworkUpdateZ_None_meth != NULL);
2151 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetworkUpdateZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2152 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
2154 case LDKCOption_NetworkUpdateZ_Some: {
2155 int64_t some_ref = tag_ptr(&obj->some, false);
2156 return (*env)->NewObject(env, LDKCOption_NetworkUpdateZ_Some_class, LDKCOption_NetworkUpdateZ_Some_meth, some_ref);
2158 case LDKCOption_NetworkUpdateZ_None: {
2159 return (*env)->NewObject(env, LDKCOption_NetworkUpdateZ_None_class, LDKCOption_NetworkUpdateZ_None_meth);
2164 static jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL;
2165 static jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL;
2166 static jclass LDKSpendableOutputDescriptor_DelayedPaymentOutput_class = NULL;
2167 static jmethodID LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = NULL;
2168 static jclass LDKSpendableOutputDescriptor_StaticPaymentOutput_class = NULL;
2169 static jmethodID LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = NULL;
2170 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv *env, jclass clz) {
2171 LDKSpendableOutputDescriptor_StaticOutput_class =
2172 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput"));
2173 CHECK(LDKSpendableOutputDescriptor_StaticOutput_class != NULL);
2174 LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "<init>", "(JJ)V");
2175 CHECK(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL);
2176 LDKSpendableOutputDescriptor_DelayedPaymentOutput_class =
2177 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$DelayedPaymentOutput"));
2178 CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_class != NULL);
2179 LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, "<init>", "(J)V");
2180 CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth != NULL);
2181 LDKSpendableOutputDescriptor_StaticPaymentOutput_class =
2182 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticPaymentOutput"));
2183 CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_class != NULL);
2184 LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, "<init>", "(J)V");
2185 CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_meth != NULL);
2187 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2188 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
2190 case LDKSpendableOutputDescriptor_StaticOutput: {
2191 LDKOutPoint outpoint_var = obj->static_output.outpoint;
2192 int64_t outpoint_ref = 0;
2193 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var);
2194 outpoint_ref = tag_ptr(outpoint_var.inner, false);
2195 LDKTxOut* output_ref = &obj->static_output.output;
2196 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, tag_ptr(output_ref, false));
2198 case LDKSpendableOutputDescriptor_DelayedPaymentOutput: {
2199 LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
2200 int64_t delayed_payment_output_ref = 0;
2201 CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var);
2202 delayed_payment_output_ref = tag_ptr(delayed_payment_output_var.inner, false);
2203 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref);
2205 case LDKSpendableOutputDescriptor_StaticPaymentOutput: {
2206 LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
2207 int64_t static_payment_output_ref = 0;
2208 CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var);
2209 static_payment_output_ref = tag_ptr(static_payment_output_var.inner, false);
2210 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref);
2215 static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) {
2216 LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen };
2217 for (size_t i = 0; i < ret.datalen; i++) {
2218 ret.data[i] = SpendableOutputDescriptor_clone(&orig->data[i]);
2222 static jclass LDKEvent_FundingGenerationReady_class = NULL;
2223 static jmethodID LDKEvent_FundingGenerationReady_meth = NULL;
2224 static jclass LDKEvent_PaymentReceived_class = NULL;
2225 static jmethodID LDKEvent_PaymentReceived_meth = NULL;
2226 static jclass LDKEvent_PaymentClaimed_class = NULL;
2227 static jmethodID LDKEvent_PaymentClaimed_meth = NULL;
2228 static jclass LDKEvent_PaymentSent_class = NULL;
2229 static jmethodID LDKEvent_PaymentSent_meth = NULL;
2230 static jclass LDKEvent_PaymentFailed_class = NULL;
2231 static jmethodID LDKEvent_PaymentFailed_meth = NULL;
2232 static jclass LDKEvent_PaymentPathSuccessful_class = NULL;
2233 static jmethodID LDKEvent_PaymentPathSuccessful_meth = NULL;
2234 static jclass LDKEvent_PaymentPathFailed_class = NULL;
2235 static jmethodID LDKEvent_PaymentPathFailed_meth = NULL;
2236 static jclass LDKEvent_ProbeSuccessful_class = NULL;
2237 static jmethodID LDKEvent_ProbeSuccessful_meth = NULL;
2238 static jclass LDKEvent_ProbeFailed_class = NULL;
2239 static jmethodID LDKEvent_ProbeFailed_meth = NULL;
2240 static jclass LDKEvent_PendingHTLCsForwardable_class = NULL;
2241 static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL;
2242 static jclass LDKEvent_SpendableOutputs_class = NULL;
2243 static jmethodID LDKEvent_SpendableOutputs_meth = NULL;
2244 static jclass LDKEvent_PaymentForwarded_class = NULL;
2245 static jmethodID LDKEvent_PaymentForwarded_meth = NULL;
2246 static jclass LDKEvent_ChannelClosed_class = NULL;
2247 static jmethodID LDKEvent_ChannelClosed_meth = NULL;
2248 static jclass LDKEvent_DiscardFunding_class = NULL;
2249 static jmethodID LDKEvent_DiscardFunding_meth = NULL;
2250 static jclass LDKEvent_OpenChannelRequest_class = NULL;
2251 static jmethodID LDKEvent_OpenChannelRequest_meth = NULL;
2252 static jclass LDKEvent_HTLCHandlingFailed_class = NULL;
2253 static jmethodID LDKEvent_HTLCHandlingFailed_meth = NULL;
2254 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) {
2255 LDKEvent_FundingGenerationReady_class =
2256 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingGenerationReady"));
2257 CHECK(LDKEvent_FundingGenerationReady_class != NULL);
2258 LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "<init>", "([B[BJ[BJ)V");
2259 CHECK(LDKEvent_FundingGenerationReady_meth != NULL);
2260 LDKEvent_PaymentReceived_class =
2261 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentReceived"));
2262 CHECK(LDKEvent_PaymentReceived_class != NULL);
2263 LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([BJJ)V");
2264 CHECK(LDKEvent_PaymentReceived_meth != NULL);
2265 LDKEvent_PaymentClaimed_class =
2266 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimed"));
2267 CHECK(LDKEvent_PaymentClaimed_class != NULL);
2268 LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "<init>", "([BJJ)V");
2269 CHECK(LDKEvent_PaymentClaimed_meth != NULL);
2270 LDKEvent_PaymentSent_class =
2271 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent"));
2272 CHECK(LDKEvent_PaymentSent_class != NULL);
2273 LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B[B[BJ)V");
2274 CHECK(LDKEvent_PaymentSent_meth != NULL);
2275 LDKEvent_PaymentFailed_class =
2276 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentFailed"));
2277 CHECK(LDKEvent_PaymentFailed_class != NULL);
2278 LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "<init>", "([B[B)V");
2279 CHECK(LDKEvent_PaymentFailed_meth != NULL);
2280 LDKEvent_PaymentPathSuccessful_class =
2281 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful"));
2282 CHECK(LDKEvent_PaymentPathSuccessful_class != NULL);
2283 LDKEvent_PaymentPathSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathSuccessful_class, "<init>", "([B[B[J)V");
2284 CHECK(LDKEvent_PaymentPathSuccessful_meth != NULL);
2285 LDKEvent_PaymentPathFailed_class =
2286 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathFailed"));
2287 CHECK(LDKEvent_PaymentPathFailed_class != NULL);
2288 LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([B[BZJZ[JJJ)V");
2289 CHECK(LDKEvent_PaymentPathFailed_meth != NULL);
2290 LDKEvent_ProbeSuccessful_class =
2291 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ProbeSuccessful"));
2292 CHECK(LDKEvent_ProbeSuccessful_class != NULL);
2293 LDKEvent_ProbeSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_ProbeSuccessful_class, "<init>", "([B[B[J)V");
2294 CHECK(LDKEvent_ProbeSuccessful_meth != NULL);
2295 LDKEvent_ProbeFailed_class =
2296 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ProbeFailed"));
2297 CHECK(LDKEvent_ProbeFailed_class != NULL);
2298 LDKEvent_ProbeFailed_meth = (*env)->GetMethodID(env, LDKEvent_ProbeFailed_class, "<init>", "([B[B[JJ)V");
2299 CHECK(LDKEvent_ProbeFailed_meth != NULL);
2300 LDKEvent_PendingHTLCsForwardable_class =
2301 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable"));
2302 CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL);
2303 LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "<init>", "(J)V");
2304 CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL);
2305 LDKEvent_SpendableOutputs_class =
2306 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$SpendableOutputs"));
2307 CHECK(LDKEvent_SpendableOutputs_class != NULL);
2308 LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "<init>", "([J)V");
2309 CHECK(LDKEvent_SpendableOutputs_meth != NULL);
2310 LDKEvent_PaymentForwarded_class =
2311 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentForwarded"));
2312 CHECK(LDKEvent_PaymentForwarded_class != NULL);
2313 LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "<init>", "([B[BJZ)V");
2314 CHECK(LDKEvent_PaymentForwarded_meth != NULL);
2315 LDKEvent_ChannelClosed_class =
2316 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed"));
2317 CHECK(LDKEvent_ChannelClosed_class != NULL);
2318 LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "<init>", "([BJJ)V");
2319 CHECK(LDKEvent_ChannelClosed_meth != NULL);
2320 LDKEvent_DiscardFunding_class =
2321 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding"));
2322 CHECK(LDKEvent_DiscardFunding_class != NULL);
2323 LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "<init>", "([B[B)V");
2324 CHECK(LDKEvent_DiscardFunding_meth != NULL);
2325 LDKEvent_OpenChannelRequest_class =
2326 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OpenChannelRequest"));
2327 CHECK(LDKEvent_OpenChannelRequest_class != NULL);
2328 LDKEvent_OpenChannelRequest_meth = (*env)->GetMethodID(env, LDKEvent_OpenChannelRequest_class, "<init>", "([B[BJJJ)V");
2329 CHECK(LDKEvent_OpenChannelRequest_meth != NULL);
2330 LDKEvent_HTLCHandlingFailed_class =
2331 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$HTLCHandlingFailed"));
2332 CHECK(LDKEvent_HTLCHandlingFailed_class != NULL);
2333 LDKEvent_HTLCHandlingFailed_meth = (*env)->GetMethodID(env, LDKEvent_HTLCHandlingFailed_class, "<init>", "([BJ)V");
2334 CHECK(LDKEvent_HTLCHandlingFailed_meth != NULL);
2336 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2337 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
2339 case LDKEvent_FundingGenerationReady: {
2340 int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
2341 (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data);
2342 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
2343 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->funding_generation_ready.counterparty_node_id.compressed_form);
2344 int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis;
2345 LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
2346 int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen);
2347 (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data);
2348 int64_t user_channel_id_conv = obj->funding_generation_ready.user_channel_id;
2349 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);
2351 case LDKEvent_PaymentReceived: {
2352 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
2353 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data);
2354 int64_t amount_msat_conv = obj->payment_received.amount_msat;
2355 int64_t purpose_ref = tag_ptr(&obj->payment_received.purpose, false);
2356 return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, amount_msat_conv, purpose_ref);
2358 case LDKEvent_PaymentClaimed: {
2359 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
2360 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_claimed.payment_hash.data);
2361 int64_t amount_msat_conv = obj->payment_claimed.amount_msat;
2362 int64_t purpose_ref = tag_ptr(&obj->payment_claimed.purpose, false);
2363 return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, payment_hash_arr, amount_msat_conv, purpose_ref);
2365 case LDKEvent_PaymentSent: {
2366 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
2367 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data);
2368 int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
2369 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data);
2370 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
2371 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data);
2372 int64_t fee_paid_msat_ref = tag_ptr(&obj->payment_sent.fee_paid_msat, false);
2373 return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref);
2375 case LDKEvent_PaymentFailed: {
2376 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
2377 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data);
2378 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
2379 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data);
2380 return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr);
2382 case LDKEvent_PaymentPathSuccessful: {
2383 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
2384 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_successful.payment_id.data);
2385 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
2386 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_successful.payment_hash.data);
2387 LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
2388 int64_tArray path_arr = NULL;
2389 path_arr = (*env)->NewLongArray(env, path_var.datalen);
2390 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
2391 for (size_t k = 0; k < path_var.datalen; k++) {
2392 LDKRouteHop path_conv_10_var = path_var.data[k];
2393 int64_t path_conv_10_ref = 0;
2394 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
2395 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
2396 path_arr_ptr[k] = path_conv_10_ref;
2398 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
2399 return (*env)->NewObject(env, LDKEvent_PaymentPathSuccessful_class, LDKEvent_PaymentPathSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr);
2401 case LDKEvent_PaymentPathFailed: {
2402 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
2403 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data);
2404 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
2405 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data);
2406 jboolean rejected_by_dest_conv = obj->payment_path_failed.rejected_by_dest;
2407 int64_t network_update_ref = tag_ptr(&obj->payment_path_failed.network_update, false);
2408 jboolean all_paths_failed_conv = obj->payment_path_failed.all_paths_failed;
2409 LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
2410 int64_tArray path_arr = NULL;
2411 path_arr = (*env)->NewLongArray(env, path_var.datalen);
2412 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
2413 for (size_t k = 0; k < path_var.datalen; k++) {
2414 LDKRouteHop path_conv_10_var = path_var.data[k];
2415 int64_t path_conv_10_ref = 0;
2416 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
2417 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
2418 path_arr_ptr[k] = path_conv_10_ref;
2420 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
2421 int64_t short_channel_id_ref = tag_ptr(&obj->payment_path_failed.short_channel_id, false);
2422 LDKRouteParameters retry_var = obj->payment_path_failed.retry;
2423 int64_t retry_ref = 0;
2424 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var);
2425 retry_ref = tag_ptr(retry_var.inner, false);
2426 return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, rejected_by_dest_conv, network_update_ref, all_paths_failed_conv, path_arr, short_channel_id_ref, retry_ref);
2428 case LDKEvent_ProbeSuccessful: {
2429 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
2430 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->probe_successful.payment_id.data);
2431 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
2432 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->probe_successful.payment_hash.data);
2433 LDKCVec_RouteHopZ path_var = obj->probe_successful.path;
2434 int64_tArray path_arr = NULL;
2435 path_arr = (*env)->NewLongArray(env, path_var.datalen);
2436 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
2437 for (size_t k = 0; k < path_var.datalen; k++) {
2438 LDKRouteHop path_conv_10_var = path_var.data[k];
2439 int64_t path_conv_10_ref = 0;
2440 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
2441 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
2442 path_arr_ptr[k] = path_conv_10_ref;
2444 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
2445 return (*env)->NewObject(env, LDKEvent_ProbeSuccessful_class, LDKEvent_ProbeSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr);
2447 case LDKEvent_ProbeFailed: {
2448 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
2449 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->probe_failed.payment_id.data);
2450 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
2451 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->probe_failed.payment_hash.data);
2452 LDKCVec_RouteHopZ path_var = obj->probe_failed.path;
2453 int64_tArray path_arr = NULL;
2454 path_arr = (*env)->NewLongArray(env, path_var.datalen);
2455 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
2456 for (size_t k = 0; k < path_var.datalen; k++) {
2457 LDKRouteHop path_conv_10_var = path_var.data[k];
2458 int64_t path_conv_10_ref = 0;
2459 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
2460 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
2461 path_arr_ptr[k] = path_conv_10_ref;
2463 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
2464 int64_t short_channel_id_ref = tag_ptr(&obj->probe_failed.short_channel_id, false);
2465 return (*env)->NewObject(env, LDKEvent_ProbeFailed_class, LDKEvent_ProbeFailed_meth, payment_id_arr, payment_hash_arr, path_arr, short_channel_id_ref);
2467 case LDKEvent_PendingHTLCsForwardable: {
2468 int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable;
2469 return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, time_forwardable_conv);
2471 case LDKEvent_SpendableOutputs: {
2472 LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
2473 int64_tArray outputs_arr = NULL;
2474 outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
2475 int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL);
2476 for (size_t b = 0; b < outputs_var.datalen; b++) {
2477 int64_t outputs_conv_27_ref = tag_ptr(&outputs_var.data[b], false);
2478 outputs_arr_ptr[b] = outputs_conv_27_ref;
2480 (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0);
2481 return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr);
2483 case LDKEvent_PaymentForwarded: {
2484 int8_tArray prev_channel_id_arr = (*env)->NewByteArray(env, 32);
2485 (*env)->SetByteArrayRegion(env, prev_channel_id_arr, 0, 32, obj->payment_forwarded.prev_channel_id.data);
2486 int8_tArray next_channel_id_arr = (*env)->NewByteArray(env, 32);
2487 (*env)->SetByteArrayRegion(env, next_channel_id_arr, 0, 32, obj->payment_forwarded.next_channel_id.data);
2488 int64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false);
2489 jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx;
2490 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);
2492 case LDKEvent_ChannelClosed: {
2493 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
2494 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data);
2495 int64_t user_channel_id_conv = obj->channel_closed.user_channel_id;
2496 int64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false);
2497 return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, user_channel_id_conv, reason_ref);
2499 case LDKEvent_DiscardFunding: {
2500 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
2501 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data);
2502 LDKTransaction transaction_var = obj->discard_funding.transaction;
2503 int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen);
2504 (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data);
2505 return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr);
2507 case LDKEvent_OpenChannelRequest: {
2508 int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
2509 (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->open_channel_request.temporary_channel_id.data);
2510 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
2511 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->open_channel_request.counterparty_node_id.compressed_form);
2512 int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis;
2513 int64_t push_msat_conv = obj->open_channel_request.push_msat;
2514 LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type;
2515 int64_t channel_type_ref = 0;
2516 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
2517 channel_type_ref = tag_ptr(channel_type_var.inner, false);
2518 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);
2520 case LDKEvent_HTLCHandlingFailed: {
2521 int8_tArray prev_channel_id_arr = (*env)->NewByteArray(env, 32);
2522 (*env)->SetByteArrayRegion(env, prev_channel_id_arr, 0, 32, obj->htlc_handling_failed.prev_channel_id.data);
2523 int64_t failed_next_destination_ref = tag_ptr(&obj->htlc_handling_failed.failed_next_destination, false);
2524 return (*env)->NewObject(env, LDKEvent_HTLCHandlingFailed_class, LDKEvent_HTLCHandlingFailed_meth, prev_channel_id_arr, failed_next_destination_ref);
2529 static jclass LDKCOption_EventZ_Some_class = NULL;
2530 static jmethodID LDKCOption_EventZ_Some_meth = NULL;
2531 static jclass LDKCOption_EventZ_None_class = NULL;
2532 static jmethodID LDKCOption_EventZ_None_meth = NULL;
2533 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init (JNIEnv *env, jclass clz) {
2534 LDKCOption_EventZ_Some_class =
2535 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$Some"));
2536 CHECK(LDKCOption_EventZ_Some_class != NULL);
2537 LDKCOption_EventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_Some_class, "<init>", "(J)V");
2538 CHECK(LDKCOption_EventZ_Some_meth != NULL);
2539 LDKCOption_EventZ_None_class =
2540 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$None"));
2541 CHECK(LDKCOption_EventZ_None_class != NULL);
2542 LDKCOption_EventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_None_class, "<init>", "()V");
2543 CHECK(LDKCOption_EventZ_None_meth != NULL);
2545 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1EventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2546 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
2548 case LDKCOption_EventZ_Some: {
2549 int64_t some_ref = tag_ptr(&obj->some, false);
2550 return (*env)->NewObject(env, LDKCOption_EventZ_Some_class, LDKCOption_EventZ_Some_meth, some_ref);
2552 case LDKCOption_EventZ_None: {
2553 return (*env)->NewObject(env, LDKCOption_EventZ_None_class, LDKCOption_EventZ_None_meth);
2558 static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
2559 CHECK(owner->result_ok);
2560 return COption_EventZ_clone(&*owner->contents.result);
2562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2563 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
2564 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
2565 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv);
2566 int64_t ret_ref = tag_ptr(ret_copy, true);
2570 static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
2571 CHECK(!owner->result_ok);
2572 return DecodeError_clone(&*owner->contents.err);
2574 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2575 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
2576 LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
2577 int64_t ret_ref = 0;
2578 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2579 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2583 static jclass LDKErrorAction_DisconnectPeer_class = NULL;
2584 static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL;
2585 static jclass LDKErrorAction_IgnoreError_class = NULL;
2586 static jmethodID LDKErrorAction_IgnoreError_meth = NULL;
2587 static jclass LDKErrorAction_IgnoreAndLog_class = NULL;
2588 static jmethodID LDKErrorAction_IgnoreAndLog_meth = NULL;
2589 static jclass LDKErrorAction_IgnoreDuplicateGossip_class = NULL;
2590 static jmethodID LDKErrorAction_IgnoreDuplicateGossip_meth = NULL;
2591 static jclass LDKErrorAction_SendErrorMessage_class = NULL;
2592 static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL;
2593 static jclass LDKErrorAction_SendWarningMessage_class = NULL;
2594 static jmethodID LDKErrorAction_SendWarningMessage_meth = NULL;
2595 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv *env, jclass clz) {
2596 LDKErrorAction_DisconnectPeer_class =
2597 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$DisconnectPeer"));
2598 CHECK(LDKErrorAction_DisconnectPeer_class != NULL);
2599 LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "<init>", "(J)V");
2600 CHECK(LDKErrorAction_DisconnectPeer_meth != NULL);
2601 LDKErrorAction_IgnoreError_class =
2602 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreError"));
2603 CHECK(LDKErrorAction_IgnoreError_class != NULL);
2604 LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "<init>", "()V");
2605 CHECK(LDKErrorAction_IgnoreError_meth != NULL);
2606 LDKErrorAction_IgnoreAndLog_class =
2607 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreAndLog"));
2608 CHECK(LDKErrorAction_IgnoreAndLog_class != NULL);
2609 LDKErrorAction_IgnoreAndLog_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreAndLog_class, "<init>", "(Lorg/ldk/enums/Level;)V");
2610 CHECK(LDKErrorAction_IgnoreAndLog_meth != NULL);
2611 LDKErrorAction_IgnoreDuplicateGossip_class =
2612 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreDuplicateGossip"));
2613 CHECK(LDKErrorAction_IgnoreDuplicateGossip_class != NULL);
2614 LDKErrorAction_IgnoreDuplicateGossip_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreDuplicateGossip_class, "<init>", "()V");
2615 CHECK(LDKErrorAction_IgnoreDuplicateGossip_meth != NULL);
2616 LDKErrorAction_SendErrorMessage_class =
2617 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$SendErrorMessage"));
2618 CHECK(LDKErrorAction_SendErrorMessage_class != NULL);
2619 LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "<init>", "(J)V");
2620 CHECK(LDKErrorAction_SendErrorMessage_meth != NULL);
2621 LDKErrorAction_SendWarningMessage_class =
2622 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$SendWarningMessage"));
2623 CHECK(LDKErrorAction_SendWarningMessage_class != NULL);
2624 LDKErrorAction_SendWarningMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendWarningMessage_class, "<init>", "(JLorg/ldk/enums/Level;)V");
2625 CHECK(LDKErrorAction_SendWarningMessage_meth != NULL);
2627 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2628 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2630 case LDKErrorAction_DisconnectPeer: {
2631 LDKErrorMessage msg_var = obj->disconnect_peer.msg;
2632 int64_t msg_ref = 0;
2633 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2634 msg_ref = tag_ptr(msg_var.inner, false);
2635 return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref);
2637 case LDKErrorAction_IgnoreError: {
2638 return (*env)->NewObject(env, LDKErrorAction_IgnoreError_class, LDKErrorAction_IgnoreError_meth);
2640 case LDKErrorAction_IgnoreAndLog: {
2641 jclass ignore_and_log_conv = LDKLevel_to_java(env, obj->ignore_and_log);
2642 return (*env)->NewObject(env, LDKErrorAction_IgnoreAndLog_class, LDKErrorAction_IgnoreAndLog_meth, ignore_and_log_conv);
2644 case LDKErrorAction_IgnoreDuplicateGossip: {
2645 return (*env)->NewObject(env, LDKErrorAction_IgnoreDuplicateGossip_class, LDKErrorAction_IgnoreDuplicateGossip_meth);
2647 case LDKErrorAction_SendErrorMessage: {
2648 LDKErrorMessage msg_var = obj->send_error_message.msg;
2649 int64_t msg_ref = 0;
2650 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2651 msg_ref = tag_ptr(msg_var.inner, false);
2652 return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref);
2654 case LDKErrorAction_SendWarningMessage: {
2655 LDKWarningMessage msg_var = obj->send_warning_message.msg;
2656 int64_t msg_ref = 0;
2657 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2658 msg_ref = tag_ptr(msg_var.inner, false);
2659 jclass log_level_conv = LDKLevel_to_java(env, obj->send_warning_message.log_level);
2660 return (*env)->NewObject(env, LDKErrorAction_SendWarningMessage_class, LDKErrorAction_SendWarningMessage_meth, msg_ref, log_level_conv);
2665 static jclass LDKMessageSendEvent_SendAcceptChannel_class = NULL;
2666 static jmethodID LDKMessageSendEvent_SendAcceptChannel_meth = NULL;
2667 static jclass LDKMessageSendEvent_SendOpenChannel_class = NULL;
2668 static jmethodID LDKMessageSendEvent_SendOpenChannel_meth = NULL;
2669 static jclass LDKMessageSendEvent_SendFundingCreated_class = NULL;
2670 static jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL;
2671 static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL;
2672 static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL;
2673 static jclass LDKMessageSendEvent_SendChannelReady_class = NULL;
2674 static jmethodID LDKMessageSendEvent_SendChannelReady_meth = NULL;
2675 static jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL;
2676 static jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL;
2677 static jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL;
2678 static jmethodID LDKMessageSendEvent_UpdateHTLCs_meth = NULL;
2679 static jclass LDKMessageSendEvent_SendRevokeAndACK_class = NULL;
2680 static jmethodID LDKMessageSendEvent_SendRevokeAndACK_meth = NULL;
2681 static jclass LDKMessageSendEvent_SendClosingSigned_class = NULL;
2682 static jmethodID LDKMessageSendEvent_SendClosingSigned_meth = NULL;
2683 static jclass LDKMessageSendEvent_SendShutdown_class = NULL;
2684 static jmethodID LDKMessageSendEvent_SendShutdown_meth = NULL;
2685 static jclass LDKMessageSendEvent_SendChannelReestablish_class = NULL;
2686 static jmethodID LDKMessageSendEvent_SendChannelReestablish_meth = NULL;
2687 static jclass LDKMessageSendEvent_BroadcastChannelAnnouncement_class = NULL;
2688 static jmethodID LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = NULL;
2689 static jclass LDKMessageSendEvent_BroadcastNodeAnnouncement_class = NULL;
2690 static jmethodID LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = NULL;
2691 static jclass LDKMessageSendEvent_BroadcastChannelUpdate_class = NULL;
2692 static jmethodID LDKMessageSendEvent_BroadcastChannelUpdate_meth = NULL;
2693 static jclass LDKMessageSendEvent_SendChannelUpdate_class = NULL;
2694 static jmethodID LDKMessageSendEvent_SendChannelUpdate_meth = NULL;
2695 static jclass LDKMessageSendEvent_HandleError_class = NULL;
2696 static jmethodID LDKMessageSendEvent_HandleError_meth = NULL;
2697 static jclass LDKMessageSendEvent_SendChannelRangeQuery_class = NULL;
2698 static jmethodID LDKMessageSendEvent_SendChannelRangeQuery_meth = NULL;
2699 static jclass LDKMessageSendEvent_SendShortIdsQuery_class = NULL;
2700 static jmethodID LDKMessageSendEvent_SendShortIdsQuery_meth = NULL;
2701 static jclass LDKMessageSendEvent_SendReplyChannelRange_class = NULL;
2702 static jmethodID LDKMessageSendEvent_SendReplyChannelRange_meth = NULL;
2703 static jclass LDKMessageSendEvent_SendGossipTimestampFilter_class = NULL;
2704 static jmethodID LDKMessageSendEvent_SendGossipTimestampFilter_meth = NULL;
2705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv *env, jclass clz) {
2706 LDKMessageSendEvent_SendAcceptChannel_class =
2707 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel"));
2708 CHECK(LDKMessageSendEvent_SendAcceptChannel_class != NULL);
2709 LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "<init>", "([BJ)V");
2710 CHECK(LDKMessageSendEvent_SendAcceptChannel_meth != NULL);
2711 LDKMessageSendEvent_SendOpenChannel_class =
2712 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel"));
2713 CHECK(LDKMessageSendEvent_SendOpenChannel_class != NULL);
2714 LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "<init>", "([BJ)V");
2715 CHECK(LDKMessageSendEvent_SendOpenChannel_meth != NULL);
2716 LDKMessageSendEvent_SendFundingCreated_class =
2717 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated"));
2718 CHECK(LDKMessageSendEvent_SendFundingCreated_class != NULL);
2719 LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "<init>", "([BJ)V");
2720 CHECK(LDKMessageSendEvent_SendFundingCreated_meth != NULL);
2721 LDKMessageSendEvent_SendFundingSigned_class =
2722 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned"));
2723 CHECK(LDKMessageSendEvent_SendFundingSigned_class != NULL);
2724 LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "<init>", "([BJ)V");
2725 CHECK(LDKMessageSendEvent_SendFundingSigned_meth != NULL);
2726 LDKMessageSendEvent_SendChannelReady_class =
2727 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReady"));
2728 CHECK(LDKMessageSendEvent_SendChannelReady_class != NULL);
2729 LDKMessageSendEvent_SendChannelReady_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReady_class, "<init>", "([BJ)V");
2730 CHECK(LDKMessageSendEvent_SendChannelReady_meth != NULL);
2731 LDKMessageSendEvent_SendAnnouncementSignatures_class =
2732 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures"));
2733 CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL);
2734 LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "<init>", "([BJ)V");
2735 CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL);
2736 LDKMessageSendEvent_UpdateHTLCs_class =
2737 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs"));
2738 CHECK(LDKMessageSendEvent_UpdateHTLCs_class != NULL);
2739 LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "<init>", "([BJ)V");
2740 CHECK(LDKMessageSendEvent_UpdateHTLCs_meth != NULL);
2741 LDKMessageSendEvent_SendRevokeAndACK_class =
2742 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK"));
2743 CHECK(LDKMessageSendEvent_SendRevokeAndACK_class != NULL);
2744 LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "<init>", "([BJ)V");
2745 CHECK(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL);
2746 LDKMessageSendEvent_SendClosingSigned_class =
2747 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned"));
2748 CHECK(LDKMessageSendEvent_SendClosingSigned_class != NULL);
2749 LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "<init>", "([BJ)V");
2750 CHECK(LDKMessageSendEvent_SendClosingSigned_meth != NULL);
2751 LDKMessageSendEvent_SendShutdown_class =
2752 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown"));
2753 CHECK(LDKMessageSendEvent_SendShutdown_class != NULL);
2754 LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "<init>", "([BJ)V");
2755 CHECK(LDKMessageSendEvent_SendShutdown_meth != NULL);
2756 LDKMessageSendEvent_SendChannelReestablish_class =
2757 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish"));
2758 CHECK(LDKMessageSendEvent_SendChannelReestablish_class != NULL);
2759 LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "<init>", "([BJ)V");
2760 CHECK(LDKMessageSendEvent_SendChannelReestablish_meth != NULL);
2761 LDKMessageSendEvent_BroadcastChannelAnnouncement_class =
2762 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement"));
2763 CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL);
2764 LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "<init>", "(JJ)V");
2765 CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL);
2766 LDKMessageSendEvent_BroadcastNodeAnnouncement_class =
2767 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement"));
2768 CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_class != NULL);
2769 LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, "<init>", "(J)V");
2770 CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_meth != NULL);
2771 LDKMessageSendEvent_BroadcastChannelUpdate_class =
2772 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate"));
2773 CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL);
2774 LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "<init>", "(J)V");
2775 CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL);
2776 LDKMessageSendEvent_SendChannelUpdate_class =
2777 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelUpdate"));
2778 CHECK(LDKMessageSendEvent_SendChannelUpdate_class != NULL);
2779 LDKMessageSendEvent_SendChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelUpdate_class, "<init>", "([BJ)V");
2780 CHECK(LDKMessageSendEvent_SendChannelUpdate_meth != NULL);
2781 LDKMessageSendEvent_HandleError_class =
2782 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$HandleError"));
2783 CHECK(LDKMessageSendEvent_HandleError_class != NULL);
2784 LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "<init>", "([BJ)V");
2785 CHECK(LDKMessageSendEvent_HandleError_meth != NULL);
2786 LDKMessageSendEvent_SendChannelRangeQuery_class =
2787 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelRangeQuery"));
2788 CHECK(LDKMessageSendEvent_SendChannelRangeQuery_class != NULL);
2789 LDKMessageSendEvent_SendChannelRangeQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelRangeQuery_class, "<init>", "([BJ)V");
2790 CHECK(LDKMessageSendEvent_SendChannelRangeQuery_meth != NULL);
2791 LDKMessageSendEvent_SendShortIdsQuery_class =
2792 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShortIdsQuery"));
2793 CHECK(LDKMessageSendEvent_SendShortIdsQuery_class != NULL);
2794 LDKMessageSendEvent_SendShortIdsQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShortIdsQuery_class, "<init>", "([BJ)V");
2795 CHECK(LDKMessageSendEvent_SendShortIdsQuery_meth != NULL);
2796 LDKMessageSendEvent_SendReplyChannelRange_class =
2797 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendReplyChannelRange"));
2798 CHECK(LDKMessageSendEvent_SendReplyChannelRange_class != NULL);
2799 LDKMessageSendEvent_SendReplyChannelRange_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendReplyChannelRange_class, "<init>", "([BJ)V");
2800 CHECK(LDKMessageSendEvent_SendReplyChannelRange_meth != NULL);
2801 LDKMessageSendEvent_SendGossipTimestampFilter_class =
2802 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendGossipTimestampFilter"));
2803 CHECK(LDKMessageSendEvent_SendGossipTimestampFilter_class != NULL);
2804 LDKMessageSendEvent_SendGossipTimestampFilter_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendGossipTimestampFilter_class, "<init>", "([BJ)V");
2805 CHECK(LDKMessageSendEvent_SendGossipTimestampFilter_meth != NULL);
2807 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2808 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2810 case LDKMessageSendEvent_SendAcceptChannel: {
2811 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2812 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_accept_channel.node_id.compressed_form);
2813 LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
2814 int64_t msg_ref = 0;
2815 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2816 msg_ref = tag_ptr(msg_var.inner, false);
2817 return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref);
2819 case LDKMessageSendEvent_SendOpenChannel: {
2820 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2821 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_open_channel.node_id.compressed_form);
2822 LDKOpenChannel msg_var = obj->send_open_channel.msg;
2823 int64_t msg_ref = 0;
2824 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2825 msg_ref = tag_ptr(msg_var.inner, false);
2826 return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref);
2828 case LDKMessageSendEvent_SendFundingCreated: {
2829 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2830 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_created.node_id.compressed_form);
2831 LDKFundingCreated msg_var = obj->send_funding_created.msg;
2832 int64_t msg_ref = 0;
2833 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2834 msg_ref = tag_ptr(msg_var.inner, false);
2835 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref);
2837 case LDKMessageSendEvent_SendFundingSigned: {
2838 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2839 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_signed.node_id.compressed_form);
2840 LDKFundingSigned msg_var = obj->send_funding_signed.msg;
2841 int64_t msg_ref = 0;
2842 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2843 msg_ref = tag_ptr(msg_var.inner, false);
2844 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref);
2846 case LDKMessageSendEvent_SendChannelReady: {
2847 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2848 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_ready.node_id.compressed_form);
2849 LDKChannelReady msg_var = obj->send_channel_ready.msg;
2850 int64_t msg_ref = 0;
2851 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2852 msg_ref = tag_ptr(msg_var.inner, false);
2853 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReady_class, LDKMessageSendEvent_SendChannelReady_meth, node_id_arr, msg_ref);
2855 case LDKMessageSendEvent_SendAnnouncementSignatures: {
2856 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2857 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_announcement_signatures.node_id.compressed_form);
2858 LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
2859 int64_t msg_ref = 0;
2860 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2861 msg_ref = tag_ptr(msg_var.inner, false);
2862 return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref);
2864 case LDKMessageSendEvent_UpdateHTLCs: {
2865 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2866 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->update_htl_cs.node_id.compressed_form);
2867 LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
2868 int64_t updates_ref = 0;
2869 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var);
2870 updates_ref = tag_ptr(updates_var.inner, false);
2871 return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref);
2873 case LDKMessageSendEvent_SendRevokeAndACK: {
2874 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2875 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_revoke_and_ack.node_id.compressed_form);
2876 LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
2877 int64_t msg_ref = 0;
2878 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2879 msg_ref = tag_ptr(msg_var.inner, false);
2880 return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref);
2882 case LDKMessageSendEvent_SendClosingSigned: {
2883 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2884 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_closing_signed.node_id.compressed_form);
2885 LDKClosingSigned msg_var = obj->send_closing_signed.msg;
2886 int64_t msg_ref = 0;
2887 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2888 msg_ref = tag_ptr(msg_var.inner, false);
2889 return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref);
2891 case LDKMessageSendEvent_SendShutdown: {
2892 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2893 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_shutdown.node_id.compressed_form);
2894 LDKShutdown msg_var = obj->send_shutdown.msg;
2895 int64_t msg_ref = 0;
2896 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2897 msg_ref = tag_ptr(msg_var.inner, false);
2898 return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref);
2900 case LDKMessageSendEvent_SendChannelReestablish: {
2901 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2902 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_reestablish.node_id.compressed_form);
2903 LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
2904 int64_t msg_ref = 0;
2905 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2906 msg_ref = tag_ptr(msg_var.inner, false);
2907 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref);
2909 case LDKMessageSendEvent_BroadcastChannelAnnouncement: {
2910 LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
2911 int64_t msg_ref = 0;
2912 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2913 msg_ref = tag_ptr(msg_var.inner, false);
2914 LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
2915 int64_t update_msg_ref = 0;
2916 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
2917 update_msg_ref = tag_ptr(update_msg_var.inner, false);
2918 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref);
2920 case LDKMessageSendEvent_BroadcastNodeAnnouncement: {
2921 LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
2922 int64_t msg_ref = 0;
2923 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2924 msg_ref = tag_ptr(msg_var.inner, false);
2925 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref);
2927 case LDKMessageSendEvent_BroadcastChannelUpdate: {
2928 LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
2929 int64_t msg_ref = 0;
2930 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2931 msg_ref = tag_ptr(msg_var.inner, false);
2932 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref);
2934 case LDKMessageSendEvent_SendChannelUpdate: {
2935 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2936 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_update.node_id.compressed_form);
2937 LDKChannelUpdate msg_var = obj->send_channel_update.msg;
2938 int64_t msg_ref = 0;
2939 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2940 msg_ref = tag_ptr(msg_var.inner, false);
2941 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref);
2943 case LDKMessageSendEvent_HandleError: {
2944 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2945 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->handle_error.node_id.compressed_form);
2946 int64_t action_ref = tag_ptr(&obj->handle_error.action, false);
2947 return (*env)->NewObject(env, LDKMessageSendEvent_HandleError_class, LDKMessageSendEvent_HandleError_meth, node_id_arr, action_ref);
2949 case LDKMessageSendEvent_SendChannelRangeQuery: {
2950 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2951 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_range_query.node_id.compressed_form);
2952 LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
2953 int64_t msg_ref = 0;
2954 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2955 msg_ref = tag_ptr(msg_var.inner, false);
2956 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref);
2958 case LDKMessageSendEvent_SendShortIdsQuery: {
2959 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2960 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_short_ids_query.node_id.compressed_form);
2961 LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
2962 int64_t msg_ref = 0;
2963 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2964 msg_ref = tag_ptr(msg_var.inner, false);
2965 return (*env)->NewObject(env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref);
2967 case LDKMessageSendEvent_SendReplyChannelRange: {
2968 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2969 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_reply_channel_range.node_id.compressed_form);
2970 LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
2971 int64_t msg_ref = 0;
2972 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2973 msg_ref = tag_ptr(msg_var.inner, false);
2974 return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref);
2976 case LDKMessageSendEvent_SendGossipTimestampFilter: {
2977 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2978 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_gossip_timestamp_filter.node_id.compressed_form);
2979 LDKGossipTimestampFilter msg_var = obj->send_gossip_timestamp_filter.msg;
2980 int64_t msg_ref = 0;
2981 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2982 msg_ref = tag_ptr(msg_var.inner, false);
2983 return (*env)->NewObject(env, LDKMessageSendEvent_SendGossipTimestampFilter_class, LDKMessageSendEvent_SendGossipTimestampFilter_meth, node_id_arr, msg_ref);
2988 static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) {
2989 LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen };
2990 for (size_t i = 0; i < ret.datalen; i++) {
2991 ret.data[i] = MessageSendEvent_clone(&orig->data[i]);
2995 static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2996 CHECK(owner->result_ok);
2997 return TxOut_clone(&*owner->contents.result);
2999 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3000 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
3001 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
3002 *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv);
3003 return tag_ptr(ret_ref, true);
3006 static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
3007 CHECK(!owner->result_ok);
3008 return AccessError_clone(&*owner->contents.err);
3010 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3011 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
3012 jclass ret_conv = LDKAccessError_to_java(env, CResult_TxOutAccessErrorZ_get_err(owner_conv));
3016 static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
3019 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
3020 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
3021 int64_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv);
3025 static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
3028 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
3029 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
3030 LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv);
3031 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
3032 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
3036 static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) {
3037 LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen };
3038 for (size_t i = 0; i < ret.datalen; i++) {
3039 ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]);
3043 static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) {
3044 LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ clone bytes"), .datalen = orig->datalen };
3045 for (size_t i = 0; i < ret.datalen; i++) {
3046 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
3050 static inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
3051 CHECK(owner->result_ok);
3052 return *owner->contents.result;
3054 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3055 LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
3056 CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv);
3059 static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
3060 CHECK(!owner->result_ok);
3061 return ChannelMonitorUpdateErr_clone(&*owner->contents.err);
3063 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3064 LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
3065 jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv));
3069 static jclass LDKMonitorEvent_HTLCEvent_class = NULL;
3070 static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL;
3071 static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL;
3072 static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL;
3073 static jclass LDKMonitorEvent_UpdateCompleted_class = NULL;
3074 static jmethodID LDKMonitorEvent_UpdateCompleted_meth = NULL;
3075 static jclass LDKMonitorEvent_UpdateFailed_class = NULL;
3076 static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL;
3077 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) {
3078 LDKMonitorEvent_HTLCEvent_class =
3079 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent"));
3080 CHECK(LDKMonitorEvent_HTLCEvent_class != NULL);
3081 LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "<init>", "(J)V");
3082 CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL);
3083 LDKMonitorEvent_CommitmentTxConfirmed_class =
3084 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed"));
3085 CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL);
3086 LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "<init>", "(J)V");
3087 CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL);
3088 LDKMonitorEvent_UpdateCompleted_class =
3089 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted"));
3090 CHECK(LDKMonitorEvent_UpdateCompleted_class != NULL);
3091 LDKMonitorEvent_UpdateCompleted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateCompleted_class, "<init>", "(JJ)V");
3092 CHECK(LDKMonitorEvent_UpdateCompleted_meth != NULL);
3093 LDKMonitorEvent_UpdateFailed_class =
3094 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed"));
3095 CHECK(LDKMonitorEvent_UpdateFailed_class != NULL);
3096 LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "<init>", "(J)V");
3097 CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL);
3099 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3100 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
3102 case LDKMonitorEvent_HTLCEvent: {
3103 LDKHTLCUpdate htlc_event_var = obj->htlc_event;
3104 int64_t htlc_event_ref = 0;
3105 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var);
3106 htlc_event_ref = tag_ptr(htlc_event_var.inner, false);
3107 return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref);
3109 case LDKMonitorEvent_CommitmentTxConfirmed: {
3110 LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
3111 int64_t commitment_tx_confirmed_ref = 0;
3112 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var);
3113 commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
3114 return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref);
3116 case LDKMonitorEvent_UpdateCompleted: {
3117 LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
3118 int64_t funding_txo_ref = 0;
3119 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
3120 funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
3121 int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id;
3122 return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, monitor_update_id_conv);
3124 case LDKMonitorEvent_UpdateFailed: {
3125 LDKOutPoint update_failed_var = obj->update_failed;
3126 int64_t update_failed_ref = 0;
3127 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var);
3128 update_failed_ref = tag_ptr(update_failed_var.inner, false);
3129 return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref);
3134 static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) {
3135 LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen };
3136 for (size_t i = 0; i < ret.datalen; i++) {
3137 ret.data[i] = MonitorEvent_clone(&orig->data[i]);
3141 static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
3142 return OutPoint_clone(&owner->a);
3144 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
3145 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
3146 LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv);
3147 int64_t ret_ref = 0;
3148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3149 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3153 static inline struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
3154 return CVec_MonitorEventZ_clone(&owner->b);
3156 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
3157 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
3158 LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv);
3159 int64_tArray ret_arr = NULL;
3160 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
3161 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
3162 for (size_t o = 0; o < ret_var.datalen; o++) {
3163 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
3164 *ret_conv_14_copy = ret_var.data[o];
3165 int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
3166 ret_arr_ptr[o] = ret_conv_14_ref;
3168 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
3173 static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
3176 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
3177 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
3178 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
3179 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form);
3183 static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) {
3184 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen };
3185 for (size_t i = 0; i < ret.datalen; i++) {
3186 ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]);
3190 static jclass LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = NULL;
3191 static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = NULL;
3192 static jclass LDKCOption_C2Tuple_usizeTransactionZZ_None_class = NULL;
3193 static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = NULL;
3194 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1usizeTransactionZZ_init (JNIEnv *env, jclass clz) {
3195 LDKCOption_C2Tuple_usizeTransactionZZ_Some_class =
3196 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$Some"));
3197 CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_class != NULL);
3198 LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, "<init>", "(J)V");
3199 CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth != NULL);
3200 LDKCOption_C2Tuple_usizeTransactionZZ_None_class =
3201 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$None"));
3202 CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_class != NULL);
3203 LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, "<init>", "()V");
3204 CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_meth != NULL);
3206 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeTransactionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3207 LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(ptr);
3209 case LDKCOption_C2Tuple_usizeTransactionZZ_Some: {
3210 LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
3211 *some_conv = obj->some;
3212 *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv);
3213 return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth, tag_ptr(some_conv, true));
3215 case LDKCOption_C2Tuple_usizeTransactionZZ_None: {
3216 return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, LDKCOption_C2Tuple_usizeTransactionZZ_None_meth);
3221 static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
3222 CHECK(owner->result_ok);
3223 return FixedPenaltyScorer_clone(&*owner->contents.result);
3225 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3226 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
3227 LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv);
3228 int64_t ret_ref = 0;
3229 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3230 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3234 static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
3235 CHECK(!owner->result_ok);
3236 return DecodeError_clone(&*owner->contents.err);
3238 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3239 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
3240 LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
3241 int64_t ret_ref = 0;
3242 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3243 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3247 static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
3250 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
3251 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
3252 int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv);
3256 static inline uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
3259 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
3260 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
3261 int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv);
3265 static jclass LDKCOption_C2Tuple_u64u64ZZ_Some_class = NULL;
3266 static jmethodID LDKCOption_C2Tuple_u64u64ZZ_Some_meth = NULL;
3267 static jclass LDKCOption_C2Tuple_u64u64ZZ_None_class = NULL;
3268 static jmethodID LDKCOption_C2Tuple_u64u64ZZ_None_meth = NULL;
3269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1u64u64ZZ_init (JNIEnv *env, jclass clz) {
3270 LDKCOption_C2Tuple_u64u64ZZ_Some_class =
3271 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_u64u64ZZ$Some"));
3272 CHECK(LDKCOption_C2Tuple_u64u64ZZ_Some_class != NULL);
3273 LDKCOption_C2Tuple_u64u64ZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_u64u64ZZ_Some_class, "<init>", "(J)V");
3274 CHECK(LDKCOption_C2Tuple_u64u64ZZ_Some_meth != NULL);
3275 LDKCOption_C2Tuple_u64u64ZZ_None_class =
3276 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_u64u64ZZ$None"));
3277 CHECK(LDKCOption_C2Tuple_u64u64ZZ_None_class != NULL);
3278 LDKCOption_C2Tuple_u64u64ZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_u64u64ZZ_None_class, "<init>", "()V");
3279 CHECK(LDKCOption_C2Tuple_u64u64ZZ_None_meth != NULL);
3281 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1u64u64ZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3282 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
3284 case LDKCOption_C2Tuple_u64u64ZZ_Some: {
3285 LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
3286 *some_conv = obj->some;
3287 *some_conv = C2Tuple_u64u64Z_clone(some_conv);
3288 return (*env)->NewObject(env, LDKCOption_C2Tuple_u64u64ZZ_Some_class, LDKCOption_C2Tuple_u64u64ZZ_Some_meth, tag_ptr(some_conv, true));
3290 case LDKCOption_C2Tuple_u64u64ZZ_None: {
3291 return (*env)->NewObject(env, LDKCOption_C2Tuple_u64u64ZZ_None_class, LDKCOption_C2Tuple_u64u64ZZ_None_meth);
3296 static inline LDKCVec_NodeIdZ CVec_NodeIdZ_clone(const LDKCVec_NodeIdZ *orig) {
3297 LDKCVec_NodeIdZ ret = { .data = MALLOC(sizeof(LDKNodeId) * orig->datalen, "LDKCVec_NodeIdZ clone bytes"), .datalen = orig->datalen };
3298 for (size_t i = 0; i < ret.datalen; i++) {
3299 ret.data[i] = NodeId_clone(&orig->data[i]);
3303 typedef struct LDKLogger_JCalls {
3304 atomic_size_t refcnt;
3309 static void LDKLogger_JCalls_free(void* this_arg) {
3310 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
3311 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3313 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
3314 if (get_jenv_res == JNI_EDETACHED) {
3315 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
3317 DO_ASSERT(get_jenv_res == JNI_OK);
3319 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
3320 if (get_jenv_res == JNI_EDETACHED) {
3321 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
3326 void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) {
3327 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
3329 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
3330 if (get_jenv_res == JNI_EDETACHED) {
3331 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
3333 DO_ASSERT(get_jenv_res == JNI_OK);
3335 LDKRecord record_var = *record;
3336 int64_t record_ref = 0;
3337 record_var = Record_clone(&record_var);
3338 CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var);
3339 record_ref = tag_ptr(record_var.inner, record_var.is_owned);
3340 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
3342 (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref);
3343 if (UNLIKELY((*env)->ExceptionCheck(env))) {
3344 (*env)->ExceptionDescribe(env);
3345 (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception.");
3347 if (get_jenv_res == JNI_EDETACHED) {
3348 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
3351 static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
3352 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
3353 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3355 static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) {
3356 jclass c = (*env)->GetObjectClass(env, o);
3358 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
3359 atomic_init(&calls->refcnt, 1);
3360 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
3361 calls->o = (*env)->NewWeakGlobalRef(env, o);
3362 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V");
3363 CHECK(calls->log_meth != NULL);
3366 .this_arg = (void*) calls,
3367 .log = log_LDKLogger_jcall,
3368 .free = LDKLogger_JCalls_free,
3372 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new(JNIEnv *env, jclass clz, jobject o) {
3373 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
3374 *res_ptr = LDKLogger_init(env, clz, o);
3375 return tag_ptr(res_ptr, true);
3377 static inline struct LDKProbabilisticScorer *CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
3378 CHECK(owner->result_ok);
3379 return &*owner->contents.result;
3381 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3382 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
3383 LDKProbabilisticScorer ret_var = *CResult_ProbabilisticScorerDecodeErrorZ_get_ok(owner_conv);
3384 int64_t ret_ref = 0;
3385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3386 ret_ref = tag_ptr(ret_var.inner, false);
3390 static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
3391 CHECK(!owner->result_ok);
3392 return DecodeError_clone(&*owner->contents.err);
3394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3395 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
3396 LDKDecodeError ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
3397 int64_t ret_ref = 0;
3398 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3399 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3403 static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
3404 CHECK(owner->result_ok);
3405 return InitFeatures_clone(&*owner->contents.result);
3407 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3408 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
3409 LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv);
3410 int64_t ret_ref = 0;
3411 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3412 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3416 static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
3417 CHECK(!owner->result_ok);
3418 return DecodeError_clone(&*owner->contents.err);
3420 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3421 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
3422 LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
3423 int64_t ret_ref = 0;
3424 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3425 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3429 static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
3430 CHECK(owner->result_ok);
3431 return ChannelFeatures_clone(&*owner->contents.result);
3433 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3434 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
3435 LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv);
3436 int64_t ret_ref = 0;
3437 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3438 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3442 static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
3443 CHECK(!owner->result_ok);
3444 return DecodeError_clone(&*owner->contents.err);
3446 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3447 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
3448 LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
3449 int64_t ret_ref = 0;
3450 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3451 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3455 static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
3456 CHECK(owner->result_ok);
3457 return NodeFeatures_clone(&*owner->contents.result);
3459 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3460 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
3461 LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv);
3462 int64_t ret_ref = 0;
3463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3468 static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
3469 CHECK(!owner->result_ok);
3470 return DecodeError_clone(&*owner->contents.err);
3472 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3473 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
3474 LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
3475 int64_t ret_ref = 0;
3476 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3477 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3481 static inline struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
3482 CHECK(owner->result_ok);
3483 return InvoiceFeatures_clone(&*owner->contents.result);
3485 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3486 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
3487 LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner_conv);
3488 int64_t ret_ref = 0;
3489 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3490 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3494 static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
3495 CHECK(!owner->result_ok);
3496 return DecodeError_clone(&*owner->contents.err);
3498 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3499 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
3500 LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
3501 int64_t ret_ref = 0;
3502 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3503 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3507 static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
3508 CHECK(owner->result_ok);
3509 return ChannelTypeFeatures_clone(&*owner->contents.result);
3511 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3512 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
3513 LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv);
3514 int64_t ret_ref = 0;
3515 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3516 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3520 static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
3521 CHECK(!owner->result_ok);
3522 return DecodeError_clone(&*owner->contents.err);
3524 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3525 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
3526 LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
3527 int64_t ret_ref = 0;
3528 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3529 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3533 static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
3534 CHECK(owner->result_ok);
3535 return NodeId_clone(&*owner->contents.result);
3537 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3538 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
3539 LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv);
3540 int64_t ret_ref = 0;
3541 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3542 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3546 static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
3547 CHECK(!owner->result_ok);
3548 return DecodeError_clone(&*owner->contents.err);
3550 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3551 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
3552 LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
3553 int64_t ret_ref = 0;
3554 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3555 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3559 static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
3560 CHECK(owner->result_ok);
3561 return COption_NetworkUpdateZ_clone(&*owner->contents.result);
3563 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3564 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
3565 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
3566 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv);
3567 int64_t ret_ref = tag_ptr(ret_copy, true);
3571 static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
3572 CHECK(!owner->result_ok);
3573 return DecodeError_clone(&*owner->contents.err);
3575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3576 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
3577 LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
3578 int64_t ret_ref = 0;
3579 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3580 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3584 typedef struct LDKAccess_JCalls {
3585 atomic_size_t refcnt;
3588 jmethodID get_utxo_meth;
3590 static void LDKAccess_JCalls_free(void* this_arg) {
3591 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
3592 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3594 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
3595 if (get_jenv_res == JNI_EDETACHED) {
3596 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
3598 DO_ASSERT(get_jenv_res == JNI_OK);
3600 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
3601 if (get_jenv_res == JNI_EDETACHED) {
3602 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
3607 LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
3608 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
3610 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
3611 if (get_jenv_res == JNI_EDETACHED) {
3612 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
3614 DO_ASSERT(get_jenv_res == JNI_OK);
3616 int8_tArray genesis_hash_arr = (*env)->NewByteArray(env, 32);
3617 (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash);
3618 int64_t short_channel_id_conv = short_channel_id;
3619 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
3621 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id_conv);
3622 if (UNLIKELY((*env)->ExceptionCheck(env))) {
3623 (*env)->ExceptionDescribe(env);
3624 (*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception.");
3626 void* ret_ptr = untag_ptr(ret);
3627 CHECK_ACCESS(ret_ptr);
3628 LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
3629 FREE(untag_ptr(ret));
3630 if (get_jenv_res == JNI_EDETACHED) {
3631 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
3635 static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
3636 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
3637 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3639 static inline LDKAccess LDKAccess_init (JNIEnv *env, jclass clz, jobject o) {
3640 jclass c = (*env)->GetObjectClass(env, o);
3642 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
3643 atomic_init(&calls->refcnt, 1);
3644 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
3645 calls->o = (*env)->NewWeakGlobalRef(env, o);
3646 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
3647 CHECK(calls->get_utxo_meth != NULL);
3650 .this_arg = (void*) calls,
3651 .get_utxo = get_utxo_LDKAccess_jcall,
3652 .free = LDKAccess_JCalls_free,
3656 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new(JNIEnv *env, jclass clz, jobject o) {
3657 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
3658 *res_ptr = LDKAccess_init(env, clz, o);
3659 return tag_ptr(res_ptr, true);
3661 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) {
3662 void* this_arg_ptr = untag_ptr(this_arg);
3663 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3664 LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
3665 unsigned char genesis_hash_arr[32];
3666 CHECK((*env)->GetArrayLength(env, genesis_hash) == 32);
3667 (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr);
3668 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
3669 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
3670 *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
3671 return tag_ptr(ret_conv, true);
3674 static jclass LDKCOption_AccessZ_Some_class = NULL;
3675 static jmethodID LDKCOption_AccessZ_Some_meth = NULL;
3676 static jclass LDKCOption_AccessZ_None_class = NULL;
3677 static jmethodID LDKCOption_AccessZ_None_meth = NULL;
3678 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AccessZ_init (JNIEnv *env, jclass clz) {
3679 LDKCOption_AccessZ_Some_class =
3680 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$Some"));
3681 CHECK(LDKCOption_AccessZ_Some_class != NULL);
3682 LDKCOption_AccessZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_Some_class, "<init>", "(J)V");
3683 CHECK(LDKCOption_AccessZ_Some_meth != NULL);
3684 LDKCOption_AccessZ_None_class =
3685 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$None"));
3686 CHECK(LDKCOption_AccessZ_None_class != NULL);
3687 LDKCOption_AccessZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_None_class, "<init>", "()V");
3688 CHECK(LDKCOption_AccessZ_None_meth != NULL);
3690 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3691 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
3693 case LDKCOption_AccessZ_Some: {
3694 LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
3695 *some_ret = obj->some;
3696 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
3697 if ((*some_ret).free == LDKAccess_JCalls_free) {
3698 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3699 LDKAccess_JCalls_cloned(&(*some_ret));
3701 return (*env)->NewObject(env, LDKCOption_AccessZ_Some_class, LDKCOption_AccessZ_Some_meth, tag_ptr(some_ret, true));
3703 case LDKCOption_AccessZ_None: {
3704 return (*env)->NewObject(env, LDKCOption_AccessZ_None_class, LDKCOption_AccessZ_None_meth);
3709 static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
3710 CHECK(owner->result_ok);
3711 return *owner->contents.result;
3713 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3714 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
3715 jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv);
3719 static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
3720 CHECK(!owner->result_ok);
3721 return LightningError_clone(&*owner->contents.err);
3723 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3724 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
3725 LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv);
3726 int64_t ret_ref = 0;
3727 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3728 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3732 static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3733 return ChannelAnnouncement_clone(&owner->a);
3735 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
3736 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3737 LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv);
3738 int64_t ret_ref = 0;
3739 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3740 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3744 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3745 return ChannelUpdate_clone(&owner->b);
3747 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
3748 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3749 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv);
3750 int64_t ret_ref = 0;
3751 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3752 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3756 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3757 return ChannelUpdate_clone(&owner->c);
3759 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
3760 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3761 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv);
3762 int64_t ret_ref = 0;
3763 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3764 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3768 static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) {
3769 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen };
3770 for (size_t i = 0; i < ret.datalen; i++) {
3771 ret.data[i] = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(&orig->data[i]);
3775 static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) {
3776 LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen };
3777 for (size_t i = 0; i < ret.datalen; i++) {
3778 ret.data[i] = NodeAnnouncement_clone(&orig->data[i]);
3782 static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
3783 CHECK(owner->result_ok);
3784 return *owner->contents.result;
3786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3787 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3788 CResult_NoneLightningErrorZ_get_ok(owner_conv);
3791 static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
3792 CHECK(!owner->result_ok);
3793 return LightningError_clone(&*owner->contents.err);
3795 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3796 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3797 LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv);
3798 int64_t ret_ref = 0;
3799 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3800 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3804 static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3805 CHECK(owner->result_ok);
3806 return ChannelUpdateInfo_clone(&*owner->contents.result);
3808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3809 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3810 LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv);
3811 int64_t ret_ref = 0;
3812 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3813 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3817 static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3818 CHECK(!owner->result_ok);
3819 return DecodeError_clone(&*owner->contents.err);
3821 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3822 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3823 LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
3824 int64_t ret_ref = 0;
3825 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3826 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3830 static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3831 CHECK(owner->result_ok);
3832 return ChannelInfo_clone(&*owner->contents.result);
3834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3835 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3836 LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv);
3837 int64_t ret_ref = 0;
3838 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3839 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3843 static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3844 CHECK(!owner->result_ok);
3845 return DecodeError_clone(&*owner->contents.err);
3847 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3848 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3849 LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
3850 int64_t ret_ref = 0;
3851 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3852 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3856 static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3857 CHECK(owner->result_ok);
3858 return RoutingFees_clone(&*owner->contents.result);
3860 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3861 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3862 LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv);
3863 int64_t ret_ref = 0;
3864 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3865 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3869 static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3870 CHECK(!owner->result_ok);
3871 return DecodeError_clone(&*owner->contents.err);
3873 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3874 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3875 LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
3876 int64_t ret_ref = 0;
3877 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3878 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3882 static jclass LDKNetAddress_IPv4_class = NULL;
3883 static jmethodID LDKNetAddress_IPv4_meth = NULL;
3884 static jclass LDKNetAddress_IPv6_class = NULL;
3885 static jmethodID LDKNetAddress_IPv6_meth = NULL;
3886 static jclass LDKNetAddress_OnionV2_class = NULL;
3887 static jmethodID LDKNetAddress_OnionV2_meth = NULL;
3888 static jclass LDKNetAddress_OnionV3_class = NULL;
3889 static jmethodID LDKNetAddress_OnionV3_meth = NULL;
3890 static jclass LDKNetAddress_Hostname_class = NULL;
3891 static jmethodID LDKNetAddress_Hostname_meth = NULL;
3892 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv *env, jclass clz) {
3893 LDKNetAddress_IPv4_class =
3894 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv4"));
3895 CHECK(LDKNetAddress_IPv4_class != NULL);
3896 LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "<init>", "([BS)V");
3897 CHECK(LDKNetAddress_IPv4_meth != NULL);
3898 LDKNetAddress_IPv6_class =
3899 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv6"));
3900 CHECK(LDKNetAddress_IPv6_class != NULL);
3901 LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "<init>", "([BS)V");
3902 CHECK(LDKNetAddress_IPv6_meth != NULL);
3903 LDKNetAddress_OnionV2_class =
3904 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV2"));
3905 CHECK(LDKNetAddress_OnionV2_class != NULL);
3906 LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "<init>", "([B)V");
3907 CHECK(LDKNetAddress_OnionV2_meth != NULL);
3908 LDKNetAddress_OnionV3_class =
3909 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV3"));
3910 CHECK(LDKNetAddress_OnionV3_class != NULL);
3911 LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "<init>", "([BSBS)V");
3912 CHECK(LDKNetAddress_OnionV3_meth != NULL);
3913 LDKNetAddress_Hostname_class =
3914 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$Hostname"));
3915 CHECK(LDKNetAddress_Hostname_class != NULL);
3916 LDKNetAddress_Hostname_meth = (*env)->GetMethodID(env, LDKNetAddress_Hostname_class, "<init>", "(JS)V");
3917 CHECK(LDKNetAddress_Hostname_meth != NULL);
3919 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3920 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3922 case LDKNetAddress_IPv4: {
3923 int8_tArray addr_arr = (*env)->NewByteArray(env, 4);
3924 (*env)->SetByteArrayRegion(env, addr_arr, 0, 4, obj->i_pv4.addr.data);
3925 int16_t port_conv = obj->i_pv4.port;
3926 return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_arr, port_conv);
3928 case LDKNetAddress_IPv6: {
3929 int8_tArray addr_arr = (*env)->NewByteArray(env, 16);
3930 (*env)->SetByteArrayRegion(env, addr_arr, 0, 16, obj->i_pv6.addr.data);
3931 int16_t port_conv = obj->i_pv6.port;
3932 return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, port_conv);
3934 case LDKNetAddress_OnionV2: {
3935 int8_tArray onion_v2_arr = (*env)->NewByteArray(env, 12);
3936 (*env)->SetByteArrayRegion(env, onion_v2_arr, 0, 12, obj->onion_v2.data);
3937 return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, onion_v2_arr);
3939 case LDKNetAddress_OnionV3: {
3940 int8_tArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32);
3941 (*env)->SetByteArrayRegion(env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data);
3942 int16_t checksum_conv = obj->onion_v3.checksum;
3943 int8_t version_conv = obj->onion_v3.version;
3944 int16_t port_conv = obj->onion_v3.port;
3945 return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, checksum_conv, version_conv, port_conv);
3947 case LDKNetAddress_Hostname: {
3948 LDKHostname hostname_var = obj->hostname.hostname;
3949 int64_t hostname_ref = 0;
3950 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_var);
3951 hostname_ref = tag_ptr(hostname_var.inner, false);
3952 int16_t port_conv = obj->hostname.port;
3953 return (*env)->NewObject(env, LDKNetAddress_Hostname_class, LDKNetAddress_Hostname_meth, hostname_ref, port_conv);
3958 static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) {
3959 LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen };
3960 for (size_t i = 0; i < ret.datalen; i++) {
3961 ret.data[i] = NetAddress_clone(&orig->data[i]);
3965 static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3966 CHECK(owner->result_ok);
3967 return NodeAnnouncementInfo_clone(&*owner->contents.result);
3969 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3970 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3971 LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv);
3972 int64_t ret_ref = 0;
3973 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3974 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3978 static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3979 CHECK(!owner->result_ok);
3980 return DecodeError_clone(&*owner->contents.err);
3982 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3983 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3984 LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
3985 int64_t ret_ref = 0;
3986 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3987 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3991 static inline struct LDKNodeAlias CResult_NodeAliasDecodeErrorZ_get_ok(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3992 CHECK(owner->result_ok);
3993 return NodeAlias_clone(&*owner->contents.result);
3995 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3996 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3997 LDKNodeAlias ret_var = CResult_NodeAliasDecodeErrorZ_get_ok(owner_conv);
3998 int64_t ret_ref = 0;
3999 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4000 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4004 static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
4005 CHECK(!owner->result_ok);
4006 return DecodeError_clone(&*owner->contents.err);
4008 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4009 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
4010 LDKDecodeError ret_var = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
4011 int64_t ret_ref = 0;
4012 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4013 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4017 static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
4018 CHECK(owner->result_ok);
4019 return NodeInfo_clone(&*owner->contents.result);
4021 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4022 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
4023 LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv);
4024 int64_t ret_ref = 0;
4025 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4026 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4030 static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
4031 CHECK(!owner->result_ok);
4032 return DecodeError_clone(&*owner->contents.err);
4034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4035 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
4036 LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
4037 int64_t ret_ref = 0;
4038 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4039 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4043 static inline struct LDKNetworkGraph *CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
4044 CHECK(owner->result_ok);
4045 return &*owner->contents.result;
4047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4048 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
4049 LDKNetworkGraph ret_var = *CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv);
4050 int64_t ret_ref = 0;
4051 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4052 ret_ref = tag_ptr(ret_var.inner, false);
4056 static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
4057 CHECK(!owner->result_ok);
4058 return DecodeError_clone(&*owner->contents.err);
4060 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4061 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
4062 LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
4063 int64_t ret_ref = 0;
4064 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4065 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4069 static jclass LDKCOption_CVec_NetAddressZZ_Some_class = NULL;
4070 static jmethodID LDKCOption_CVec_NetAddressZZ_Some_meth = NULL;
4071 static jclass LDKCOption_CVec_NetAddressZZ_None_class = NULL;
4072 static jmethodID LDKCOption_CVec_NetAddressZZ_None_meth = NULL;
4073 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1NetAddressZZ_init (JNIEnv *env, jclass clz) {
4074 LDKCOption_CVec_NetAddressZZ_Some_class =
4075 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some"));
4076 CHECK(LDKCOption_CVec_NetAddressZZ_Some_class != NULL);
4077 LDKCOption_CVec_NetAddressZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_Some_class, "<init>", "([J)V");
4078 CHECK(LDKCOption_CVec_NetAddressZZ_Some_meth != NULL);
4079 LDKCOption_CVec_NetAddressZZ_None_class =
4080 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None"));
4081 CHECK(LDKCOption_CVec_NetAddressZZ_None_class != NULL);
4082 LDKCOption_CVec_NetAddressZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_None_class, "<init>", "()V");
4083 CHECK(LDKCOption_CVec_NetAddressZZ_None_meth != NULL);
4085 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4086 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
4088 case LDKCOption_CVec_NetAddressZZ_Some: {
4089 LDKCVec_NetAddressZ some_var = obj->some;
4090 int64_tArray some_arr = NULL;
4091 some_arr = (*env)->NewLongArray(env, some_var.datalen);
4092 int64_t *some_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, some_arr, NULL);
4093 for (size_t m = 0; m < some_var.datalen; m++) {
4094 int64_t some_conv_12_ref = tag_ptr(&some_var.data[m], false);
4095 some_arr_ptr[m] = some_conv_12_ref;
4097 (*env)->ReleasePrimitiveArrayCritical(env, some_arr, some_arr_ptr, 0);
4098 return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_Some_class, LDKCOption_CVec_NetAddressZZ_Some_meth, some_arr);
4100 case LDKCOption_CVec_NetAddressZZ_None: {
4101 return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_None_class, LDKCOption_CVec_NetAddressZZ_None_meth);
4106 static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4107 CHECK(owner->result_ok);
4108 return DelayedPaymentOutputDescriptor_clone(&*owner->contents.result);
4110 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4111 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4112 LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
4113 int64_t ret_ref = 0;
4114 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4115 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4119 static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4120 CHECK(!owner->result_ok);
4121 return DecodeError_clone(&*owner->contents.err);
4123 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4124 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4125 LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
4126 int64_t ret_ref = 0;
4127 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4128 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4132 static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4133 CHECK(owner->result_ok);
4134 return StaticPaymentOutputDescriptor_clone(&*owner->contents.result);
4136 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4137 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4138 LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
4139 int64_t ret_ref = 0;
4140 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4141 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4145 static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4146 CHECK(!owner->result_ok);
4147 return DecodeError_clone(&*owner->contents.err);
4149 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4150 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4151 LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
4152 int64_t ret_ref = 0;
4153 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4154 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4158 static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4159 CHECK(owner->result_ok);
4160 return SpendableOutputDescriptor_clone(&*owner->contents.result);
4162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4163 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4164 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
4165 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
4166 int64_t ret_ref = tag_ptr(ret_copy, true);
4170 static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
4171 CHECK(!owner->result_ok);
4172 return DecodeError_clone(&*owner->contents.err);
4174 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4175 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
4176 LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
4177 int64_t ret_ref = 0;
4178 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4179 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4183 static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) {
4184 LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen };
4185 for (size_t i = 0; i < ret.datalen; i++) {
4186 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
4190 static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
4193 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4194 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
4195 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
4196 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form);
4200 static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
4203 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4204 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
4205 LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv);
4206 jobjectArray ret_arr = NULL;
4207 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
4209 for (size_t i = 0; i < ret_var.datalen; i++) {
4210 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
4211 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
4212 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
4218 static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
4219 CHECK(owner->result_ok);
4220 return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result);
4222 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4223 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
4224 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
4225 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv);
4226 return tag_ptr(ret_conv, true);
4229 static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
4230 CHECK(!owner->result_ok);
4231 return *owner->contents.err;
4233 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4234 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
4235 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv);
4238 static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
4239 CHECK(owner->result_ok);
4240 return *owner->contents.result;
4242 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4243 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
4244 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
4245 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form);
4249 static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
4250 CHECK(!owner->result_ok);
4251 return *owner->contents.err;
4253 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4254 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
4255 CResult_SignatureNoneZ_get_err(owner_conv);
4258 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
4261 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4262 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
4263 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
4264 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form);
4268 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
4271 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4272 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
4273 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
4274 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form);
4278 static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
4279 CHECK(owner->result_ok);
4280 return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result);
4282 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4283 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
4284 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
4285 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv);
4286 return tag_ptr(ret_conv, true);
4289 static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
4290 CHECK(!owner->result_ok);
4291 return *owner->contents.err;
4293 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4294 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
4295 CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv);
4298 static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
4299 CHECK(owner->result_ok);
4300 return *owner->contents.result;
4302 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4303 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
4304 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
4305 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes);
4309 static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
4310 CHECK(!owner->result_ok);
4311 return *owner->contents.err;
4313 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4314 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
4315 CResult_SecretKeyNoneZ_get_err(owner_conv);
4318 typedef struct LDKBaseSign_JCalls {
4319 atomic_size_t refcnt;
4322 jmethodID get_per_commitment_point_meth;
4323 jmethodID release_commitment_secret_meth;
4324 jmethodID validate_holder_commitment_meth;
4325 jmethodID channel_keys_id_meth;
4326 jmethodID sign_counterparty_commitment_meth;
4327 jmethodID validate_counterparty_revocation_meth;
4328 jmethodID sign_holder_commitment_and_htlcs_meth;
4329 jmethodID sign_justice_revoked_output_meth;
4330 jmethodID sign_justice_revoked_htlc_meth;
4331 jmethodID sign_counterparty_htlc_transaction_meth;
4332 jmethodID sign_closing_transaction_meth;
4333 jmethodID sign_channel_announcement_meth;
4334 jmethodID ready_channel_meth;
4335 } LDKBaseSign_JCalls;
4336 static void LDKBaseSign_JCalls_free(void* this_arg) {
4337 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4338 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4340 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4341 if (get_jenv_res == JNI_EDETACHED) {
4342 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4344 DO_ASSERT(get_jenv_res == JNI_OK);
4346 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
4347 if (get_jenv_res == JNI_EDETACHED) {
4348 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4353 LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
4354 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4356 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4357 if (get_jenv_res == JNI_EDETACHED) {
4358 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4360 DO_ASSERT(get_jenv_res == JNI_OK);
4362 int64_t idx_conv = idx;
4363 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4365 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv);
4366 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4367 (*env)->ExceptionDescribe(env);
4368 (*env)->FatalError(env, "A call to get_per_commitment_point in LDKBaseSign from rust threw an exception.");
4370 LDKPublicKey ret_ref;
4371 CHECK((*env)->GetArrayLength(env, ret) == 33);
4372 (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
4373 if (get_jenv_res == JNI_EDETACHED) {
4374 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4378 LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
4379 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4381 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4382 if (get_jenv_res == JNI_EDETACHED) {
4383 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4385 DO_ASSERT(get_jenv_res == JNI_OK);
4387 int64_t idx_conv = idx;
4388 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4390 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv);
4391 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4392 (*env)->ExceptionDescribe(env);
4393 (*env)->FatalError(env, "A call to release_commitment_secret in LDKBaseSign from rust threw an exception.");
4395 LDKThirtyTwoBytes ret_ref;
4396 CHECK((*env)->GetArrayLength(env, ret) == 32);
4397 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
4398 if (get_jenv_res == JNI_EDETACHED) {
4399 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4403 LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
4404 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4406 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4407 if (get_jenv_res == JNI_EDETACHED) {
4408 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4410 DO_ASSERT(get_jenv_res == JNI_OK);
4412 LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
4413 int64_t holder_tx_ref = 0;
4414 holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var);
4415 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var);
4416 holder_tx_ref = tag_ptr(holder_tx_var.inner, holder_tx_var.is_owned);
4417 LDKCVec_PaymentPreimageZ preimages_var = preimages;
4418 jobjectArray preimages_arr = NULL;
4419 preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL);
4421 for (size_t i = 0; i < preimages_var.datalen; i++) {
4422 int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32);
4423 (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data);
4424 (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr);
4427 FREE(preimages_var.data);
4428 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4430 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_holder_commitment_meth, holder_tx_ref, preimages_arr);
4431 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4432 (*env)->ExceptionDescribe(env);
4433 (*env)->FatalError(env, "A call to validate_holder_commitment in LDKBaseSign from rust threw an exception.");
4435 void* ret_ptr = untag_ptr(ret);
4436 CHECK_ACCESS(ret_ptr);
4437 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
4438 FREE(untag_ptr(ret));
4439 if (get_jenv_res == JNI_EDETACHED) {
4440 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4444 LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) {
4445 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4447 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4448 if (get_jenv_res == JNI_EDETACHED) {
4449 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4451 DO_ASSERT(get_jenv_res == JNI_OK);
4453 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4455 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth);
4456 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4457 (*env)->ExceptionDescribe(env);
4458 (*env)->FatalError(env, "A call to channel_keys_id in LDKBaseSign from rust threw an exception.");
4460 LDKThirtyTwoBytes ret_ref;
4461 CHECK((*env)->GetArrayLength(env, ret) == 32);
4462 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
4463 if (get_jenv_res == JNI_EDETACHED) {
4464 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4468 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
4469 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4471 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4472 if (get_jenv_res == JNI_EDETACHED) {
4473 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4475 DO_ASSERT(get_jenv_res == JNI_OK);
4477 LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
4478 int64_t commitment_tx_ref = 0;
4479 commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var);
4480 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
4481 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
4482 LDKCVec_PaymentPreimageZ preimages_var = preimages;
4483 jobjectArray preimages_arr = NULL;
4484 preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL);
4486 for (size_t i = 0; i < preimages_var.datalen; i++) {
4487 int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32);
4488 (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data);
4489 (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr);
4492 FREE(preimages_var.data);
4493 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4495 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_commitment_meth, commitment_tx_ref, preimages_arr);
4496 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4497 (*env)->ExceptionDescribe(env);
4498 (*env)->FatalError(env, "A call to sign_counterparty_commitment in LDKBaseSign from rust threw an exception.");
4500 void* ret_ptr = untag_ptr(ret);
4501 CHECK_ACCESS(ret_ptr);
4502 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
4503 FREE(untag_ptr(ret));
4504 if (get_jenv_res == JNI_EDETACHED) {
4505 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4509 LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
4510 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4512 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4513 if (get_jenv_res == JNI_EDETACHED) {
4514 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4516 DO_ASSERT(get_jenv_res == JNI_OK);
4518 int64_t idx_conv = idx;
4519 int8_tArray secret_arr = (*env)->NewByteArray(env, 32);
4520 (*env)->SetByteArrayRegion(env, secret_arr, 0, 32, *secret);
4521 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4523 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_counterparty_revocation_meth, idx_conv, secret_arr);
4524 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4525 (*env)->ExceptionDescribe(env);
4526 (*env)->FatalError(env, "A call to validate_counterparty_revocation in LDKBaseSign from rust threw an exception.");
4528 void* ret_ptr = untag_ptr(ret);
4529 CHECK_ACCESS(ret_ptr);
4530 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
4531 FREE(untag_ptr(ret));
4532 if (get_jenv_res == JNI_EDETACHED) {
4533 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4537 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
4538 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4540 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4541 if (get_jenv_res == JNI_EDETACHED) {
4542 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4544 DO_ASSERT(get_jenv_res == JNI_OK);
4546 LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
4547 int64_t commitment_tx_ref = 0;
4548 commitment_tx_var = HolderCommitmentTransaction_clone(&commitment_tx_var);
4549 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
4550 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
4551 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4553 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref);
4554 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4555 (*env)->ExceptionDescribe(env);
4556 (*env)->FatalError(env, "A call to sign_holder_commitment_and_htlcs in LDKBaseSign from rust threw an exception.");
4558 void* ret_ptr = untag_ptr(ret);
4559 CHECK_ACCESS(ret_ptr);
4560 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
4561 FREE(untag_ptr(ret));
4562 if (get_jenv_res == JNI_EDETACHED) {
4563 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4567 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]) {
4568 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4570 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4571 if (get_jenv_res == JNI_EDETACHED) {
4572 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4574 DO_ASSERT(get_jenv_res == JNI_OK);
4576 LDKTransaction justice_tx_var = justice_tx;
4577 int8_tArray justice_tx_arr = (*env)->NewByteArray(env, justice_tx_var.datalen);
4578 (*env)->SetByteArrayRegion(env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data);
4579 Transaction_free(justice_tx_var);
4580 int64_t input_conv = input;
4581 int64_t amount_conv = amount;
4582 int8_tArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
4583 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
4584 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4586 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);
4587 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4588 (*env)->ExceptionDescribe(env);
4589 (*env)->FatalError(env, "A call to sign_justice_revoked_output in LDKBaseSign from rust threw an exception.");
4591 void* ret_ptr = untag_ptr(ret);
4592 CHECK_ACCESS(ret_ptr);
4593 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
4594 FREE(untag_ptr(ret));
4595 if (get_jenv_res == JNI_EDETACHED) {
4596 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4600 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) {
4601 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4603 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4604 if (get_jenv_res == JNI_EDETACHED) {
4605 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4607 DO_ASSERT(get_jenv_res == JNI_OK);
4609 LDKTransaction justice_tx_var = justice_tx;
4610 int8_tArray justice_tx_arr = (*env)->NewByteArray(env, justice_tx_var.datalen);
4611 (*env)->SetByteArrayRegion(env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data);
4612 Transaction_free(justice_tx_var);
4613 int64_t input_conv = input;
4614 int64_t amount_conv = amount;
4615 int8_tArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
4616 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
4617 LDKHTLCOutputInCommitment htlc_var = *htlc;
4618 int64_t htlc_ref = 0;
4619 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
4620 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
4621 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
4622 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4624 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);
4625 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4626 (*env)->ExceptionDescribe(env);
4627 (*env)->FatalError(env, "A call to sign_justice_revoked_htlc in LDKBaseSign from rust threw an exception.");
4629 void* ret_ptr = untag_ptr(ret);
4630 CHECK_ACCESS(ret_ptr);
4631 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
4632 FREE(untag_ptr(ret));
4633 if (get_jenv_res == JNI_EDETACHED) {
4634 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4638 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) {
4639 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4641 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4642 if (get_jenv_res == JNI_EDETACHED) {
4643 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4645 DO_ASSERT(get_jenv_res == JNI_OK);
4647 LDKTransaction htlc_tx_var = htlc_tx;
4648 int8_tArray htlc_tx_arr = (*env)->NewByteArray(env, htlc_tx_var.datalen);
4649 (*env)->SetByteArrayRegion(env, htlc_tx_arr, 0, htlc_tx_var.datalen, htlc_tx_var.data);
4650 Transaction_free(htlc_tx_var);
4651 int64_t input_conv = input;
4652 int64_t amount_conv = amount;
4653 int8_tArray per_commitment_point_arr = (*env)->NewByteArray(env, 33);
4654 (*env)->SetByteArrayRegion(env, per_commitment_point_arr, 0, 33, per_commitment_point.compressed_form);
4655 LDKHTLCOutputInCommitment htlc_var = *htlc;
4656 int64_t htlc_ref = 0;
4657 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
4658 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
4659 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
4660 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4662 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);
4663 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4664 (*env)->ExceptionDescribe(env);
4665 (*env)->FatalError(env, "A call to sign_counterparty_htlc_transaction in LDKBaseSign from rust threw an exception.");
4667 void* ret_ptr = untag_ptr(ret);
4668 CHECK_ACCESS(ret_ptr);
4669 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
4670 FREE(untag_ptr(ret));
4671 if (get_jenv_res == JNI_EDETACHED) {
4672 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4676 LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
4677 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4679 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4680 if (get_jenv_res == JNI_EDETACHED) {
4681 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4683 DO_ASSERT(get_jenv_res == JNI_OK);
4685 LDKClosingTransaction closing_tx_var = *closing_tx;
4686 int64_t closing_tx_ref = 0;
4687 closing_tx_var = ClosingTransaction_clone(&closing_tx_var);
4688 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
4689 closing_tx_ref = tag_ptr(closing_tx_var.inner, closing_tx_var.is_owned);
4690 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4692 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_closing_transaction_meth, closing_tx_ref);
4693 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4694 (*env)->ExceptionDescribe(env);
4695 (*env)->FatalError(env, "A call to sign_closing_transaction in LDKBaseSign from rust threw an exception.");
4697 void* ret_ptr = untag_ptr(ret);
4698 CHECK_ACCESS(ret_ptr);
4699 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
4700 FREE(untag_ptr(ret));
4701 if (get_jenv_res == JNI_EDETACHED) {
4702 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4706 LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
4707 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4709 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4710 if (get_jenv_res == JNI_EDETACHED) {
4711 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4713 DO_ASSERT(get_jenv_res == JNI_OK);
4715 LDKUnsignedChannelAnnouncement msg_var = *msg;
4716 int64_t msg_ref = 0;
4717 msg_var = UnsignedChannelAnnouncement_clone(&msg_var);
4718 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4719 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
4720 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4722 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_channel_announcement_meth, msg_ref);
4723 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4724 (*env)->ExceptionDescribe(env);
4725 (*env)->FatalError(env, "A call to sign_channel_announcement in LDKBaseSign from rust threw an exception.");
4727 void* ret_ptr = untag_ptr(ret);
4728 CHECK_ACCESS(ret_ptr);
4729 LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr);
4730 FREE(untag_ptr(ret));
4731 if (get_jenv_res == JNI_EDETACHED) {
4732 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4736 void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
4737 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
4739 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4740 if (get_jenv_res == JNI_EDETACHED) {
4741 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4743 DO_ASSERT(get_jenv_res == JNI_OK);
4745 LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
4746 int64_t channel_parameters_ref = 0;
4747 channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
4748 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
4749 channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
4750 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4752 (*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref);
4753 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4754 (*env)->ExceptionDescribe(env);
4755 (*env)->FatalError(env, "A call to ready_channel in LDKBaseSign from rust threw an exception.");
4757 if (get_jenv_res == JNI_EDETACHED) {
4758 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4761 static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
4762 jclass c = (*env)->GetObjectClass(env, o);
4764 LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
4765 atomic_init(&calls->refcnt, 1);
4766 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
4767 calls->o = (*env)->NewWeakGlobalRef(env, o);
4768 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)[B");
4769 CHECK(calls->get_per_commitment_point_meth != NULL);
4770 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B");
4771 CHECK(calls->release_commitment_secret_meth != NULL);
4772 calls->validate_holder_commitment_meth = (*env)->GetMethodID(env, c, "validate_holder_commitment", "(J[[B)J");
4773 CHECK(calls->validate_holder_commitment_meth != NULL);
4774 calls->channel_keys_id_meth = (*env)->GetMethodID(env, c, "channel_keys_id", "()[B");
4775 CHECK(calls->channel_keys_id_meth != NULL);
4776 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(J[[B)J");
4777 CHECK(calls->sign_counterparty_commitment_meth != NULL);
4778 calls->validate_counterparty_revocation_meth = (*env)->GetMethodID(env, c, "validate_counterparty_revocation", "(J[B)J");
4779 CHECK(calls->validate_counterparty_revocation_meth != NULL);
4780 calls->sign_holder_commitment_and_htlcs_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_and_htlcs", "(J)J");
4781 CHECK(calls->sign_holder_commitment_and_htlcs_meth != NULL);
4782 calls->sign_justice_revoked_output_meth = (*env)->GetMethodID(env, c, "sign_justice_revoked_output", "([BJJ[B)J");
4783 CHECK(calls->sign_justice_revoked_output_meth != NULL);
4784 calls->sign_justice_revoked_htlc_meth = (*env)->GetMethodID(env, c, "sign_justice_revoked_htlc", "([BJJ[BJ)J");
4785 CHECK(calls->sign_justice_revoked_htlc_meth != NULL);
4786 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "([BJJ[BJ)J");
4787 CHECK(calls->sign_counterparty_htlc_transaction_meth != NULL);
4788 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
4789 CHECK(calls->sign_closing_transaction_meth != NULL);
4790 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
4791 CHECK(calls->sign_channel_announcement_meth != NULL);
4792 calls->ready_channel_meth = (*env)->GetMethodID(env, c, "ready_channel", "(J)V");
4793 CHECK(calls->ready_channel_meth != NULL);
4795 LDKChannelPublicKeys pubkeys_conv;
4796 pubkeys_conv.inner = untag_ptr(pubkeys);
4797 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
4798 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
4801 .this_arg = (void*) calls,
4802 .get_per_commitment_point = get_per_commitment_point_LDKBaseSign_jcall,
4803 .release_commitment_secret = release_commitment_secret_LDKBaseSign_jcall,
4804 .validate_holder_commitment = validate_holder_commitment_LDKBaseSign_jcall,
4805 .channel_keys_id = channel_keys_id_LDKBaseSign_jcall,
4806 .sign_counterparty_commitment = sign_counterparty_commitment_LDKBaseSign_jcall,
4807 .validate_counterparty_revocation = validate_counterparty_revocation_LDKBaseSign_jcall,
4808 .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKBaseSign_jcall,
4809 .sign_justice_revoked_output = sign_justice_revoked_output_LDKBaseSign_jcall,
4810 .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall,
4811 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall,
4812 .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall,
4813 .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall,
4814 .ready_channel = ready_channel_LDKBaseSign_jcall,
4815 .free = LDKBaseSign_JCalls_free,
4816 .pubkeys = pubkeys_conv,
4817 .set_pubkeys = NULL,
4821 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKBaseSign_1new(JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
4822 LDKBaseSign *res_ptr = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
4823 *res_ptr = LDKBaseSign_init(env, clz, o, pubkeys);
4824 return tag_ptr(res_ptr, true);
4826 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) {
4827 void* this_arg_ptr = untag_ptr(this_arg);
4828 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4829 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4830 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
4831 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form);
4835 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
4836 void* this_arg_ptr = untag_ptr(this_arg);
4837 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4838 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4839 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
4840 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data);
4844 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) {
4845 void* this_arg_ptr = untag_ptr(this_arg);
4846 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4847 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4848 LDKHolderCommitmentTransaction holder_tx_conv;
4849 holder_tx_conv.inner = untag_ptr(holder_tx);
4850 holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
4851 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
4852 holder_tx_conv.is_owned = false;
4853 LDKCVec_PaymentPreimageZ preimages_constr;
4854 preimages_constr.datalen = (*env)->GetArrayLength(env, preimages);
4855 if (preimages_constr.datalen > 0)
4856 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
4858 preimages_constr.data = NULL;
4859 for (size_t i = 0; i < preimages_constr.datalen; i++) {
4860 int8_tArray preimages_conv_8 = (*env)->GetObjectArrayElement(env, preimages, i);
4861 LDKThirtyTwoBytes preimages_conv_8_ref;
4862 CHECK((*env)->GetArrayLength(env, preimages_conv_8) == 32);
4863 (*env)->GetByteArrayRegion(env, preimages_conv_8, 0, 32, preimages_conv_8_ref.data);
4864 preimages_constr.data[i] = preimages_conv_8_ref;
4866 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
4867 *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
4868 return tag_ptr(ret_conv, true);
4871 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
4872 void* this_arg_ptr = untag_ptr(this_arg);
4873 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4874 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4875 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
4876 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data);
4880 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) {
4881 void* this_arg_ptr = untag_ptr(this_arg);
4882 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4883 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4884 LDKCommitmentTransaction commitment_tx_conv;
4885 commitment_tx_conv.inner = untag_ptr(commitment_tx);
4886 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
4887 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
4888 commitment_tx_conv.is_owned = false;
4889 LDKCVec_PaymentPreimageZ preimages_constr;
4890 preimages_constr.datalen = (*env)->GetArrayLength(env, preimages);
4891 if (preimages_constr.datalen > 0)
4892 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
4894 preimages_constr.data = NULL;
4895 for (size_t i = 0; i < preimages_constr.datalen; i++) {
4896 int8_tArray preimages_conv_8 = (*env)->GetObjectArrayElement(env, preimages, i);
4897 LDKThirtyTwoBytes preimages_conv_8_ref;
4898 CHECK((*env)->GetArrayLength(env, preimages_conv_8) == 32);
4899 (*env)->GetByteArrayRegion(env, preimages_conv_8, 0, 32, preimages_conv_8_ref.data);
4900 preimages_constr.data[i] = preimages_conv_8_ref;
4902 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
4903 *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, preimages_constr);
4904 return tag_ptr(ret_conv, true);
4907 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) {
4908 void* this_arg_ptr = untag_ptr(this_arg);
4909 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4910 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4911 unsigned char secret_arr[32];
4912 CHECK((*env)->GetArrayLength(env, secret) == 32);
4913 (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_arr);
4914 unsigned char (*secret_ref)[32] = &secret_arr;
4915 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
4916 *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref);
4917 return tag_ptr(ret_conv, true);
4920 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) {
4921 void* this_arg_ptr = untag_ptr(this_arg);
4922 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4923 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4924 LDKHolderCommitmentTransaction commitment_tx_conv;
4925 commitment_tx_conv.inner = untag_ptr(commitment_tx);
4926 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
4927 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
4928 commitment_tx_conv.is_owned = false;
4929 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
4930 *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv);
4931 return tag_ptr(ret_conv, true);
4934 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) {
4935 void* this_arg_ptr = untag_ptr(this_arg);
4936 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4937 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4938 LDKTransaction justice_tx_ref;
4939 justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
4940 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
4941 (*env)->GetByteArrayRegion(env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data);
4942 justice_tx_ref.data_is_owned = true;
4943 unsigned char per_commitment_key_arr[32];
4944 CHECK((*env)->GetArrayLength(env, per_commitment_key) == 32);
4945 (*env)->GetByteArrayRegion(env, per_commitment_key, 0, 32, per_commitment_key_arr);
4946 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
4947 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4948 *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref);
4949 return tag_ptr(ret_conv, true);
4952 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) {
4953 void* this_arg_ptr = untag_ptr(this_arg);
4954 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4955 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4956 LDKTransaction justice_tx_ref;
4957 justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
4958 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
4959 (*env)->GetByteArrayRegion(env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data);
4960 justice_tx_ref.data_is_owned = true;
4961 unsigned char per_commitment_key_arr[32];
4962 CHECK((*env)->GetArrayLength(env, per_commitment_key) == 32);
4963 (*env)->GetByteArrayRegion(env, per_commitment_key, 0, 32, per_commitment_key_arr);
4964 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
4965 LDKHTLCOutputInCommitment htlc_conv;
4966 htlc_conv.inner = untag_ptr(htlc);
4967 htlc_conv.is_owned = ptr_is_owned(htlc);
4968 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
4969 htlc_conv.is_owned = false;
4970 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4971 *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);
4972 return tag_ptr(ret_conv, true);
4975 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) {
4976 void* this_arg_ptr = untag_ptr(this_arg);
4977 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4978 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4979 LDKTransaction htlc_tx_ref;
4980 htlc_tx_ref.datalen = (*env)->GetArrayLength(env, htlc_tx);
4981 htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
4982 (*env)->GetByteArrayRegion(env, htlc_tx, 0, htlc_tx_ref.datalen, htlc_tx_ref.data);
4983 htlc_tx_ref.data_is_owned = true;
4984 LDKPublicKey per_commitment_point_ref;
4985 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
4986 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
4987 LDKHTLCOutputInCommitment htlc_conv;
4988 htlc_conv.inner = untag_ptr(htlc);
4989 htlc_conv.is_owned = ptr_is_owned(htlc);
4990 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
4991 htlc_conv.is_owned = false;
4992 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4993 *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);
4994 return tag_ptr(ret_conv, true);
4997 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) {
4998 void* this_arg_ptr = untag_ptr(this_arg);
4999 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5000 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5001 LDKClosingTransaction closing_tx_conv;
5002 closing_tx_conv.inner = untag_ptr(closing_tx);
5003 closing_tx_conv.is_owned = ptr_is_owned(closing_tx);
5004 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv);
5005 closing_tx_conv.is_owned = false;
5006 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
5007 *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv);
5008 return tag_ptr(ret_conv, true);
5011 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
5012 void* this_arg_ptr = untag_ptr(this_arg);
5013 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5014 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5015 LDKUnsignedChannelAnnouncement msg_conv;
5016 msg_conv.inner = untag_ptr(msg);
5017 msg_conv.is_owned = ptr_is_owned(msg);
5018 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
5019 msg_conv.is_owned = false;
5020 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
5021 *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
5022 return tag_ptr(ret_conv, true);
5025 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) {
5026 void* this_arg_ptr = untag_ptr(this_arg);
5027 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5028 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5029 LDKChannelTransactionParameters channel_parameters_conv;
5030 channel_parameters_conv.inner = untag_ptr(channel_parameters);
5031 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
5032 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
5033 channel_parameters_conv.is_owned = false;
5034 (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
5037 LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) {
5038 if (this_arg->set_pubkeys != NULL)
5039 this_arg->set_pubkeys(this_arg);
5040 return this_arg->pubkeys;
5042 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
5043 void* this_arg_ptr = untag_ptr(this_arg);
5044 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5045 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
5046 LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
5047 int64_t ret_ref = 0;
5048 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5049 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5053 typedef struct LDKSign_JCalls {
5054 atomic_size_t refcnt;
5057 LDKBaseSign_JCalls* BaseSign;
5058 jmethodID write_meth;
5060 static void LDKSign_JCalls_free(void* this_arg) {
5061 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
5062 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5064 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5065 if (get_jenv_res == JNI_EDETACHED) {
5066 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5068 DO_ASSERT(get_jenv_res == JNI_OK);
5070 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
5071 if (get_jenv_res == JNI_EDETACHED) {
5072 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5077 LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
5078 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
5080 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5081 if (get_jenv_res == JNI_EDETACHED) {
5082 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5084 DO_ASSERT(get_jenv_res == JNI_OK);
5086 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5088 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
5089 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5090 (*env)->ExceptionDescribe(env);
5091 (*env)->FatalError(env, "A call to write in LDKSign from rust threw an exception.");
5093 LDKCVec_u8Z ret_ref;
5094 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
5095 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5096 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
5097 if (get_jenv_res == JNI_EDETACHED) {
5098 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5102 static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
5103 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
5104 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5105 atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
5107 static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, jobject BaseSign, int64_t pubkeys) {
5108 jclass c = (*env)->GetObjectClass(env, o);
5110 LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
5111 atomic_init(&calls->refcnt, 1);
5112 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
5113 calls->o = (*env)->NewWeakGlobalRef(env, o);
5114 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
5115 CHECK(calls->write_meth != NULL);
5117 LDKChannelPublicKeys pubkeys_conv;
5118 pubkeys_conv.inner = untag_ptr(pubkeys);
5119 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
5120 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
5123 .this_arg = (void*) calls,
5124 .write = write_LDKSign_jcall,
5125 .cloned = LDKSign_JCalls_cloned,
5126 .free = LDKSign_JCalls_free,
5127 .BaseSign = LDKBaseSign_init(env, clz, BaseSign, pubkeys),
5129 calls->BaseSign = ret.BaseSign.this_arg;
5132 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSign_1new(JNIEnv *env, jclass clz, jobject o, jobject BaseSign, int64_t pubkeys) {
5133 LDKSign *res_ptr = MALLOC(sizeof(LDKSign), "LDKSign");
5134 *res_ptr = LDKSign_init(env, clz, o, BaseSign, pubkeys);
5135 return tag_ptr(res_ptr, true);
5137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSign_1get_1BaseSign(JNIEnv *env, jclass clz, int64_t arg) {
5138 LDKSign *inp = (LDKSign *)untag_ptr(arg);
5139 return tag_ptr(&inp->BaseSign, false);
5141 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
5142 void* this_arg_ptr = untag_ptr(this_arg);
5143 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5144 LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
5145 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
5146 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
5147 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
5148 CVec_u8Z_free(ret_var);
5152 static inline struct LDKSign CResult_SignDecodeErrorZ_get_ok(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
5153 CHECK(owner->result_ok);
5154 return Sign_clone(&*owner->contents.result);
5156 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5157 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
5158 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
5159 *ret_ret = CResult_SignDecodeErrorZ_get_ok(owner_conv);
5160 return tag_ptr(ret_ret, true);
5163 static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
5164 CHECK(!owner->result_ok);
5165 return DecodeError_clone(&*owner->contents.err);
5167 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5168 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
5169 LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv);
5170 int64_t ret_ref = 0;
5171 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5172 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5176 static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
5177 CHECK(owner->result_ok);
5178 return *owner->contents.result;
5180 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5181 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
5182 int8_tArray ret_arr = (*env)->NewByteArray(env, 68);
5183 (*env)->SetByteArrayRegion(env, ret_arr, 0, 68, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form);
5187 static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
5188 CHECK(!owner->result_ok);
5189 return *owner->contents.err;
5191 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5192 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
5193 CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
5196 static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
5197 LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
5198 for (size_t i = 0; i < ret.datalen; i++) {
5199 ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
5203 static inline struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
5204 CHECK(owner->result_ok);
5205 return CVec_CVec_u8ZZ_clone(&*owner->contents.result);
5207 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5208 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
5209 LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv);
5210 jobjectArray ret_arr = NULL;
5211 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
5213 for (size_t i = 0; i < ret_var.datalen; i++) {
5214 LDKCVec_u8Z ret_conv_8_var = ret_var.data[i];
5215 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen);
5216 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data);
5217 CVec_u8Z_free(ret_conv_8_var);
5218 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
5225 static inline void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
5226 CHECK(!owner->result_ok);
5227 return *owner->contents.err;
5229 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5230 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
5231 CResult_CVec_CVec_u8ZZNoneZ_get_err(owner_conv);
5234 static inline struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
5235 CHECK(owner->result_ok);
5236 return InMemorySigner_clone(&*owner->contents.result);
5238 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5239 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
5240 LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv);
5241 int64_t ret_ref = 0;
5242 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5243 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5247 static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
5248 CHECK(!owner->result_ok);
5249 return DecodeError_clone(&*owner->contents.err);
5251 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5252 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
5253 LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
5254 int64_t ret_ref = 0;
5255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5260 static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
5261 LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
5262 for (size_t i = 0; i < ret.datalen; i++) {
5263 ret.data[i] = TxOut_clone(&orig->data[i]);
5267 static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
5268 CHECK(owner->result_ok);
5269 return *owner->contents.result;
5271 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5272 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
5273 LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv);
5274 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
5275 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
5279 static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
5280 CHECK(!owner->result_ok);
5281 return *owner->contents.err;
5283 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5284 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
5285 CResult_TransactionNoneZ_get_err(owner_conv);
5288 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
5289 return ThirtyTwoBytes_clone(&owner->a);
5291 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
5292 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
5293 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5294 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data);
5298 static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
5299 return ChannelMonitor_clone(&owner->b);
5301 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
5302 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
5303 LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv);
5304 int64_t ret_ref = 0;
5305 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5306 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5310 static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(const LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *orig) {
5311 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ clone bytes"), .datalen = orig->datalen };
5312 for (size_t i = 0; i < ret.datalen; i++) {
5313 ret.data[i] = C2Tuple_BlockHashChannelMonitorZ_clone(&orig->data[i]);
5317 static inline struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner){
5318 CHECK(owner->result_ok);
5319 return CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(&*owner->contents.result);
5321 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5322 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(owner);
5323 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret_var = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(owner_conv);
5324 int64_tArray ret_arr = NULL;
5325 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
5326 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
5327 for (size_t j = 0; j < ret_var.datalen; j++) {
5328 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv_35_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
5329 *ret_conv_35_conv = ret_var.data[j];
5330 ret_arr_ptr[j] = tag_ptr(ret_conv_35_conv, true);
5332 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
5337 static inline enum LDKIOError CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner){
5338 CHECK(!owner->result_ok);
5339 return *owner->contents.err;
5341 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5342 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(owner);
5343 jclass ret_conv = LDKIOError_to_java(env, CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(owner_conv));
5347 static jclass LDKCOption_u16Z_Some_class = NULL;
5348 static jmethodID LDKCOption_u16Z_Some_meth = NULL;
5349 static jclass LDKCOption_u16Z_None_class = NULL;
5350 static jmethodID LDKCOption_u16Z_None_meth = NULL;
5351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u16Z_init (JNIEnv *env, jclass clz) {
5352 LDKCOption_u16Z_Some_class =
5353 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$Some"));
5354 CHECK(LDKCOption_u16Z_Some_class != NULL);
5355 LDKCOption_u16Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_Some_class, "<init>", "(S)V");
5356 CHECK(LDKCOption_u16Z_Some_meth != NULL);
5357 LDKCOption_u16Z_None_class =
5358 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$None"));
5359 CHECK(LDKCOption_u16Z_None_class != NULL);
5360 LDKCOption_u16Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_None_class, "<init>", "()V");
5361 CHECK(LDKCOption_u16Z_None_meth != NULL);
5363 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u16Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5364 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
5366 case LDKCOption_u16Z_Some: {
5367 int16_t some_conv = obj->some;
5368 return (*env)->NewObject(env, LDKCOption_u16Z_Some_class, LDKCOption_u16Z_Some_meth, some_conv);
5370 case LDKCOption_u16Z_None: {
5371 return (*env)->NewObject(env, LDKCOption_u16Z_None_class, LDKCOption_u16Z_None_meth);
5376 static jclass LDKAPIError_APIMisuseError_class = NULL;
5377 static jmethodID LDKAPIError_APIMisuseError_meth = NULL;
5378 static jclass LDKAPIError_FeeRateTooHigh_class = NULL;
5379 static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL;
5380 static jclass LDKAPIError_RouteError_class = NULL;
5381 static jmethodID LDKAPIError_RouteError_meth = NULL;
5382 static jclass LDKAPIError_ChannelUnavailable_class = NULL;
5383 static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL;
5384 static jclass LDKAPIError_MonitorUpdateFailed_class = NULL;
5385 static jmethodID LDKAPIError_MonitorUpdateFailed_meth = NULL;
5386 static jclass LDKAPIError_IncompatibleShutdownScript_class = NULL;
5387 static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL;
5388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) {
5389 LDKAPIError_APIMisuseError_class =
5390 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$APIMisuseError"));
5391 CHECK(LDKAPIError_APIMisuseError_class != NULL);
5392 LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "<init>", "(Ljava/lang/String;)V");
5393 CHECK(LDKAPIError_APIMisuseError_meth != NULL);
5394 LDKAPIError_FeeRateTooHigh_class =
5395 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh"));
5396 CHECK(LDKAPIError_FeeRateTooHigh_class != NULL);
5397 LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "<init>", "(Ljava/lang/String;I)V");
5398 CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL);
5399 LDKAPIError_RouteError_class =
5400 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$RouteError"));
5401 CHECK(LDKAPIError_RouteError_class != NULL);
5402 LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "<init>", "(Ljava/lang/String;)V");
5403 CHECK(LDKAPIError_RouteError_meth != NULL);
5404 LDKAPIError_ChannelUnavailable_class =
5405 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable"));
5406 CHECK(LDKAPIError_ChannelUnavailable_class != NULL);
5407 LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "<init>", "(Ljava/lang/String;)V");
5408 CHECK(LDKAPIError_ChannelUnavailable_meth != NULL);
5409 LDKAPIError_MonitorUpdateFailed_class =
5410 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed"));
5411 CHECK(LDKAPIError_MonitorUpdateFailed_class != NULL);
5412 LDKAPIError_MonitorUpdateFailed_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateFailed_class, "<init>", "()V");
5413 CHECK(LDKAPIError_MonitorUpdateFailed_meth != NULL);
5414 LDKAPIError_IncompatibleShutdownScript_class =
5415 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript"));
5416 CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL);
5417 LDKAPIError_IncompatibleShutdownScript_meth = (*env)->GetMethodID(env, LDKAPIError_IncompatibleShutdownScript_class, "<init>", "(J)V");
5418 CHECK(LDKAPIError_IncompatibleShutdownScript_meth != NULL);
5420 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5421 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
5423 case LDKAPIError_APIMisuseError: {
5424 LDKStr err_str = obj->api_misuse_error.err;
5425 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
5426 return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_conv);
5428 case LDKAPIError_FeeRateTooHigh: {
5429 LDKStr err_str = obj->fee_rate_too_high.err;
5430 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
5431 int32_t feerate_conv = obj->fee_rate_too_high.feerate;
5432 return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_conv, feerate_conv);
5434 case LDKAPIError_RouteError: {
5435 LDKStr err_str = obj->route_error.err;
5436 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
5437 return (*env)->NewObject(env, LDKAPIError_RouteError_class, LDKAPIError_RouteError_meth, err_conv);
5439 case LDKAPIError_ChannelUnavailable: {
5440 LDKStr err_str = obj->channel_unavailable.err;
5441 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
5442 return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_conv);
5444 case LDKAPIError_MonitorUpdateFailed: {
5445 return (*env)->NewObject(env, LDKAPIError_MonitorUpdateFailed_class, LDKAPIError_MonitorUpdateFailed_meth);
5447 case LDKAPIError_IncompatibleShutdownScript: {
5448 LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
5449 int64_t script_ref = 0;
5450 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
5451 script_ref = tag_ptr(script_var.inner, false);
5452 return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref);
5457 static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
5458 CHECK(owner->result_ok);
5459 return *owner->contents.result;
5461 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5462 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
5463 CResult_NoneAPIErrorZ_get_ok(owner_conv);
5466 static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
5467 CHECK(!owner->result_ok);
5468 return APIError_clone(&*owner->contents.err);
5470 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5471 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
5472 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
5473 *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
5474 int64_t ret_ref = tag_ptr(ret_copy, true);
5478 static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
5479 LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
5480 for (size_t i = 0; i < ret.datalen; i++) {
5481 ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
5485 static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
5486 LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
5487 for (size_t i = 0; i < ret.datalen; i++) {
5488 ret.data[i] = APIError_clone(&orig->data[i]);
5492 static inline struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
5493 CHECK(owner->result_ok);
5494 return ThirtyTwoBytes_clone(&*owner->contents.result);
5496 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5497 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
5498 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5499 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult__u832APIErrorZ_get_ok(owner_conv).data);
5503 static inline struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
5504 CHECK(!owner->result_ok);
5505 return APIError_clone(&*owner->contents.err);
5507 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5508 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
5509 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
5510 *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv);
5511 int64_t ret_ref = tag_ptr(ret_copy, true);
5515 static jclass LDKPaymentSendFailure_ParameterError_class = NULL;
5516 static jmethodID LDKPaymentSendFailure_ParameterError_meth = NULL;
5517 static jclass LDKPaymentSendFailure_PathParameterError_class = NULL;
5518 static jmethodID LDKPaymentSendFailure_PathParameterError_meth = NULL;
5519 static jclass LDKPaymentSendFailure_AllFailedRetrySafe_class = NULL;
5520 static jmethodID LDKPaymentSendFailure_AllFailedRetrySafe_meth = NULL;
5521 static jclass LDKPaymentSendFailure_PartialFailure_class = NULL;
5522 static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL;
5523 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) {
5524 LDKPaymentSendFailure_ParameterError_class =
5525 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError"));
5526 CHECK(LDKPaymentSendFailure_ParameterError_class != NULL);
5527 LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "<init>", "(J)V");
5528 CHECK(LDKPaymentSendFailure_ParameterError_meth != NULL);
5529 LDKPaymentSendFailure_PathParameterError_class =
5530 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError"));
5531 CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL);
5532 LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "<init>", "([J)V");
5533 CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL);
5534 LDKPaymentSendFailure_AllFailedRetrySafe_class =
5535 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedRetrySafe"));
5536 CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_class != NULL);
5537 LDKPaymentSendFailure_AllFailedRetrySafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, "<init>", "([J)V");
5538 CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_meth != NULL);
5539 LDKPaymentSendFailure_PartialFailure_class =
5540 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure"));
5541 CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL);
5542 LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "([JJ[B)V");
5543 CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL);
5545 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5546 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
5548 case LDKPaymentSendFailure_ParameterError: {
5549 int64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false);
5550 return (*env)->NewObject(env, LDKPaymentSendFailure_ParameterError_class, LDKPaymentSendFailure_ParameterError_meth, parameter_error_ref);
5552 case LDKPaymentSendFailure_PathParameterError: {
5553 LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
5554 int64_tArray path_parameter_error_arr = NULL;
5555 path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen);
5556 int64_t *path_parameter_error_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_parameter_error_arr, NULL);
5557 for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
5558 LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
5559 *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w];
5560 *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
5561 path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true);
5563 (*env)->ReleasePrimitiveArrayCritical(env, path_parameter_error_arr, path_parameter_error_arr_ptr, 0);
5564 return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth, path_parameter_error_arr);
5566 case LDKPaymentSendFailure_AllFailedRetrySafe: {
5567 LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
5568 int64_tArray all_failed_retry_safe_arr = NULL;
5569 all_failed_retry_safe_arr = (*env)->NewLongArray(env, all_failed_retry_safe_var.datalen);
5570 int64_t *all_failed_retry_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_retry_safe_arr, NULL);
5571 for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
5572 int64_t all_failed_retry_safe_conv_10_ref = tag_ptr(&all_failed_retry_safe_var.data[k], false);
5573 all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref;
5575 (*env)->ReleasePrimitiveArrayCritical(env, all_failed_retry_safe_arr, all_failed_retry_safe_arr_ptr, 0);
5576 return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, LDKPaymentSendFailure_AllFailedRetrySafe_meth, all_failed_retry_safe_arr);
5578 case LDKPaymentSendFailure_PartialFailure: {
5579 LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
5580 int64_tArray results_arr = NULL;
5581 results_arr = (*env)->NewLongArray(env, results_var.datalen);
5582 int64_t *results_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, results_arr, NULL);
5583 for (size_t w = 0; w < results_var.datalen; w++) {
5584 LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
5585 *results_conv_22_conv = results_var.data[w];
5586 *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
5587 results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true);
5589 (*env)->ReleasePrimitiveArrayCritical(env, results_arr, results_arr_ptr, 0);
5590 LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
5591 int64_t failed_paths_retry_ref = 0;
5592 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var);
5593 failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false);
5594 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
5595 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->partial_failure.payment_id.data);
5596 return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, results_arr, failed_paths_retry_ref, payment_id_arr);
5601 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
5602 CHECK(owner->result_ok);
5603 return ThirtyTwoBytes_clone(&*owner->contents.result);
5605 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5606 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
5607 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5608 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data);
5612 static inline struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
5613 CHECK(!owner->result_ok);
5614 return PaymentSendFailure_clone(&*owner->contents.err);
5616 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5617 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
5618 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
5619 *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv);
5620 int64_t ret_ref = tag_ptr(ret_copy, true);
5624 static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
5625 CHECK(owner->result_ok);
5626 return *owner->contents.result;
5628 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5629 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
5630 CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
5633 static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
5634 CHECK(!owner->result_ok);
5635 return PaymentSendFailure_clone(&*owner->contents.err);
5637 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5638 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
5639 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
5640 *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
5641 int64_t ret_ref = tag_ptr(ret_copy, true);
5645 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
5646 return ThirtyTwoBytes_clone(&owner->a);
5648 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
5649 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
5650 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5651 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data);
5655 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
5656 return ThirtyTwoBytes_clone(&owner->b);
5658 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
5659 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
5660 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5661 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data);
5665 static inline struct LDKC2Tuple_PaymentHashPaymentIdZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
5666 CHECK(owner->result_ok);
5667 return C2Tuple_PaymentHashPaymentIdZ_clone(&*owner->contents.result);
5669 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5670 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
5671 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
5672 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv);
5673 return tag_ptr(ret_conv, true);
5676 static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
5677 CHECK(!owner->result_ok);
5678 return PaymentSendFailure_clone(&*owner->contents.err);
5680 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5681 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
5682 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
5683 *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv);
5684 int64_t ret_ref = tag_ptr(ret_copy, true);
5688 static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) {
5689 LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen };
5690 for (size_t i = 0; i < ret.datalen; i++) {
5691 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
5695 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
5696 return ThirtyTwoBytes_clone(&owner->a);
5698 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
5699 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
5700 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5701 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data);
5705 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
5706 return ThirtyTwoBytes_clone(&owner->b);
5708 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
5709 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
5710 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5711 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data);
5715 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
5716 CHECK(owner->result_ok);
5717 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
5719 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5720 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
5721 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
5722 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv);
5723 return tag_ptr(ret_conv, true);
5726 static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
5727 CHECK(!owner->result_ok);
5728 return *owner->contents.err;
5730 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5731 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
5732 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner_conv);
5735 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
5736 CHECK(owner->result_ok);
5737 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
5739 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5740 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
5741 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
5742 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv);
5743 return tag_ptr(ret_conv, true);
5746 static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
5747 CHECK(!owner->result_ok);
5748 return APIError_clone(&*owner->contents.err);
5750 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5751 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
5752 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
5753 *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv);
5754 int64_t ret_ref = tag_ptr(ret_copy, true);
5758 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
5759 CHECK(owner->result_ok);
5760 return ThirtyTwoBytes_clone(&*owner->contents.result);
5762 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5763 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
5764 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5765 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data);
5769 static inline void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
5770 CHECK(!owner->result_ok);
5771 return *owner->contents.err;
5773 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5774 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
5775 CResult_PaymentSecretNoneZ_get_err(owner_conv);
5778 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
5779 CHECK(owner->result_ok);
5780 return ThirtyTwoBytes_clone(&*owner->contents.result);
5782 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5783 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
5784 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5785 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data);
5789 static inline struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
5790 CHECK(!owner->result_ok);
5791 return APIError_clone(&*owner->contents.err);
5793 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5794 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
5795 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
5796 *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv);
5797 int64_t ret_ref = tag_ptr(ret_copy, true);
5801 static inline struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
5802 CHECK(owner->result_ok);
5803 return ThirtyTwoBytes_clone(&*owner->contents.result);
5805 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5806 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
5807 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5808 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data);
5812 static inline struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
5813 CHECK(!owner->result_ok);
5814 return APIError_clone(&*owner->contents.err);
5816 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5817 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
5818 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
5819 *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv);
5820 int64_t ret_ref = tag_ptr(ret_copy, true);
5824 static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
5825 CHECK(owner->result_ok);
5826 return CounterpartyForwardingInfo_clone(&*owner->contents.result);
5828 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5829 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
5830 LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(owner_conv);
5831 int64_t ret_ref = 0;
5832 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5833 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5837 static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
5838 CHECK(!owner->result_ok);
5839 return DecodeError_clone(&*owner->contents.err);
5841 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5842 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
5843 LDKDecodeError ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
5844 int64_t ret_ref = 0;
5845 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5846 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5850 static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
5851 CHECK(owner->result_ok);
5852 return ChannelCounterparty_clone(&*owner->contents.result);
5854 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5855 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
5856 LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_ok(owner_conv);
5857 int64_t ret_ref = 0;
5858 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5859 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5863 static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
5864 CHECK(!owner->result_ok);
5865 return DecodeError_clone(&*owner->contents.err);
5867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5868 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
5869 LDKDecodeError ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
5870 int64_t ret_ref = 0;
5871 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5872 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5876 static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
5877 CHECK(owner->result_ok);
5878 return ChannelDetails_clone(&*owner->contents.result);
5880 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5881 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
5882 LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_get_ok(owner_conv);
5883 int64_t ret_ref = 0;
5884 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5885 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5889 static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
5890 CHECK(!owner->result_ok);
5891 return DecodeError_clone(&*owner->contents.err);
5893 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5894 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
5895 LDKDecodeError ret_var = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
5896 int64_t ret_ref = 0;
5897 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5898 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5902 static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
5903 CHECK(owner->result_ok);
5904 return PhantomRouteHints_clone(&*owner->contents.result);
5906 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5907 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
5908 LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_ok(owner_conv);
5909 int64_t ret_ref = 0;
5910 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5911 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5915 static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
5916 CHECK(!owner->result_ok);
5917 return DecodeError_clone(&*owner->contents.err);
5919 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5920 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
5921 LDKDecodeError ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
5922 int64_t ret_ref = 0;
5923 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5924 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5928 static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
5929 LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
5930 for (size_t i = 0; i < ret.datalen; i++) {
5931 ret.data[i] = ChannelMonitor_clone(&orig->data[i]);
5935 typedef struct LDKWatch_JCalls {
5936 atomic_size_t refcnt;
5939 jmethodID watch_channel_meth;
5940 jmethodID update_channel_meth;
5941 jmethodID release_pending_monitor_events_meth;
5943 static void LDKWatch_JCalls_free(void* this_arg) {
5944 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
5945 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5947 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5948 if (get_jenv_res == JNI_EDETACHED) {
5949 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5951 DO_ASSERT(get_jenv_res == JNI_OK);
5953 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
5954 if (get_jenv_res == JNI_EDETACHED) {
5955 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5960 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
5961 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
5963 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5964 if (get_jenv_res == JNI_EDETACHED) {
5965 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5967 DO_ASSERT(get_jenv_res == JNI_OK);
5969 LDKOutPoint funding_txo_var = funding_txo;
5970 int64_t funding_txo_ref = 0;
5971 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
5972 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
5973 LDKChannelMonitor monitor_var = monitor;
5974 int64_t monitor_ref = 0;
5975 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
5976 monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
5977 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5979 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
5980 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5981 (*env)->ExceptionDescribe(env);
5982 (*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception.");
5984 void* ret_ptr = untag_ptr(ret);
5985 CHECK_ACCESS(ret_ptr);
5986 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
5987 FREE(untag_ptr(ret));
5988 if (get_jenv_res == JNI_EDETACHED) {
5989 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5993 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
5994 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
5996 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5997 if (get_jenv_res == JNI_EDETACHED) {
5998 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6000 DO_ASSERT(get_jenv_res == JNI_OK);
6002 LDKOutPoint funding_txo_var = funding_txo;
6003 int64_t funding_txo_ref = 0;
6004 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
6005 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
6006 LDKChannelMonitorUpdate update_var = update;
6007 int64_t update_ref = 0;
6008 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
6009 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
6010 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6012 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref);
6013 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6014 (*env)->ExceptionDescribe(env);
6015 (*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception.");
6017 void* ret_ptr = untag_ptr(ret);
6018 CHECK_ACCESS(ret_ptr);
6019 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
6020 FREE(untag_ptr(ret));
6021 if (get_jenv_res == JNI_EDETACHED) {
6022 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6026 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
6027 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
6029 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6030 if (get_jenv_res == JNI_EDETACHED) {
6031 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6033 DO_ASSERT(get_jenv_res == JNI_OK);
6035 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6037 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth);
6038 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6039 (*env)->ExceptionDescribe(env);
6040 (*env)->FatalError(env, "A call to release_pending_monitor_events in LDKWatch from rust threw an exception.");
6042 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr;
6043 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
6044 if (ret_constr.datalen > 0)
6045 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
6047 ret_constr.data = NULL;
6048 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
6049 for (size_t x = 0; x < ret_constr.datalen; x++) {
6050 int64_t ret_conv_49 = ret_vals[x];
6051 void* ret_conv_49_ptr = untag_ptr(ret_conv_49);
6052 CHECK_ACCESS(ret_conv_49_ptr);
6053 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr);
6054 FREE(untag_ptr(ret_conv_49));
6055 ret_constr.data[x] = ret_conv_49_conv;
6057 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
6058 if (get_jenv_res == JNI_EDETACHED) {
6059 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6063 static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
6064 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
6065 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6067 static inline LDKWatch LDKWatch_init (JNIEnv *env, jclass clz, jobject o) {
6068 jclass c = (*env)->GetObjectClass(env, o);
6070 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
6071 atomic_init(&calls->refcnt, 1);
6072 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6073 calls->o = (*env)->NewWeakGlobalRef(env, o);
6074 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J");
6075 CHECK(calls->watch_channel_meth != NULL);
6076 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J");
6077 CHECK(calls->update_channel_meth != NULL);
6078 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()[J");
6079 CHECK(calls->release_pending_monitor_events_meth != NULL);
6082 .this_arg = (void*) calls,
6083 .watch_channel = watch_channel_LDKWatch_jcall,
6084 .update_channel = update_channel_LDKWatch_jcall,
6085 .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
6086 .free = LDKWatch_JCalls_free,
6090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new(JNIEnv *env, jclass clz, jobject o) {
6091 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
6092 *res_ptr = LDKWatch_init(env, clz, o);
6093 return tag_ptr(res_ptr, true);
6095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) {
6096 void* this_arg_ptr = untag_ptr(this_arg);
6097 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6098 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
6099 LDKOutPoint funding_txo_conv;
6100 funding_txo_conv.inner = untag_ptr(funding_txo);
6101 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
6102 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
6103 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
6104 LDKChannelMonitor monitor_conv;
6105 monitor_conv.inner = untag_ptr(monitor);
6106 monitor_conv.is_owned = ptr_is_owned(monitor);
6107 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
6108 monitor_conv = ChannelMonitor_clone(&monitor_conv);
6109 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
6110 *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv);
6111 return tag_ptr(ret_conv, true);
6114 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t update) {
6115 void* this_arg_ptr = untag_ptr(this_arg);
6116 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6117 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
6118 LDKOutPoint funding_txo_conv;
6119 funding_txo_conv.inner = untag_ptr(funding_txo);
6120 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
6121 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
6122 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
6123 LDKChannelMonitorUpdate update_conv;
6124 update_conv.inner = untag_ptr(update);
6125 update_conv.is_owned = ptr_is_owned(update);
6126 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
6127 update_conv = ChannelMonitorUpdate_clone(&update_conv);
6128 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
6129 *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv);
6130 return tag_ptr(ret_conv, true);
6133 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
6134 void* this_arg_ptr = untag_ptr(this_arg);
6135 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6136 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
6137 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
6138 int64_tArray ret_arr = NULL;
6139 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
6140 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
6141 for (size_t x = 0; x < ret_var.datalen; x++) {
6142 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
6143 *ret_conv_49_conv = ret_var.data[x];
6144 ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true);
6146 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
6151 typedef struct LDKBroadcasterInterface_JCalls {
6152 atomic_size_t refcnt;
6155 jmethodID broadcast_transaction_meth;
6156 } LDKBroadcasterInterface_JCalls;
6157 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
6158 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
6159 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
6161 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6162 if (get_jenv_res == JNI_EDETACHED) {
6163 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6165 DO_ASSERT(get_jenv_res == JNI_OK);
6167 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
6168 if (get_jenv_res == JNI_EDETACHED) {
6169 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6174 void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
6175 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
6177 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6178 if (get_jenv_res == JNI_EDETACHED) {
6179 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6181 DO_ASSERT(get_jenv_res == JNI_OK);
6183 LDKTransaction tx_var = tx;
6184 int8_tArray tx_arr = (*env)->NewByteArray(env, tx_var.datalen);
6185 (*env)->SetByteArrayRegion(env, tx_arr, 0, tx_var.datalen, tx_var.data);
6186 Transaction_free(tx_var);
6187 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6189 (*env)->CallVoidMethod(env, obj, j_calls->broadcast_transaction_meth, tx_arr);
6190 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6191 (*env)->ExceptionDescribe(env);
6192 (*env)->FatalError(env, "A call to broadcast_transaction in LDKBroadcasterInterface from rust threw an exception.");
6194 if (get_jenv_res == JNI_EDETACHED) {
6195 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6198 static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
6199 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
6200 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6202 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv *env, jclass clz, jobject o) {
6203 jclass c = (*env)->GetObjectClass(env, o);
6205 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
6206 atomic_init(&calls->refcnt, 1);
6207 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6208 calls->o = (*env)->NewWeakGlobalRef(env, o);
6209 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "([B)V");
6210 CHECK(calls->broadcast_transaction_meth != NULL);
6212 LDKBroadcasterInterface ret = {
6213 .this_arg = (void*) calls,
6214 .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
6215 .free = LDKBroadcasterInterface_JCalls_free,
6219 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new(JNIEnv *env, jclass clz, jobject o) {
6220 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
6221 *res_ptr = LDKBroadcasterInterface_init(env, clz, o);
6222 return tag_ptr(res_ptr, true);
6224 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray tx) {
6225 void* this_arg_ptr = untag_ptr(this_arg);
6226 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6227 LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
6228 LDKTransaction tx_ref;
6229 tx_ref.datalen = (*env)->GetArrayLength(env, tx);
6230 tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
6231 (*env)->GetByteArrayRegion(env, tx, 0, tx_ref.datalen, tx_ref.data);
6232 tx_ref.data_is_owned = true;
6233 (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
6236 typedef struct LDKKeysInterface_JCalls {
6237 atomic_size_t refcnt;
6240 jmethodID get_node_secret_meth;
6241 jmethodID get_destination_script_meth;
6242 jmethodID get_shutdown_scriptpubkey_meth;
6243 jmethodID get_channel_signer_meth;
6244 jmethodID get_secure_random_bytes_meth;
6245 jmethodID read_chan_signer_meth;
6246 jmethodID sign_invoice_meth;
6247 jmethodID get_inbound_payment_key_material_meth;
6248 } LDKKeysInterface_JCalls;
6249 static void LDKKeysInterface_JCalls_free(void* this_arg) {
6250 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
6251 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
6253 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6254 if (get_jenv_res == JNI_EDETACHED) {
6255 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6257 DO_ASSERT(get_jenv_res == JNI_OK);
6259 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
6260 if (get_jenv_res == JNI_EDETACHED) {
6261 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6266 LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
6267 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
6269 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6270 if (get_jenv_res == JNI_EDETACHED) {
6271 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6273 DO_ASSERT(get_jenv_res == JNI_OK);
6275 jclass recipient_conv = LDKRecipient_to_java(env, recipient);
6276 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6278 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_node_secret_meth, recipient_conv);
6279 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6280 (*env)->ExceptionDescribe(env);
6281 (*env)->FatalError(env, "A call to get_node_secret in LDKKeysInterface from rust threw an exception.");
6283 void* ret_ptr = untag_ptr(ret);
6284 CHECK_ACCESS(ret_ptr);
6285 LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr);
6286 FREE(untag_ptr(ret));
6287 if (get_jenv_res == JNI_EDETACHED) {
6288 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6292 LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
6293 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
6295 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6296 if (get_jenv_res == JNI_EDETACHED) {
6297 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6299 DO_ASSERT(get_jenv_res == JNI_OK);
6301 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6303 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth);
6304 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6305 (*env)->ExceptionDescribe(env);
6306 (*env)->FatalError(env, "A call to get_destination_script in LDKKeysInterface from rust threw an exception.");
6308 LDKCVec_u8Z ret_ref;
6309 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
6310 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
6311 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
6312 if (get_jenv_res == JNI_EDETACHED) {
6313 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6317 LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
6318 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
6320 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6321 if (get_jenv_res == JNI_EDETACHED) {
6322 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6324 DO_ASSERT(get_jenv_res == JNI_OK);
6326 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6328 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_shutdown_scriptpubkey_meth);
6329 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6330 (*env)->ExceptionDescribe(env);
6331 (*env)->FatalError(env, "A call to get_shutdown_scriptpubkey in LDKKeysInterface from rust threw an exception.");
6333 LDKShutdownScript ret_conv;
6334 ret_conv.inner = untag_ptr(ret);
6335 ret_conv.is_owned = ptr_is_owned(ret);
6336 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
6337 if (get_jenv_res == JNI_EDETACHED) {
6338 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6342 LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
6343 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
6345 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6346 if (get_jenv_res == JNI_EDETACHED) {
6347 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6349 DO_ASSERT(get_jenv_res == JNI_OK);
6351 jboolean inbound_conv = inbound;
6352 int64_t channel_value_satoshis_conv = channel_value_satoshis;
6353 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6355 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_channel_signer_meth, inbound_conv, channel_value_satoshis_conv);
6356 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6357 (*env)->ExceptionDescribe(env);
6358 (*env)->FatalError(env, "A call to get_channel_signer in LDKKeysInterface from rust threw an exception.");
6360 void* ret_ptr = untag_ptr(ret);
6361 CHECK_ACCESS(ret_ptr);
6362 LDKSign ret_conv = *(LDKSign*)(ret_ptr);
6363 FREE(untag_ptr(ret));
6364 if (get_jenv_res == JNI_EDETACHED) {
6365 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6369 LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
6370 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
6372 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6373 if (get_jenv_res == JNI_EDETACHED) {
6374 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6376 DO_ASSERT(get_jenv_res == JNI_OK);
6378 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6380 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth);
6381 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6382 (*env)->ExceptionDescribe(env);
6383 (*env)->FatalError(env, "A call to get_secure_random_bytes in LDKKeysInterface from rust threw an exception.");
6385 LDKThirtyTwoBytes ret_ref;
6386 CHECK((*env)->GetArrayLength(env, ret) == 32);
6387 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
6388 if (get_jenv_res == JNI_EDETACHED) {
6389 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6393 LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
6394 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
6396 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6397 if (get_jenv_res == JNI_EDETACHED) {
6398 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6400 DO_ASSERT(get_jenv_res == JNI_OK);
6402 LDKu8slice reader_var = reader;
6403 int8_tArray reader_arr = (*env)->NewByteArray(env, reader_var.datalen);
6404 (*env)->SetByteArrayRegion(env, reader_arr, 0, reader_var.datalen, reader_var.data);
6405 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6407 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr);
6408 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6409 (*env)->ExceptionDescribe(env);
6410 (*env)->FatalError(env, "A call to read_chan_signer in LDKKeysInterface from rust threw an exception.");
6412 void* ret_ptr = untag_ptr(ret);
6413 CHECK_ACCESS(ret_ptr);
6414 LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
6415 FREE(untag_ptr(ret));
6416 if (get_jenv_res == JNI_EDETACHED) {
6417 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6421 LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_u5Z invoice_data, LDKRecipient receipient) {
6422 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
6424 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6425 if (get_jenv_res == JNI_EDETACHED) {
6426 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6428 DO_ASSERT(get_jenv_res == JNI_OK);
6430 LDKu8slice hrp_bytes_var = hrp_bytes;
6431 int8_tArray hrp_bytes_arr = (*env)->NewByteArray(env, hrp_bytes_var.datalen);
6432 (*env)->SetByteArrayRegion(env, hrp_bytes_arr, 0, hrp_bytes_var.datalen, hrp_bytes_var.data);
6433 LDKCVec_u5Z invoice_data_var = invoice_data;
6434 jobjectArray invoice_data_arr = NULL;
6435 invoice_data_arr = (*env)->NewByteArray(env, invoice_data_var.datalen);
6436 int8_t *invoice_data_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, invoice_data_arr, NULL);
6437 for (size_t h = 0; h < invoice_data_var.datalen; h++) {
6438 uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0;
6439 invoice_data_arr_ptr[h] = invoice_data_conv_7_val;
6441 (*env)->ReleasePrimitiveArrayCritical(env, invoice_data_arr, invoice_data_arr_ptr, 0);
6442 FREE(invoice_data_var.data);
6443 jclass receipient_conv = LDKRecipient_to_java(env, receipient);
6444 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6446 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, hrp_bytes_arr, invoice_data_arr, receipient_conv);
6447 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6448 (*env)->ExceptionDescribe(env);
6449 (*env)->FatalError(env, "A call to sign_invoice in LDKKeysInterface from rust threw an exception.");
6451 void* ret_ptr = untag_ptr(ret);
6452 CHECK_ACCESS(ret_ptr);
6453 LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
6454 FREE(untag_ptr(ret));
6455 if (get_jenv_res == JNI_EDETACHED) {
6456 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6460 LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
6461 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
6463 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6464 if (get_jenv_res == JNI_EDETACHED) {
6465 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6467 DO_ASSERT(get_jenv_res == JNI_OK);
6469 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6471 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_inbound_payment_key_material_meth);
6472 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6473 (*env)->ExceptionDescribe(env);
6474 (*env)->FatalError(env, "A call to get_inbound_payment_key_material in LDKKeysInterface from rust threw an exception.");
6476 LDKThirtyTwoBytes ret_ref;
6477 CHECK((*env)->GetArrayLength(env, ret) == 32);
6478 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
6479 if (get_jenv_res == JNI_EDETACHED) {
6480 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6484 static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
6485 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
6486 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6488 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv *env, jclass clz, jobject o) {
6489 jclass c = (*env)->GetObjectClass(env, o);
6491 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
6492 atomic_init(&calls->refcnt, 1);
6493 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6494 calls->o = (*env)->NewWeakGlobalRef(env, o);
6495 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "(Lorg/ldk/enums/Recipient;)J");
6496 CHECK(calls->get_node_secret_meth != NULL);
6497 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()[B");
6498 CHECK(calls->get_destination_script_meth != NULL);
6499 calls->get_shutdown_scriptpubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_scriptpubkey", "()J");
6500 CHECK(calls->get_shutdown_scriptpubkey_meth != NULL);
6501 calls->get_channel_signer_meth = (*env)->GetMethodID(env, c, "get_channel_signer", "(ZJ)J");
6502 CHECK(calls->get_channel_signer_meth != NULL);
6503 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B");
6504 CHECK(calls->get_secure_random_bytes_meth != NULL);
6505 calls->read_chan_signer_meth = (*env)->GetMethodID(env, c, "read_chan_signer", "([B)J");
6506 CHECK(calls->read_chan_signer_meth != NULL);
6507 calls->sign_invoice_meth = (*env)->GetMethodID(env, c, "sign_invoice", "([B[BLorg/ldk/enums/Recipient;)J");
6508 CHECK(calls->sign_invoice_meth != NULL);
6509 calls->get_inbound_payment_key_material_meth = (*env)->GetMethodID(env, c, "get_inbound_payment_key_material", "()[B");
6510 CHECK(calls->get_inbound_payment_key_material_meth != NULL);
6512 LDKKeysInterface ret = {
6513 .this_arg = (void*) calls,
6514 .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
6515 .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
6516 .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
6517 .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
6518 .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
6519 .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
6520 .sign_invoice = sign_invoice_LDKKeysInterface_jcall,
6521 .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
6522 .free = LDKKeysInterface_JCalls_free,
6526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new(JNIEnv *env, jclass clz, jobject o) {
6527 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
6528 *res_ptr = LDKKeysInterface_init(env, clz, o);
6529 return tag_ptr(res_ptr, true);
6531 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient) {
6532 void* this_arg_ptr = untag_ptr(this_arg);
6533 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6534 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
6535 LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
6536 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
6537 *ret_conv = (this_arg_conv->get_node_secret)(this_arg_conv->this_arg, recipient_conv);
6538 return tag_ptr(ret_conv, true);
6541 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1destination_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
6542 void* this_arg_ptr = untag_ptr(this_arg);
6543 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6544 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
6545 LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
6546 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
6547 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
6548 CVec_u8Z_free(ret_var);
6552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
6553 void* this_arg_ptr = untag_ptr(this_arg);
6554 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6555 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
6556 LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
6557 int64_t ret_ref = 0;
6558 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6559 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6563 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) {
6564 void* this_arg_ptr = untag_ptr(this_arg);
6565 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6566 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
6567 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
6568 *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
6569 return tag_ptr(ret_ret, true);
6572 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1secure_1random_1bytes(JNIEnv *env, jclass clz, int64_t this_arg) {
6573 void* this_arg_ptr = untag_ptr(this_arg);
6574 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6575 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
6576 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6577 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data);
6581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1read_1chan_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray reader) {
6582 void* this_arg_ptr = untag_ptr(this_arg);
6583 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6584 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
6585 LDKu8slice reader_ref;
6586 reader_ref.datalen = (*env)->GetArrayLength(env, reader);
6587 reader_ref.data = (*env)->GetByteArrayElements (env, reader, NULL);
6588 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
6589 *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
6590 (*env)->ReleaseByteArrayElements(env, reader, (int8_t*)reader_ref.data, 0);
6591 return tag_ptr(ret_conv, true);
6594 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) {
6595 void* this_arg_ptr = untag_ptr(this_arg);
6596 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6597 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
6598 LDKu8slice hrp_bytes_ref;
6599 hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes);
6600 hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL);
6601 LDKCVec_u5Z invoice_data_constr;
6602 invoice_data_constr.datalen = (*env)->GetArrayLength(env, invoice_data);
6603 if (invoice_data_constr.datalen > 0)
6604 invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
6606 invoice_data_constr.data = NULL;
6607 int8_t* invoice_data_vals = (*env)->GetByteArrayElements (env, invoice_data, NULL);
6608 for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
6609 int8_t invoice_data_conv_7 = invoice_data_vals[h];
6611 invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 };
6613 (*env)->ReleaseByteArrayElements(env, invoice_data, invoice_data_vals, 0);
6614 LDKRecipient receipient_conv = LDKRecipient_from_java(env, receipient);
6615 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
6616 *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, receipient_conv);
6617 (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0);
6618 return tag_ptr(ret_conv, true);
6621 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1inbound_1payment_1key_1material(JNIEnv *env, jclass clz, int64_t this_arg) {
6622 void* this_arg_ptr = untag_ptr(this_arg);
6623 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6624 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
6625 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6626 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data);
6630 typedef struct LDKFeeEstimator_JCalls {
6631 atomic_size_t refcnt;
6634 jmethodID get_est_sat_per_1000_weight_meth;
6635 } LDKFeeEstimator_JCalls;
6636 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
6637 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
6638 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
6640 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6641 if (get_jenv_res == JNI_EDETACHED) {
6642 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6644 DO_ASSERT(get_jenv_res == JNI_OK);
6646 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
6647 if (get_jenv_res == JNI_EDETACHED) {
6648 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6653 uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
6654 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
6656 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6657 if (get_jenv_res == JNI_EDETACHED) {
6658 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6660 DO_ASSERT(get_jenv_res == JNI_OK);
6662 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(env, confirmation_target);
6663 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6665 int32_t ret = (*env)->CallIntMethod(env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
6666 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6667 (*env)->ExceptionDescribe(env);
6668 (*env)->FatalError(env, "A call to get_est_sat_per_1000_weight in LDKFeeEstimator from rust threw an exception.");
6670 if (get_jenv_res == JNI_EDETACHED) {
6671 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6675 static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
6676 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
6677 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6679 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv *env, jclass clz, jobject o) {
6680 jclass c = (*env)->GetObjectClass(env, o);
6682 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
6683 atomic_init(&calls->refcnt, 1);
6684 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6685 calls->o = (*env)->NewWeakGlobalRef(env, o);
6686 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/enums/ConfirmationTarget;)I");
6687 CHECK(calls->get_est_sat_per_1000_weight_meth != NULL);
6689 LDKFeeEstimator ret = {
6690 .this_arg = (void*) calls,
6691 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
6692 .free = LDKFeeEstimator_JCalls_free,
6696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new(JNIEnv *env, jclass clz, jobject o) {
6697 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
6698 *res_ptr = LDKFeeEstimator_init(env, clz, o);
6699 return tag_ptr(res_ptr, true);
6701 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) {
6702 void* this_arg_ptr = untag_ptr(this_arg);
6703 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6704 LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
6705 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(env, confirmation_target);
6706 int32_t ret_conv = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
6710 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
6711 return ThirtyTwoBytes_clone(&owner->a);
6713 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
6714 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
6715 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6716 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data);
6720 static inline struct LDKChannelManager *C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
6723 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
6724 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
6725 LDKChannelManager ret_var = *C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv);
6726 int64_t ret_ref = 0;
6727 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6728 ret_ref = tag_ptr(ret_var.inner, false);
6732 static inline struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
6733 CHECK(owner->result_ok);
6734 return &*owner->contents.result;
6736 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6737 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
6738 int64_t ret_ret = tag_ptr(CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv), false);
6742 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
6743 CHECK(!owner->result_ok);
6744 return DecodeError_clone(&*owner->contents.err);
6746 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6747 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
6748 LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
6749 int64_t ret_ref = 0;
6750 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6751 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6755 static inline struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
6756 CHECK(owner->result_ok);
6757 return ChannelConfig_clone(&*owner->contents.result);
6759 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6760 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
6761 LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv);
6762 int64_t ret_ref = 0;
6763 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6764 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6768 static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
6769 CHECK(!owner->result_ok);
6770 return DecodeError_clone(&*owner->contents.err);
6772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6773 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
6774 LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
6775 int64_t ret_ref = 0;
6776 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6777 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6781 static inline struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
6782 CHECK(owner->result_ok);
6783 return OutPoint_clone(&*owner->contents.result);
6785 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6786 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
6787 LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv);
6788 int64_t ret_ref = 0;
6789 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6790 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6794 static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
6795 CHECK(!owner->result_ok);
6796 return DecodeError_clone(&*owner->contents.err);
6798 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6799 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
6800 LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
6801 int64_t ret_ref = 0;
6802 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6803 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6807 typedef struct LDKType_JCalls {
6808 atomic_size_t refcnt;
6811 jmethodID type_id_meth;
6812 jmethodID debug_str_meth;
6813 jmethodID write_meth;
6815 static void LDKType_JCalls_free(void* this_arg) {
6816 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
6817 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
6819 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6820 if (get_jenv_res == JNI_EDETACHED) {
6821 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6823 DO_ASSERT(get_jenv_res == JNI_OK);
6825 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
6826 if (get_jenv_res == JNI_EDETACHED) {
6827 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6832 uint16_t type_id_LDKType_jcall(const void* this_arg) {
6833 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
6835 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6836 if (get_jenv_res == JNI_EDETACHED) {
6837 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6839 DO_ASSERT(get_jenv_res == JNI_OK);
6841 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6843 int16_t ret = (*env)->CallShortMethod(env, obj, j_calls->type_id_meth);
6844 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6845 (*env)->ExceptionDescribe(env);
6846 (*env)->FatalError(env, "A call to type_id in LDKType from rust threw an exception.");
6848 if (get_jenv_res == JNI_EDETACHED) {
6849 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6853 LDKStr debug_str_LDKType_jcall(const void* this_arg) {
6854 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
6856 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6857 if (get_jenv_res == JNI_EDETACHED) {
6858 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6860 DO_ASSERT(get_jenv_res == JNI_OK);
6862 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6864 jstring ret = (*env)->CallObjectMethod(env, obj, j_calls->debug_str_meth);
6865 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6866 (*env)->ExceptionDescribe(env);
6867 (*env)->FatalError(env, "A call to debug_str in LDKType from rust threw an exception.");
6869 LDKStr ret_conv = java_to_owned_str(env, ret);
6870 if (get_jenv_res == JNI_EDETACHED) {
6871 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6875 LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
6876 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
6878 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6879 if (get_jenv_res == JNI_EDETACHED) {
6880 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6882 DO_ASSERT(get_jenv_res == JNI_OK);
6884 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6886 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
6887 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6888 (*env)->ExceptionDescribe(env);
6889 (*env)->FatalError(env, "A call to write in LDKType from rust threw an exception.");
6891 LDKCVec_u8Z ret_ref;
6892 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
6893 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
6894 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
6895 if (get_jenv_res == JNI_EDETACHED) {
6896 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6900 static void LDKType_JCalls_cloned(LDKType* new_obj) {
6901 LDKType_JCalls *j_calls = (LDKType_JCalls*) new_obj->this_arg;
6902 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6904 static inline LDKType LDKType_init (JNIEnv *env, jclass clz, jobject o) {
6905 jclass c = (*env)->GetObjectClass(env, o);
6907 LDKType_JCalls *calls = MALLOC(sizeof(LDKType_JCalls), "LDKType_JCalls");
6908 atomic_init(&calls->refcnt, 1);
6909 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6910 calls->o = (*env)->NewWeakGlobalRef(env, o);
6911 calls->type_id_meth = (*env)->GetMethodID(env, c, "type_id", "()S");
6912 CHECK(calls->type_id_meth != NULL);
6913 calls->debug_str_meth = (*env)->GetMethodID(env, c, "debug_str", "()Ljava/lang/String;");
6914 CHECK(calls->debug_str_meth != NULL);
6915 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
6916 CHECK(calls->write_meth != NULL);
6919 .this_arg = (void*) calls,
6920 .type_id = type_id_LDKType_jcall,
6921 .debug_str = debug_str_LDKType_jcall,
6922 .write = write_LDKType_jcall,
6923 .cloned = LDKType_JCalls_cloned,
6924 .free = LDKType_JCalls_free,
6928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKType_1new(JNIEnv *env, jclass clz, jobject o) {
6929 LDKType *res_ptr = MALLOC(sizeof(LDKType), "LDKType");
6930 *res_ptr = LDKType_init(env, clz, o);
6931 return tag_ptr(res_ptr, true);
6933 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Type_1type_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
6934 void* this_arg_ptr = untag_ptr(this_arg);
6935 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6936 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
6937 int16_t ret_conv = (this_arg_conv->type_id)(this_arg_conv->this_arg);
6941 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Type_1debug_1str(JNIEnv *env, jclass clz, int64_t this_arg) {
6942 void* this_arg_ptr = untag_ptr(this_arg);
6943 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6944 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
6945 LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
6946 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
6951 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Type_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
6952 void* this_arg_ptr = untag_ptr(this_arg);
6953 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6954 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
6955 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
6956 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
6957 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
6958 CVec_u8Z_free(ret_var);
6962 static jclass LDKCOption_TypeZ_Some_class = NULL;
6963 static jmethodID LDKCOption_TypeZ_Some_meth = NULL;
6964 static jclass LDKCOption_TypeZ_None_class = NULL;
6965 static jmethodID LDKCOption_TypeZ_None_meth = NULL;
6966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1TypeZ_init (JNIEnv *env, jclass clz) {
6967 LDKCOption_TypeZ_Some_class =
6968 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$Some"));
6969 CHECK(LDKCOption_TypeZ_Some_class != NULL);
6970 LDKCOption_TypeZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_Some_class, "<init>", "(J)V");
6971 CHECK(LDKCOption_TypeZ_Some_meth != NULL);
6972 LDKCOption_TypeZ_None_class =
6973 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$None"));
6974 CHECK(LDKCOption_TypeZ_None_class != NULL);
6975 LDKCOption_TypeZ_None_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_None_class, "<init>", "()V");
6976 CHECK(LDKCOption_TypeZ_None_meth != NULL);
6978 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1TypeZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
6979 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
6981 case LDKCOption_TypeZ_Some: {
6982 LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
6983 *some_ret = Type_clone(&obj->some);
6984 return (*env)->NewObject(env, LDKCOption_TypeZ_Some_class, LDKCOption_TypeZ_Some_meth, tag_ptr(some_ret, true));
6986 case LDKCOption_TypeZ_None: {
6987 return (*env)->NewObject(env, LDKCOption_TypeZ_None_class, LDKCOption_TypeZ_None_meth);
6992 static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
6993 CHECK(owner->result_ok);
6994 return COption_TypeZ_clone(&*owner->contents.result);
6996 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6997 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
6998 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
6999 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv);
7000 int64_t ret_ref = tag_ptr(ret_copy, true);
7004 static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
7005 CHECK(!owner->result_ok);
7006 return DecodeError_clone(&*owner->contents.err);
7008 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7009 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
7010 LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
7011 int64_t ret_ref = 0;
7012 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7013 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7017 static jclass LDKPaymentError_Invoice_class = NULL;
7018 static jmethodID LDKPaymentError_Invoice_meth = NULL;
7019 static jclass LDKPaymentError_Routing_class = NULL;
7020 static jmethodID LDKPaymentError_Routing_meth = NULL;
7021 static jclass LDKPaymentError_Sending_class = NULL;
7022 static jmethodID LDKPaymentError_Sending_meth = NULL;
7023 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentError_init (JNIEnv *env, jclass clz) {
7024 LDKPaymentError_Invoice_class =
7025 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Invoice"));
7026 CHECK(LDKPaymentError_Invoice_class != NULL);
7027 LDKPaymentError_Invoice_meth = (*env)->GetMethodID(env, LDKPaymentError_Invoice_class, "<init>", "(Ljava/lang/String;)V");
7028 CHECK(LDKPaymentError_Invoice_meth != NULL);
7029 LDKPaymentError_Routing_class =
7030 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Routing"));
7031 CHECK(LDKPaymentError_Routing_class != NULL);
7032 LDKPaymentError_Routing_meth = (*env)->GetMethodID(env, LDKPaymentError_Routing_class, "<init>", "(J)V");
7033 CHECK(LDKPaymentError_Routing_meth != NULL);
7034 LDKPaymentError_Sending_class =
7035 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Sending"));
7036 CHECK(LDKPaymentError_Sending_class != NULL);
7037 LDKPaymentError_Sending_meth = (*env)->GetMethodID(env, LDKPaymentError_Sending_class, "<init>", "(J)V");
7038 CHECK(LDKPaymentError_Sending_meth != NULL);
7040 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
7041 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
7043 case LDKPaymentError_Invoice: {
7044 LDKStr invoice_str = obj->invoice;
7045 jstring invoice_conv = str_ref_to_java(env, invoice_str.chars, invoice_str.len);
7046 return (*env)->NewObject(env, LDKPaymentError_Invoice_class, LDKPaymentError_Invoice_meth, invoice_conv);
7048 case LDKPaymentError_Routing: {
7049 LDKLightningError routing_var = obj->routing;
7050 int64_t routing_ref = 0;
7051 CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var);
7052 routing_ref = tag_ptr(routing_var.inner, false);
7053 return (*env)->NewObject(env, LDKPaymentError_Routing_class, LDKPaymentError_Routing_meth, routing_ref);
7055 case LDKPaymentError_Sending: {
7056 int64_t sending_ref = tag_ptr(&obj->sending, false);
7057 return (*env)->NewObject(env, LDKPaymentError_Sending_class, LDKPaymentError_Sending_meth, sending_ref);
7062 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
7063 CHECK(owner->result_ok);
7064 return ThirtyTwoBytes_clone(&*owner->contents.result);
7066 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7067 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
7068 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7069 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentIdPaymentErrorZ_get_ok(owner_conv).data);
7073 static inline struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
7074 CHECK(!owner->result_ok);
7075 return PaymentError_clone(&*owner->contents.err);
7077 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7078 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
7079 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
7080 *ret_copy = CResult_PaymentIdPaymentErrorZ_get_err(owner_conv);
7081 int64_t ret_ref = tag_ptr(ret_copy, true);
7085 static jclass LDKParseError_Bech32Error_class = NULL;
7086 static jmethodID LDKParseError_Bech32Error_meth = NULL;
7087 static jclass LDKParseError_ParseAmountError_class = NULL;
7088 static jmethodID LDKParseError_ParseAmountError_meth = NULL;
7089 static jclass LDKParseError_MalformedSignature_class = NULL;
7090 static jmethodID LDKParseError_MalformedSignature_meth = NULL;
7091 static jclass LDKParseError_BadPrefix_class = NULL;
7092 static jmethodID LDKParseError_BadPrefix_meth = NULL;
7093 static jclass LDKParseError_UnknownCurrency_class = NULL;
7094 static jmethodID LDKParseError_UnknownCurrency_meth = NULL;
7095 static jclass LDKParseError_UnknownSiPrefix_class = NULL;
7096 static jmethodID LDKParseError_UnknownSiPrefix_meth = NULL;
7097 static jclass LDKParseError_MalformedHRP_class = NULL;
7098 static jmethodID LDKParseError_MalformedHRP_meth = NULL;
7099 static jclass LDKParseError_TooShortDataPart_class = NULL;
7100 static jmethodID LDKParseError_TooShortDataPart_meth = NULL;
7101 static jclass LDKParseError_UnexpectedEndOfTaggedFields_class = NULL;
7102 static jmethodID LDKParseError_UnexpectedEndOfTaggedFields_meth = NULL;
7103 static jclass LDKParseError_DescriptionDecodeError_class = NULL;
7104 static jmethodID LDKParseError_DescriptionDecodeError_meth = NULL;
7105 static jclass LDKParseError_PaddingError_class = NULL;
7106 static jmethodID LDKParseError_PaddingError_meth = NULL;
7107 static jclass LDKParseError_IntegerOverflowError_class = NULL;
7108 static jmethodID LDKParseError_IntegerOverflowError_meth = NULL;
7109 static jclass LDKParseError_InvalidSegWitProgramLength_class = NULL;
7110 static jmethodID LDKParseError_InvalidSegWitProgramLength_meth = NULL;
7111 static jclass LDKParseError_InvalidPubKeyHashLength_class = NULL;
7112 static jmethodID LDKParseError_InvalidPubKeyHashLength_meth = NULL;
7113 static jclass LDKParseError_InvalidScriptHashLength_class = NULL;
7114 static jmethodID LDKParseError_InvalidScriptHashLength_meth = NULL;
7115 static jclass LDKParseError_InvalidRecoveryId_class = NULL;
7116 static jmethodID LDKParseError_InvalidRecoveryId_meth = NULL;
7117 static jclass LDKParseError_InvalidSliceLength_class = NULL;
7118 static jmethodID LDKParseError_InvalidSliceLength_meth = NULL;
7119 static jclass LDKParseError_Skip_class = NULL;
7120 static jmethodID LDKParseError_Skip_meth = NULL;
7121 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseError_init (JNIEnv *env, jclass clz) {
7122 LDKParseError_Bech32Error_class =
7123 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Bech32Error"));
7124 CHECK(LDKParseError_Bech32Error_class != NULL);
7125 LDKParseError_Bech32Error_meth = (*env)->GetMethodID(env, LDKParseError_Bech32Error_class, "<init>", "(J)V");
7126 CHECK(LDKParseError_Bech32Error_meth != NULL);
7127 LDKParseError_ParseAmountError_class =
7128 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$ParseAmountError"));
7129 CHECK(LDKParseError_ParseAmountError_class != NULL);
7130 LDKParseError_ParseAmountError_meth = (*env)->GetMethodID(env, LDKParseError_ParseAmountError_class, "<init>", "(I)V");
7131 CHECK(LDKParseError_ParseAmountError_meth != NULL);
7132 LDKParseError_MalformedSignature_class =
7133 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedSignature"));
7134 CHECK(LDKParseError_MalformedSignature_class != NULL);
7135 LDKParseError_MalformedSignature_meth = (*env)->GetMethodID(env, LDKParseError_MalformedSignature_class, "<init>", "(Lorg/ldk/enums/Secp256k1Error;)V");
7136 CHECK(LDKParseError_MalformedSignature_meth != NULL);
7137 LDKParseError_BadPrefix_class =
7138 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$BadPrefix"));
7139 CHECK(LDKParseError_BadPrefix_class != NULL);
7140 LDKParseError_BadPrefix_meth = (*env)->GetMethodID(env, LDKParseError_BadPrefix_class, "<init>", "()V");
7141 CHECK(LDKParseError_BadPrefix_meth != NULL);
7142 LDKParseError_UnknownCurrency_class =
7143 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownCurrency"));
7144 CHECK(LDKParseError_UnknownCurrency_class != NULL);
7145 LDKParseError_UnknownCurrency_meth = (*env)->GetMethodID(env, LDKParseError_UnknownCurrency_class, "<init>", "()V");
7146 CHECK(LDKParseError_UnknownCurrency_meth != NULL);
7147 LDKParseError_UnknownSiPrefix_class =
7148 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownSiPrefix"));
7149 CHECK(LDKParseError_UnknownSiPrefix_class != NULL);
7150 LDKParseError_UnknownSiPrefix_meth = (*env)->GetMethodID(env, LDKParseError_UnknownSiPrefix_class, "<init>", "()V");
7151 CHECK(LDKParseError_UnknownSiPrefix_meth != NULL);
7152 LDKParseError_MalformedHRP_class =
7153 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedHRP"));
7154 CHECK(LDKParseError_MalformedHRP_class != NULL);
7155 LDKParseError_MalformedHRP_meth = (*env)->GetMethodID(env, LDKParseError_MalformedHRP_class, "<init>", "()V");
7156 CHECK(LDKParseError_MalformedHRP_meth != NULL);
7157 LDKParseError_TooShortDataPart_class =
7158 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$TooShortDataPart"));
7159 CHECK(LDKParseError_TooShortDataPart_class != NULL);
7160 LDKParseError_TooShortDataPart_meth = (*env)->GetMethodID(env, LDKParseError_TooShortDataPart_class, "<init>", "()V");
7161 CHECK(LDKParseError_TooShortDataPart_meth != NULL);
7162 LDKParseError_UnexpectedEndOfTaggedFields_class =
7163 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnexpectedEndOfTaggedFields"));
7164 CHECK(LDKParseError_UnexpectedEndOfTaggedFields_class != NULL);
7165 LDKParseError_UnexpectedEndOfTaggedFields_meth = (*env)->GetMethodID(env, LDKParseError_UnexpectedEndOfTaggedFields_class, "<init>", "()V");
7166 CHECK(LDKParseError_UnexpectedEndOfTaggedFields_meth != NULL);
7167 LDKParseError_DescriptionDecodeError_class =
7168 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$DescriptionDecodeError"));
7169 CHECK(LDKParseError_DescriptionDecodeError_class != NULL);
7170 LDKParseError_DescriptionDecodeError_meth = (*env)->GetMethodID(env, LDKParseError_DescriptionDecodeError_class, "<init>", "(I)V");
7171 CHECK(LDKParseError_DescriptionDecodeError_meth != NULL);
7172 LDKParseError_PaddingError_class =
7173 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$PaddingError"));
7174 CHECK(LDKParseError_PaddingError_class != NULL);
7175 LDKParseError_PaddingError_meth = (*env)->GetMethodID(env, LDKParseError_PaddingError_class, "<init>", "()V");
7176 CHECK(LDKParseError_PaddingError_meth != NULL);
7177 LDKParseError_IntegerOverflowError_class =
7178 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$IntegerOverflowError"));
7179 CHECK(LDKParseError_IntegerOverflowError_class != NULL);
7180 LDKParseError_IntegerOverflowError_meth = (*env)->GetMethodID(env, LDKParseError_IntegerOverflowError_class, "<init>", "()V");
7181 CHECK(LDKParseError_IntegerOverflowError_meth != NULL);
7182 LDKParseError_InvalidSegWitProgramLength_class =
7183 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSegWitProgramLength"));
7184 CHECK(LDKParseError_InvalidSegWitProgramLength_class != NULL);
7185 LDKParseError_InvalidSegWitProgramLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSegWitProgramLength_class, "<init>", "()V");
7186 CHECK(LDKParseError_InvalidSegWitProgramLength_meth != NULL);
7187 LDKParseError_InvalidPubKeyHashLength_class =
7188 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidPubKeyHashLength"));
7189 CHECK(LDKParseError_InvalidPubKeyHashLength_class != NULL);
7190 LDKParseError_InvalidPubKeyHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidPubKeyHashLength_class, "<init>", "()V");
7191 CHECK(LDKParseError_InvalidPubKeyHashLength_meth != NULL);
7192 LDKParseError_InvalidScriptHashLength_class =
7193 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidScriptHashLength"));
7194 CHECK(LDKParseError_InvalidScriptHashLength_class != NULL);
7195 LDKParseError_InvalidScriptHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidScriptHashLength_class, "<init>", "()V");
7196 CHECK(LDKParseError_InvalidScriptHashLength_meth != NULL);
7197 LDKParseError_InvalidRecoveryId_class =
7198 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidRecoveryId"));
7199 CHECK(LDKParseError_InvalidRecoveryId_class != NULL);
7200 LDKParseError_InvalidRecoveryId_meth = (*env)->GetMethodID(env, LDKParseError_InvalidRecoveryId_class, "<init>", "()V");
7201 CHECK(LDKParseError_InvalidRecoveryId_meth != NULL);
7202 LDKParseError_InvalidSliceLength_class =
7203 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSliceLength"));
7204 CHECK(LDKParseError_InvalidSliceLength_class != NULL);
7205 LDKParseError_InvalidSliceLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSliceLength_class, "<init>", "(Ljava/lang/String;)V");
7206 CHECK(LDKParseError_InvalidSliceLength_meth != NULL);
7207 LDKParseError_Skip_class =
7208 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Skip"));
7209 CHECK(LDKParseError_Skip_class != NULL);
7210 LDKParseError_Skip_meth = (*env)->GetMethodID(env, LDKParseError_Skip_class, "<init>", "()V");
7211 CHECK(LDKParseError_Skip_meth != NULL);
7213 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
7214 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
7216 case LDKParseError_Bech32Error: {
7217 int64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
7218 return (*env)->NewObject(env, LDKParseError_Bech32Error_class, LDKParseError_Bech32Error_meth, bech32_error_ref);
7220 case LDKParseError_ParseAmountError: {
7221 /*obj->parse_amount_error*/
7222 return (*env)->NewObject(env, LDKParseError_ParseAmountError_class, LDKParseError_ParseAmountError_meth, 0);
7224 case LDKParseError_MalformedSignature: {
7225 jclass malformed_signature_conv = LDKSecp256k1Error_to_java(env, obj->malformed_signature);
7226 return (*env)->NewObject(env, LDKParseError_MalformedSignature_class, LDKParseError_MalformedSignature_meth, malformed_signature_conv);
7228 case LDKParseError_BadPrefix: {
7229 return (*env)->NewObject(env, LDKParseError_BadPrefix_class, LDKParseError_BadPrefix_meth);
7231 case LDKParseError_UnknownCurrency: {
7232 return (*env)->NewObject(env, LDKParseError_UnknownCurrency_class, LDKParseError_UnknownCurrency_meth);
7234 case LDKParseError_UnknownSiPrefix: {
7235 return (*env)->NewObject(env, LDKParseError_UnknownSiPrefix_class, LDKParseError_UnknownSiPrefix_meth);
7237 case LDKParseError_MalformedHRP: {
7238 return (*env)->NewObject(env, LDKParseError_MalformedHRP_class, LDKParseError_MalformedHRP_meth);
7240 case LDKParseError_TooShortDataPart: {
7241 return (*env)->NewObject(env, LDKParseError_TooShortDataPart_class, LDKParseError_TooShortDataPart_meth);
7243 case LDKParseError_UnexpectedEndOfTaggedFields: {
7244 return (*env)->NewObject(env, LDKParseError_UnexpectedEndOfTaggedFields_class, LDKParseError_UnexpectedEndOfTaggedFields_meth);
7246 case LDKParseError_DescriptionDecodeError: {
7247 /*obj->description_decode_error*/
7248 return (*env)->NewObject(env, LDKParseError_DescriptionDecodeError_class, LDKParseError_DescriptionDecodeError_meth, 0);
7250 case LDKParseError_PaddingError: {
7251 return (*env)->NewObject(env, LDKParseError_PaddingError_class, LDKParseError_PaddingError_meth);
7253 case LDKParseError_IntegerOverflowError: {
7254 return (*env)->NewObject(env, LDKParseError_IntegerOverflowError_class, LDKParseError_IntegerOverflowError_meth);
7256 case LDKParseError_InvalidSegWitProgramLength: {
7257 return (*env)->NewObject(env, LDKParseError_InvalidSegWitProgramLength_class, LDKParseError_InvalidSegWitProgramLength_meth);
7259 case LDKParseError_InvalidPubKeyHashLength: {
7260 return (*env)->NewObject(env, LDKParseError_InvalidPubKeyHashLength_class, LDKParseError_InvalidPubKeyHashLength_meth);
7262 case LDKParseError_InvalidScriptHashLength: {
7263 return (*env)->NewObject(env, LDKParseError_InvalidScriptHashLength_class, LDKParseError_InvalidScriptHashLength_meth);
7265 case LDKParseError_InvalidRecoveryId: {
7266 return (*env)->NewObject(env, LDKParseError_InvalidRecoveryId_class, LDKParseError_InvalidRecoveryId_meth);
7268 case LDKParseError_InvalidSliceLength: {
7269 LDKStr invalid_slice_length_str = obj->invalid_slice_length;
7270 jstring invalid_slice_length_conv = str_ref_to_java(env, invalid_slice_length_str.chars, invalid_slice_length_str.len);
7271 return (*env)->NewObject(env, LDKParseError_InvalidSliceLength_class, LDKParseError_InvalidSliceLength_meth, invalid_slice_length_conv);
7273 case LDKParseError_Skip: {
7274 return (*env)->NewObject(env, LDKParseError_Skip_class, LDKParseError_Skip_meth);
7279 static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
7280 CHECK(owner->result_ok);
7281 return SiPrefix_clone(&*owner->contents.result);
7283 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7284 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
7285 jclass ret_conv = LDKSiPrefix_to_java(env, CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
7289 static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
7290 CHECK(!owner->result_ok);
7291 return ParseError_clone(&*owner->contents.err);
7293 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7294 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
7295 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
7296 *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
7297 int64_t ret_ref = tag_ptr(ret_copy, true);
7301 static jclass LDKParseOrSemanticError_ParseError_class = NULL;
7302 static jmethodID LDKParseOrSemanticError_ParseError_meth = NULL;
7303 static jclass LDKParseOrSemanticError_SemanticError_class = NULL;
7304 static jmethodID LDKParseOrSemanticError_SemanticError_meth = NULL;
7305 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseOrSemanticError_init (JNIEnv *env, jclass clz) {
7306 LDKParseOrSemanticError_ParseError_class =
7307 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$ParseError"));
7308 CHECK(LDKParseOrSemanticError_ParseError_class != NULL);
7309 LDKParseOrSemanticError_ParseError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_ParseError_class, "<init>", "(J)V");
7310 CHECK(LDKParseOrSemanticError_ParseError_meth != NULL);
7311 LDKParseOrSemanticError_SemanticError_class =
7312 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$SemanticError"));
7313 CHECK(LDKParseOrSemanticError_SemanticError_class != NULL);
7314 LDKParseOrSemanticError_SemanticError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_SemanticError_class, "<init>", "(Lorg/ldk/enums/SemanticError;)V");
7315 CHECK(LDKParseOrSemanticError_SemanticError_meth != NULL);
7317 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
7318 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
7320 case LDKParseOrSemanticError_ParseError: {
7321 int64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
7322 return (*env)->NewObject(env, LDKParseOrSemanticError_ParseError_class, LDKParseOrSemanticError_ParseError_meth, parse_error_ref);
7324 case LDKParseOrSemanticError_SemanticError: {
7325 jclass semantic_error_conv = LDKSemanticError_to_java(env, obj->semantic_error);
7326 return (*env)->NewObject(env, LDKParseOrSemanticError_SemanticError_class, LDKParseOrSemanticError_SemanticError_meth, semantic_error_conv);
7331 static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
7332 CHECK(owner->result_ok);
7333 return Invoice_clone(&*owner->contents.result);
7335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7336 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
7337 LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
7338 int64_t ret_ref = 0;
7339 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7340 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7344 static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
7345 CHECK(!owner->result_ok);
7346 return ParseOrSemanticError_clone(&*owner->contents.err);
7348 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7349 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
7350 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
7351 *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
7352 int64_t ret_ref = tag_ptr(ret_copy, true);
7356 static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
7357 CHECK(owner->result_ok);
7358 return SignedRawInvoice_clone(&*owner->contents.result);
7360 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7361 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
7362 LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
7363 int64_t ret_ref = 0;
7364 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7365 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7369 static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
7370 CHECK(!owner->result_ok);
7371 return ParseError_clone(&*owner->contents.err);
7373 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7374 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
7375 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
7376 *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
7377 int64_t ret_ref = tag_ptr(ret_copy, true);
7381 static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
7382 return RawInvoice_clone(&owner->a);
7384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7385 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
7386 LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
7387 int64_t ret_ref = 0;
7388 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7389 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7393 static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
7394 return ThirtyTwoBytes_clone(&owner->b);
7396 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7397 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
7398 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7399 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data);
7403 static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
7404 return InvoiceSignature_clone(&owner->c);
7406 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
7407 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
7408 LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
7409 int64_t ret_ref = 0;
7410 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7411 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7415 static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
7416 CHECK(owner->result_ok);
7417 return PayeePubKey_clone(&*owner->contents.result);
7419 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7420 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
7421 LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
7422 int64_t ret_ref = 0;
7423 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7424 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7428 static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
7429 CHECK(!owner->result_ok);
7430 return *owner->contents.err;
7432 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7433 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
7434 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PayeePubKeyErrorZ_get_err(owner_conv));
7438 static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
7439 LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
7440 for (size_t i = 0; i < ret.datalen; i++) {
7441 ret.data[i] = PrivateRoute_clone(&orig->data[i]);
7445 static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
7446 CHECK(owner->result_ok);
7447 return PositiveTimestamp_clone(&*owner->contents.result);
7449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7450 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
7451 LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
7452 int64_t ret_ref = 0;
7453 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7454 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7458 static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
7459 CHECK(!owner->result_ok);
7460 return CreationError_clone(&*owner->contents.err);
7462 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7463 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
7464 jclass ret_conv = LDKCreationError_to_java(env, CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
7468 static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
7469 CHECK(owner->result_ok);
7470 return *owner->contents.result;
7472 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7473 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
7474 CResult_NoneSemanticErrorZ_get_ok(owner_conv);
7477 static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
7478 CHECK(!owner->result_ok);
7479 return SemanticError_clone(&*owner->contents.err);
7481 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7482 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
7483 jclass ret_conv = LDKSemanticError_to_java(env, CResult_NoneSemanticErrorZ_get_err(owner_conv));
7487 static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
7488 CHECK(owner->result_ok);
7489 return Invoice_clone(&*owner->contents.result);
7491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7492 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
7493 LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
7494 int64_t ret_ref = 0;
7495 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7496 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7500 static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
7501 CHECK(!owner->result_ok);
7502 return SemanticError_clone(&*owner->contents.err);
7504 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7505 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
7506 jclass ret_conv = LDKSemanticError_to_java(env, CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
7510 static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
7511 CHECK(owner->result_ok);
7512 return Description_clone(&*owner->contents.result);
7514 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7515 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
7516 LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
7517 int64_t ret_ref = 0;
7518 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7519 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7523 static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
7524 CHECK(!owner->result_ok);
7525 return CreationError_clone(&*owner->contents.err);
7527 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7528 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
7529 jclass ret_conv = LDKCreationError_to_java(env, CResult_DescriptionCreationErrorZ_get_err(owner_conv));
7533 static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
7534 CHECK(owner->result_ok);
7535 return PrivateRoute_clone(&*owner->contents.result);
7537 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7538 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
7539 LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
7540 int64_t ret_ref = 0;
7541 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7542 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7546 static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
7547 CHECK(!owner->result_ok);
7548 return CreationError_clone(&*owner->contents.err);
7550 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7551 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
7552 jclass ret_conv = LDKCreationError_to_java(env, CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
7556 static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
7557 CHECK(owner->result_ok);
7558 return *owner->contents.result;
7560 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7561 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
7562 LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
7563 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
7567 static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
7568 CHECK(!owner->result_ok);
7569 return *owner->contents.err;
7571 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7572 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
7573 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_StringErrorZ_get_err(owner_conv));
7577 static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
7578 CHECK(owner->result_ok);
7579 return ChannelMonitorUpdate_clone(&*owner->contents.result);
7581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7582 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
7583 LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
7584 int64_t ret_ref = 0;
7585 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7586 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7590 static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
7591 CHECK(!owner->result_ok);
7592 return DecodeError_clone(&*owner->contents.err);
7594 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7595 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
7596 LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
7597 int64_t ret_ref = 0;
7598 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7599 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7603 static jclass LDKCOption_MonitorEventZ_Some_class = NULL;
7604 static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL;
7605 static jclass LDKCOption_MonitorEventZ_None_class = NULL;
7606 static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL;
7607 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) {
7608 LDKCOption_MonitorEventZ_Some_class =
7609 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some"));
7610 CHECK(LDKCOption_MonitorEventZ_Some_class != NULL);
7611 LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "<init>", "(J)V");
7612 CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL);
7613 LDKCOption_MonitorEventZ_None_class =
7614 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$None"));
7615 CHECK(LDKCOption_MonitorEventZ_None_class != NULL);
7616 LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "<init>", "()V");
7617 CHECK(LDKCOption_MonitorEventZ_None_meth != NULL);
7619 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
7620 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
7622 case LDKCOption_MonitorEventZ_Some: {
7623 int64_t some_ref = tag_ptr(&obj->some, false);
7624 return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref);
7626 case LDKCOption_MonitorEventZ_None: {
7627 return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth);
7632 static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
7633 CHECK(owner->result_ok);
7634 return COption_MonitorEventZ_clone(&*owner->contents.result);
7636 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7637 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
7638 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
7639 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
7640 int64_t ret_ref = tag_ptr(ret_copy, true);
7644 static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
7645 CHECK(!owner->result_ok);
7646 return DecodeError_clone(&*owner->contents.err);
7648 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7649 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
7650 LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
7651 int64_t ret_ref = 0;
7652 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7653 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7657 static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
7658 CHECK(owner->result_ok);
7659 return HTLCUpdate_clone(&*owner->contents.result);
7661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7662 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
7663 LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
7664 int64_t ret_ref = 0;
7665 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7666 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7670 static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
7671 CHECK(!owner->result_ok);
7672 return DecodeError_clone(&*owner->contents.err);
7674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7675 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
7676 LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
7677 int64_t ret_ref = 0;
7678 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7679 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7683 static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
7684 return OutPoint_clone(&owner->a);
7686 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7687 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
7688 LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
7689 int64_t ret_ref = 0;
7690 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7691 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7695 static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
7696 return CVec_u8Z_clone(&owner->b);
7698 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7699 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
7700 LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
7701 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
7702 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
7703 CVec_u8Z_free(ret_var);
7707 static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
7710 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7711 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
7712 int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
7716 static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
7717 return CVec_u8Z_clone(&owner->b);
7719 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7720 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
7721 LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv);
7722 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
7723 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
7724 CVec_u8Z_free(ret_var);
7728 static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) {
7729 LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen };
7730 for (size_t i = 0; i < ret.datalen; i++) {
7731 ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]);
7735 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
7736 return ThirtyTwoBytes_clone(&owner->a);
7738 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7739 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
7740 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7741 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data);
7745 static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
7746 return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b);
7748 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7749 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
7750 LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv);
7751 int64_tArray ret_arr = NULL;
7752 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
7753 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
7754 for (size_t v = 0; v < ret_var.datalen; v++) {
7755 LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
7756 *ret_conv_21_conv = ret_var.data[v];
7757 ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true);
7759 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
7764 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) {
7765 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 };
7766 for (size_t i = 0; i < ret.datalen; i++) {
7767 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]);
7771 static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) {
7772 LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen };
7773 for (size_t i = 0; i < ret.datalen; i++) {
7774 ret.data[i] = Event_clone(&orig->data[i]);
7778 static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
7781 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7782 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
7783 int32_t ret_conv = C2Tuple_u32TxOutZ_get_a(owner_conv);
7787 static inline struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
7788 return TxOut_clone(&owner->b);
7790 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7791 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
7792 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
7793 *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv);
7794 return tag_ptr(ret_ref, true);
7797 static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) {
7798 LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen };
7799 for (size_t i = 0; i < ret.datalen; i++) {
7800 ret.data[i] = C2Tuple_u32TxOutZ_clone(&orig->data[i]);
7804 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
7805 return ThirtyTwoBytes_clone(&owner->a);
7807 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7808 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
7809 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7810 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data);
7814 static inline struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
7815 return CVec_C2Tuple_u32TxOutZZ_clone(&owner->b);
7817 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7818 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
7819 LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv);
7820 int64_tArray ret_arr = NULL;
7821 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
7822 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
7823 for (size_t u = 0; u < ret_var.datalen; u++) {
7824 LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
7825 *ret_conv_20_conv = ret_var.data[u];
7826 ret_arr_ptr[u] = tag_ptr(ret_conv_20_conv, true);
7828 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
7833 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) {
7834 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 };
7835 for (size_t i = 0; i < ret.datalen; i++) {
7836 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(&orig->data[i]);
7840 static jclass LDKBalance_ClaimableOnChannelClose_class = NULL;
7841 static jmethodID LDKBalance_ClaimableOnChannelClose_meth = NULL;
7842 static jclass LDKBalance_ClaimableAwaitingConfirmations_class = NULL;
7843 static jmethodID LDKBalance_ClaimableAwaitingConfirmations_meth = NULL;
7844 static jclass LDKBalance_ContentiousClaimable_class = NULL;
7845 static jmethodID LDKBalance_ContentiousClaimable_meth = NULL;
7846 static jclass LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class = NULL;
7847 static jmethodID LDKBalance_MaybeClaimableHTLCAwaitingTimeout_meth = NULL;
7848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBalance_init (JNIEnv *env, jclass clz) {
7849 LDKBalance_ClaimableOnChannelClose_class =
7850 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableOnChannelClose"));
7851 CHECK(LDKBalance_ClaimableOnChannelClose_class != NULL);
7852 LDKBalance_ClaimableOnChannelClose_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableOnChannelClose_class, "<init>", "(J)V");
7853 CHECK(LDKBalance_ClaimableOnChannelClose_meth != NULL);
7854 LDKBalance_ClaimableAwaitingConfirmations_class =
7855 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableAwaitingConfirmations"));
7856 CHECK(LDKBalance_ClaimableAwaitingConfirmations_class != NULL);
7857 LDKBalance_ClaimableAwaitingConfirmations_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableAwaitingConfirmations_class, "<init>", "(JI)V");
7858 CHECK(LDKBalance_ClaimableAwaitingConfirmations_meth != NULL);
7859 LDKBalance_ContentiousClaimable_class =
7860 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ContentiousClaimable"));
7861 CHECK(LDKBalance_ContentiousClaimable_class != NULL);
7862 LDKBalance_ContentiousClaimable_meth = (*env)->GetMethodID(env, LDKBalance_ContentiousClaimable_class, "<init>", "(JI)V");
7863 CHECK(LDKBalance_ContentiousClaimable_meth != NULL);
7864 LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class =
7865 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybeClaimableHTLCAwaitingTimeout"));
7866 CHECK(LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class != NULL);
7867 LDKBalance_MaybeClaimableHTLCAwaitingTimeout_meth = (*env)->GetMethodID(env, LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class, "<init>", "(JI)V");
7868 CHECK(LDKBalance_MaybeClaimableHTLCAwaitingTimeout_meth != NULL);
7870 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
7871 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
7873 case LDKBalance_ClaimableOnChannelClose: {
7874 int64_t claimable_amount_satoshis_conv = obj->claimable_on_channel_close.claimable_amount_satoshis;
7875 return (*env)->NewObject(env, LDKBalance_ClaimableOnChannelClose_class, LDKBalance_ClaimableOnChannelClose_meth, claimable_amount_satoshis_conv);
7877 case LDKBalance_ClaimableAwaitingConfirmations: {
7878 int64_t claimable_amount_satoshis_conv = obj->claimable_awaiting_confirmations.claimable_amount_satoshis;
7879 int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height;
7880 return (*env)->NewObject(env, LDKBalance_ClaimableAwaitingConfirmations_class, LDKBalance_ClaimableAwaitingConfirmations_meth, claimable_amount_satoshis_conv, confirmation_height_conv);
7882 case LDKBalance_ContentiousClaimable: {
7883 int64_t claimable_amount_satoshis_conv = obj->contentious_claimable.claimable_amount_satoshis;
7884 int32_t timeout_height_conv = obj->contentious_claimable.timeout_height;
7885 return (*env)->NewObject(env, LDKBalance_ContentiousClaimable_class, LDKBalance_ContentiousClaimable_meth, claimable_amount_satoshis_conv, timeout_height_conv);
7887 case LDKBalance_MaybeClaimableHTLCAwaitingTimeout: {
7888 int64_t claimable_amount_satoshis_conv = obj->maybe_claimable_htlc_awaiting_timeout.claimable_amount_satoshis;
7889 int32_t claimable_height_conv = obj->maybe_claimable_htlc_awaiting_timeout.claimable_height;
7890 return (*env)->NewObject(env, LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class, LDKBalance_MaybeClaimableHTLCAwaitingTimeout_meth, claimable_amount_satoshis_conv, claimable_height_conv);
7895 static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
7896 LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
7897 for (size_t i = 0; i < ret.datalen; i++) {
7898 ret.data[i] = Balance_clone(&orig->data[i]);
7902 static inline struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
7903 CHECK(owner->result_ok);
7904 return C2Tuple_BlockHashChannelMonitorZ_clone(&*owner->contents.result);
7906 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7907 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
7908 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
7909 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv);
7910 return tag_ptr(ret_conv, true);
7913 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
7914 CHECK(!owner->result_ok);
7915 return DecodeError_clone(&*owner->contents.err);
7917 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7918 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
7919 LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
7920 int64_t ret_ref = 0;
7921 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7922 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7926 static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
7929 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7930 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
7931 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
7932 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form);
7936 static inline struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
7937 return Type_clone(&owner->b);
7939 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7940 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
7941 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
7942 *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv);
7943 return tag_ptr(ret_ret, true);
7946 static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) {
7947 LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen };
7948 for (size_t i = 0; i < ret.datalen; i++) {
7949 ret.data[i] = C2Tuple_PublicKeyTypeZ_clone(&orig->data[i]);
7953 static jclass LDKCOption_NetAddressZ_Some_class = NULL;
7954 static jmethodID LDKCOption_NetAddressZ_Some_meth = NULL;
7955 static jclass LDKCOption_NetAddressZ_None_class = NULL;
7956 static jmethodID LDKCOption_NetAddressZ_None_meth = NULL;
7957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetAddressZ_init (JNIEnv *env, jclass clz) {
7958 LDKCOption_NetAddressZ_Some_class =
7959 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetAddressZ$Some"));
7960 CHECK(LDKCOption_NetAddressZ_Some_class != NULL);
7961 LDKCOption_NetAddressZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NetAddressZ_Some_class, "<init>", "(J)V");
7962 CHECK(LDKCOption_NetAddressZ_Some_meth != NULL);
7963 LDKCOption_NetAddressZ_None_class =
7964 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetAddressZ$None"));
7965 CHECK(LDKCOption_NetAddressZ_None_class != NULL);
7966 LDKCOption_NetAddressZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NetAddressZ_None_class, "<init>", "()V");
7967 CHECK(LDKCOption_NetAddressZ_None_meth != NULL);
7969 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetAddressZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
7970 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
7972 case LDKCOption_NetAddressZ_Some: {
7973 int64_t some_ref = tag_ptr(&obj->some, false);
7974 return (*env)->NewObject(env, LDKCOption_NetAddressZ_Some_class, LDKCOption_NetAddressZ_Some_meth, some_ref);
7976 case LDKCOption_NetAddressZ_None: {
7977 return (*env)->NewObject(env, LDKCOption_NetAddressZ_None_class, LDKCOption_NetAddressZ_None_meth);
7982 static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
7983 CHECK(owner->result_ok);
7984 return CVec_u8Z_clone(&*owner->contents.result);
7986 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7987 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
7988 LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv);
7989 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
7990 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
7991 CVec_u8Z_free(ret_var);
7995 static inline struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
7996 CHECK(!owner->result_ok);
7997 return PeerHandleError_clone(&*owner->contents.err);
7999 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8000 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
8001 LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv);
8002 int64_t ret_ref = 0;
8003 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8004 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8008 static inline void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
8009 CHECK(owner->result_ok);
8010 return *owner->contents.result;
8012 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8013 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
8014 CResult_NonePeerHandleErrorZ_get_ok(owner_conv);
8017 static inline struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
8018 CHECK(!owner->result_ok);
8019 return PeerHandleError_clone(&*owner->contents.err);
8021 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8022 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
8023 LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv);
8024 int64_t ret_ref = 0;
8025 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8026 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8030 static inline bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
8031 CHECK(owner->result_ok);
8032 return *owner->contents.result;
8034 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8035 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
8036 jboolean ret_conv = CResult_boolPeerHandleErrorZ_get_ok(owner_conv);
8040 static inline struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
8041 CHECK(!owner->result_ok);
8042 return PeerHandleError_clone(&*owner->contents.err);
8044 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8045 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
8046 LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv);
8047 int64_t ret_ref = 0;
8048 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8049 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8053 static jclass LDKGraphSyncError_DecodeError_class = NULL;
8054 static jmethodID LDKGraphSyncError_DecodeError_meth = NULL;
8055 static jclass LDKGraphSyncError_LightningError_class = NULL;
8056 static jmethodID LDKGraphSyncError_LightningError_meth = NULL;
8057 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGraphSyncError_init (JNIEnv *env, jclass clz) {
8058 LDKGraphSyncError_DecodeError_class =
8059 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$DecodeError"));
8060 CHECK(LDKGraphSyncError_DecodeError_class != NULL);
8061 LDKGraphSyncError_DecodeError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_DecodeError_class, "<init>", "(J)V");
8062 CHECK(LDKGraphSyncError_DecodeError_meth != NULL);
8063 LDKGraphSyncError_LightningError_class =
8064 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$LightningError"));
8065 CHECK(LDKGraphSyncError_LightningError_class != NULL);
8066 LDKGraphSyncError_LightningError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_LightningError_class, "<init>", "(J)V");
8067 CHECK(LDKGraphSyncError_LightningError_meth != NULL);
8069 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
8070 LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
8072 case LDKGraphSyncError_DecodeError: {
8073 LDKDecodeError decode_error_var = obj->decode_error;
8074 int64_t decode_error_ref = 0;
8075 CHECK_INNER_FIELD_ACCESS_OR_NULL(decode_error_var);
8076 decode_error_ref = tag_ptr(decode_error_var.inner, false);
8077 return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref);
8079 case LDKGraphSyncError_LightningError: {
8080 LDKLightningError lightning_error_var = obj->lightning_error;
8081 int64_t lightning_error_ref = 0;
8082 CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var);
8083 lightning_error_ref = tag_ptr(lightning_error_var.inner, false);
8084 return (*env)->NewObject(env, LDKGraphSyncError_LightningError_class, LDKGraphSyncError_LightningError_meth, lightning_error_ref);
8089 static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
8090 CHECK(owner->result_ok);
8091 return *owner->contents.result;
8093 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8094 LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
8095 int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv);
8099 static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
8100 CHECK(!owner->result_ok);
8101 return GraphSyncError_clone(&*owner->contents.err);
8103 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8104 LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
8105 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
8106 *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv);
8107 int64_t ret_ref = tag_ptr(ret_copy, true);
8111 static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
8112 CHECK(owner->result_ok);
8113 return NetAddress_clone(&*owner->contents.result);
8115 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8116 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
8117 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
8118 *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
8119 int64_t ret_ref = tag_ptr(ret_copy, true);
8123 static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
8124 CHECK(!owner->result_ok);
8125 return DecodeError_clone(&*owner->contents.err);
8127 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8128 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
8129 LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
8130 int64_t ret_ref = 0;
8131 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8132 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8136 static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
8137 LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
8138 for (size_t i = 0; i < ret.datalen; i++) {
8139 ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
8143 static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
8144 LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
8145 for (size_t i = 0; i < ret.datalen; i++) {
8146 ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
8150 static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
8151 LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
8152 for (size_t i = 0; i < ret.datalen; i++) {
8153 ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
8157 static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
8158 LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
8159 for (size_t i = 0; i < ret.datalen; i++) {
8160 ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
8164 static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
8165 CHECK(owner->result_ok);
8166 return AcceptChannel_clone(&*owner->contents.result);
8168 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8169 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
8170 LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv);
8171 int64_t ret_ref = 0;
8172 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8173 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8177 static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
8178 CHECK(!owner->result_ok);
8179 return DecodeError_clone(&*owner->contents.err);
8181 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8182 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
8183 LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
8184 int64_t ret_ref = 0;
8185 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8186 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8190 static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
8191 CHECK(owner->result_ok);
8192 return AnnouncementSignatures_clone(&*owner->contents.result);
8194 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8195 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
8196 LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
8197 int64_t ret_ref = 0;
8198 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8199 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8203 static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
8204 CHECK(!owner->result_ok);
8205 return DecodeError_clone(&*owner->contents.err);
8207 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8208 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
8209 LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
8210 int64_t ret_ref = 0;
8211 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8212 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8216 static inline struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
8217 CHECK(owner->result_ok);
8218 return ChannelReestablish_clone(&*owner->contents.result);
8220 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8221 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
8222 LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv);
8223 int64_t ret_ref = 0;
8224 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8225 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8229 static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
8230 CHECK(!owner->result_ok);
8231 return DecodeError_clone(&*owner->contents.err);
8233 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8234 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
8235 LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
8236 int64_t ret_ref = 0;
8237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8242 static inline struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
8243 CHECK(owner->result_ok);
8244 return ClosingSigned_clone(&*owner->contents.result);
8246 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8247 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
8248 LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv);
8249 int64_t ret_ref = 0;
8250 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8251 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8255 static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
8256 CHECK(!owner->result_ok);
8257 return DecodeError_clone(&*owner->contents.err);
8259 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8260 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
8261 LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
8262 int64_t ret_ref = 0;
8263 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8264 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8268 static inline struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
8269 CHECK(owner->result_ok);
8270 return ClosingSignedFeeRange_clone(&*owner->contents.result);
8272 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8273 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
8274 LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv);
8275 int64_t ret_ref = 0;
8276 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8277 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8281 static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
8282 CHECK(!owner->result_ok);
8283 return DecodeError_clone(&*owner->contents.err);
8285 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8286 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
8287 LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
8288 int64_t ret_ref = 0;
8289 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8290 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8294 static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
8295 CHECK(owner->result_ok);
8296 return CommitmentSigned_clone(&*owner->contents.result);
8298 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8299 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
8300 LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv);
8301 int64_t ret_ref = 0;
8302 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8303 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8307 static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
8308 CHECK(!owner->result_ok);
8309 return DecodeError_clone(&*owner->contents.err);
8311 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8312 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
8313 LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
8314 int64_t ret_ref = 0;
8315 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8316 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8320 static inline struct LDKFundingCreated CResult_FundingCreatedDecodeErrorZ_get_ok(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
8321 CHECK(owner->result_ok);
8322 return FundingCreated_clone(&*owner->contents.result);
8324 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8325 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
8326 LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv);
8327 int64_t ret_ref = 0;
8328 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8329 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8333 static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
8334 CHECK(!owner->result_ok);
8335 return DecodeError_clone(&*owner->contents.err);
8337 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8338 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
8339 LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
8340 int64_t ret_ref = 0;
8341 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8342 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8346 static inline struct LDKFundingSigned CResult_FundingSignedDecodeErrorZ_get_ok(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
8347 CHECK(owner->result_ok);
8348 return FundingSigned_clone(&*owner->contents.result);
8350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8351 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
8352 LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv);
8353 int64_t ret_ref = 0;
8354 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8355 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8359 static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
8360 CHECK(!owner->result_ok);
8361 return DecodeError_clone(&*owner->contents.err);
8363 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8364 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
8365 LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
8366 int64_t ret_ref = 0;
8367 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8368 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8372 static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
8373 CHECK(owner->result_ok);
8374 return ChannelReady_clone(&*owner->contents.result);
8376 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8377 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
8378 LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv);
8379 int64_t ret_ref = 0;
8380 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8381 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8385 static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
8386 CHECK(!owner->result_ok);
8387 return DecodeError_clone(&*owner->contents.err);
8389 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8390 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
8391 LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
8392 int64_t ret_ref = 0;
8393 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8394 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8398 static inline struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
8399 CHECK(owner->result_ok);
8400 return Init_clone(&*owner->contents.result);
8402 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8403 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
8404 LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv);
8405 int64_t ret_ref = 0;
8406 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8407 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8411 static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
8412 CHECK(!owner->result_ok);
8413 return DecodeError_clone(&*owner->contents.err);
8415 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8416 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
8417 LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv);
8418 int64_t ret_ref = 0;
8419 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8420 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8424 static inline struct LDKOpenChannel CResult_OpenChannelDecodeErrorZ_get_ok(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
8425 CHECK(owner->result_ok);
8426 return OpenChannel_clone(&*owner->contents.result);
8428 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8429 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
8430 LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_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 struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
8438 CHECK(!owner->result_ok);
8439 return DecodeError_clone(&*owner->contents.err);
8441 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8442 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
8443 LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
8444 int64_t ret_ref = 0;
8445 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8446 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8450 static inline struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
8451 CHECK(owner->result_ok);
8452 return RevokeAndACK_clone(&*owner->contents.result);
8454 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8455 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
8456 LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_get_ok(owner_conv);
8457 int64_t ret_ref = 0;
8458 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8459 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8463 static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
8464 CHECK(!owner->result_ok);
8465 return DecodeError_clone(&*owner->contents.err);
8467 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8468 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
8469 LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
8470 int64_t ret_ref = 0;
8471 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8472 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8476 static inline struct LDKShutdown CResult_ShutdownDecodeErrorZ_get_ok(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
8477 CHECK(owner->result_ok);
8478 return Shutdown_clone(&*owner->contents.result);
8480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8481 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
8482 LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv);
8483 int64_t ret_ref = 0;
8484 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8485 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8489 static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
8490 CHECK(!owner->result_ok);
8491 return DecodeError_clone(&*owner->contents.err);
8493 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8494 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
8495 LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
8496 int64_t ret_ref = 0;
8497 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8498 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8502 static inline struct LDKUpdateFailHTLC CResult_UpdateFailHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
8503 CHECK(owner->result_ok);
8504 return UpdateFailHTLC_clone(&*owner->contents.result);
8506 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8507 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
8508 LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv);
8509 int64_t ret_ref = 0;
8510 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8511 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8515 static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
8516 CHECK(!owner->result_ok);
8517 return DecodeError_clone(&*owner->contents.err);
8519 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8520 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
8521 LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
8522 int64_t ret_ref = 0;
8523 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8524 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8528 static inline struct LDKUpdateFailMalformedHTLC CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
8529 CHECK(owner->result_ok);
8530 return UpdateFailMalformedHTLC_clone(&*owner->contents.result);
8532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8533 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
8534 LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv);
8535 int64_t ret_ref = 0;
8536 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8537 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8541 static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
8542 CHECK(!owner->result_ok);
8543 return DecodeError_clone(&*owner->contents.err);
8545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8546 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
8547 LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
8548 int64_t ret_ref = 0;
8549 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8550 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8554 static inline struct LDKUpdateFee CResult_UpdateFeeDecodeErrorZ_get_ok(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
8555 CHECK(owner->result_ok);
8556 return UpdateFee_clone(&*owner->contents.result);
8558 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8559 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
8560 LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv);
8561 int64_t ret_ref = 0;
8562 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8563 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8567 static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
8568 CHECK(!owner->result_ok);
8569 return DecodeError_clone(&*owner->contents.err);
8571 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8572 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
8573 LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
8574 int64_t ret_ref = 0;
8575 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8576 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8580 static inline struct LDKUpdateFulfillHTLC CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
8581 CHECK(owner->result_ok);
8582 return UpdateFulfillHTLC_clone(&*owner->contents.result);
8584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8585 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
8586 LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv);
8587 int64_t ret_ref = 0;
8588 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8589 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8593 static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
8594 CHECK(!owner->result_ok);
8595 return DecodeError_clone(&*owner->contents.err);
8597 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8598 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
8599 LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
8600 int64_t ret_ref = 0;
8601 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8602 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8606 static inline struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
8607 CHECK(owner->result_ok);
8608 return UpdateAddHTLC_clone(&*owner->contents.result);
8610 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8611 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
8612 LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner_conv);
8613 int64_t ret_ref = 0;
8614 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8615 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8619 static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
8620 CHECK(!owner->result_ok);
8621 return DecodeError_clone(&*owner->contents.err);
8623 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8624 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
8625 LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
8626 int64_t ret_ref = 0;
8627 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8628 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8632 static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
8633 CHECK(owner->result_ok);
8634 return Ping_clone(&*owner->contents.result);
8636 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8637 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
8638 LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv);
8639 int64_t ret_ref = 0;
8640 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8641 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8645 static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
8646 CHECK(!owner->result_ok);
8647 return DecodeError_clone(&*owner->contents.err);
8649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8650 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
8651 LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv);
8652 int64_t ret_ref = 0;
8653 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8654 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8658 static inline struct LDKPong CResult_PongDecodeErrorZ_get_ok(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
8659 CHECK(owner->result_ok);
8660 return Pong_clone(&*owner->contents.result);
8662 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8663 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
8664 LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv);
8665 int64_t ret_ref = 0;
8666 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8667 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8671 static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
8672 CHECK(!owner->result_ok);
8673 return DecodeError_clone(&*owner->contents.err);
8675 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8676 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
8677 LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv);
8678 int64_t ret_ref = 0;
8679 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8680 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8684 static inline struct LDKUnsignedChannelAnnouncement CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
8685 CHECK(owner->result_ok);
8686 return UnsignedChannelAnnouncement_clone(&*owner->contents.result);
8688 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8689 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
8690 LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
8691 int64_t ret_ref = 0;
8692 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8693 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8697 static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
8698 CHECK(!owner->result_ok);
8699 return DecodeError_clone(&*owner->contents.err);
8701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8702 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
8703 LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
8704 int64_t ret_ref = 0;
8705 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8706 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8710 static inline struct LDKChannelAnnouncement CResult_ChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
8711 CHECK(owner->result_ok);
8712 return ChannelAnnouncement_clone(&*owner->contents.result);
8714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8715 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
8716 LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
8717 int64_t ret_ref = 0;
8718 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8719 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8723 static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
8724 CHECK(!owner->result_ok);
8725 return DecodeError_clone(&*owner->contents.err);
8727 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8728 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
8729 LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
8730 int64_t ret_ref = 0;
8731 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8732 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8736 static inline struct LDKUnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
8737 CHECK(owner->result_ok);
8738 return UnsignedChannelUpdate_clone(&*owner->contents.result);
8740 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8741 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
8742 LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv);
8743 int64_t ret_ref = 0;
8744 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8745 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8749 static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
8750 CHECK(!owner->result_ok);
8751 return DecodeError_clone(&*owner->contents.err);
8753 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8754 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
8755 LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
8756 int64_t ret_ref = 0;
8757 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8758 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8762 static inline struct LDKChannelUpdate CResult_ChannelUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
8763 CHECK(owner->result_ok);
8764 return ChannelUpdate_clone(&*owner->contents.result);
8766 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8767 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
8768 LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_get_ok(owner_conv);
8769 int64_t ret_ref = 0;
8770 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8771 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8775 static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
8776 CHECK(!owner->result_ok);
8777 return DecodeError_clone(&*owner->contents.err);
8779 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8780 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
8781 LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
8782 int64_t ret_ref = 0;
8783 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8784 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8788 static inline struct LDKErrorMessage CResult_ErrorMessageDecodeErrorZ_get_ok(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
8789 CHECK(owner->result_ok);
8790 return ErrorMessage_clone(&*owner->contents.result);
8792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8793 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
8794 LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(owner_conv);
8795 int64_t ret_ref = 0;
8796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8801 static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
8802 CHECK(!owner->result_ok);
8803 return DecodeError_clone(&*owner->contents.err);
8805 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8806 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
8807 LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
8808 int64_t ret_ref = 0;
8809 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8810 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8814 static inline struct LDKWarningMessage CResult_WarningMessageDecodeErrorZ_get_ok(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
8815 CHECK(owner->result_ok);
8816 return WarningMessage_clone(&*owner->contents.result);
8818 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8819 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
8820 LDKWarningMessage ret_var = CResult_WarningMessageDecodeErrorZ_get_ok(owner_conv);
8821 int64_t ret_ref = 0;
8822 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8823 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8827 static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
8828 CHECK(!owner->result_ok);
8829 return DecodeError_clone(&*owner->contents.err);
8831 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8832 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
8833 LDKDecodeError ret_var = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
8834 int64_t ret_ref = 0;
8835 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8836 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8840 static inline struct LDKUnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
8841 CHECK(owner->result_ok);
8842 return UnsignedNodeAnnouncement_clone(&*owner->contents.result);
8844 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8845 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
8846 LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
8847 int64_t ret_ref = 0;
8848 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8849 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8853 static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
8854 CHECK(!owner->result_ok);
8855 return DecodeError_clone(&*owner->contents.err);
8857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8858 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
8859 LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
8860 int64_t ret_ref = 0;
8861 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8862 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8866 static inline struct LDKNodeAnnouncement CResult_NodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
8867 CHECK(owner->result_ok);
8868 return NodeAnnouncement_clone(&*owner->contents.result);
8870 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8871 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
8872 LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
8873 int64_t ret_ref = 0;
8874 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8875 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8879 static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
8880 CHECK(!owner->result_ok);
8881 return DecodeError_clone(&*owner->contents.err);
8883 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8884 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
8885 LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
8886 int64_t ret_ref = 0;
8887 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8888 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8892 static inline struct LDKQueryShortChannelIds CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
8893 CHECK(owner->result_ok);
8894 return QueryShortChannelIds_clone(&*owner->contents.result);
8896 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8897 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
8898 LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv);
8899 int64_t ret_ref = 0;
8900 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8901 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8905 static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
8906 CHECK(!owner->result_ok);
8907 return DecodeError_clone(&*owner->contents.err);
8909 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8910 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
8911 LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
8912 int64_t ret_ref = 0;
8913 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8914 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8918 static inline struct LDKReplyShortChannelIdsEnd CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
8919 CHECK(owner->result_ok);
8920 return ReplyShortChannelIdsEnd_clone(&*owner->contents.result);
8922 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8923 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
8924 LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv);
8925 int64_t ret_ref = 0;
8926 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8927 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8931 static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
8932 CHECK(!owner->result_ok);
8933 return DecodeError_clone(&*owner->contents.err);
8935 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8936 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
8937 LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
8938 int64_t ret_ref = 0;
8939 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8940 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8944 static inline struct LDKQueryChannelRange CResult_QueryChannelRangeDecodeErrorZ_get_ok(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
8945 CHECK(owner->result_ok);
8946 return QueryChannelRange_clone(&*owner->contents.result);
8948 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8949 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
8950 LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv);
8951 int64_t ret_ref = 0;
8952 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8953 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8957 static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
8958 CHECK(!owner->result_ok);
8959 return DecodeError_clone(&*owner->contents.err);
8961 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8962 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
8963 LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
8964 int64_t ret_ref = 0;
8965 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8966 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8970 static inline struct LDKReplyChannelRange CResult_ReplyChannelRangeDecodeErrorZ_get_ok(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
8971 CHECK(owner->result_ok);
8972 return ReplyChannelRange_clone(&*owner->contents.result);
8974 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8975 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
8976 LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner_conv);
8977 int64_t ret_ref = 0;
8978 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8979 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8983 static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
8984 CHECK(!owner->result_ok);
8985 return DecodeError_clone(&*owner->contents.err);
8987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8988 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
8989 LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
8990 int64_t ret_ref = 0;
8991 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8992 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8996 static inline struct LDKGossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_get_ok(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
8997 CHECK(owner->result_ok);
8998 return GossipTimestampFilter_clone(&*owner->contents.result);
9000 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9001 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
9002 LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv);
9003 int64_t ret_ref = 0;
9004 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9005 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9009 static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
9010 CHECK(!owner->result_ok);
9011 return DecodeError_clone(&*owner->contents.err);
9013 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9014 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
9015 LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
9016 int64_t ret_ref = 0;
9017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9018 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9022 static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) {
9023 LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen };
9024 for (size_t i = 0; i < ret.datalen; i++) {
9025 ret.data[i] = PhantomRouteHints_clone(&orig->data[i]);
9029 static jclass LDKSignOrCreationError_SignError_class = NULL;
9030 static jmethodID LDKSignOrCreationError_SignError_meth = NULL;
9031 static jclass LDKSignOrCreationError_CreationError_class = NULL;
9032 static jmethodID LDKSignOrCreationError_CreationError_meth = NULL;
9033 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSignOrCreationError_init (JNIEnv *env, jclass clz) {
9034 LDKSignOrCreationError_SignError_class =
9035 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$SignError"));
9036 CHECK(LDKSignOrCreationError_SignError_class != NULL);
9037 LDKSignOrCreationError_SignError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_SignError_class, "<init>", "()V");
9038 CHECK(LDKSignOrCreationError_SignError_meth != NULL);
9039 LDKSignOrCreationError_CreationError_class =
9040 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$CreationError"));
9041 CHECK(LDKSignOrCreationError_CreationError_class != NULL);
9042 LDKSignOrCreationError_CreationError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_CreationError_class, "<init>", "(Lorg/ldk/enums/CreationError;)V");
9043 CHECK(LDKSignOrCreationError_CreationError_meth != NULL);
9045 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9046 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
9048 case LDKSignOrCreationError_SignError: {
9049 return (*env)->NewObject(env, LDKSignOrCreationError_SignError_class, LDKSignOrCreationError_SignError_meth);
9051 case LDKSignOrCreationError_CreationError: {
9052 jclass creation_error_conv = LDKCreationError_to_java(env, obj->creation_error);
9053 return (*env)->NewObject(env, LDKSignOrCreationError_CreationError_class, LDKSignOrCreationError_CreationError_meth, creation_error_conv);
9058 static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
9059 CHECK(owner->result_ok);
9060 return Invoice_clone(&*owner->contents.result);
9062 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9063 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
9064 LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_get_ok(owner_conv);
9065 int64_t ret_ref = 0;
9066 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9067 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9071 static inline struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
9072 CHECK(!owner->result_ok);
9073 return SignOrCreationError_clone(&*owner->contents.err);
9075 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9076 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
9077 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
9078 *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv);
9079 int64_t ret_ref = tag_ptr(ret_copy, true);
9083 typedef struct LDKFilter_JCalls {
9084 atomic_size_t refcnt;
9087 jmethodID register_tx_meth;
9088 jmethodID register_output_meth;
9090 static void LDKFilter_JCalls_free(void* this_arg) {
9091 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
9092 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9094 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9095 if (get_jenv_res == JNI_EDETACHED) {
9096 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9098 DO_ASSERT(get_jenv_res == JNI_OK);
9100 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
9101 if (get_jenv_res == JNI_EDETACHED) {
9102 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9107 void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
9108 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
9110 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9111 if (get_jenv_res == JNI_EDETACHED) {
9112 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9114 DO_ASSERT(get_jenv_res == JNI_OK);
9116 int8_tArray txid_arr = (*env)->NewByteArray(env, 32);
9117 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
9118 LDKu8slice script_pubkey_var = script_pubkey;
9119 int8_tArray script_pubkey_arr = (*env)->NewByteArray(env, script_pubkey_var.datalen);
9120 (*env)->SetByteArrayRegion(env, script_pubkey_arr, 0, script_pubkey_var.datalen, script_pubkey_var.data);
9121 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9123 (*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr);
9124 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9125 (*env)->ExceptionDescribe(env);
9126 (*env)->FatalError(env, "A call to register_tx in LDKFilter from rust threw an exception.");
9128 if (get_jenv_res == JNI_EDETACHED) {
9129 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9132 LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
9133 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
9135 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9136 if (get_jenv_res == JNI_EDETACHED) {
9137 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9139 DO_ASSERT(get_jenv_res == JNI_OK);
9141 LDKWatchedOutput output_var = output;
9142 int64_t output_ref = 0;
9143 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
9144 output_ref = tag_ptr(output_var.inner, output_var.is_owned);
9145 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9147 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->register_output_meth, output_ref);
9148 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9149 (*env)->ExceptionDescribe(env);
9150 (*env)->FatalError(env, "A call to register_output in LDKFilter from rust threw an exception.");
9152 void* ret_ptr = untag_ptr(ret);
9153 CHECK_ACCESS(ret_ptr);
9154 LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
9155 FREE(untag_ptr(ret));
9156 if (get_jenv_res == JNI_EDETACHED) {
9157 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9161 static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
9162 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
9163 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9165 static inline LDKFilter LDKFilter_init (JNIEnv *env, jclass clz, jobject o) {
9166 jclass c = (*env)->GetObjectClass(env, o);
9168 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
9169 atomic_init(&calls->refcnt, 1);
9170 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
9171 calls->o = (*env)->NewWeakGlobalRef(env, o);
9172 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([B[B)V");
9173 CHECK(calls->register_tx_meth != NULL);
9174 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(J)J");
9175 CHECK(calls->register_output_meth != NULL);
9178 .this_arg = (void*) calls,
9179 .register_tx = register_tx_LDKFilter_jcall,
9180 .register_output = register_output_LDKFilter_jcall,
9181 .free = LDKFilter_JCalls_free,
9185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new(JNIEnv *env, jclass clz, jobject o) {
9186 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
9187 *res_ptr = LDKFilter_init(env, clz, o);
9188 return tag_ptr(res_ptr, true);
9190 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) {
9191 void* this_arg_ptr = untag_ptr(this_arg);
9192 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9193 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
9194 unsigned char txid_arr[32];
9195 CHECK((*env)->GetArrayLength(env, txid) == 32);
9196 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
9197 unsigned char (*txid_ref)[32] = &txid_arr;
9198 LDKu8slice script_pubkey_ref;
9199 script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
9200 script_pubkey_ref.data = (*env)->GetByteArrayElements (env, script_pubkey, NULL);
9201 (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
9202 (*env)->ReleaseByteArrayElements(env, script_pubkey, (int8_t*)script_pubkey_ref.data, 0);
9205 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEnv *env, jclass clz, int64_t this_arg, int64_t output) {
9206 void* this_arg_ptr = untag_ptr(this_arg);
9207 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9208 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
9209 LDKWatchedOutput output_conv;
9210 output_conv.inner = untag_ptr(output);
9211 output_conv.is_owned = ptr_is_owned(output);
9212 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
9213 output_conv = WatchedOutput_clone(&output_conv);
9214 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
9215 *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
9216 int64_t ret_ref = tag_ptr(ret_copy, true);
9220 static jclass LDKCOption_FilterZ_Some_class = NULL;
9221 static jmethodID LDKCOption_FilterZ_Some_meth = NULL;
9222 static jclass LDKCOption_FilterZ_None_class = NULL;
9223 static jmethodID LDKCOption_FilterZ_None_meth = NULL;
9224 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1FilterZ_init (JNIEnv *env, jclass clz) {
9225 LDKCOption_FilterZ_Some_class =
9226 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$Some"));
9227 CHECK(LDKCOption_FilterZ_Some_class != NULL);
9228 LDKCOption_FilterZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_Some_class, "<init>", "(J)V");
9229 CHECK(LDKCOption_FilterZ_Some_meth != NULL);
9230 LDKCOption_FilterZ_None_class =
9231 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$None"));
9232 CHECK(LDKCOption_FilterZ_None_class != NULL);
9233 LDKCOption_FilterZ_None_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_None_class, "<init>", "()V");
9234 CHECK(LDKCOption_FilterZ_None_meth != NULL);
9236 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1FilterZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9237 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
9239 case LDKCOption_FilterZ_Some: {
9240 LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
9241 *some_ret = obj->some;
9242 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
9243 if ((*some_ret).free == LDKFilter_JCalls_free) {
9244 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9245 LDKFilter_JCalls_cloned(&(*some_ret));
9247 return (*env)->NewObject(env, LDKCOption_FilterZ_Some_class, LDKCOption_FilterZ_Some_meth, tag_ptr(some_ret, true));
9249 case LDKCOption_FilterZ_None: {
9250 return (*env)->NewObject(env, LDKCOption_FilterZ_None_class, LDKCOption_FilterZ_None_meth);
9255 static inline struct LDKLockedChannelMonitor *CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
9256 CHECK(owner->result_ok);
9257 return &*owner->contents.result;
9259 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9260 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
9261 LDKLockedChannelMonitor ret_var = *CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv);
9262 int64_t ret_ref = 0;
9263 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9264 ret_ref = tag_ptr(ret_var.inner, false);
9268 static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
9269 CHECK(!owner->result_ok);
9270 return *owner->contents.err;
9272 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9273 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
9274 CResult_LockedChannelMonitorNoneZ_get_err(owner_conv);
9277 static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) {
9278 LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen };
9279 for (size_t i = 0; i < ret.datalen; i++) {
9280 ret.data[i] = OutPoint_clone(&orig->data[i]);
9284 typedef struct LDKMessageSendEventsProvider_JCalls {
9285 atomic_size_t refcnt;
9288 jmethodID get_and_clear_pending_msg_events_meth;
9289 } LDKMessageSendEventsProvider_JCalls;
9290 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
9291 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
9292 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9294 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9295 if (get_jenv_res == JNI_EDETACHED) {
9296 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9298 DO_ASSERT(get_jenv_res == JNI_OK);
9300 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
9301 if (get_jenv_res == JNI_EDETACHED) {
9302 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9307 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
9308 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
9310 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9311 if (get_jenv_res == JNI_EDETACHED) {
9312 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9314 DO_ASSERT(get_jenv_res == JNI_OK);
9316 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9318 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth);
9319 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9320 (*env)->ExceptionDescribe(env);
9321 (*env)->FatalError(env, "A call to get_and_clear_pending_msg_events in LDKMessageSendEventsProvider from rust threw an exception.");
9323 LDKCVec_MessageSendEventZ ret_constr;
9324 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
9325 if (ret_constr.datalen > 0)
9326 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
9328 ret_constr.data = NULL;
9329 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
9330 for (size_t s = 0; s < ret_constr.datalen; s++) {
9331 int64_t ret_conv_18 = ret_vals[s];
9332 void* ret_conv_18_ptr = untag_ptr(ret_conv_18);
9333 CHECK_ACCESS(ret_conv_18_ptr);
9334 LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
9335 FREE(untag_ptr(ret_conv_18));
9336 ret_constr.data[s] = ret_conv_18_conv;
9338 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
9339 if (get_jenv_res == JNI_EDETACHED) {
9340 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9344 static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
9345 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
9346 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9348 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
9349 jclass c = (*env)->GetObjectClass(env, o);
9351 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
9352 atomic_init(&calls->refcnt, 1);
9353 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
9354 calls->o = (*env)->NewWeakGlobalRef(env, o);
9355 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()[J");
9356 CHECK(calls->get_and_clear_pending_msg_events_meth != NULL);
9358 LDKMessageSendEventsProvider ret = {
9359 .this_arg = (void*) calls,
9360 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
9361 .free = LDKMessageSendEventsProvider_JCalls_free,
9365 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new(JNIEnv *env, jclass clz, jobject o) {
9366 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
9367 *res_ptr = LDKMessageSendEventsProvider_init(env, clz, o);
9368 return tag_ptr(res_ptr, true);
9370 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
9371 void* this_arg_ptr = untag_ptr(this_arg);
9372 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9373 LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
9374 LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
9375 int64_tArray ret_arr = NULL;
9376 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
9377 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
9378 for (size_t s = 0; s < ret_var.datalen; s++) {
9379 LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
9380 *ret_conv_18_copy = ret_var.data[s];
9381 int64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true);
9382 ret_arr_ptr[s] = ret_conv_18_ref;
9384 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
9389 typedef struct LDKEventHandler_JCalls {
9390 atomic_size_t refcnt;
9393 jmethodID handle_event_meth;
9394 } LDKEventHandler_JCalls;
9395 static void LDKEventHandler_JCalls_free(void* this_arg) {
9396 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
9397 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9399 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9400 if (get_jenv_res == JNI_EDETACHED) {
9401 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9403 DO_ASSERT(get_jenv_res == JNI_OK);
9405 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
9406 if (get_jenv_res == JNI_EDETACHED) {
9407 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9412 void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * event) {
9413 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
9415 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9416 if (get_jenv_res == JNI_EDETACHED) {
9417 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9419 DO_ASSERT(get_jenv_res == JNI_OK);
9421 LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion");
9422 *ret_event = Event_clone(event);
9423 int64_t ref_event = tag_ptr(ret_event, true);
9424 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9426 (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, ref_event);
9427 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9428 (*env)->ExceptionDescribe(env);
9429 (*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception.");
9431 if (get_jenv_res == JNI_EDETACHED) {
9432 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9435 static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
9436 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
9437 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9439 static inline LDKEventHandler LDKEventHandler_init (JNIEnv *env, jclass clz, jobject o) {
9440 jclass c = (*env)->GetObjectClass(env, o);
9442 LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
9443 atomic_init(&calls->refcnt, 1);
9444 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
9445 calls->o = (*env)->NewWeakGlobalRef(env, o);
9446 calls->handle_event_meth = (*env)->GetMethodID(env, c, "handle_event", "(J)V");
9447 CHECK(calls->handle_event_meth != NULL);
9449 LDKEventHandler ret = {
9450 .this_arg = (void*) calls,
9451 .handle_event = handle_event_LDKEventHandler_jcall,
9452 .free = LDKEventHandler_JCalls_free,
9456 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventHandler_1new(JNIEnv *env, jclass clz, jobject o) {
9457 LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
9458 *res_ptr = LDKEventHandler_init(env, clz, o);
9459 return tag_ptr(res_ptr, true);
9461 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) {
9462 void* this_arg_ptr = untag_ptr(this_arg);
9463 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9464 LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
9465 LDKEvent* event_conv = (LDKEvent*)untag_ptr(event);
9466 (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
9469 typedef struct LDKEventsProvider_JCalls {
9470 atomic_size_t refcnt;
9473 jmethodID process_pending_events_meth;
9474 } LDKEventsProvider_JCalls;
9475 static void LDKEventsProvider_JCalls_free(void* this_arg) {
9476 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
9477 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9479 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9480 if (get_jenv_res == JNI_EDETACHED) {
9481 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9483 DO_ASSERT(get_jenv_res == JNI_OK);
9485 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
9486 if (get_jenv_res == JNI_EDETACHED) {
9487 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9492 void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
9493 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
9495 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9496 if (get_jenv_res == JNI_EDETACHED) {
9497 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9499 DO_ASSERT(get_jenv_res == JNI_OK);
9501 LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
9502 *handler_ret = handler;
9503 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9505 (*env)->CallVoidMethod(env, obj, j_calls->process_pending_events_meth, tag_ptr(handler_ret, true));
9506 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9507 (*env)->ExceptionDescribe(env);
9508 (*env)->FatalError(env, "A call to process_pending_events in LDKEventsProvider from rust threw an exception.");
9510 if (get_jenv_res == JNI_EDETACHED) {
9511 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9514 static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
9515 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
9516 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9518 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
9519 jclass c = (*env)->GetObjectClass(env, o);
9521 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
9522 atomic_init(&calls->refcnt, 1);
9523 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
9524 calls->o = (*env)->NewWeakGlobalRef(env, o);
9525 calls->process_pending_events_meth = (*env)->GetMethodID(env, c, "process_pending_events", "(J)V");
9526 CHECK(calls->process_pending_events_meth != NULL);
9528 LDKEventsProvider ret = {
9529 .this_arg = (void*) calls,
9530 .process_pending_events = process_pending_events_LDKEventsProvider_jcall,
9531 .free = LDKEventsProvider_JCalls_free,
9535 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new(JNIEnv *env, jclass clz, jobject o) {
9536 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
9537 *res_ptr = LDKEventsProvider_init(env, clz, o);
9538 return tag_ptr(res_ptr, true);
9540 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg, int64_t handler) {
9541 void* this_arg_ptr = untag_ptr(this_arg);
9542 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9543 LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
9544 void* handler_ptr = untag_ptr(handler);
9545 CHECK_ACCESS(handler_ptr);
9546 LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
9547 if (handler_conv.free == LDKEventHandler_JCalls_free) {
9548 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9549 LDKEventHandler_JCalls_cloned(&handler_conv);
9551 (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
9554 typedef struct LDKScore_JCalls {
9555 atomic_size_t refcnt;
9558 jmethodID channel_penalty_msat_meth;
9559 jmethodID payment_path_failed_meth;
9560 jmethodID payment_path_successful_meth;
9561 jmethodID probe_failed_meth;
9562 jmethodID probe_successful_meth;
9563 jmethodID write_meth;
9565 static void LDKScore_JCalls_free(void* this_arg) {
9566 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
9567 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9569 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9570 if (get_jenv_res == JNI_EDETACHED) {
9571 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9573 DO_ASSERT(get_jenv_res == JNI_OK);
9575 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
9576 if (get_jenv_res == JNI_EDETACHED) {
9577 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9582 uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) {
9583 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
9585 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9586 if (get_jenv_res == JNI_EDETACHED) {
9587 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9589 DO_ASSERT(get_jenv_res == JNI_OK);
9591 int64_t short_channel_id_conv = short_channel_id;
9592 LDKNodeId source_var = *source;
9593 int64_t source_ref = 0;
9594 source_var = NodeId_clone(&source_var);
9595 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var);
9596 source_ref = tag_ptr(source_var.inner, source_var.is_owned);
9597 LDKNodeId target_var = *target;
9598 int64_t target_ref = 0;
9599 target_var = NodeId_clone(&target_var);
9600 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var);
9601 target_ref = tag_ptr(target_var.inner, target_var.is_owned);
9602 LDKChannelUsage usage_var = usage;
9603 int64_t usage_ref = 0;
9604 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var);
9605 usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned);
9606 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9608 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id_conv, source_ref, target_ref, usage_ref);
9609 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9610 (*env)->ExceptionDescribe(env);
9611 (*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception.");
9613 if (get_jenv_res == JNI_EDETACHED) {
9614 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9618 void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
9619 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
9621 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9622 if (get_jenv_res == JNI_EDETACHED) {
9623 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9625 DO_ASSERT(get_jenv_res == JNI_OK);
9627 LDKCVec_RouteHopZ path_var = path;
9628 int64_tArray path_arr = NULL;
9629 path_arr = (*env)->NewLongArray(env, path_var.datalen);
9630 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
9631 for (size_t k = 0; k < path_var.datalen; k++) {
9632 LDKRouteHop path_conv_10_var = path_var.data[k];
9633 int64_t path_conv_10_ref = 0;
9634 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
9635 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
9636 path_arr_ptr[k] = path_conv_10_ref;
9638 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
9639 FREE(path_var.data);
9640 int64_t short_channel_id_conv = short_channel_id;
9641 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9643 (*env)->CallVoidMethod(env, obj, j_calls->payment_path_failed_meth, path_arr, short_channel_id_conv);
9644 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9645 (*env)->ExceptionDescribe(env);
9646 (*env)->FatalError(env, "A call to payment_path_failed in LDKScore from rust threw an exception.");
9648 if (get_jenv_res == JNI_EDETACHED) {
9649 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9652 void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
9653 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
9655 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9656 if (get_jenv_res == JNI_EDETACHED) {
9657 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9659 DO_ASSERT(get_jenv_res == JNI_OK);
9661 LDKCVec_RouteHopZ path_var = path;
9662 int64_tArray path_arr = NULL;
9663 path_arr = (*env)->NewLongArray(env, path_var.datalen);
9664 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
9665 for (size_t k = 0; k < path_var.datalen; k++) {
9666 LDKRouteHop path_conv_10_var = path_var.data[k];
9667 int64_t path_conv_10_ref = 0;
9668 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
9669 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
9670 path_arr_ptr[k] = path_conv_10_ref;
9672 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
9673 FREE(path_var.data);
9674 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9676 (*env)->CallVoidMethod(env, obj, j_calls->payment_path_successful_meth, path_arr);
9677 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9678 (*env)->ExceptionDescribe(env);
9679 (*env)->FatalError(env, "A call to payment_path_successful in LDKScore from rust threw an exception.");
9681 if (get_jenv_res == JNI_EDETACHED) {
9682 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9685 void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
9686 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
9688 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9689 if (get_jenv_res == JNI_EDETACHED) {
9690 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9692 DO_ASSERT(get_jenv_res == JNI_OK);
9694 LDKCVec_RouteHopZ path_var = path;
9695 int64_tArray path_arr = NULL;
9696 path_arr = (*env)->NewLongArray(env, path_var.datalen);
9697 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
9698 for (size_t k = 0; k < path_var.datalen; k++) {
9699 LDKRouteHop path_conv_10_var = path_var.data[k];
9700 int64_t path_conv_10_ref = 0;
9701 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
9702 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
9703 path_arr_ptr[k] = path_conv_10_ref;
9705 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
9706 FREE(path_var.data);
9707 int64_t short_channel_id_conv = short_channel_id;
9708 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9710 (*env)->CallVoidMethod(env, obj, j_calls->probe_failed_meth, path_arr, short_channel_id_conv);
9711 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9712 (*env)->ExceptionDescribe(env);
9713 (*env)->FatalError(env, "A call to probe_failed in LDKScore from rust threw an exception.");
9715 if (get_jenv_res == JNI_EDETACHED) {
9716 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9719 void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
9720 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
9722 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9723 if (get_jenv_res == JNI_EDETACHED) {
9724 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9726 DO_ASSERT(get_jenv_res == JNI_OK);
9728 LDKCVec_RouteHopZ path_var = path;
9729 int64_tArray path_arr = NULL;
9730 path_arr = (*env)->NewLongArray(env, path_var.datalen);
9731 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
9732 for (size_t k = 0; k < path_var.datalen; k++) {
9733 LDKRouteHop path_conv_10_var = path_var.data[k];
9734 int64_t path_conv_10_ref = 0;
9735 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
9736 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
9737 path_arr_ptr[k] = path_conv_10_ref;
9739 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
9740 FREE(path_var.data);
9741 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9743 (*env)->CallVoidMethod(env, obj, j_calls->probe_successful_meth, path_arr);
9744 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9745 (*env)->ExceptionDescribe(env);
9746 (*env)->FatalError(env, "A call to probe_successful in LDKScore from rust threw an exception.");
9748 if (get_jenv_res == JNI_EDETACHED) {
9749 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9752 LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
9753 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
9755 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9756 if (get_jenv_res == JNI_EDETACHED) {
9757 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9759 DO_ASSERT(get_jenv_res == JNI_OK);
9761 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9763 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
9764 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9765 (*env)->ExceptionDescribe(env);
9766 (*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception.");
9768 LDKCVec_u8Z ret_ref;
9769 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
9770 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
9771 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
9772 if (get_jenv_res == JNI_EDETACHED) {
9773 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9777 static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
9778 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
9779 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9781 static inline LDKScore LDKScore_init (JNIEnv *env, jclass clz, jobject o) {
9782 jclass c = (*env)->GetObjectClass(env, o);
9784 LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls");
9785 atomic_init(&calls->refcnt, 1);
9786 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
9787 calls->o = (*env)->NewWeakGlobalRef(env, o);
9788 calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJJ)J");
9789 CHECK(calls->channel_penalty_msat_meth != NULL);
9790 calls->payment_path_failed_meth = (*env)->GetMethodID(env, c, "payment_path_failed", "([JJ)V");
9791 CHECK(calls->payment_path_failed_meth != NULL);
9792 calls->payment_path_successful_meth = (*env)->GetMethodID(env, c, "payment_path_successful", "([J)V");
9793 CHECK(calls->payment_path_successful_meth != NULL);
9794 calls->probe_failed_meth = (*env)->GetMethodID(env, c, "probe_failed", "([JJ)V");
9795 CHECK(calls->probe_failed_meth != NULL);
9796 calls->probe_successful_meth = (*env)->GetMethodID(env, c, "probe_successful", "([J)V");
9797 CHECK(calls->probe_successful_meth != NULL);
9798 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
9799 CHECK(calls->write_meth != NULL);
9802 .this_arg = (void*) calls,
9803 .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
9804 .payment_path_failed = payment_path_failed_LDKScore_jcall,
9805 .payment_path_successful = payment_path_successful_LDKScore_jcall,
9806 .probe_failed = probe_failed_LDKScore_jcall,
9807 .probe_successful = probe_successful_LDKScore_jcall,
9808 .write = write_LDKScore_jcall,
9809 .free = LDKScore_JCalls_free,
9813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKScore_1new(JNIEnv *env, jclass clz, jobject o) {
9814 LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore");
9815 *res_ptr = LDKScore_init(env, clz, o);
9816 return tag_ptr(res_ptr, true);
9818 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) {
9819 void* this_arg_ptr = untag_ptr(this_arg);
9820 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9821 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
9822 LDKNodeId source_conv;
9823 source_conv.inner = untag_ptr(source);
9824 source_conv.is_owned = ptr_is_owned(source);
9825 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
9826 source_conv.is_owned = false;
9827 LDKNodeId target_conv;
9828 target_conv.inner = untag_ptr(target);
9829 target_conv.is_owned = ptr_is_owned(target);
9830 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
9831 target_conv.is_owned = false;
9832 LDKChannelUsage usage_conv;
9833 usage_conv.inner = untag_ptr(usage);
9834 usage_conv.is_owned = ptr_is_owned(usage);
9835 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv);
9836 usage_conv = ChannelUsage_clone(&usage_conv);
9837 int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv);
9841 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) {
9842 void* this_arg_ptr = untag_ptr(this_arg);
9843 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9844 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
9845 LDKCVec_RouteHopZ path_constr;
9846 path_constr.datalen = (*env)->GetArrayLength(env, path);
9847 if (path_constr.datalen > 0)
9848 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
9850 path_constr.data = NULL;
9851 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
9852 for (size_t k = 0; k < path_constr.datalen; k++) {
9853 int64_t path_conv_10 = path_vals[k];
9854 LDKRouteHop path_conv_10_conv;
9855 path_conv_10_conv.inner = untag_ptr(path_conv_10);
9856 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
9857 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
9858 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
9859 path_constr.data[k] = path_conv_10_conv;
9861 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
9862 (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
9865 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) {
9866 void* this_arg_ptr = untag_ptr(this_arg);
9867 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9868 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
9869 LDKCVec_RouteHopZ path_constr;
9870 path_constr.datalen = (*env)->GetArrayLength(env, path);
9871 if (path_constr.datalen > 0)
9872 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
9874 path_constr.data = NULL;
9875 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
9876 for (size_t k = 0; k < path_constr.datalen; k++) {
9877 int64_t path_conv_10 = path_vals[k];
9878 LDKRouteHop path_conv_10_conv;
9879 path_conv_10_conv.inner = untag_ptr(path_conv_10);
9880 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
9881 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
9882 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
9883 path_constr.data[k] = path_conv_10_conv;
9885 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
9886 (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
9889 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) {
9890 void* this_arg_ptr = untag_ptr(this_arg);
9891 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9892 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
9893 LDKCVec_RouteHopZ path_constr;
9894 path_constr.datalen = (*env)->GetArrayLength(env, path);
9895 if (path_constr.datalen > 0)
9896 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
9898 path_constr.data = NULL;
9899 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
9900 for (size_t k = 0; k < path_constr.datalen; k++) {
9901 int64_t path_conv_10 = path_vals[k];
9902 LDKRouteHop path_conv_10_conv;
9903 path_conv_10_conv.inner = untag_ptr(path_conv_10);
9904 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
9905 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
9906 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
9907 path_constr.data[k] = path_conv_10_conv;
9909 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
9910 (this_arg_conv->probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
9913 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1probe_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) {
9914 void* this_arg_ptr = untag_ptr(this_arg);
9915 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9916 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
9917 LDKCVec_RouteHopZ path_constr;
9918 path_constr.datalen = (*env)->GetArrayLength(env, path);
9919 if (path_constr.datalen > 0)
9920 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
9922 path_constr.data = NULL;
9923 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
9924 for (size_t k = 0; k < path_constr.datalen; k++) {
9925 int64_t path_conv_10 = path_vals[k];
9926 LDKRouteHop path_conv_10_conv;
9927 path_conv_10_conv.inner = untag_ptr(path_conv_10);
9928 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
9929 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
9930 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
9931 path_constr.data[k] = path_conv_10_conv;
9933 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
9934 (this_arg_conv->probe_successful)(this_arg_conv->this_arg, path_constr);
9937 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Score_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
9938 void* this_arg_ptr = untag_ptr(this_arg);
9939 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9940 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
9941 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
9942 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9943 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9944 CVec_u8Z_free(ret_var);
9948 typedef struct LDKPersister_JCalls {
9949 atomic_size_t refcnt;
9952 jmethodID persist_manager_meth;
9953 jmethodID persist_graph_meth;
9954 jmethodID persist_scorer_meth;
9955 } LDKPersister_JCalls;
9956 static void LDKPersister_JCalls_free(void* this_arg) {
9957 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
9958 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9960 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9961 if (get_jenv_res == JNI_EDETACHED) {
9962 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9964 DO_ASSERT(get_jenv_res == JNI_OK);
9966 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
9967 if (get_jenv_res == JNI_EDETACHED) {
9968 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9973 LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
9974 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
9976 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9977 if (get_jenv_res == JNI_EDETACHED) {
9978 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9980 DO_ASSERT(get_jenv_res == JNI_OK);
9982 LDKChannelManager channel_manager_var = *channel_manager;
9983 int64_t channel_manager_ref = 0;
9984 // WARNING: we may need a move here but no clone is available for LDKChannelManager
9985 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
9986 channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned);
9987 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9989 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref);
9990 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9991 (*env)->ExceptionDescribe(env);
9992 (*env)->FatalError(env, "A call to persist_manager in LDKPersister from rust threw an exception.");
9994 void* ret_ptr = untag_ptr(ret);
9995 CHECK_ACCESS(ret_ptr);
9996 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
9997 FREE(untag_ptr(ret));
9998 if (get_jenv_res == JNI_EDETACHED) {
9999 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10003 LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) {
10004 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
10006 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10007 if (get_jenv_res == JNI_EDETACHED) {
10008 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10010 DO_ASSERT(get_jenv_res == JNI_OK);
10012 LDKNetworkGraph network_graph_var = *network_graph;
10013 int64_t network_graph_ref = 0;
10014 // WARNING: we may need a move here but no clone is available for LDKNetworkGraph
10015 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var);
10016 network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned);
10017 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10018 CHECK(obj != NULL);
10019 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_graph_meth, network_graph_ref);
10020 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10021 (*env)->ExceptionDescribe(env);
10022 (*env)->FatalError(env, "A call to persist_graph in LDKPersister from rust threw an exception.");
10024 void* ret_ptr = untag_ptr(ret);
10025 CHECK_ACCESS(ret_ptr);
10026 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
10027 FREE(untag_ptr(ret));
10028 if (get_jenv_res == JNI_EDETACHED) {
10029 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10033 LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKMultiThreadedLockableScore * scorer) {
10034 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
10036 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10037 if (get_jenv_res == JNI_EDETACHED) {
10038 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10040 DO_ASSERT(get_jenv_res == JNI_OK);
10042 LDKMultiThreadedLockableScore scorer_var = *scorer;
10043 int64_t scorer_ref = 0;
10044 // WARNING: we may need a move here but no clone is available for LDKMultiThreadedLockableScore
10045 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_var);
10046 scorer_ref = tag_ptr(scorer_var.inner, scorer_var.is_owned);
10047 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10048 CHECK(obj != NULL);
10049 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_scorer_meth, scorer_ref);
10050 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10051 (*env)->ExceptionDescribe(env);
10052 (*env)->FatalError(env, "A call to persist_scorer in LDKPersister from rust threw an exception.");
10054 void* ret_ptr = untag_ptr(ret);
10055 CHECK_ACCESS(ret_ptr);
10056 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
10057 FREE(untag_ptr(ret));
10058 if (get_jenv_res == JNI_EDETACHED) {
10059 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10063 static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) {
10064 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg;
10065 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10067 static inline LDKPersister LDKPersister_init (JNIEnv *env, jclass clz, jobject o) {
10068 jclass c = (*env)->GetObjectClass(env, o);
10070 LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls");
10071 atomic_init(&calls->refcnt, 1);
10072 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
10073 calls->o = (*env)->NewWeakGlobalRef(env, o);
10074 calls->persist_manager_meth = (*env)->GetMethodID(env, c, "persist_manager", "(J)J");
10075 CHECK(calls->persist_manager_meth != NULL);
10076 calls->persist_graph_meth = (*env)->GetMethodID(env, c, "persist_graph", "(J)J");
10077 CHECK(calls->persist_graph_meth != NULL);
10078 calls->persist_scorer_meth = (*env)->GetMethodID(env, c, "persist_scorer", "(J)J");
10079 CHECK(calls->persist_scorer_meth != NULL);
10081 LDKPersister ret = {
10082 .this_arg = (void*) calls,
10083 .persist_manager = persist_manager_LDKPersister_jcall,
10084 .persist_graph = persist_graph_LDKPersister_jcall,
10085 .persist_scorer = persist_scorer_LDKPersister_jcall,
10086 .free = LDKPersister_JCalls_free,
10090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersister_1new(JNIEnv *env, jclass clz, jobject o) {
10091 LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister");
10092 *res_ptr = LDKPersister_init(env, clz, o);
10093 return tag_ptr(res_ptr, true);
10095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1manager(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_manager) {
10096 void* this_arg_ptr = untag_ptr(this_arg);
10097 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10098 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
10099 LDKChannelManager channel_manager_conv;
10100 channel_manager_conv.inner = untag_ptr(channel_manager);
10101 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
10102 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
10103 channel_manager_conv.is_owned = false;
10104 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
10105 *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv);
10106 return tag_ptr(ret_conv, true);
10109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) {
10110 void* this_arg_ptr = untag_ptr(this_arg);
10111 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10112 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
10113 LDKNetworkGraph network_graph_conv;
10114 network_graph_conv.inner = untag_ptr(network_graph);
10115 network_graph_conv.is_owned = ptr_is_owned(network_graph);
10116 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
10117 network_graph_conv.is_owned = false;
10118 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
10119 *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv);
10120 return tag_ptr(ret_conv, true);
10123 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1scorer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scorer) {
10124 void* this_arg_ptr = untag_ptr(this_arg);
10125 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10126 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
10127 LDKMultiThreadedLockableScore scorer_conv;
10128 scorer_conv.inner = untag_ptr(scorer);
10129 scorer_conv.is_owned = ptr_is_owned(scorer);
10130 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
10131 scorer_conv.is_owned = false;
10132 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
10133 *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, &scorer_conv);
10134 return tag_ptr(ret_conv, true);
10137 typedef struct LDKListen_JCalls {
10138 atomic_size_t refcnt;
10141 jmethodID filtered_block_connected_meth;
10142 jmethodID block_connected_meth;
10143 jmethodID block_disconnected_meth;
10144 } LDKListen_JCalls;
10145 static void LDKListen_JCalls_free(void* this_arg) {
10146 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
10147 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10149 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10150 if (get_jenv_res == JNI_EDETACHED) {
10151 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10153 DO_ASSERT(get_jenv_res == JNI_OK);
10155 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
10156 if (get_jenv_res == JNI_EDETACHED) {
10157 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10162 void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
10163 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
10165 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10166 if (get_jenv_res == JNI_EDETACHED) {
10167 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10169 DO_ASSERT(get_jenv_res == JNI_OK);
10171 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
10172 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
10173 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
10174 int64_tArray txdata_arr = NULL;
10175 txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
10176 int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL);
10177 for (size_t c = 0; c < txdata_var.datalen; c++) {
10178 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
10179 *txdata_conv_28_conv = txdata_var.data[c];
10180 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
10182 (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0);
10183 FREE(txdata_var.data);
10184 int32_t height_conv = height;
10185 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10186 CHECK(obj != NULL);
10187 (*env)->CallVoidMethod(env, obj, j_calls->filtered_block_connected_meth, header_arr, txdata_arr, height_conv);
10188 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10189 (*env)->ExceptionDescribe(env);
10190 (*env)->FatalError(env, "A call to filtered_block_connected in LDKListen from rust threw an exception.");
10192 if (get_jenv_res == JNI_EDETACHED) {
10193 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10196 void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
10197 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
10199 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10200 if (get_jenv_res == JNI_EDETACHED) {
10201 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10203 DO_ASSERT(get_jenv_res == JNI_OK);
10205 LDKu8slice block_var = block;
10206 int8_tArray block_arr = (*env)->NewByteArray(env, block_var.datalen);
10207 (*env)->SetByteArrayRegion(env, block_arr, 0, block_var.datalen, block_var.data);
10208 int32_t height_conv = height;
10209 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10210 CHECK(obj != NULL);
10211 (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height_conv);
10212 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10213 (*env)->ExceptionDescribe(env);
10214 (*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception.");
10216 if (get_jenv_res == JNI_EDETACHED) {
10217 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10220 void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
10221 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
10223 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10224 if (get_jenv_res == JNI_EDETACHED) {
10225 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10227 DO_ASSERT(get_jenv_res == JNI_OK);
10229 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
10230 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
10231 int32_t height_conv = height;
10232 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10233 CHECK(obj != NULL);
10234 (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height_conv);
10235 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10236 (*env)->ExceptionDescribe(env);
10237 (*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception.");
10239 if (get_jenv_res == JNI_EDETACHED) {
10240 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10243 static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
10244 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
10245 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10247 static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) {
10248 jclass c = (*env)->GetObjectClass(env, o);
10250 LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
10251 atomic_init(&calls->refcnt, 1);
10252 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
10253 calls->o = (*env)->NewWeakGlobalRef(env, o);
10254 calls->filtered_block_connected_meth = (*env)->GetMethodID(env, c, "filtered_block_connected", "([B[JI)V");
10255 CHECK(calls->filtered_block_connected_meth != NULL);
10256 calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BI)V");
10257 CHECK(calls->block_connected_meth != NULL);
10258 calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V");
10259 CHECK(calls->block_disconnected_meth != NULL);
10262 .this_arg = (void*) calls,
10263 .filtered_block_connected = filtered_block_connected_LDKListen_jcall,
10264 .block_connected = block_connected_LDKListen_jcall,
10265 .block_disconnected = block_disconnected_LDKListen_jcall,
10266 .free = LDKListen_JCalls_free,
10270 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKListen_1new(JNIEnv *env, jclass clz, jobject o) {
10271 LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
10272 *res_ptr = LDKListen_init(env, clz, o);
10273 return tag_ptr(res_ptr, true);
10275 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) {
10276 void* this_arg_ptr = untag_ptr(this_arg);
10277 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10278 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
10279 unsigned char header_arr[80];
10280 CHECK((*env)->GetArrayLength(env, header) == 80);
10281 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
10282 unsigned char (*header_ref)[80] = &header_arr;
10283 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
10284 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
10285 if (txdata_constr.datalen > 0)
10286 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
10288 txdata_constr.data = NULL;
10289 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
10290 for (size_t c = 0; c < txdata_constr.datalen; c++) {
10291 int64_t txdata_conv_28 = txdata_vals[c];
10292 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
10293 CHECK_ACCESS(txdata_conv_28_ptr);
10294 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
10295 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
10296 txdata_constr.data[c] = txdata_conv_28_conv;
10298 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
10299 (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
10302 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) {
10303 void* this_arg_ptr = untag_ptr(this_arg);
10304 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10305 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
10306 LDKu8slice block_ref;
10307 block_ref.datalen = (*env)->GetArrayLength(env, block);
10308 block_ref.data = (*env)->GetByteArrayElements (env, block, NULL);
10309 (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
10310 (*env)->ReleaseByteArrayElements(env, block, (int8_t*)block_ref.data, 0);
10313 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) {
10314 void* this_arg_ptr = untag_ptr(this_arg);
10315 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10316 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
10317 unsigned char header_arr[80];
10318 CHECK((*env)->GetArrayLength(env, header) == 80);
10319 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
10320 unsigned char (*header_ref)[80] = &header_arr;
10321 (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
10324 typedef struct LDKConfirm_JCalls {
10325 atomic_size_t refcnt;
10328 jmethodID transactions_confirmed_meth;
10329 jmethodID transaction_unconfirmed_meth;
10330 jmethodID best_block_updated_meth;
10331 jmethodID get_relevant_txids_meth;
10332 } LDKConfirm_JCalls;
10333 static void LDKConfirm_JCalls_free(void* this_arg) {
10334 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
10335 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10337 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10338 if (get_jenv_res == JNI_EDETACHED) {
10339 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10341 DO_ASSERT(get_jenv_res == JNI_OK);
10343 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
10344 if (get_jenv_res == JNI_EDETACHED) {
10345 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10350 void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
10351 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
10353 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10354 if (get_jenv_res == JNI_EDETACHED) {
10355 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10357 DO_ASSERT(get_jenv_res == JNI_OK);
10359 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
10360 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
10361 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
10362 int64_tArray txdata_arr = NULL;
10363 txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
10364 int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL);
10365 for (size_t c = 0; c < txdata_var.datalen; c++) {
10366 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
10367 *txdata_conv_28_conv = txdata_var.data[c];
10368 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
10370 (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0);
10371 FREE(txdata_var.data);
10372 int32_t height_conv = height;
10373 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10374 CHECK(obj != NULL);
10375 (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height_conv);
10376 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10377 (*env)->ExceptionDescribe(env);
10378 (*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception.");
10380 if (get_jenv_res == JNI_EDETACHED) {
10381 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10384 void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
10385 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
10387 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10388 if (get_jenv_res == JNI_EDETACHED) {
10389 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10391 DO_ASSERT(get_jenv_res == JNI_OK);
10393 int8_tArray txid_arr = (*env)->NewByteArray(env, 32);
10394 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
10395 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10396 CHECK(obj != NULL);
10397 (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr);
10398 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10399 (*env)->ExceptionDescribe(env);
10400 (*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception.");
10402 if (get_jenv_res == JNI_EDETACHED) {
10403 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10406 void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
10407 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
10409 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10410 if (get_jenv_res == JNI_EDETACHED) {
10411 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10413 DO_ASSERT(get_jenv_res == JNI_OK);
10415 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
10416 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
10417 int32_t height_conv = height;
10418 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10419 CHECK(obj != NULL);
10420 (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height_conv);
10421 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10422 (*env)->ExceptionDescribe(env);
10423 (*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception.");
10425 if (get_jenv_res == JNI_EDETACHED) {
10426 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10429 LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
10430 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
10432 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10433 if (get_jenv_res == JNI_EDETACHED) {
10434 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10436 DO_ASSERT(get_jenv_res == JNI_OK);
10438 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10439 CHECK(obj != NULL);
10440 jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth);
10441 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10442 (*env)->ExceptionDescribe(env);
10443 (*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception.");
10445 LDKCVec_TxidZ ret_constr;
10446 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
10447 if (ret_constr.datalen > 0)
10448 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
10450 ret_constr.data = NULL;
10451 for (size_t i = 0; i < ret_constr.datalen; i++) {
10452 int8_tArray ret_conv_8 = (*env)->GetObjectArrayElement(env, ret, i);
10453 LDKThirtyTwoBytes ret_conv_8_ref;
10454 CHECK((*env)->GetArrayLength(env, ret_conv_8) == 32);
10455 (*env)->GetByteArrayRegion(env, ret_conv_8, 0, 32, ret_conv_8_ref.data);
10456 ret_constr.data[i] = ret_conv_8_ref;
10458 if (get_jenv_res == JNI_EDETACHED) {
10459 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10463 static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
10464 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
10465 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10467 static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) {
10468 jclass c = (*env)->GetObjectClass(env, o);
10470 LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
10471 atomic_init(&calls->refcnt, 1);
10472 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
10473 calls->o = (*env)->NewWeakGlobalRef(env, o);
10474 calls->transactions_confirmed_meth = (*env)->GetMethodID(env, c, "transactions_confirmed", "([B[JI)V");
10475 CHECK(calls->transactions_confirmed_meth != NULL);
10476 calls->transaction_unconfirmed_meth = (*env)->GetMethodID(env, c, "transaction_unconfirmed", "([B)V");
10477 CHECK(calls->transaction_unconfirmed_meth != NULL);
10478 calls->best_block_updated_meth = (*env)->GetMethodID(env, c, "best_block_updated", "([BI)V");
10479 CHECK(calls->best_block_updated_meth != NULL);
10480 calls->get_relevant_txids_meth = (*env)->GetMethodID(env, c, "get_relevant_txids", "()[[B");
10481 CHECK(calls->get_relevant_txids_meth != NULL);
10484 .this_arg = (void*) calls,
10485 .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall,
10486 .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall,
10487 .best_block_updated = best_block_updated_LDKConfirm_jcall,
10488 .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall,
10489 .free = LDKConfirm_JCalls_free,
10493 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKConfirm_1new(JNIEnv *env, jclass clz, jobject o) {
10494 LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
10495 *res_ptr = LDKConfirm_init(env, clz, o);
10496 return tag_ptr(res_ptr, true);
10498 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) {
10499 void* this_arg_ptr = untag_ptr(this_arg);
10500 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10501 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
10502 unsigned char header_arr[80];
10503 CHECK((*env)->GetArrayLength(env, header) == 80);
10504 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
10505 unsigned char (*header_ref)[80] = &header_arr;
10506 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
10507 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
10508 if (txdata_constr.datalen > 0)
10509 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
10511 txdata_constr.data = NULL;
10512 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
10513 for (size_t c = 0; c < txdata_constr.datalen; c++) {
10514 int64_t txdata_conv_28 = txdata_vals[c];
10515 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
10516 CHECK_ACCESS(txdata_conv_28_ptr);
10517 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
10518 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
10519 txdata_constr.data[c] = txdata_conv_28_conv;
10521 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
10522 (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
10525 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid) {
10526 void* this_arg_ptr = untag_ptr(this_arg);
10527 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10528 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
10529 unsigned char txid_arr[32];
10530 CHECK((*env)->GetArrayLength(env, txid) == 32);
10531 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
10532 unsigned char (*txid_ref)[32] = &txid_arr;
10533 (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref);
10536 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) {
10537 void* this_arg_ptr = untag_ptr(this_arg);
10538 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10539 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
10540 unsigned char header_arr[80];
10541 CHECK((*env)->GetArrayLength(env, header) == 80);
10542 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
10543 unsigned char (*header_ref)[80] = &header_arr;
10544 (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height);
10547 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) {
10548 void* this_arg_ptr = untag_ptr(this_arg);
10549 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10550 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
10551 LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
10552 jobjectArray ret_arr = NULL;
10553 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
10555 for (size_t i = 0; i < ret_var.datalen; i++) {
10556 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32);
10557 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data);
10558 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
10561 FREE(ret_var.data);
10565 typedef struct LDKPersist_JCalls {
10566 atomic_size_t refcnt;
10569 jmethodID persist_new_channel_meth;
10570 jmethodID update_persisted_channel_meth;
10571 } LDKPersist_JCalls;
10572 static void LDKPersist_JCalls_free(void* this_arg) {
10573 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
10574 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10576 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10577 if (get_jenv_res == JNI_EDETACHED) {
10578 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10580 DO_ASSERT(get_jenv_res == JNI_OK);
10582 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
10583 if (get_jenv_res == JNI_EDETACHED) {
10584 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10589 LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
10590 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
10592 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10593 if (get_jenv_res == JNI_EDETACHED) {
10594 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10596 DO_ASSERT(get_jenv_res == JNI_OK);
10598 LDKOutPoint channel_id_var = channel_id;
10599 int64_t channel_id_ref = 0;
10600 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
10601 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
10602 LDKChannelMonitor data_var = *data;
10603 int64_t data_ref = 0;
10604 data_var = ChannelMonitor_clone(&data_var);
10605 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
10606 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
10607 LDKMonitorUpdateId update_id_var = update_id;
10608 int64_t update_id_ref = 0;
10609 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
10610 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
10611 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10612 CHECK(obj != NULL);
10613 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
10614 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10615 (*env)->ExceptionDescribe(env);
10616 (*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
10618 void* ret_ptr = untag_ptr(ret);
10619 CHECK_ACCESS(ret_ptr);
10620 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
10621 FREE(untag_ptr(ret));
10622 if (get_jenv_res == JNI_EDETACHED) {
10623 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10627 LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
10628 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
10630 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10631 if (get_jenv_res == JNI_EDETACHED) {
10632 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10634 DO_ASSERT(get_jenv_res == JNI_OK);
10636 LDKOutPoint channel_id_var = channel_id;
10637 int64_t channel_id_ref = 0;
10638 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
10639 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
10640 LDKChannelMonitorUpdate update_var = *update;
10641 int64_t update_ref = 0;
10642 update_var = ChannelMonitorUpdate_clone(&update_var);
10643 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
10644 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
10645 LDKChannelMonitor data_var = *data;
10646 int64_t data_ref = 0;
10647 data_var = ChannelMonitor_clone(&data_var);
10648 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
10649 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
10650 LDKMonitorUpdateId update_id_var = update_id;
10651 int64_t update_id_ref = 0;
10652 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
10653 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
10654 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10655 CHECK(obj != NULL);
10656 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
10657 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10658 (*env)->ExceptionDescribe(env);
10659 (*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception.");
10661 void* ret_ptr = untag_ptr(ret);
10662 CHECK_ACCESS(ret_ptr);
10663 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
10664 FREE(untag_ptr(ret));
10665 if (get_jenv_res == JNI_EDETACHED) {
10666 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10670 static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
10671 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
10672 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10674 static inline LDKPersist LDKPersist_init (JNIEnv *env, jclass clz, jobject o) {
10675 jclass c = (*env)->GetObjectClass(env, o);
10677 LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
10678 atomic_init(&calls->refcnt, 1);
10679 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
10680 calls->o = (*env)->NewWeakGlobalRef(env, o);
10681 calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)J");
10682 CHECK(calls->persist_new_channel_meth != NULL);
10683 calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)J");
10684 CHECK(calls->update_persisted_channel_meth != NULL);
10687 .this_arg = (void*) calls,
10688 .persist_new_channel = persist_new_channel_LDKPersist_jcall,
10689 .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
10690 .free = LDKPersist_JCalls_free,
10694 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new(JNIEnv *env, jclass clz, jobject o) {
10695 LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist");
10696 *res_ptr = LDKPersist_init(env, clz, o);
10697 return tag_ptr(res_ptr, true);
10699 JNIEXPORT int64_t 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) {
10700 void* this_arg_ptr = untag_ptr(this_arg);
10701 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10702 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
10703 LDKOutPoint channel_id_conv;
10704 channel_id_conv.inner = untag_ptr(channel_id);
10705 channel_id_conv.is_owned = ptr_is_owned(channel_id);
10706 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
10707 channel_id_conv = OutPoint_clone(&channel_id_conv);
10708 LDKChannelMonitor data_conv;
10709 data_conv.inner = untag_ptr(data);
10710 data_conv.is_owned = ptr_is_owned(data);
10711 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
10712 data_conv.is_owned = false;
10713 LDKMonitorUpdateId update_id_conv;
10714 update_id_conv.inner = untag_ptr(update_id);
10715 update_id_conv.is_owned = ptr_is_owned(update_id);
10716 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
10717 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
10718 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
10719 *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
10720 return tag_ptr(ret_conv, true);
10723 JNIEXPORT int64_t 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) {
10724 void* this_arg_ptr = untag_ptr(this_arg);
10725 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10726 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
10727 LDKOutPoint channel_id_conv;
10728 channel_id_conv.inner = untag_ptr(channel_id);
10729 channel_id_conv.is_owned = ptr_is_owned(channel_id);
10730 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
10731 channel_id_conv = OutPoint_clone(&channel_id_conv);
10732 LDKChannelMonitorUpdate update_conv;
10733 update_conv.inner = untag_ptr(update);
10734 update_conv.is_owned = ptr_is_owned(update);
10735 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
10736 update_conv.is_owned = false;
10737 LDKChannelMonitor data_conv;
10738 data_conv.inner = untag_ptr(data);
10739 data_conv.is_owned = ptr_is_owned(data);
10740 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
10741 data_conv.is_owned = false;
10742 LDKMonitorUpdateId update_id_conv;
10743 update_id_conv.inner = untag_ptr(update_id);
10744 update_id_conv.is_owned = ptr_is_owned(update_id);
10745 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
10746 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
10747 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
10748 *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
10749 return tag_ptr(ret_conv, true);
10752 typedef struct LDKChannelMessageHandler_JCalls {
10753 atomic_size_t refcnt;
10756 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
10757 jmethodID handle_open_channel_meth;
10758 jmethodID handle_accept_channel_meth;
10759 jmethodID handle_funding_created_meth;
10760 jmethodID handle_funding_signed_meth;
10761 jmethodID handle_channel_ready_meth;
10762 jmethodID handle_shutdown_meth;
10763 jmethodID handle_closing_signed_meth;
10764 jmethodID handle_update_add_htlc_meth;
10765 jmethodID handle_update_fulfill_htlc_meth;
10766 jmethodID handle_update_fail_htlc_meth;
10767 jmethodID handle_update_fail_malformed_htlc_meth;
10768 jmethodID handle_commitment_signed_meth;
10769 jmethodID handle_revoke_and_ack_meth;
10770 jmethodID handle_update_fee_meth;
10771 jmethodID handle_announcement_signatures_meth;
10772 jmethodID peer_disconnected_meth;
10773 jmethodID peer_connected_meth;
10774 jmethodID handle_channel_reestablish_meth;
10775 jmethodID handle_channel_update_meth;
10776 jmethodID handle_error_meth;
10777 } LDKChannelMessageHandler_JCalls;
10778 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
10779 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
10780 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10782 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10783 if (get_jenv_res == JNI_EDETACHED) {
10784 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10786 DO_ASSERT(get_jenv_res == JNI_OK);
10788 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
10789 if (get_jenv_res == JNI_EDETACHED) {
10790 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10795 void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
10796 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
10798 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10799 if (get_jenv_res == JNI_EDETACHED) {
10800 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10802 DO_ASSERT(get_jenv_res == JNI_OK);
10804 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
10805 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
10806 LDKInitFeatures their_features_var = their_features;
10807 int64_t their_features_ref = 0;
10808 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
10809 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
10810 LDKOpenChannel msg_var = *msg;
10811 int64_t msg_ref = 0;
10812 msg_var = OpenChannel_clone(&msg_var);
10813 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
10814 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
10815 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10816 CHECK(obj != NULL);
10817 (*env)->CallVoidMethod(env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
10818 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10819 (*env)->ExceptionDescribe(env);
10820 (*env)->FatalError(env, "A call to handle_open_channel in LDKChannelMessageHandler from rust threw an exception.");
10822 if (get_jenv_res == JNI_EDETACHED) {
10823 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10826 void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
10827 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
10829 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10830 if (get_jenv_res == JNI_EDETACHED) {
10831 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10833 DO_ASSERT(get_jenv_res == JNI_OK);
10835 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
10836 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
10837 LDKInitFeatures their_features_var = their_features;
10838 int64_t their_features_ref = 0;
10839 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
10840 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
10841 LDKAcceptChannel msg_var = *msg;
10842 int64_t msg_ref = 0;
10843 msg_var = AcceptChannel_clone(&msg_var);
10844 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
10845 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
10846 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10847 CHECK(obj != NULL);
10848 (*env)->CallVoidMethod(env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
10849 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10850 (*env)->ExceptionDescribe(env);
10851 (*env)->FatalError(env, "A call to handle_accept_channel in LDKChannelMessageHandler from rust threw an exception.");
10853 if (get_jenv_res == JNI_EDETACHED) {
10854 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10857 void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
10858 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
10860 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10861 if (get_jenv_res == JNI_EDETACHED) {
10862 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10864 DO_ASSERT(get_jenv_res == JNI_OK);
10866 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
10867 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
10868 LDKFundingCreated msg_var = *msg;
10869 int64_t msg_ref = 0;
10870 msg_var = FundingCreated_clone(&msg_var);
10871 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
10872 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
10873 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10874 CHECK(obj != NULL);
10875 (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref);
10876 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10877 (*env)->ExceptionDescribe(env);
10878 (*env)->FatalError(env, "A call to handle_funding_created in LDKChannelMessageHandler from rust threw an exception.");
10880 if (get_jenv_res == JNI_EDETACHED) {
10881 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10884 void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
10885 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
10894 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
10895 LDKFundingSigned msg_var = *msg;
10896 int64_t msg_ref = 0;
10897 msg_var = FundingSigned_clone(&msg_var);
10898 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
10899 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
10900 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10901 CHECK(obj != NULL);
10902 (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref);
10903 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10904 (*env)->ExceptionDescribe(env);
10905 (*env)->FatalError(env, "A call to handle_funding_signed in LDKChannelMessageHandler from rust threw an exception.");
10907 if (get_jenv_res == JNI_EDETACHED) {
10908 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10911 void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
10912 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
10914 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10915 if (get_jenv_res == JNI_EDETACHED) {
10916 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10918 DO_ASSERT(get_jenv_res == JNI_OK);
10920 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
10921 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
10922 LDKChannelReady msg_var = *msg;
10923 int64_t msg_ref = 0;
10924 msg_var = ChannelReady_clone(&msg_var);
10925 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
10926 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
10927 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10928 CHECK(obj != NULL);
10929 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_ready_meth, their_node_id_arr, msg_ref);
10930 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10931 (*env)->ExceptionDescribe(env);
10932 (*env)->FatalError(env, "A call to handle_channel_ready in LDKChannelMessageHandler from rust threw an exception.");
10934 if (get_jenv_res == JNI_EDETACHED) {
10935 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10938 void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
10939 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
10941 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10942 if (get_jenv_res == JNI_EDETACHED) {
10943 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10945 DO_ASSERT(get_jenv_res == JNI_OK);
10947 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
10948 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
10949 LDKInitFeatures their_features_var = *their_features;
10950 int64_t their_features_ref = 0;
10951 their_features_var = InitFeatures_clone(&their_features_var);
10952 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
10953 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
10954 LDKShutdown msg_var = *msg;
10955 int64_t msg_ref = 0;
10956 msg_var = Shutdown_clone(&msg_var);
10957 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
10958 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
10959 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10960 CHECK(obj != NULL);
10961 (*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, their_features_ref, msg_ref);
10962 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10963 (*env)->ExceptionDescribe(env);
10964 (*env)->FatalError(env, "A call to handle_shutdown in LDKChannelMessageHandler from rust threw an exception.");
10966 if (get_jenv_res == JNI_EDETACHED) {
10967 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10970 void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
10971 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
10973 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
10974 if (get_jenv_res == JNI_EDETACHED) {
10975 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
10977 DO_ASSERT(get_jenv_res == JNI_OK);
10979 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
10980 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
10981 LDKClosingSigned msg_var = *msg;
10982 int64_t msg_ref = 0;
10983 msg_var = ClosingSigned_clone(&msg_var);
10984 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
10985 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
10986 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
10987 CHECK(obj != NULL);
10988 (*env)->CallVoidMethod(env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref);
10989 if (UNLIKELY((*env)->ExceptionCheck(env))) {
10990 (*env)->ExceptionDescribe(env);
10991 (*env)->FatalError(env, "A call to handle_closing_signed in LDKChannelMessageHandler from rust threw an exception.");
10993 if (get_jenv_res == JNI_EDETACHED) {
10994 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
10997 void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
10998 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11000 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11001 if (get_jenv_res == JNI_EDETACHED) {
11002 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11004 DO_ASSERT(get_jenv_res == JNI_OK);
11006 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11007 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11008 LDKUpdateAddHTLC msg_var = *msg;
11009 int64_t msg_ref = 0;
11010 msg_var = UpdateAddHTLC_clone(&msg_var);
11011 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11012 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11013 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11014 CHECK(obj != NULL);
11015 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref);
11016 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11017 (*env)->ExceptionDescribe(env);
11018 (*env)->FatalError(env, "A call to handle_update_add_htlc in LDKChannelMessageHandler from rust threw an exception.");
11020 if (get_jenv_res == JNI_EDETACHED) {
11021 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11024 void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
11025 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11027 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11028 if (get_jenv_res == JNI_EDETACHED) {
11029 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11031 DO_ASSERT(get_jenv_res == JNI_OK);
11033 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11034 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11035 LDKUpdateFulfillHTLC msg_var = *msg;
11036 int64_t msg_ref = 0;
11037 msg_var = UpdateFulfillHTLC_clone(&msg_var);
11038 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11039 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11040 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11041 CHECK(obj != NULL);
11042 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref);
11043 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11044 (*env)->ExceptionDescribe(env);
11045 (*env)->FatalError(env, "A call to handle_update_fulfill_htlc in LDKChannelMessageHandler from rust threw an exception.");
11047 if (get_jenv_res == JNI_EDETACHED) {
11048 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11051 void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
11052 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11054 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11055 if (get_jenv_res == JNI_EDETACHED) {
11056 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11058 DO_ASSERT(get_jenv_res == JNI_OK);
11060 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11061 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11062 LDKUpdateFailHTLC msg_var = *msg;
11063 int64_t msg_ref = 0;
11064 msg_var = UpdateFailHTLC_clone(&msg_var);
11065 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11066 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11067 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11068 CHECK(obj != NULL);
11069 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref);
11070 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11071 (*env)->ExceptionDescribe(env);
11072 (*env)->FatalError(env, "A call to handle_update_fail_htlc in LDKChannelMessageHandler from rust threw an exception.");
11074 if (get_jenv_res == JNI_EDETACHED) {
11075 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11078 void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
11079 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11081 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11082 if (get_jenv_res == JNI_EDETACHED) {
11083 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11085 DO_ASSERT(get_jenv_res == JNI_OK);
11087 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11088 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11089 LDKUpdateFailMalformedHTLC msg_var = *msg;
11090 int64_t msg_ref = 0;
11091 msg_var = UpdateFailMalformedHTLC_clone(&msg_var);
11092 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11093 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11094 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11095 CHECK(obj != NULL);
11096 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref);
11097 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11098 (*env)->ExceptionDescribe(env);
11099 (*env)->FatalError(env, "A call to handle_update_fail_malformed_htlc in LDKChannelMessageHandler from rust threw an exception.");
11101 if (get_jenv_res == JNI_EDETACHED) {
11102 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11105 void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
11106 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11108 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11109 if (get_jenv_res == JNI_EDETACHED) {
11110 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11112 DO_ASSERT(get_jenv_res == JNI_OK);
11114 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11115 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11116 LDKCommitmentSigned msg_var = *msg;
11117 int64_t msg_ref = 0;
11118 msg_var = CommitmentSigned_clone(&msg_var);
11119 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11120 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11121 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11122 CHECK(obj != NULL);
11123 (*env)->CallVoidMethod(env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref);
11124 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11125 (*env)->ExceptionDescribe(env);
11126 (*env)->FatalError(env, "A call to handle_commitment_signed in LDKChannelMessageHandler from rust threw an exception.");
11128 if (get_jenv_res == JNI_EDETACHED) {
11129 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11132 void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
11133 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11135 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11136 if (get_jenv_res == JNI_EDETACHED) {
11137 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11139 DO_ASSERT(get_jenv_res == JNI_OK);
11141 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11142 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11143 LDKRevokeAndACK msg_var = *msg;
11144 int64_t msg_ref = 0;
11145 msg_var = RevokeAndACK_clone(&msg_var);
11146 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11147 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11148 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11149 CHECK(obj != NULL);
11150 (*env)->CallVoidMethod(env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref);
11151 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11152 (*env)->ExceptionDescribe(env);
11153 (*env)->FatalError(env, "A call to handle_revoke_and_ack in LDKChannelMessageHandler from rust threw an exception.");
11155 if (get_jenv_res == JNI_EDETACHED) {
11156 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11159 void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
11160 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11162 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11163 if (get_jenv_res == JNI_EDETACHED) {
11164 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11166 DO_ASSERT(get_jenv_res == JNI_OK);
11168 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11169 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11170 LDKUpdateFee msg_var = *msg;
11171 int64_t msg_ref = 0;
11172 msg_var = UpdateFee_clone(&msg_var);
11173 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11174 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11175 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11176 CHECK(obj != NULL);
11177 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref);
11178 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11179 (*env)->ExceptionDescribe(env);
11180 (*env)->FatalError(env, "A call to handle_update_fee in LDKChannelMessageHandler from rust threw an exception.");
11182 if (get_jenv_res == JNI_EDETACHED) {
11183 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11186 void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
11187 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11189 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11190 if (get_jenv_res == JNI_EDETACHED) {
11191 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11193 DO_ASSERT(get_jenv_res == JNI_OK);
11195 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11196 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11197 LDKAnnouncementSignatures msg_var = *msg;
11198 int64_t msg_ref = 0;
11199 msg_var = AnnouncementSignatures_clone(&msg_var);
11200 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11201 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11202 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11203 CHECK(obj != NULL);
11204 (*env)->CallVoidMethod(env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref);
11205 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11206 (*env)->ExceptionDescribe(env);
11207 (*env)->FatalError(env, "A call to handle_announcement_signatures in LDKChannelMessageHandler from rust threw an exception.");
11209 if (get_jenv_res == JNI_EDETACHED) {
11210 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11213 void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
11214 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11216 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11217 if (get_jenv_res == JNI_EDETACHED) {
11218 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11220 DO_ASSERT(get_jenv_res == JNI_OK);
11222 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11223 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11224 jboolean no_connection_possible_conv = no_connection_possible;
11225 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11226 CHECK(obj != NULL);
11227 (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible_conv);
11228 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11229 (*env)->ExceptionDescribe(env);
11230 (*env)->FatalError(env, "A call to peer_disconnected in LDKChannelMessageHandler from rust threw an exception.");
11232 if (get_jenv_res == JNI_EDETACHED) {
11233 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11236 void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
11237 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11239 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11240 if (get_jenv_res == JNI_EDETACHED) {
11241 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11243 DO_ASSERT(get_jenv_res == JNI_OK);
11245 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11246 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11247 LDKInit msg_var = *msg;
11248 int64_t msg_ref = 0;
11249 msg_var = Init_clone(&msg_var);
11250 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11251 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11252 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11253 CHECK(obj != NULL);
11254 (*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
11255 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11256 (*env)->ExceptionDescribe(env);
11257 (*env)->FatalError(env, "A call to peer_connected in LDKChannelMessageHandler from rust threw an exception.");
11259 if (get_jenv_res == JNI_EDETACHED) {
11260 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11263 void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
11264 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11266 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11267 if (get_jenv_res == JNI_EDETACHED) {
11268 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11270 DO_ASSERT(get_jenv_res == JNI_OK);
11272 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11273 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11274 LDKChannelReestablish msg_var = *msg;
11275 int64_t msg_ref = 0;
11276 msg_var = ChannelReestablish_clone(&msg_var);
11277 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11278 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11279 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11280 CHECK(obj != NULL);
11281 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref);
11282 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11283 (*env)->ExceptionDescribe(env);
11284 (*env)->FatalError(env, "A call to handle_channel_reestablish in LDKChannelMessageHandler from rust threw an exception.");
11286 if (get_jenv_res == JNI_EDETACHED) {
11287 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11290 void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
11291 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11293 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11294 if (get_jenv_res == JNI_EDETACHED) {
11295 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11297 DO_ASSERT(get_jenv_res == JNI_OK);
11299 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11300 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11301 LDKChannelUpdate msg_var = *msg;
11302 int64_t msg_ref = 0;
11303 msg_var = ChannelUpdate_clone(&msg_var);
11304 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11305 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11306 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11307 CHECK(obj != NULL);
11308 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref);
11309 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11310 (*env)->ExceptionDescribe(env);
11311 (*env)->FatalError(env, "A call to handle_channel_update in LDKChannelMessageHandler from rust threw an exception.");
11313 if (get_jenv_res == JNI_EDETACHED) {
11314 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11317 void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
11318 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
11320 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11321 if (get_jenv_res == JNI_EDETACHED) {
11322 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11324 DO_ASSERT(get_jenv_res == JNI_OK);
11326 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11327 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11328 LDKErrorMessage msg_var = *msg;
11329 int64_t msg_ref = 0;
11330 msg_var = ErrorMessage_clone(&msg_var);
11331 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11332 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11333 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11334 CHECK(obj != NULL);
11335 (*env)->CallVoidMethod(env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref);
11336 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11337 (*env)->ExceptionDescribe(env);
11338 (*env)->FatalError(env, "A call to handle_error in LDKChannelMessageHandler from rust threw an exception.");
11340 if (get_jenv_res == JNI_EDETACHED) {
11341 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11344 static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
11345 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
11346 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11347 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
11349 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
11350 jclass c = (*env)->GetObjectClass(env, o);
11352 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
11353 atomic_init(&calls->refcnt, 1);
11354 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11355 calls->o = (*env)->NewWeakGlobalRef(env, o);
11356 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "([BJJ)V");
11357 CHECK(calls->handle_open_channel_meth != NULL);
11358 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "([BJJ)V");
11359 CHECK(calls->handle_accept_channel_meth != NULL);
11360 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "([BJ)V");
11361 CHECK(calls->handle_funding_created_meth != NULL);
11362 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "([BJ)V");
11363 CHECK(calls->handle_funding_signed_meth != NULL);
11364 calls->handle_channel_ready_meth = (*env)->GetMethodID(env, c, "handle_channel_ready", "([BJ)V");
11365 CHECK(calls->handle_channel_ready_meth != NULL);
11366 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "([BJJ)V");
11367 CHECK(calls->handle_shutdown_meth != NULL);
11368 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "([BJ)V");
11369 CHECK(calls->handle_closing_signed_meth != NULL);
11370 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "([BJ)V");
11371 CHECK(calls->handle_update_add_htlc_meth != NULL);
11372 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "([BJ)V");
11373 CHECK(calls->handle_update_fulfill_htlc_meth != NULL);
11374 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "([BJ)V");
11375 CHECK(calls->handle_update_fail_htlc_meth != NULL);
11376 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "([BJ)V");
11377 CHECK(calls->handle_update_fail_malformed_htlc_meth != NULL);
11378 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "([BJ)V");
11379 CHECK(calls->handle_commitment_signed_meth != NULL);
11380 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "([BJ)V");
11381 CHECK(calls->handle_revoke_and_ack_meth != NULL);
11382 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "([BJ)V");
11383 CHECK(calls->handle_update_fee_meth != NULL);
11384 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "([BJ)V");
11385 CHECK(calls->handle_announcement_signatures_meth != NULL);
11386 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([BZ)V");
11387 CHECK(calls->peer_disconnected_meth != NULL);
11388 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)V");
11389 CHECK(calls->peer_connected_meth != NULL);
11390 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "([BJ)V");
11391 CHECK(calls->handle_channel_reestablish_meth != NULL);
11392 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "([BJ)V");
11393 CHECK(calls->handle_channel_update_meth != NULL);
11394 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "([BJ)V");
11395 CHECK(calls->handle_error_meth != NULL);
11397 LDKChannelMessageHandler ret = {
11398 .this_arg = (void*) calls,
11399 .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
11400 .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
11401 .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
11402 .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
11403 .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall,
11404 .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
11405 .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
11406 .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
11407 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
11408 .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
11409 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
11410 .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
11411 .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
11412 .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
11413 .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
11414 .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
11415 .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
11416 .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
11417 .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
11418 .handle_error = handle_error_LDKChannelMessageHandler_jcall,
11419 .free = LDKChannelMessageHandler_JCalls_free,
11420 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider),
11422 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
11425 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
11426 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
11427 *res_ptr = LDKChannelMessageHandler_init(env, clz, o, MessageSendEventsProvider);
11428 return tag_ptr(res_ptr, true);
11430 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
11431 LDKChannelMessageHandler *inp = (LDKChannelMessageHandler *)untag_ptr(arg);
11432 return tag_ptr(&inp->MessageSendEventsProvider, false);
11434 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) {
11435 void* this_arg_ptr = untag_ptr(this_arg);
11436 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11437 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11438 LDKPublicKey their_node_id_ref;
11439 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11440 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11441 LDKInitFeatures their_features_conv;
11442 their_features_conv.inner = untag_ptr(their_features);
11443 their_features_conv.is_owned = ptr_is_owned(their_features);
11444 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
11445 their_features_conv = InitFeatures_clone(&their_features_conv);
11446 LDKOpenChannel msg_conv;
11447 msg_conv.inner = untag_ptr(msg);
11448 msg_conv.is_owned = ptr_is_owned(msg);
11449 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11450 msg_conv.is_owned = false;
11451 (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
11454 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) {
11455 void* this_arg_ptr = untag_ptr(this_arg);
11456 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11457 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11458 LDKPublicKey their_node_id_ref;
11459 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11460 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11461 LDKInitFeatures their_features_conv;
11462 their_features_conv.inner = untag_ptr(their_features);
11463 their_features_conv.is_owned = ptr_is_owned(their_features);
11464 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
11465 their_features_conv = InitFeatures_clone(&their_features_conv);
11466 LDKAcceptChannel msg_conv;
11467 msg_conv.inner = untag_ptr(msg);
11468 msg_conv.is_owned = ptr_is_owned(msg);
11469 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11470 msg_conv.is_owned = false;
11471 (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
11474 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) {
11475 void* this_arg_ptr = untag_ptr(this_arg);
11476 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11477 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11478 LDKPublicKey their_node_id_ref;
11479 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11480 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11481 LDKFundingCreated msg_conv;
11482 msg_conv.inner = untag_ptr(msg);
11483 msg_conv.is_owned = ptr_is_owned(msg);
11484 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11485 msg_conv.is_owned = false;
11486 (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11489 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) {
11490 void* this_arg_ptr = untag_ptr(this_arg);
11491 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11492 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11493 LDKPublicKey their_node_id_ref;
11494 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11495 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11496 LDKFundingSigned msg_conv;
11497 msg_conv.inner = untag_ptr(msg);
11498 msg_conv.is_owned = ptr_is_owned(msg);
11499 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11500 msg_conv.is_owned = false;
11501 (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11504 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) {
11505 void* this_arg_ptr = untag_ptr(this_arg);
11506 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11507 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11508 LDKPublicKey their_node_id_ref;
11509 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11510 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11511 LDKChannelReady msg_conv;
11512 msg_conv.inner = untag_ptr(msg);
11513 msg_conv.is_owned = ptr_is_owned(msg);
11514 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11515 msg_conv.is_owned = false;
11516 (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11519 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) {
11520 void* this_arg_ptr = untag_ptr(this_arg);
11521 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11522 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11523 LDKPublicKey their_node_id_ref;
11524 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11525 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11526 LDKInitFeatures their_features_conv;
11527 their_features_conv.inner = untag_ptr(their_features);
11528 their_features_conv.is_owned = ptr_is_owned(their_features);
11529 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
11530 their_features_conv.is_owned = false;
11531 LDKShutdown msg_conv;
11532 msg_conv.inner = untag_ptr(msg);
11533 msg_conv.is_owned = ptr_is_owned(msg);
11534 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11535 msg_conv.is_owned = false;
11536 (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
11539 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) {
11540 void* this_arg_ptr = untag_ptr(this_arg);
11541 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11542 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11543 LDKPublicKey their_node_id_ref;
11544 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11545 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11546 LDKClosingSigned msg_conv;
11547 msg_conv.inner = untag_ptr(msg);
11548 msg_conv.is_owned = ptr_is_owned(msg);
11549 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11550 msg_conv.is_owned = false;
11551 (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11554 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) {
11555 void* this_arg_ptr = untag_ptr(this_arg);
11556 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11557 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11558 LDKPublicKey their_node_id_ref;
11559 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11560 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11561 LDKUpdateAddHTLC msg_conv;
11562 msg_conv.inner = untag_ptr(msg);
11563 msg_conv.is_owned = ptr_is_owned(msg);
11564 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11565 msg_conv.is_owned = false;
11566 (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11569 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) {
11570 void* this_arg_ptr = untag_ptr(this_arg);
11571 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11572 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11573 LDKPublicKey their_node_id_ref;
11574 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11575 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11576 LDKUpdateFulfillHTLC msg_conv;
11577 msg_conv.inner = untag_ptr(msg);
11578 msg_conv.is_owned = ptr_is_owned(msg);
11579 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11580 msg_conv.is_owned = false;
11581 (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11584 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) {
11585 void* this_arg_ptr = untag_ptr(this_arg);
11586 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11587 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11588 LDKPublicKey their_node_id_ref;
11589 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11590 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11591 LDKUpdateFailHTLC msg_conv;
11592 msg_conv.inner = untag_ptr(msg);
11593 msg_conv.is_owned = ptr_is_owned(msg);
11594 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11595 msg_conv.is_owned = false;
11596 (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11599 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) {
11600 void* this_arg_ptr = untag_ptr(this_arg);
11601 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11602 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11603 LDKPublicKey their_node_id_ref;
11604 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11605 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11606 LDKUpdateFailMalformedHTLC msg_conv;
11607 msg_conv.inner = untag_ptr(msg);
11608 msg_conv.is_owned = ptr_is_owned(msg);
11609 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11610 msg_conv.is_owned = false;
11611 (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11614 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) {
11615 void* this_arg_ptr = untag_ptr(this_arg);
11616 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11617 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11618 LDKPublicKey their_node_id_ref;
11619 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11620 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11621 LDKCommitmentSigned msg_conv;
11622 msg_conv.inner = untag_ptr(msg);
11623 msg_conv.is_owned = ptr_is_owned(msg);
11624 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11625 msg_conv.is_owned = false;
11626 (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11629 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) {
11630 void* this_arg_ptr = untag_ptr(this_arg);
11631 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11632 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11633 LDKPublicKey their_node_id_ref;
11634 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11635 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11636 LDKRevokeAndACK msg_conv;
11637 msg_conv.inner = untag_ptr(msg);
11638 msg_conv.is_owned = ptr_is_owned(msg);
11639 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11640 msg_conv.is_owned = false;
11641 (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11644 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) {
11645 void* this_arg_ptr = untag_ptr(this_arg);
11646 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11647 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11648 LDKPublicKey their_node_id_ref;
11649 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11650 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11651 LDKUpdateFee msg_conv;
11652 msg_conv.inner = untag_ptr(msg);
11653 msg_conv.is_owned = ptr_is_owned(msg);
11654 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11655 msg_conv.is_owned = false;
11656 (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11659 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) {
11660 void* this_arg_ptr = untag_ptr(this_arg);
11661 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11662 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11663 LDKPublicKey their_node_id_ref;
11664 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11665 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11666 LDKAnnouncementSignatures msg_conv;
11667 msg_conv.inner = untag_ptr(msg);
11668 msg_conv.is_owned = ptr_is_owned(msg);
11669 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11670 msg_conv.is_owned = false;
11671 (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11674 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) {
11675 void* this_arg_ptr = untag_ptr(this_arg);
11676 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11677 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11678 LDKPublicKey their_node_id_ref;
11679 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11680 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11681 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
11684 JNIEXPORT void 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) {
11685 void* this_arg_ptr = untag_ptr(this_arg);
11686 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11687 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11688 LDKPublicKey their_node_id_ref;
11689 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11690 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11692 msg_conv.inner = untag_ptr(msg);
11693 msg_conv.is_owned = ptr_is_owned(msg);
11694 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11695 msg_conv.is_owned = false;
11696 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11699 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) {
11700 void* this_arg_ptr = untag_ptr(this_arg);
11701 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11702 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11703 LDKPublicKey their_node_id_ref;
11704 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11705 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11706 LDKChannelReestablish msg_conv;
11707 msg_conv.inner = untag_ptr(msg);
11708 msg_conv.is_owned = ptr_is_owned(msg);
11709 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11710 msg_conv.is_owned = false;
11711 (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11714 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) {
11715 void* this_arg_ptr = untag_ptr(this_arg);
11716 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11717 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11718 LDKPublicKey their_node_id_ref;
11719 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11720 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11721 LDKChannelUpdate msg_conv;
11722 msg_conv.inner = untag_ptr(msg);
11723 msg_conv.is_owned = ptr_is_owned(msg);
11724 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11725 msg_conv.is_owned = false;
11726 (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11729 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) {
11730 void* this_arg_ptr = untag_ptr(this_arg);
11731 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11732 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
11733 LDKPublicKey their_node_id_ref;
11734 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
11735 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
11736 LDKErrorMessage msg_conv;
11737 msg_conv.inner = untag_ptr(msg);
11738 msg_conv.is_owned = ptr_is_owned(msg);
11739 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
11740 msg_conv.is_owned = false;
11741 (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
11744 typedef struct LDKRoutingMessageHandler_JCalls {
11745 atomic_size_t refcnt;
11748 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
11749 jmethodID handle_node_announcement_meth;
11750 jmethodID handle_channel_announcement_meth;
11751 jmethodID handle_channel_update_meth;
11752 jmethodID get_next_channel_announcements_meth;
11753 jmethodID get_next_node_announcements_meth;
11754 jmethodID peer_connected_meth;
11755 jmethodID handle_reply_channel_range_meth;
11756 jmethodID handle_reply_short_channel_ids_end_meth;
11757 jmethodID handle_query_channel_range_meth;
11758 jmethodID handle_query_short_channel_ids_meth;
11759 } LDKRoutingMessageHandler_JCalls;
11760 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
11761 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
11762 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11764 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11765 if (get_jenv_res == JNI_EDETACHED) {
11766 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11768 DO_ASSERT(get_jenv_res == JNI_OK);
11770 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11771 if (get_jenv_res == JNI_EDETACHED) {
11772 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11777 LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
11778 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
11780 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11781 if (get_jenv_res == JNI_EDETACHED) {
11782 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11784 DO_ASSERT(get_jenv_res == JNI_OK);
11786 LDKNodeAnnouncement msg_var = *msg;
11787 int64_t msg_ref = 0;
11788 msg_var = NodeAnnouncement_clone(&msg_var);
11789 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11790 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11791 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11792 CHECK(obj != NULL);
11793 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref);
11794 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11795 (*env)->ExceptionDescribe(env);
11796 (*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
11798 void* ret_ptr = untag_ptr(ret);
11799 CHECK_ACCESS(ret_ptr);
11800 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
11801 FREE(untag_ptr(ret));
11802 if (get_jenv_res == JNI_EDETACHED) {
11803 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11807 LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
11808 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
11810 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11811 if (get_jenv_res == JNI_EDETACHED) {
11812 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11814 DO_ASSERT(get_jenv_res == JNI_OK);
11816 LDKChannelAnnouncement msg_var = *msg;
11817 int64_t msg_ref = 0;
11818 msg_var = ChannelAnnouncement_clone(&msg_var);
11819 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11820 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11821 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11822 CHECK(obj != NULL);
11823 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref);
11824 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11825 (*env)->ExceptionDescribe(env);
11826 (*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
11828 void* ret_ptr = untag_ptr(ret);
11829 CHECK_ACCESS(ret_ptr);
11830 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
11831 FREE(untag_ptr(ret));
11832 if (get_jenv_res == JNI_EDETACHED) {
11833 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11837 LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
11838 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
11840 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11841 if (get_jenv_res == JNI_EDETACHED) {
11842 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11844 DO_ASSERT(get_jenv_res == JNI_OK);
11846 LDKChannelUpdate msg_var = *msg;
11847 int64_t msg_ref = 0;
11848 msg_var = ChannelUpdate_clone(&msg_var);
11849 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11850 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11851 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11852 CHECK(obj != NULL);
11853 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref);
11854 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11855 (*env)->ExceptionDescribe(env);
11856 (*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception.");
11858 void* ret_ptr = untag_ptr(ret);
11859 CHECK_ACCESS(ret_ptr);
11860 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
11861 FREE(untag_ptr(ret));
11862 if (get_jenv_res == JNI_EDETACHED) {
11863 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11867 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
11868 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
11870 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11871 if (get_jenv_res == JNI_EDETACHED) {
11872 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11874 DO_ASSERT(get_jenv_res == JNI_OK);
11876 int64_t starting_point_conv = starting_point;
11877 int8_t batch_amount_conv = batch_amount;
11878 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11879 CHECK(obj != NULL);
11880 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_channel_announcements_meth, starting_point_conv, batch_amount_conv);
11881 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11882 (*env)->ExceptionDescribe(env);
11883 (*env)->FatalError(env, "A call to get_next_channel_announcements in LDKRoutingMessageHandler from rust threw an exception.");
11885 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
11886 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
11887 if (ret_constr.datalen > 0)
11888 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
11890 ret_constr.data = NULL;
11891 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
11892 for (size_t h = 0; h < ret_constr.datalen; h++) {
11893 int64_t ret_conv_59 = ret_vals[h];
11894 void* ret_conv_59_ptr = untag_ptr(ret_conv_59);
11895 CHECK_ACCESS(ret_conv_59_ptr);
11896 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr);
11897 FREE(untag_ptr(ret_conv_59));
11898 ret_constr.data[h] = ret_conv_59_conv;
11900 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
11901 if (get_jenv_res == JNI_EDETACHED) {
11902 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11906 LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
11907 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
11909 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11910 if (get_jenv_res == JNI_EDETACHED) {
11911 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11913 DO_ASSERT(get_jenv_res == JNI_OK);
11915 int8_tArray starting_point_arr = (*env)->NewByteArray(env, 33);
11916 (*env)->SetByteArrayRegion(env, starting_point_arr, 0, 33, starting_point.compressed_form);
11917 int8_t batch_amount_conv = batch_amount;
11918 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11919 CHECK(obj != NULL);
11920 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount_conv);
11921 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11922 (*env)->ExceptionDescribe(env);
11923 (*env)->FatalError(env, "A call to get_next_node_announcements in LDKRoutingMessageHandler from rust threw an exception.");
11925 LDKCVec_NodeAnnouncementZ ret_constr;
11926 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
11927 if (ret_constr.datalen > 0)
11928 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
11930 ret_constr.data = NULL;
11931 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
11932 for (size_t s = 0; s < ret_constr.datalen; s++) {
11933 int64_t ret_conv_18 = ret_vals[s];
11934 LDKNodeAnnouncement ret_conv_18_conv;
11935 ret_conv_18_conv.inner = untag_ptr(ret_conv_18);
11936 ret_conv_18_conv.is_owned = ptr_is_owned(ret_conv_18);
11937 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv);
11938 ret_constr.data[s] = ret_conv_18_conv;
11940 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
11941 if (get_jenv_res == JNI_EDETACHED) {
11942 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11946 void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
11947 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
11949 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11950 if (get_jenv_res == JNI_EDETACHED) {
11951 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11953 DO_ASSERT(get_jenv_res == JNI_OK);
11955 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11956 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11957 LDKInit init_var = *init;
11958 int64_t init_ref = 0;
11959 init_var = Init_clone(&init_var);
11960 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
11961 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
11962 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11963 CHECK(obj != NULL);
11964 (*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
11965 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11966 (*env)->ExceptionDescribe(env);
11967 (*env)->FatalError(env, "A call to peer_connected in LDKRoutingMessageHandler from rust threw an exception.");
11969 if (get_jenv_res == JNI_EDETACHED) {
11970 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11973 LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
11974 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
11976 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11977 if (get_jenv_res == JNI_EDETACHED) {
11978 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11980 DO_ASSERT(get_jenv_res == JNI_OK);
11982 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
11983 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
11984 LDKReplyChannelRange msg_var = msg;
11985 int64_t msg_ref = 0;
11986 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
11987 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
11988 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11989 CHECK(obj != NULL);
11990 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref);
11991 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11992 (*env)->ExceptionDescribe(env);
11993 (*env)->FatalError(env, "A call to handle_reply_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
11995 void* ret_ptr = untag_ptr(ret);
11996 CHECK_ACCESS(ret_ptr);
11997 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
11998 FREE(untag_ptr(ret));
11999 if (get_jenv_res == JNI_EDETACHED) {
12000 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12004 LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
12005 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
12007 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12008 if (get_jenv_res == JNI_EDETACHED) {
12009 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12011 DO_ASSERT(get_jenv_res == JNI_OK);
12013 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12014 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12015 LDKReplyShortChannelIdsEnd msg_var = msg;
12016 int64_t msg_ref = 0;
12017 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12018 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12019 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12020 CHECK(obj != NULL);
12021 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref);
12022 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12023 (*env)->ExceptionDescribe(env);
12024 (*env)->FatalError(env, "A call to handle_reply_short_channel_ids_end in LDKRoutingMessageHandler from rust threw an exception.");
12026 void* ret_ptr = untag_ptr(ret);
12027 CHECK_ACCESS(ret_ptr);
12028 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
12029 FREE(untag_ptr(ret));
12030 if (get_jenv_res == JNI_EDETACHED) {
12031 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12035 LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
12036 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
12038 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12039 if (get_jenv_res == JNI_EDETACHED) {
12040 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12042 DO_ASSERT(get_jenv_res == JNI_OK);
12044 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12045 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12046 LDKQueryChannelRange msg_var = msg;
12047 int64_t msg_ref = 0;
12048 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12049 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12050 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12051 CHECK(obj != NULL);
12052 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref);
12053 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12054 (*env)->ExceptionDescribe(env);
12055 (*env)->FatalError(env, "A call to handle_query_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
12057 void* ret_ptr = untag_ptr(ret);
12058 CHECK_ACCESS(ret_ptr);
12059 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
12060 FREE(untag_ptr(ret));
12061 if (get_jenv_res == JNI_EDETACHED) {
12062 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12066 LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
12067 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
12069 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12070 if (get_jenv_res == JNI_EDETACHED) {
12071 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12073 DO_ASSERT(get_jenv_res == JNI_OK);
12075 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
12076 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
12077 LDKQueryShortChannelIds msg_var = msg;
12078 int64_t msg_ref = 0;
12079 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
12080 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
12081 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12082 CHECK(obj != NULL);
12083 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref);
12084 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12085 (*env)->ExceptionDescribe(env);
12086 (*env)->FatalError(env, "A call to handle_query_short_channel_ids in LDKRoutingMessageHandler from rust threw an exception.");
12088 void* ret_ptr = untag_ptr(ret);
12089 CHECK_ACCESS(ret_ptr);
12090 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
12091 FREE(untag_ptr(ret));
12092 if (get_jenv_res == JNI_EDETACHED) {
12093 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12097 static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
12098 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
12099 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12100 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
12102 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
12103 jclass c = (*env)->GetObjectClass(env, o);
12105 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
12106 atomic_init(&calls->refcnt, 1);
12107 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12108 calls->o = (*env)->NewWeakGlobalRef(env, o);
12109 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
12110 CHECK(calls->handle_node_announcement_meth != NULL);
12111 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
12112 CHECK(calls->handle_channel_announcement_meth != NULL);
12113 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
12114 CHECK(calls->handle_channel_update_meth != NULL);
12115 calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)[J");
12116 CHECK(calls->get_next_channel_announcements_meth != NULL);
12117 calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "([BB)[J");
12118 CHECK(calls->get_next_node_announcements_meth != NULL);
12119 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)V");
12120 CHECK(calls->peer_connected_meth != NULL);
12121 calls->handle_reply_channel_range_meth = (*env)->GetMethodID(env, c, "handle_reply_channel_range", "([BJ)J");
12122 CHECK(calls->handle_reply_channel_range_meth != NULL);
12123 calls->handle_reply_short_channel_ids_end_meth = (*env)->GetMethodID(env, c, "handle_reply_short_channel_ids_end", "([BJ)J");
12124 CHECK(calls->handle_reply_short_channel_ids_end_meth != NULL);
12125 calls->handle_query_channel_range_meth = (*env)->GetMethodID(env, c, "handle_query_channel_range", "([BJ)J");
12126 CHECK(calls->handle_query_channel_range_meth != NULL);
12127 calls->handle_query_short_channel_ids_meth = (*env)->GetMethodID(env, c, "handle_query_short_channel_ids", "([BJ)J");
12128 CHECK(calls->handle_query_short_channel_ids_meth != NULL);
12130 LDKRoutingMessageHandler ret = {
12131 .this_arg = (void*) calls,
12132 .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
12133 .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
12134 .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
12135 .get_next_channel_announcements = get_next_channel_announcements_LDKRoutingMessageHandler_jcall,
12136 .get_next_node_announcements = get_next_node_announcements_LDKRoutingMessageHandler_jcall,
12137 .peer_connected = peer_connected_LDKRoutingMessageHandler_jcall,
12138 .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
12139 .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
12140 .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
12141 .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
12142 .free = LDKRoutingMessageHandler_JCalls_free,
12143 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider),
12145 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
12148 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
12149 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
12150 *res_ptr = LDKRoutingMessageHandler_init(env, clz, o, MessageSendEventsProvider);
12151 return tag_ptr(res_ptr, true);
12153 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
12154 LDKRoutingMessageHandler *inp = (LDKRoutingMessageHandler *)untag_ptr(arg);
12155 return tag_ptr(&inp->MessageSendEventsProvider, false);
12157 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
12158 void* this_arg_ptr = untag_ptr(this_arg);
12159 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12160 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
12161 LDKNodeAnnouncement msg_conv;
12162 msg_conv.inner = untag_ptr(msg);
12163 msg_conv.is_owned = ptr_is_owned(msg);
12164 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12165 msg_conv.is_owned = false;
12166 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
12167 *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
12168 return tag_ptr(ret_conv, true);
12171 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
12172 void* this_arg_ptr = untag_ptr(this_arg);
12173 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12174 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
12175 LDKChannelAnnouncement msg_conv;
12176 msg_conv.inner = untag_ptr(msg);
12177 msg_conv.is_owned = ptr_is_owned(msg);
12178 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12179 msg_conv.is_owned = false;
12180 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
12181 *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
12182 return tag_ptr(ret_conv, true);
12185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
12186 void* this_arg_ptr = untag_ptr(this_arg);
12187 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12188 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
12189 LDKChannelUpdate msg_conv;
12190 msg_conv.inner = untag_ptr(msg);
12191 msg_conv.is_owned = ptr_is_owned(msg);
12192 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12193 msg_conv.is_owned = false;
12194 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
12195 *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
12196 return tag_ptr(ret_conv, true);
12199 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1channel_1announcements(JNIEnv *env, jclass clz, int64_t this_arg, int64_t starting_point, int8_t batch_amount) {
12200 void* this_arg_ptr = untag_ptr(this_arg);
12201 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12202 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
12203 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
12204 int64_tArray ret_arr = NULL;
12205 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
12206 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
12207 for (size_t h = 0; h < ret_var.datalen; h++) {
12208 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
12209 *ret_conv_59_conv = ret_var.data[h];
12210 ret_arr_ptr[h] = tag_ptr(ret_conv_59_conv, true);
12212 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
12213 FREE(ret_var.data);
12217 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1node_1announcements(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray starting_point, int8_t batch_amount) {
12218 void* this_arg_ptr = untag_ptr(this_arg);
12219 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12220 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
12221 LDKPublicKey starting_point_ref;
12222 CHECK((*env)->GetArrayLength(env, starting_point) == 33);
12223 (*env)->GetByteArrayRegion(env, starting_point, 0, 33, starting_point_ref.compressed_form);
12224 LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount);
12225 int64_tArray ret_arr = NULL;
12226 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
12227 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
12228 for (size_t s = 0; s < ret_var.datalen; s++) {
12229 LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
12230 int64_t ret_conv_18_ref = 0;
12231 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var);
12232 ret_conv_18_ref = tag_ptr(ret_conv_18_var.inner, ret_conv_18_var.is_owned);
12233 ret_arr_ptr[s] = ret_conv_18_ref;
12235 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
12236 FREE(ret_var.data);
12240 JNIEXPORT void 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) {
12241 void* this_arg_ptr = untag_ptr(this_arg);
12242 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12243 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
12244 LDKPublicKey their_node_id_ref;
12245 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12246 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12248 init_conv.inner = untag_ptr(init);
12249 init_conv.is_owned = ptr_is_owned(init);
12250 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
12251 init_conv.is_owned = false;
12252 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
12255 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) {
12256 void* this_arg_ptr = untag_ptr(this_arg);
12257 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12258 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
12259 LDKPublicKey their_node_id_ref;
12260 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12261 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12262 LDKReplyChannelRange msg_conv;
12263 msg_conv.inner = untag_ptr(msg);
12264 msg_conv.is_owned = ptr_is_owned(msg);
12265 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12266 msg_conv = ReplyChannelRange_clone(&msg_conv);
12267 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
12268 *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
12269 return tag_ptr(ret_conv, true);
12272 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) {
12273 void* this_arg_ptr = untag_ptr(this_arg);
12274 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12275 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
12276 LDKPublicKey their_node_id_ref;
12277 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12278 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12279 LDKReplyShortChannelIdsEnd msg_conv;
12280 msg_conv.inner = untag_ptr(msg);
12281 msg_conv.is_owned = ptr_is_owned(msg);
12282 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12283 msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv);
12284 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
12285 *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
12286 return tag_ptr(ret_conv, true);
12289 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) {
12290 void* this_arg_ptr = untag_ptr(this_arg);
12291 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12292 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
12293 LDKPublicKey their_node_id_ref;
12294 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12295 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12296 LDKQueryChannelRange msg_conv;
12297 msg_conv.inner = untag_ptr(msg);
12298 msg_conv.is_owned = ptr_is_owned(msg);
12299 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12300 msg_conv = QueryChannelRange_clone(&msg_conv);
12301 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
12302 *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
12303 return tag_ptr(ret_conv, true);
12306 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) {
12307 void* this_arg_ptr = untag_ptr(this_arg);
12308 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12309 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
12310 LDKPublicKey their_node_id_ref;
12311 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
12312 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
12313 LDKQueryShortChannelIds msg_conv;
12314 msg_conv.inner = untag_ptr(msg);
12315 msg_conv.is_owned = ptr_is_owned(msg);
12316 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
12317 msg_conv = QueryShortChannelIds_clone(&msg_conv);
12318 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
12319 *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
12320 return tag_ptr(ret_conv, true);
12323 typedef struct LDKCustomMessageReader_JCalls {
12324 atomic_size_t refcnt;
12327 jmethodID read_meth;
12328 } LDKCustomMessageReader_JCalls;
12329 static void LDKCustomMessageReader_JCalls_free(void* this_arg) {
12330 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
12331 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12333 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12334 if (get_jenv_res == JNI_EDETACHED) {
12335 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12337 DO_ASSERT(get_jenv_res == JNI_OK);
12339 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12340 if (get_jenv_res == JNI_EDETACHED) {
12341 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12346 LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) {
12347 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
12349 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12350 if (get_jenv_res == JNI_EDETACHED) {
12351 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12353 DO_ASSERT(get_jenv_res == JNI_OK);
12355 int16_t message_type_conv = message_type;
12356 LDKu8slice buffer_var = buffer;
12357 int8_tArray buffer_arr = (*env)->NewByteArray(env, buffer_var.datalen);
12358 (*env)->SetByteArrayRegion(env, buffer_arr, 0, buffer_var.datalen, buffer_var.data);
12359 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12360 CHECK(obj != NULL);
12361 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_meth, message_type_conv, buffer_arr);
12362 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12363 (*env)->ExceptionDescribe(env);
12364 (*env)->FatalError(env, "A call to read in LDKCustomMessageReader from rust threw an exception.");
12366 void* ret_ptr = untag_ptr(ret);
12367 CHECK_ACCESS(ret_ptr);
12368 LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
12369 FREE(untag_ptr(ret));
12370 if (get_jenv_res == JNI_EDETACHED) {
12371 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12375 static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) {
12376 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) new_obj->this_arg;
12377 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12379 static inline LDKCustomMessageReader LDKCustomMessageReader_init (JNIEnv *env, jclass clz, jobject o) {
12380 jclass c = (*env)->GetObjectClass(env, o);
12382 LDKCustomMessageReader_JCalls *calls = MALLOC(sizeof(LDKCustomMessageReader_JCalls), "LDKCustomMessageReader_JCalls");
12383 atomic_init(&calls->refcnt, 1);
12384 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12385 calls->o = (*env)->NewWeakGlobalRef(env, o);
12386 calls->read_meth = (*env)->GetMethodID(env, c, "read", "(S[B)J");
12387 CHECK(calls->read_meth != NULL);
12389 LDKCustomMessageReader ret = {
12390 .this_arg = (void*) calls,
12391 .read = read_LDKCustomMessageReader_jcall,
12392 .free = LDKCustomMessageReader_JCalls_free,
12396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageReader_1new(JNIEnv *env, jclass clz, jobject o) {
12397 LDKCustomMessageReader *res_ptr = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
12398 *res_ptr = LDKCustomMessageReader_init(env, clz, o);
12399 return tag_ptr(res_ptr, true);
12401 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) {
12402 void* this_arg_ptr = untag_ptr(this_arg);
12403 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12404 LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
12405 LDKu8slice buffer_ref;
12406 buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
12407 buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
12408 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
12409 *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
12410 (*env)->ReleaseByteArrayElements(env, buffer, (int8_t*)buffer_ref.data, 0);
12411 return tag_ptr(ret_conv, true);
12414 typedef struct LDKCustomMessageHandler_JCalls {
12415 atomic_size_t refcnt;
12418 LDKCustomMessageReader_JCalls* CustomMessageReader;
12419 jmethodID handle_custom_message_meth;
12420 jmethodID get_and_clear_pending_msg_meth;
12421 } LDKCustomMessageHandler_JCalls;
12422 static void LDKCustomMessageHandler_JCalls_free(void* this_arg) {
12423 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
12424 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12426 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12427 if (get_jenv_res == JNI_EDETACHED) {
12428 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12430 DO_ASSERT(get_jenv_res == JNI_OK);
12432 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12433 if (get_jenv_res == JNI_EDETACHED) {
12434 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12439 LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
12440 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
12442 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12443 if (get_jenv_res == JNI_EDETACHED) {
12444 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12446 DO_ASSERT(get_jenv_res == JNI_OK);
12448 LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
12450 int8_tArray sender_node_id_arr = (*env)->NewByteArray(env, 33);
12451 (*env)->SetByteArrayRegion(env, sender_node_id_arr, 0, 33, sender_node_id.compressed_form);
12452 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12453 CHECK(obj != NULL);
12454 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true), sender_node_id_arr);
12455 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12456 (*env)->ExceptionDescribe(env);
12457 (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomMessageHandler from rust threw an exception.");
12459 void* ret_ptr = untag_ptr(ret);
12460 CHECK_ACCESS(ret_ptr);
12461 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
12462 FREE(untag_ptr(ret));
12463 if (get_jenv_res == JNI_EDETACHED) {
12464 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12468 LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
12469 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
12471 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12472 if (get_jenv_res == JNI_EDETACHED) {
12473 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12475 DO_ASSERT(get_jenv_res == JNI_OK);
12477 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12478 CHECK(obj != NULL);
12479 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_meth);
12480 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12481 (*env)->ExceptionDescribe(env);
12482 (*env)->FatalError(env, "A call to get_and_clear_pending_msg in LDKCustomMessageHandler from rust threw an exception.");
12484 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
12485 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
12486 if (ret_constr.datalen > 0)
12487 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
12489 ret_constr.data = NULL;
12490 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
12491 for (size_t z = 0; z < ret_constr.datalen; z++) {
12492 int64_t ret_conv_25 = ret_vals[z];
12493 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
12494 CHECK_ACCESS(ret_conv_25_ptr);
12495 LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
12496 FREE(untag_ptr(ret_conv_25));
12497 ret_constr.data[z] = ret_conv_25_conv;
12499 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
12500 if (get_jenv_res == JNI_EDETACHED) {
12501 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12505 static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
12506 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) new_obj->this_arg;
12507 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12508 atomic_fetch_add_explicit(&j_calls->CustomMessageReader->refcnt, 1, memory_order_release);
12510 static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject CustomMessageReader) {
12511 jclass c = (*env)->GetObjectClass(env, o);
12513 LDKCustomMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomMessageHandler_JCalls), "LDKCustomMessageHandler_JCalls");
12514 atomic_init(&calls->refcnt, 1);
12515 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12516 calls->o = (*env)->NewWeakGlobalRef(env, o);
12517 calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J[B)J");
12518 CHECK(calls->handle_custom_message_meth != NULL);
12519 calls->get_and_clear_pending_msg_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg", "()[J");
12520 CHECK(calls->get_and_clear_pending_msg_meth != NULL);
12522 LDKCustomMessageHandler ret = {
12523 .this_arg = (void*) calls,
12524 .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall,
12525 .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall,
12526 .free = LDKCustomMessageHandler_JCalls_free,
12527 .CustomMessageReader = LDKCustomMessageReader_init(env, clz, CustomMessageReader),
12529 calls->CustomMessageReader = ret.CustomMessageReader.this_arg;
12532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject CustomMessageReader) {
12533 LDKCustomMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
12534 *res_ptr = LDKCustomMessageHandler_init(env, clz, o, CustomMessageReader);
12535 return tag_ptr(res_ptr, true);
12537 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageHandler_1get_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t arg) {
12538 LDKCustomMessageHandler *inp = (LDKCustomMessageHandler *)untag_ptr(arg);
12539 return tag_ptr(&inp->CustomMessageReader, false);
12541 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) {
12542 void* this_arg_ptr = untag_ptr(this_arg);
12543 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12544 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
12545 void* msg_ptr = untag_ptr(msg);
12546 CHECK_ACCESS(msg_ptr);
12547 LDKType msg_conv = *(LDKType*)(msg_ptr);
12548 if (msg_conv.free == LDKType_JCalls_free) {
12549 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
12550 LDKType_JCalls_cloned(&msg_conv);
12552 LDKPublicKey sender_node_id_ref;
12553 CHECK((*env)->GetArrayLength(env, sender_node_id) == 33);
12554 (*env)->GetByteArrayRegion(env, sender_node_id, 0, 33, sender_node_id_ref.compressed_form);
12555 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
12556 *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref);
12557 return tag_ptr(ret_conv, true);
12560 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1get_1and_1clear_1pending_1msg(JNIEnv *env, jclass clz, int64_t this_arg) {
12561 void* this_arg_ptr = untag_ptr(this_arg);
12562 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12563 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
12564 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
12565 int64_tArray ret_arr = NULL;
12566 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
12567 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
12568 for (size_t z = 0; z < ret_var.datalen; z++) {
12569 LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
12570 *ret_conv_25_conv = ret_var.data[z];
12571 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
12573 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
12574 FREE(ret_var.data);
12578 typedef struct LDKSocketDescriptor_JCalls {
12579 atomic_size_t refcnt;
12582 jmethodID send_data_meth;
12583 jmethodID disconnect_socket_meth;
12585 jmethodID hash_meth;
12586 } LDKSocketDescriptor_JCalls;
12587 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
12588 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
12589 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12591 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12592 if (get_jenv_res == JNI_EDETACHED) {
12593 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12595 DO_ASSERT(get_jenv_res == JNI_OK);
12597 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12598 if (get_jenv_res == JNI_EDETACHED) {
12599 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12604 uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
12605 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
12607 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12608 if (get_jenv_res == JNI_EDETACHED) {
12609 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12611 DO_ASSERT(get_jenv_res == JNI_OK);
12613 LDKu8slice data_var = data;
12614 int8_tArray data_arr = (*env)->NewByteArray(env, data_var.datalen);
12615 (*env)->SetByteArrayRegion(env, data_arr, 0, data_var.datalen, data_var.data);
12616 jboolean resume_read_conv = resume_read;
12617 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12618 CHECK(obj != NULL);
12619 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_data_meth, data_arr, resume_read_conv);
12620 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12621 (*env)->ExceptionDescribe(env);
12622 (*env)->FatalError(env, "A call to send_data in LDKSocketDescriptor from rust threw an exception.");
12624 if (get_jenv_res == JNI_EDETACHED) {
12625 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12629 void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
12630 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
12632 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12633 if (get_jenv_res == JNI_EDETACHED) {
12634 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12636 DO_ASSERT(get_jenv_res == JNI_OK);
12638 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12639 CHECK(obj != NULL);
12640 (*env)->CallVoidMethod(env, obj, j_calls->disconnect_socket_meth);
12641 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12642 (*env)->ExceptionDescribe(env);
12643 (*env)->FatalError(env, "A call to disconnect_socket in LDKSocketDescriptor from rust threw an exception.");
12645 if (get_jenv_res == JNI_EDETACHED) {
12646 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12649 bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
12650 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
12652 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12653 if (get_jenv_res == JNI_EDETACHED) {
12654 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12656 DO_ASSERT(get_jenv_res == JNI_OK);
12658 LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
12659 *other_arg_clone = SocketDescriptor_clone(other_arg);
12660 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12661 CHECK(obj != NULL);
12662 jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->eq_meth, tag_ptr(other_arg_clone, true));
12663 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12664 (*env)->ExceptionDescribe(env);
12665 (*env)->FatalError(env, "A call to eq in LDKSocketDescriptor from rust threw an exception.");
12667 if (get_jenv_res == JNI_EDETACHED) {
12668 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12672 uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
12673 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
12675 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12676 if (get_jenv_res == JNI_EDETACHED) {
12677 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12679 DO_ASSERT(get_jenv_res == JNI_OK);
12681 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12682 CHECK(obj != NULL);
12683 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->hash_meth);
12684 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12685 (*env)->ExceptionDescribe(env);
12686 (*env)->FatalError(env, "A call to hash in LDKSocketDescriptor from rust threw an exception.");
12688 if (get_jenv_res == JNI_EDETACHED) {
12689 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12693 static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
12694 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
12695 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12697 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv *env, jclass clz, jobject o) {
12698 jclass c = (*env)->GetObjectClass(env, o);
12700 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
12701 atomic_init(&calls->refcnt, 1);
12702 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12703 calls->o = (*env)->NewWeakGlobalRef(env, o);
12704 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "([BZ)J");
12705 CHECK(calls->send_data_meth != NULL);
12706 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
12707 CHECK(calls->disconnect_socket_meth != NULL);
12708 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
12709 CHECK(calls->eq_meth != NULL);
12710 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
12711 CHECK(calls->hash_meth != NULL);
12713 LDKSocketDescriptor ret = {
12714 .this_arg = (void*) calls,
12715 .send_data = send_data_LDKSocketDescriptor_jcall,
12716 .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
12717 .eq = eq_LDKSocketDescriptor_jcall,
12718 .hash = hash_LDKSocketDescriptor_jcall,
12719 .cloned = LDKSocketDescriptor_JCalls_cloned,
12720 .free = LDKSocketDescriptor_JCalls_free,
12724 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new(JNIEnv *env, jclass clz, jobject o) {
12725 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
12726 *res_ptr = LDKSocketDescriptor_init(env, clz, o);
12727 return tag_ptr(res_ptr, true);
12729 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) {
12730 void* this_arg_ptr = untag_ptr(this_arg);
12731 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12732 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
12733 LDKu8slice data_ref;
12734 data_ref.datalen = (*env)->GetArrayLength(env, data);
12735 data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
12736 int64_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
12737 (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0);
12741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket(JNIEnv *env, jclass clz, int64_t this_arg) {
12742 void* this_arg_ptr = untag_ptr(this_arg);
12743 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12744 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
12745 (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
12748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
12749 void* this_arg_ptr = untag_ptr(this_arg);
12750 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12751 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
12752 int64_t ret_conv = (this_arg_conv->hash)(this_arg_conv->this_arg);
12756 static jclass LDKEffectiveCapacity_ExactLiquidity_class = NULL;
12757 static jmethodID LDKEffectiveCapacity_ExactLiquidity_meth = NULL;
12758 static jclass LDKEffectiveCapacity_MaximumHTLC_class = NULL;
12759 static jmethodID LDKEffectiveCapacity_MaximumHTLC_meth = NULL;
12760 static jclass LDKEffectiveCapacity_Total_class = NULL;
12761 static jmethodID LDKEffectiveCapacity_Total_meth = NULL;
12762 static jclass LDKEffectiveCapacity_Infinite_class = NULL;
12763 static jmethodID LDKEffectiveCapacity_Infinite_meth = NULL;
12764 static jclass LDKEffectiveCapacity_Unknown_class = NULL;
12765 static jmethodID LDKEffectiveCapacity_Unknown_meth = NULL;
12766 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEffectiveCapacity_init (JNIEnv *env, jclass clz) {
12767 LDKEffectiveCapacity_ExactLiquidity_class =
12768 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$ExactLiquidity"));
12769 CHECK(LDKEffectiveCapacity_ExactLiquidity_class != NULL);
12770 LDKEffectiveCapacity_ExactLiquidity_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_ExactLiquidity_class, "<init>", "(J)V");
12771 CHECK(LDKEffectiveCapacity_ExactLiquidity_meth != NULL);
12772 LDKEffectiveCapacity_MaximumHTLC_class =
12773 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$MaximumHTLC"));
12774 CHECK(LDKEffectiveCapacity_MaximumHTLC_class != NULL);
12775 LDKEffectiveCapacity_MaximumHTLC_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_MaximumHTLC_class, "<init>", "(J)V");
12776 CHECK(LDKEffectiveCapacity_MaximumHTLC_meth != NULL);
12777 LDKEffectiveCapacity_Total_class =
12778 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Total"));
12779 CHECK(LDKEffectiveCapacity_Total_class != NULL);
12780 LDKEffectiveCapacity_Total_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Total_class, "<init>", "(JJ)V");
12781 CHECK(LDKEffectiveCapacity_Total_meth != NULL);
12782 LDKEffectiveCapacity_Infinite_class =
12783 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Infinite"));
12784 CHECK(LDKEffectiveCapacity_Infinite_class != NULL);
12785 LDKEffectiveCapacity_Infinite_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Infinite_class, "<init>", "()V");
12786 CHECK(LDKEffectiveCapacity_Infinite_meth != NULL);
12787 LDKEffectiveCapacity_Unknown_class =
12788 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Unknown"));
12789 CHECK(LDKEffectiveCapacity_Unknown_class != NULL);
12790 LDKEffectiveCapacity_Unknown_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Unknown_class, "<init>", "()V");
12791 CHECK(LDKEffectiveCapacity_Unknown_meth != NULL);
12793 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
12794 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
12796 case LDKEffectiveCapacity_ExactLiquidity: {
12797 int64_t liquidity_msat_conv = obj->exact_liquidity.liquidity_msat;
12798 return (*env)->NewObject(env, LDKEffectiveCapacity_ExactLiquidity_class, LDKEffectiveCapacity_ExactLiquidity_meth, liquidity_msat_conv);
12800 case LDKEffectiveCapacity_MaximumHTLC: {
12801 int64_t amount_msat_conv = obj->maximum_htlc.amount_msat;
12802 return (*env)->NewObject(env, LDKEffectiveCapacity_MaximumHTLC_class, LDKEffectiveCapacity_MaximumHTLC_meth, amount_msat_conv);
12804 case LDKEffectiveCapacity_Total: {
12805 int64_t capacity_msat_conv = obj->total.capacity_msat;
12806 int64_t htlc_maximum_msat_ref = tag_ptr(&obj->total.htlc_maximum_msat, false);
12807 return (*env)->NewObject(env, LDKEffectiveCapacity_Total_class, LDKEffectiveCapacity_Total_meth, capacity_msat_conv, htlc_maximum_msat_ref);
12809 case LDKEffectiveCapacity_Infinite: {
12810 return (*env)->NewObject(env, LDKEffectiveCapacity_Infinite_class, LDKEffectiveCapacity_Infinite_meth);
12812 case LDKEffectiveCapacity_Unknown: {
12813 return (*env)->NewObject(env, LDKEffectiveCapacity_Unknown_class, LDKEffectiveCapacity_Unknown_meth);
12818 typedef struct LDKLockableScore_JCalls {
12819 atomic_size_t refcnt;
12822 jmethodID lock_meth;
12823 } LDKLockableScore_JCalls;
12824 static void LDKLockableScore_JCalls_free(void* this_arg) {
12825 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
12826 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12828 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12829 if (get_jenv_res == JNI_EDETACHED) {
12830 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12832 DO_ASSERT(get_jenv_res == JNI_OK);
12834 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12835 if (get_jenv_res == JNI_EDETACHED) {
12836 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12841 LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
12842 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
12844 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12845 if (get_jenv_res == JNI_EDETACHED) {
12846 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12848 DO_ASSERT(get_jenv_res == JNI_OK);
12850 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12851 CHECK(obj != NULL);
12852 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->lock_meth);
12853 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12854 (*env)->ExceptionDescribe(env);
12855 (*env)->FatalError(env, "A call to lock in LDKLockableScore from rust threw an exception.");
12857 void* ret_ptr = untag_ptr(ret);
12858 CHECK_ACCESS(ret_ptr);
12859 LDKScore ret_conv = *(LDKScore*)(ret_ptr);
12860 if (ret_conv.free == LDKScore_JCalls_free) {
12861 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
12862 LDKScore_JCalls_cloned(&ret_conv);
12863 }// WARNING: we may need a move here but no clone is available for LDKScore
12865 if (get_jenv_res == JNI_EDETACHED) {
12866 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12870 static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
12871 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
12872 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12874 static inline LDKLockableScore LDKLockableScore_init (JNIEnv *env, jclass clz, jobject o) {
12875 jclass c = (*env)->GetObjectClass(env, o);
12877 LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
12878 atomic_init(&calls->refcnt, 1);
12879 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12880 calls->o = (*env)->NewWeakGlobalRef(env, o);
12881 calls->lock_meth = (*env)->GetMethodID(env, c, "lock", "()J");
12882 CHECK(calls->lock_meth != NULL);
12884 LDKLockableScore ret = {
12885 .this_arg = (void*) calls,
12886 .lock = lock_LDKLockableScore_jcall,
12887 .free = LDKLockableScore_JCalls_free,
12891 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLockableScore_1new(JNIEnv *env, jclass clz, jobject o) {
12892 LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
12893 *res_ptr = LDKLockableScore_init(env, clz, o);
12894 return tag_ptr(res_ptr, true);
12896 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1lock(JNIEnv *env, jclass clz, int64_t this_arg) {
12897 void* this_arg_ptr = untag_ptr(this_arg);
12898 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12899 LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
12900 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
12901 *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
12902 return tag_ptr(ret_ret, true);
12905 static jclass LDKGossipSync_P2P_class = NULL;
12906 static jmethodID LDKGossipSync_P2P_meth = NULL;
12907 static jclass LDKGossipSync_Rapid_class = NULL;
12908 static jmethodID LDKGossipSync_Rapid_meth = NULL;
12909 static jclass LDKGossipSync_None_class = NULL;
12910 static jmethodID LDKGossipSync_None_meth = NULL;
12911 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGossipSync_init (JNIEnv *env, jclass clz) {
12912 LDKGossipSync_P2P_class =
12913 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$P2P"));
12914 CHECK(LDKGossipSync_P2P_class != NULL);
12915 LDKGossipSync_P2P_meth = (*env)->GetMethodID(env, LDKGossipSync_P2P_class, "<init>", "(J)V");
12916 CHECK(LDKGossipSync_P2P_meth != NULL);
12917 LDKGossipSync_Rapid_class =
12918 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$Rapid"));
12919 CHECK(LDKGossipSync_Rapid_class != NULL);
12920 LDKGossipSync_Rapid_meth = (*env)->GetMethodID(env, LDKGossipSync_Rapid_class, "<init>", "(J)V");
12921 CHECK(LDKGossipSync_Rapid_meth != NULL);
12922 LDKGossipSync_None_class =
12923 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$None"));
12924 CHECK(LDKGossipSync_None_class != NULL);
12925 LDKGossipSync_None_meth = (*env)->GetMethodID(env, LDKGossipSync_None_class, "<init>", "()V");
12926 CHECK(LDKGossipSync_None_meth != NULL);
12928 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGossipSync_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
12929 LDKGossipSync *obj = (LDKGossipSync*)untag_ptr(ptr);
12931 case LDKGossipSync_P2P: {
12932 LDKP2PGossipSync p2p_var = obj->p2p;
12933 int64_t p2p_ref = 0;
12934 CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var);
12935 p2p_ref = tag_ptr(p2p_var.inner, false);
12936 return (*env)->NewObject(env, LDKGossipSync_P2P_class, LDKGossipSync_P2P_meth, p2p_ref);
12938 case LDKGossipSync_Rapid: {
12939 LDKRapidGossipSync rapid_var = obj->rapid;
12940 int64_t rapid_ref = 0;
12941 CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var);
12942 rapid_ref = tag_ptr(rapid_var.inner, false);
12943 return (*env)->NewObject(env, LDKGossipSync_Rapid_class, LDKGossipSync_Rapid_meth, rapid_ref);
12945 case LDKGossipSync_None: {
12946 return (*env)->NewObject(env, LDKGossipSync_None_class, LDKGossipSync_None_meth);
12951 static jclass LDKFallback_SegWitProgram_class = NULL;
12952 static jmethodID LDKFallback_SegWitProgram_meth = NULL;
12953 static jclass LDKFallback_PubKeyHash_class = NULL;
12954 static jmethodID LDKFallback_PubKeyHash_meth = NULL;
12955 static jclass LDKFallback_ScriptHash_class = NULL;
12956 static jmethodID LDKFallback_ScriptHash_meth = NULL;
12957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFallback_init (JNIEnv *env, jclass clz) {
12958 LDKFallback_SegWitProgram_class =
12959 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$SegWitProgram"));
12960 CHECK(LDKFallback_SegWitProgram_class != NULL);
12961 LDKFallback_SegWitProgram_meth = (*env)->GetMethodID(env, LDKFallback_SegWitProgram_class, "<init>", "(B[B)V");
12962 CHECK(LDKFallback_SegWitProgram_meth != NULL);
12963 LDKFallback_PubKeyHash_class =
12964 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$PubKeyHash"));
12965 CHECK(LDKFallback_PubKeyHash_class != NULL);
12966 LDKFallback_PubKeyHash_meth = (*env)->GetMethodID(env, LDKFallback_PubKeyHash_class, "<init>", "([B)V");
12967 CHECK(LDKFallback_PubKeyHash_meth != NULL);
12968 LDKFallback_ScriptHash_class =
12969 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$ScriptHash"));
12970 CHECK(LDKFallback_ScriptHash_class != NULL);
12971 LDKFallback_ScriptHash_meth = (*env)->GetMethodID(env, LDKFallback_ScriptHash_class, "<init>", "([B)V");
12972 CHECK(LDKFallback_ScriptHash_meth != NULL);
12974 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFallback_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
12975 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
12977 case LDKFallback_SegWitProgram: {
12978 uint8_t version_val = obj->seg_wit_program.version._0;
12979 LDKCVec_u8Z program_var = obj->seg_wit_program.program;
12980 int8_tArray program_arr = (*env)->NewByteArray(env, program_var.datalen);
12981 (*env)->SetByteArrayRegion(env, program_arr, 0, program_var.datalen, program_var.data);
12982 return (*env)->NewObject(env, LDKFallback_SegWitProgram_class, LDKFallback_SegWitProgram_meth, version_val, program_arr);
12984 case LDKFallback_PubKeyHash: {
12985 int8_tArray pub_key_hash_arr = (*env)->NewByteArray(env, 20);
12986 (*env)->SetByteArrayRegion(env, pub_key_hash_arr, 0, 20, obj->pub_key_hash.data);
12987 return (*env)->NewObject(env, LDKFallback_PubKeyHash_class, LDKFallback_PubKeyHash_meth, pub_key_hash_arr);
12989 case LDKFallback_ScriptHash: {
12990 int8_tArray script_hash_arr = (*env)->NewByteArray(env, 20);
12991 (*env)->SetByteArrayRegion(env, script_hash_arr, 0, 20, obj->script_hash.data);
12992 return (*env)->NewObject(env, LDKFallback_ScriptHash_class, LDKFallback_ScriptHash_meth, script_hash_arr);
12997 typedef struct LDKPayer_JCalls {
12998 atomic_size_t refcnt;
13001 jmethodID node_id_meth;
13002 jmethodID first_hops_meth;
13003 jmethodID send_payment_meth;
13004 jmethodID send_spontaneous_payment_meth;
13005 jmethodID retry_payment_meth;
13006 jmethodID abandon_payment_meth;
13008 static void LDKPayer_JCalls_free(void* this_arg) {
13009 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
13010 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
13012 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13013 if (get_jenv_res == JNI_EDETACHED) {
13014 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13016 DO_ASSERT(get_jenv_res == JNI_OK);
13018 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
13019 if (get_jenv_res == JNI_EDETACHED) {
13020 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13025 LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
13026 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
13028 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13029 if (get_jenv_res == JNI_EDETACHED) {
13030 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13032 DO_ASSERT(get_jenv_res == JNI_OK);
13034 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13035 CHECK(obj != NULL);
13036 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->node_id_meth);
13037 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13038 (*env)->ExceptionDescribe(env);
13039 (*env)->FatalError(env, "A call to node_id in LDKPayer from rust threw an exception.");
13041 LDKPublicKey ret_ref;
13042 CHECK((*env)->GetArrayLength(env, ret) == 33);
13043 (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
13044 if (get_jenv_res == JNI_EDETACHED) {
13045 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13049 LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
13050 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
13052 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13053 if (get_jenv_res == JNI_EDETACHED) {
13054 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13056 DO_ASSERT(get_jenv_res == JNI_OK);
13058 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13059 CHECK(obj != NULL);
13060 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->first_hops_meth);
13061 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13062 (*env)->ExceptionDescribe(env);
13063 (*env)->FatalError(env, "A call to first_hops in LDKPayer from rust threw an exception.");
13065 LDKCVec_ChannelDetailsZ ret_constr;
13066 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
13067 if (ret_constr.datalen > 0)
13068 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
13070 ret_constr.data = NULL;
13071 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
13072 for (size_t q = 0; q < ret_constr.datalen; q++) {
13073 int64_t ret_conv_16 = ret_vals[q];
13074 LDKChannelDetails ret_conv_16_conv;
13075 ret_conv_16_conv.inner = untag_ptr(ret_conv_16);
13076 ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16);
13077 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
13078 ret_constr.data[q] = ret_conv_16_conv;
13080 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
13081 if (get_jenv_res == JNI_EDETACHED) {
13082 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13086 LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
13087 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
13089 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13090 if (get_jenv_res == JNI_EDETACHED) {
13091 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13093 DO_ASSERT(get_jenv_res == JNI_OK);
13095 LDKRoute route_var = *route;
13096 int64_t route_ref = 0;
13097 route_var = Route_clone(&route_var);
13098 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
13099 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
13100 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
13101 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, payment_hash.data);
13102 int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
13103 (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, payment_secret.data);
13104 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13105 CHECK(obj != NULL);
13106 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_payment_meth, route_ref, payment_hash_arr, payment_secret_arr);
13107 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13108 (*env)->ExceptionDescribe(env);
13109 (*env)->FatalError(env, "A call to send_payment in LDKPayer from rust threw an exception.");
13111 void* ret_ptr = untag_ptr(ret);
13112 CHECK_ACCESS(ret_ptr);
13113 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
13114 FREE(untag_ptr(ret));
13115 if (get_jenv_res == JNI_EDETACHED) {
13116 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13120 LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
13121 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
13123 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13124 if (get_jenv_res == JNI_EDETACHED) {
13125 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13127 DO_ASSERT(get_jenv_res == JNI_OK);
13129 LDKRoute route_var = *route;
13130 int64_t route_ref = 0;
13131 route_var = Route_clone(&route_var);
13132 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
13133 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
13134 int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
13135 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, payment_preimage.data);
13136 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13137 CHECK(obj != NULL);
13138 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_spontaneous_payment_meth, route_ref, payment_preimage_arr);
13139 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13140 (*env)->ExceptionDescribe(env);
13141 (*env)->FatalError(env, "A call to send_spontaneous_payment in LDKPayer from rust threw an exception.");
13143 void* ret_ptr = untag_ptr(ret);
13144 CHECK_ACCESS(ret_ptr);
13145 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
13146 FREE(untag_ptr(ret));
13147 if (get_jenv_res == JNI_EDETACHED) {
13148 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13152 LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
13153 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
13155 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13156 if (get_jenv_res == JNI_EDETACHED) {
13157 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13159 DO_ASSERT(get_jenv_res == JNI_OK);
13161 LDKRoute route_var = *route;
13162 int64_t route_ref = 0;
13163 route_var = Route_clone(&route_var);
13164 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
13165 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
13166 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
13167 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data);
13168 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13169 CHECK(obj != NULL);
13170 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->retry_payment_meth, route_ref, payment_id_arr);
13171 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13172 (*env)->ExceptionDescribe(env);
13173 (*env)->FatalError(env, "A call to retry_payment in LDKPayer from rust threw an exception.");
13175 void* ret_ptr = untag_ptr(ret);
13176 CHECK_ACCESS(ret_ptr);
13177 LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
13178 FREE(untag_ptr(ret));
13179 if (get_jenv_res == JNI_EDETACHED) {
13180 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13184 void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
13185 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
13187 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13188 if (get_jenv_res == JNI_EDETACHED) {
13189 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13191 DO_ASSERT(get_jenv_res == JNI_OK);
13193 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
13194 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data);
13195 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13196 CHECK(obj != NULL);
13197 (*env)->CallVoidMethod(env, obj, j_calls->abandon_payment_meth, payment_id_arr);
13198 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13199 (*env)->ExceptionDescribe(env);
13200 (*env)->FatalError(env, "A call to abandon_payment in LDKPayer from rust threw an exception.");
13202 if (get_jenv_res == JNI_EDETACHED) {
13203 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13206 static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
13207 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
13208 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
13210 static inline LDKPayer LDKPayer_init (JNIEnv *env, jclass clz, jobject o) {
13211 jclass c = (*env)->GetObjectClass(env, o);
13213 LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
13214 atomic_init(&calls->refcnt, 1);
13215 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
13216 calls->o = (*env)->NewWeakGlobalRef(env, o);
13217 calls->node_id_meth = (*env)->GetMethodID(env, c, "node_id", "()[B");
13218 CHECK(calls->node_id_meth != NULL);
13219 calls->first_hops_meth = (*env)->GetMethodID(env, c, "first_hops", "()[J");
13220 CHECK(calls->first_hops_meth != NULL);
13221 calls->send_payment_meth = (*env)->GetMethodID(env, c, "send_payment", "(J[B[B)J");
13222 CHECK(calls->send_payment_meth != NULL);
13223 calls->send_spontaneous_payment_meth = (*env)->GetMethodID(env, c, "send_spontaneous_payment", "(J[B)J");
13224 CHECK(calls->send_spontaneous_payment_meth != NULL);
13225 calls->retry_payment_meth = (*env)->GetMethodID(env, c, "retry_payment", "(J[B)J");
13226 CHECK(calls->retry_payment_meth != NULL);
13227 calls->abandon_payment_meth = (*env)->GetMethodID(env, c, "abandon_payment", "([B)V");
13228 CHECK(calls->abandon_payment_meth != NULL);
13231 .this_arg = (void*) calls,
13232 .node_id = node_id_LDKPayer_jcall,
13233 .first_hops = first_hops_LDKPayer_jcall,
13234 .send_payment = send_payment_LDKPayer_jcall,
13235 .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
13236 .retry_payment = retry_payment_LDKPayer_jcall,
13237 .abandon_payment = abandon_payment_LDKPayer_jcall,
13238 .free = LDKPayer_JCalls_free,
13242 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPayer_1new(JNIEnv *env, jclass clz, jobject o) {
13243 LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
13244 *res_ptr = LDKPayer_init(env, clz, o);
13245 return tag_ptr(res_ptr, true);
13247 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
13248 void* this_arg_ptr = untag_ptr(this_arg);
13249 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13250 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
13251 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
13252 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form);
13256 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(JNIEnv *env, jclass clz, int64_t this_arg) {
13257 void* this_arg_ptr = untag_ptr(this_arg);
13258 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13259 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
13260 LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
13261 int64_tArray ret_arr = NULL;
13262 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
13263 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
13264 for (size_t q = 0; q < ret_var.datalen; q++) {
13265 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
13266 int64_t ret_conv_16_ref = 0;
13267 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
13268 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
13269 ret_arr_ptr[q] = ret_conv_16_ref;
13271 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
13272 FREE(ret_var.data);
13276 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) {
13277 void* this_arg_ptr = untag_ptr(this_arg);
13278 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13279 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
13280 LDKRoute route_conv;
13281 route_conv.inner = untag_ptr(route);
13282 route_conv.is_owned = ptr_is_owned(route);
13283 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
13284 route_conv.is_owned = false;
13285 LDKThirtyTwoBytes payment_hash_ref;
13286 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
13287 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
13288 LDKThirtyTwoBytes payment_secret_ref;
13289 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
13290 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
13291 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
13292 *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref);
13293 return tag_ptr(ret_conv, true);
13296 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) {
13297 void* this_arg_ptr = untag_ptr(this_arg);
13298 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13299 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
13300 LDKRoute route_conv;
13301 route_conv.inner = untag_ptr(route);
13302 route_conv.is_owned = ptr_is_owned(route);
13303 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
13304 route_conv.is_owned = false;
13305 LDKThirtyTwoBytes payment_preimage_ref;
13306 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
13307 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
13308 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
13309 *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
13310 return tag_ptr(ret_conv, true);
13313 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) {
13314 void* this_arg_ptr = untag_ptr(this_arg);
13315 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13316 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
13317 LDKRoute route_conv;
13318 route_conv.inner = untag_ptr(route);
13319 route_conv.is_owned = ptr_is_owned(route);
13320 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
13321 route_conv.is_owned = false;
13322 LDKThirtyTwoBytes payment_id_ref;
13323 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
13324 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
13325 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
13326 *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
13327 return tag_ptr(ret_conv, true);
13330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) {
13331 void* this_arg_ptr = untag_ptr(this_arg);
13332 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13333 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
13334 LDKThirtyTwoBytes payment_id_ref;
13335 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
13336 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
13337 (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
13340 typedef struct LDKRouter_JCalls {
13341 atomic_size_t refcnt;
13344 jmethodID find_route_meth;
13345 } LDKRouter_JCalls;
13346 static void LDKRouter_JCalls_free(void* this_arg) {
13347 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
13348 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
13350 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13351 if (get_jenv_res == JNI_EDETACHED) {
13352 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13354 DO_ASSERT(get_jenv_res == JNI_OK);
13356 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
13357 if (get_jenv_res == JNI_EDETACHED) {
13358 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13363 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, const LDKScore * scorer) {
13364 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
13366 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13367 if (get_jenv_res == JNI_EDETACHED) {
13368 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13370 DO_ASSERT(get_jenv_res == JNI_OK);
13372 int8_tArray payer_arr = (*env)->NewByteArray(env, 33);
13373 (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form);
13374 LDKRouteParameters route_params_var = *route_params;
13375 int64_t route_params_ref = 0;
13376 route_params_var = RouteParameters_clone(&route_params_var);
13377 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
13378 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
13379 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
13380 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, *payment_hash);
13381 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
13382 int64_tArray first_hops_arr = NULL;
13383 if (first_hops != NULL) {
13384 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
13385 first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen);
13386 int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL);
13387 for (size_t q = 0; q < first_hops_var.datalen; q++) {
13388 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
13389 int64_t first_hops_conv_16_ref = 0;
13390 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
13391 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
13392 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
13394 (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0);
13396 // WARNING: This object doesn't live past this scope, needs clone!
13397 int64_t ret_scorer = tag_ptr(scorer, false);
13398 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13399 CHECK(obj != NULL);
13400 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, payment_hash_arr, first_hops_arr, ret_scorer);
13401 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13402 (*env)->ExceptionDescribe(env);
13403 (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception.");
13405 void* ret_ptr = untag_ptr(ret);
13406 CHECK_ACCESS(ret_ptr);
13407 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
13408 FREE(untag_ptr(ret));
13409 if (get_jenv_res == JNI_EDETACHED) {
13410 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13414 static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
13415 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
13416 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
13418 static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) {
13419 jclass c = (*env)->GetObjectClass(env, o);
13421 LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
13422 atomic_init(&calls->refcnt, 1);
13423 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
13424 calls->o = (*env)->NewWeakGlobalRef(env, o);
13425 calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[B[JJ)J");
13426 CHECK(calls->find_route_meth != NULL);
13429 .this_arg = (void*) calls,
13430 .find_route = find_route_LDKRouter_jcall,
13431 .free = LDKRouter_JCalls_free,
13435 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, jclass clz, jobject o) {
13436 LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
13437 *res_ptr = LDKRouter_init(env, clz, o);
13438 return tag_ptr(res_ptr, true);
13440 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 scorer) {
13441 void* this_arg_ptr = untag_ptr(this_arg);
13442 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13443 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
13444 LDKPublicKey payer_ref;
13445 CHECK((*env)->GetArrayLength(env, payer) == 33);
13446 (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_ref.compressed_form);
13447 LDKRouteParameters route_params_conv;
13448 route_params_conv.inner = untag_ptr(route_params);
13449 route_params_conv.is_owned = ptr_is_owned(route_params);
13450 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
13451 route_params_conv.is_owned = false;
13452 unsigned char payment_hash_arr[32];
13453 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
13454 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
13455 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
13456 LDKCVec_ChannelDetailsZ first_hops_constr;
13457 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
13458 if (first_hops != NULL) {
13459 first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
13460 if (first_hops_constr.datalen > 0)
13461 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
13463 first_hops_constr.data = NULL;
13464 int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
13465 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
13466 int64_t first_hops_conv_16 = first_hops_vals[q];
13467 LDKChannelDetails first_hops_conv_16_conv;
13468 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
13469 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
13470 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
13471 first_hops_conv_16_conv.is_owned = false;
13472 first_hops_constr.data[q] = first_hops_conv_16_conv;
13474 (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
13475 first_hops_ptr = &first_hops_constr;
13477 void* scorer_ptr = untag_ptr(scorer);
13478 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
13479 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
13480 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
13481 *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, payment_hash_ref, first_hops_ptr, scorer_conv);
13482 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
13483 return tag_ptr(ret_conv, true);
13486 static jclass LDKRetry_Attempts_class = NULL;
13487 static jmethodID LDKRetry_Attempts_meth = NULL;
13488 static jclass LDKRetry_Timeout_class = NULL;
13489 static jmethodID LDKRetry_Timeout_meth = NULL;
13490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init (JNIEnv *env, jclass clz) {
13491 LDKRetry_Attempts_class =
13492 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Attempts"));
13493 CHECK(LDKRetry_Attempts_class != NULL);
13494 LDKRetry_Attempts_meth = (*env)->GetMethodID(env, LDKRetry_Attempts_class, "<init>", "(J)V");
13495 CHECK(LDKRetry_Attempts_meth != NULL);
13496 LDKRetry_Timeout_class =
13497 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Timeout"));
13498 CHECK(LDKRetry_Timeout_class != NULL);
13499 LDKRetry_Timeout_meth = (*env)->GetMethodID(env, LDKRetry_Timeout_class, "<init>", "(J)V");
13500 CHECK(LDKRetry_Timeout_meth != NULL);
13502 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
13503 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
13505 case LDKRetry_Attempts: {
13506 int64_t attempts_conv = obj->attempts;
13507 return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv);
13509 case LDKRetry_Timeout: {
13510 int64_t timeout_conv = obj->timeout;
13511 return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv);
13516 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version(JNIEnv *env, jclass clz) {
13517 LDKStr ret_str = _ldk_get_compiled_version();
13518 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
13523 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) {
13524 LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
13525 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
13530 static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) {
13531 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
13532 *ret_copy = Bech32Error_clone(arg);
13533 int64_t ret_ref = tag_ptr(ret_copy, true);
13536 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
13537 LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg);
13538 int64_t ret_conv = Bech32Error_clone_ptr(arg_conv);
13542 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone(JNIEnv *env, jclass clz, int64_t orig) {
13543 LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig);
13544 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
13545 *ret_copy = Bech32Error_clone(orig_conv);
13546 int64_t ret_ref = tag_ptr(ret_copy, true);
13550 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bech32Error_1free(JNIEnv *env, jclass clz, int64_t o) {
13551 if (!ptr_is_owned(o)) return;
13552 void* o_ptr = untag_ptr(o);
13553 CHECK_ACCESS(o_ptr);
13554 LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr);
13555 FREE(untag_ptr(o));
13556 Bech32Error_free(o_conv);
13559 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
13560 LDKTransaction _res_ref;
13561 _res_ref.datalen = (*env)->GetArrayLength(env, _res);
13562 _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
13563 (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
13564 _res_ref.data_is_owned = true;
13565 Transaction_free(_res_ref);
13568 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) {
13569 LDKCVec_u8Z script_pubkey_ref;
13570 script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
13571 script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
13572 (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data);
13573 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
13574 *ret_ref = TxOut_new(script_pubkey_ref, value);
13575 return tag_ptr(ret_ref, true);
13578 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) {
13579 if (!ptr_is_owned(_res)) return;
13580 void* _res_ptr = untag_ptr(_res);
13581 CHECK_ACCESS(_res_ptr);
13582 LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
13583 FREE(untag_ptr(_res));
13584 TxOut_free(_res_conv);
13587 static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) {
13588 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
13589 *ret_ref = TxOut_clone(arg);
13590 return tag_ptr(ret_ref, true);
13592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
13593 LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg);
13594 int64_t ret_conv = TxOut_clone_ptr(arg_conv);
13598 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) {
13599 LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig);
13600 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
13601 *ret_ref = TxOut_clone(orig_conv);
13602 return tag_ptr(ret_ref, true);
13605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) {
13606 LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
13610 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok(JNIEnv *env, jclass clz) {
13611 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
13612 *ret_conv = CResult_NoneNoneZ_ok();
13613 return tag_ptr(ret_conv, true);
13616 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNIEnv *env, jclass clz) {
13617 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
13618 *ret_conv = CResult_NoneNoneZ_err();
13619 return tag_ptr(ret_conv, true);
13622 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
13623 LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o);
13624 jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv);
13628 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
13629 if (!ptr_is_owned(_res)) return;
13630 void* _res_ptr = untag_ptr(_res);
13631 CHECK_ACCESS(_res_ptr);
13632 LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
13633 FREE(untag_ptr(_res));
13634 CResult_NoneNoneZ_free(_res_conv);
13637 static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) {
13638 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
13639 *ret_conv = CResult_NoneNoneZ_clone(arg);
13640 return tag_ptr(ret_conv, true);
13642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
13643 LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg);
13644 int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv);
13648 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
13649 LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig);
13650 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
13651 *ret_conv = CResult_NoneNoneZ_clone(orig_conv);
13652 return tag_ptr(ret_conv, true);
13655 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
13656 LDKCounterpartyCommitmentSecrets o_conv;
13657 o_conv.inner = untag_ptr(o);
13658 o_conv.is_owned = ptr_is_owned(o);
13659 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13660 o_conv = CounterpartyCommitmentSecrets_clone(&o_conv);
13661 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
13662 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv);
13663 return tag_ptr(ret_conv, true);
13666 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
13667 LDKDecodeError e_conv;
13668 e_conv.inner = untag_ptr(e);
13669 e_conv.is_owned = ptr_is_owned(e);
13670 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13671 e_conv = DecodeError_clone(&e_conv);
13672 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
13673 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
13674 return tag_ptr(ret_conv, true);
13677 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
13678 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o);
13679 jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv);
13683 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
13684 if (!ptr_is_owned(_res)) return;
13685 void* _res_ptr = untag_ptr(_res);
13686 CHECK_ACCESS(_res_ptr);
13687 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr);
13688 FREE(untag_ptr(_res));
13689 CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv);
13692 static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) {
13693 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
13694 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg);
13695 return tag_ptr(ret_conv, true);
13697 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
13698 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg);
13699 int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv);
13703 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
13704 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig);
13705 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
13706 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv);
13707 return tag_ptr(ret_conv, true);
13710 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
13711 LDKSecretKey o_ref;
13712 CHECK((*env)->GetArrayLength(env, o) == 32);
13713 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes);
13714 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
13715 *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
13716 return tag_ptr(ret_conv, true);
13719 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
13720 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
13721 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
13722 *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
13723 return tag_ptr(ret_conv, true);
13726 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
13727 LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(o);
13728 jboolean ret_conv = CResult_SecretKeyErrorZ_is_ok(o_conv);
13732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
13733 if (!ptr_is_owned(_res)) return;
13734 void* _res_ptr = untag_ptr(_res);
13735 CHECK_ACCESS(_res_ptr);
13736 LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
13737 FREE(untag_ptr(_res));
13738 CResult_SecretKeyErrorZ_free(_res_conv);
13741 static inline uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg) {
13742 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
13743 *ret_conv = CResult_SecretKeyErrorZ_clone(arg);
13744 return tag_ptr(ret_conv, true);
13746 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
13747 LDKCResult_SecretKeyErrorZ* arg_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(arg);
13748 int64_t ret_conv = CResult_SecretKeyErrorZ_clone_ptr(arg_conv);
13752 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
13753 LDKCResult_SecretKeyErrorZ* orig_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(orig);
13754 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
13755 *ret_conv = CResult_SecretKeyErrorZ_clone(orig_conv);
13756 return tag_ptr(ret_conv, true);
13759 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
13760 LDKPublicKey o_ref;
13761 CHECK((*env)->GetArrayLength(env, o) == 33);
13762 (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
13763 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
13764 *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
13765 return tag_ptr(ret_conv, true);
13768 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
13769 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
13770 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
13771 *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
13772 return tag_ptr(ret_conv, true);
13775 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
13776 LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
13777 jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
13781 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
13782 if (!ptr_is_owned(_res)) return;
13783 void* _res_ptr = untag_ptr(_res);
13784 CHECK_ACCESS(_res_ptr);
13785 LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
13786 FREE(untag_ptr(_res));
13787 CResult_PublicKeyErrorZ_free(_res_conv);
13790 static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
13791 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
13792 *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
13793 return tag_ptr(ret_conv, true);
13795 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
13796 LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
13797 int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
13801 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
13802 LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
13803 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
13804 *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
13805 return tag_ptr(ret_conv, true);
13808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
13809 LDKTxCreationKeys o_conv;
13810 o_conv.inner = untag_ptr(o);
13811 o_conv.is_owned = ptr_is_owned(o);
13812 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13813 o_conv = TxCreationKeys_clone(&o_conv);
13814 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
13815 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
13816 return tag_ptr(ret_conv, true);
13819 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
13820 LDKDecodeError e_conv;
13821 e_conv.inner = untag_ptr(e);
13822 e_conv.is_owned = ptr_is_owned(e);
13823 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13824 e_conv = DecodeError_clone(&e_conv);
13825 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
13826 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
13827 return tag_ptr(ret_conv, true);
13830 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
13831 LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
13832 jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
13836 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
13837 if (!ptr_is_owned(_res)) return;
13838 void* _res_ptr = untag_ptr(_res);
13839 CHECK_ACCESS(_res_ptr);
13840 LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
13841 FREE(untag_ptr(_res));
13842 CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
13845 static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
13846 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
13847 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
13848 return tag_ptr(ret_conv, true);
13850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
13851 LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
13852 int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
13856 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
13857 LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
13858 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
13859 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
13860 return tag_ptr(ret_conv, true);
13863 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
13864 LDKChannelPublicKeys o_conv;
13865 o_conv.inner = untag_ptr(o);
13866 o_conv.is_owned = ptr_is_owned(o);
13867 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13868 o_conv = ChannelPublicKeys_clone(&o_conv);
13869 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
13870 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
13871 return tag_ptr(ret_conv, true);
13874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
13875 LDKDecodeError e_conv;
13876 e_conv.inner = untag_ptr(e);
13877 e_conv.is_owned = ptr_is_owned(e);
13878 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13879 e_conv = DecodeError_clone(&e_conv);
13880 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
13881 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
13882 return tag_ptr(ret_conv, true);
13885 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
13886 LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o);
13887 jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv);
13891 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
13892 if (!ptr_is_owned(_res)) return;
13893 void* _res_ptr = untag_ptr(_res);
13894 CHECK_ACCESS(_res_ptr);
13895 LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
13896 FREE(untag_ptr(_res));
13897 CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
13900 static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) {
13901 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
13902 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg);
13903 return tag_ptr(ret_conv, true);
13905 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
13906 LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg);
13907 int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv);
13911 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
13912 LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig);
13913 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
13914 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv);
13915 return tag_ptr(ret_conv, true);
13918 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
13919 LDKTxCreationKeys o_conv;
13920 o_conv.inner = untag_ptr(o);
13921 o_conv.is_owned = ptr_is_owned(o);
13922 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13923 o_conv = TxCreationKeys_clone(&o_conv);
13924 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
13925 *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv);
13926 return tag_ptr(ret_conv, true);
13929 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
13930 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
13931 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
13932 *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv);
13933 return tag_ptr(ret_conv, true);
13936 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
13937 LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(o);
13938 jboolean ret_conv = CResult_TxCreationKeysErrorZ_is_ok(o_conv);
13942 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
13943 if (!ptr_is_owned(_res)) return;
13944 void* _res_ptr = untag_ptr(_res);
13945 CHECK_ACCESS(_res_ptr);
13946 LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
13947 FREE(untag_ptr(_res));
13948 CResult_TxCreationKeysErrorZ_free(_res_conv);
13951 static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) {
13952 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
13953 *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg);
13954 return tag_ptr(ret_conv, true);
13956 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
13957 LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(arg);
13958 int64_t ret_conv = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv);
13962 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
13963 LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(orig);
13964 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
13965 *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv);
13966 return tag_ptr(ret_conv, true);
13969 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1some(JNIEnv *env, jclass clz, int32_t o) {
13970 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
13971 *ret_copy = COption_u32Z_some(o);
13972 int64_t ret_ref = tag_ptr(ret_copy, true);
13976 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1none(JNIEnv *env, jclass clz) {
13977 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
13978 *ret_copy = COption_u32Z_none();
13979 int64_t ret_ref = tag_ptr(ret_copy, true);
13983 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
13984 if (!ptr_is_owned(_res)) return;
13985 void* _res_ptr = untag_ptr(_res);
13986 CHECK_ACCESS(_res_ptr);
13987 LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
13988 FREE(untag_ptr(_res));
13989 COption_u32Z_free(_res_conv);
13992 static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) {
13993 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
13994 *ret_copy = COption_u32Z_clone(arg);
13995 int64_t ret_ref = tag_ptr(ret_copy, true);
13998 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
13999 LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)untag_ptr(arg);
14000 int64_t ret_conv = COption_u32Z_clone_ptr(arg_conv);
14004 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14005 LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)untag_ptr(orig);
14006 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
14007 *ret_copy = COption_u32Z_clone(orig_conv);
14008 int64_t ret_ref = tag_ptr(ret_copy, true);
14012 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14013 LDKHTLCOutputInCommitment o_conv;
14014 o_conv.inner = untag_ptr(o);
14015 o_conv.is_owned = ptr_is_owned(o);
14016 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14017 o_conv = HTLCOutputInCommitment_clone(&o_conv);
14018 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
14019 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv);
14020 return tag_ptr(ret_conv, true);
14023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14024 LDKDecodeError e_conv;
14025 e_conv.inner = untag_ptr(e);
14026 e_conv.is_owned = ptr_is_owned(e);
14027 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14028 e_conv = DecodeError_clone(&e_conv);
14029 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
14030 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
14031 return tag_ptr(ret_conv, true);
14034 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14035 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o);
14036 jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv);
14040 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14041 if (!ptr_is_owned(_res)) return;
14042 void* _res_ptr = untag_ptr(_res);
14043 CHECK_ACCESS(_res_ptr);
14044 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
14045 FREE(untag_ptr(_res));
14046 CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
14049 static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) {
14050 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
14051 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg);
14052 return tag_ptr(ret_conv, true);
14054 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14055 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg);
14056 int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv);
14060 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14061 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig);
14062 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
14063 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv);
14064 return tag_ptr(ret_conv, true);
14067 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1some(JNIEnv *env, jclass clz) {
14068 jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_some());
14072 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1none(JNIEnv *env, jclass clz) {
14073 jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_none());
14077 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1free(JNIEnv *env, jclass clz, jclass _res) {
14078 LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_java(env, _res);
14079 COption_NoneZ_free(_res_conv);
14082 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14083 LDKCounterpartyChannelTransactionParameters o_conv;
14084 o_conv.inner = untag_ptr(o);
14085 o_conv.is_owned = ptr_is_owned(o);
14086 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14087 o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv);
14088 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
14089 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv);
14090 return tag_ptr(ret_conv, true);
14093 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14094 LDKDecodeError e_conv;
14095 e_conv.inner = untag_ptr(e);
14096 e_conv.is_owned = ptr_is_owned(e);
14097 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14098 e_conv = DecodeError_clone(&e_conv);
14099 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
14100 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
14101 return tag_ptr(ret_conv, true);
14104 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14105 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
14106 jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
14110 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14111 if (!ptr_is_owned(_res)) return;
14112 void* _res_ptr = untag_ptr(_res);
14113 CHECK_ACCESS(_res_ptr);
14114 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
14115 FREE(untag_ptr(_res));
14116 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
14119 static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
14120 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
14121 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg);
14122 return tag_ptr(ret_conv, true);
14124 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14125 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
14126 int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
14130 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14131 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
14132 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
14133 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
14134 return tag_ptr(ret_conv, true);
14137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14138 LDKChannelTransactionParameters o_conv;
14139 o_conv.inner = untag_ptr(o);
14140 o_conv.is_owned = ptr_is_owned(o);
14141 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14142 o_conv = ChannelTransactionParameters_clone(&o_conv);
14143 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
14144 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv);
14145 return tag_ptr(ret_conv, true);
14148 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14149 LDKDecodeError e_conv;
14150 e_conv.inner = untag_ptr(e);
14151 e_conv.is_owned = ptr_is_owned(e);
14152 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14153 e_conv = DecodeError_clone(&e_conv);
14154 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
14155 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
14156 return tag_ptr(ret_conv, true);
14159 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14160 LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
14161 jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
14165 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14166 if (!ptr_is_owned(_res)) return;
14167 void* _res_ptr = untag_ptr(_res);
14168 CHECK_ACCESS(_res_ptr);
14169 LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
14170 FREE(untag_ptr(_res));
14171 CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
14174 static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
14175 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
14176 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg);
14177 return tag_ptr(ret_conv, true);
14179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14180 LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
14181 int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
14185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14186 LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
14187 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
14188 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
14189 return tag_ptr(ret_conv, true);
14192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
14193 LDKCVec_SignatureZ _res_constr;
14194 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
14195 if (_res_constr.datalen > 0)
14196 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
14198 _res_constr.data = NULL;
14199 for (size_t i = 0; i < _res_constr.datalen; i++) {
14200 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
14201 LDKSignature _res_conv_8_ref;
14202 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 64);
14203 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 64, _res_conv_8_ref.compact_form);
14204 _res_constr.data[i] = _res_conv_8_ref;
14206 CVec_SignatureZ_free(_res_constr);
14209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14210 LDKHolderCommitmentTransaction o_conv;
14211 o_conv.inner = untag_ptr(o);
14212 o_conv.is_owned = ptr_is_owned(o);
14213 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14214 o_conv = HolderCommitmentTransaction_clone(&o_conv);
14215 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
14216 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv);
14217 return tag_ptr(ret_conv, true);
14220 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14221 LDKDecodeError e_conv;
14222 e_conv.inner = untag_ptr(e);
14223 e_conv.is_owned = ptr_is_owned(e);
14224 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14225 e_conv = DecodeError_clone(&e_conv);
14226 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
14227 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
14228 return tag_ptr(ret_conv, true);
14231 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14232 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
14233 jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
14237 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14238 if (!ptr_is_owned(_res)) return;
14239 void* _res_ptr = untag_ptr(_res);
14240 CHECK_ACCESS(_res_ptr);
14241 LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
14242 FREE(untag_ptr(_res));
14243 CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
14246 static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
14247 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
14248 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg);
14249 return tag_ptr(ret_conv, true);
14251 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14252 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
14253 int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
14257 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14258 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
14259 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
14260 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv);
14261 return tag_ptr(ret_conv, true);
14264 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14265 LDKBuiltCommitmentTransaction o_conv;
14266 o_conv.inner = untag_ptr(o);
14267 o_conv.is_owned = ptr_is_owned(o);
14268 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14269 o_conv = BuiltCommitmentTransaction_clone(&o_conv);
14270 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
14271 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv);
14272 return tag_ptr(ret_conv, true);
14275 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14276 LDKDecodeError e_conv;
14277 e_conv.inner = untag_ptr(e);
14278 e_conv.is_owned = ptr_is_owned(e);
14279 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14280 e_conv = DecodeError_clone(&e_conv);
14281 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
14282 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
14283 return tag_ptr(ret_conv, true);
14286 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14287 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
14288 jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
14292 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14293 if (!ptr_is_owned(_res)) return;
14294 void* _res_ptr = untag_ptr(_res);
14295 CHECK_ACCESS(_res_ptr);
14296 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
14297 FREE(untag_ptr(_res));
14298 CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
14301 static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
14302 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
14303 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg);
14304 return tag_ptr(ret_conv, true);
14306 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14307 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
14308 int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
14312 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14313 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
14314 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
14315 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv);
14316 return tag_ptr(ret_conv, true);
14319 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14320 LDKTrustedClosingTransaction o_conv;
14321 o_conv.inner = untag_ptr(o);
14322 o_conv.is_owned = ptr_is_owned(o);
14323 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14324 // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction
14326 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
14327 *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv);
14328 return tag_ptr(ret_conv, true);
14331 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1err(JNIEnv *env, jclass clz) {
14332 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
14333 *ret_conv = CResult_TrustedClosingTransactionNoneZ_err();
14334 return tag_ptr(ret_conv, true);
14337 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14338 LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o);
14339 jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv);
14343 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14344 if (!ptr_is_owned(_res)) return;
14345 void* _res_ptr = untag_ptr(_res);
14346 CHECK_ACCESS(_res_ptr);
14347 LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
14348 FREE(untag_ptr(_res));
14349 CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
14352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14353 LDKCommitmentTransaction o_conv;
14354 o_conv.inner = untag_ptr(o);
14355 o_conv.is_owned = ptr_is_owned(o);
14356 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14357 o_conv = CommitmentTransaction_clone(&o_conv);
14358 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
14359 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv);
14360 return tag_ptr(ret_conv, true);
14363 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14364 LDKDecodeError e_conv;
14365 e_conv.inner = untag_ptr(e);
14366 e_conv.is_owned = ptr_is_owned(e);
14367 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14368 e_conv = DecodeError_clone(&e_conv);
14369 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
14370 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
14371 return tag_ptr(ret_conv, true);
14374 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14375 LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o);
14376 jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv);
14380 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14381 if (!ptr_is_owned(_res)) return;
14382 void* _res_ptr = untag_ptr(_res);
14383 CHECK_ACCESS(_res_ptr);
14384 LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
14385 FREE(untag_ptr(_res));
14386 CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
14389 static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
14390 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
14391 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg);
14392 return tag_ptr(ret_conv, true);
14394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14395 LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
14396 int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
14400 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14401 LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
14402 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
14403 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv);
14404 return tag_ptr(ret_conv, true);
14407 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14408 LDKTrustedCommitmentTransaction o_conv;
14409 o_conv.inner = untag_ptr(o);
14410 o_conv.is_owned = ptr_is_owned(o);
14411 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14412 // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction
14414 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
14415 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv);
14416 return tag_ptr(ret_conv, true);
14419 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1err(JNIEnv *env, jclass clz) {
14420 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
14421 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err();
14422 return tag_ptr(ret_conv, true);
14425 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14426 LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o);
14427 jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv);
14431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14432 if (!ptr_is_owned(_res)) return;
14433 void* _res_ptr = untag_ptr(_res);
14434 CHECK_ACCESS(_res_ptr);
14435 LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
14436 FREE(untag_ptr(_res));
14437 CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
14440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) {
14441 LDKCVec_SignatureZ o_constr;
14442 o_constr.datalen = (*env)->GetArrayLength(env, o);
14443 if (o_constr.datalen > 0)
14444 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
14446 o_constr.data = NULL;
14447 for (size_t i = 0; i < o_constr.datalen; i++) {
14448 int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
14449 LDKSignature o_conv_8_ref;
14450 CHECK((*env)->GetArrayLength(env, o_conv_8) == 64);
14451 (*env)->GetByteArrayRegion(env, o_conv_8, 0, 64, o_conv_8_ref.compact_form);
14452 o_constr.data[i] = o_conv_8_ref;
14454 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
14455 *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
14456 return tag_ptr(ret_conv, true);
14459 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv *env, jclass clz) {
14460 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
14461 *ret_conv = CResult_CVec_SignatureZNoneZ_err();
14462 return tag_ptr(ret_conv, true);
14465 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14466 LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(o);
14467 jboolean ret_conv = CResult_CVec_SignatureZNoneZ_is_ok(o_conv);
14471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14472 if (!ptr_is_owned(_res)) return;
14473 void* _res_ptr = untag_ptr(_res);
14474 CHECK_ACCESS(_res_ptr);
14475 LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
14476 FREE(untag_ptr(_res));
14477 CResult_CVec_SignatureZNoneZ_free(_res_conv);
14480 static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) {
14481 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
14482 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg);
14483 return tag_ptr(ret_conv, true);
14485 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14486 LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(arg);
14487 int64_t ret_conv = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv);
14491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14492 LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(orig);
14493 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
14494 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv);
14495 return tag_ptr(ret_conv, true);
14498 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14499 LDKShutdownScript o_conv;
14500 o_conv.inner = untag_ptr(o);
14501 o_conv.is_owned = ptr_is_owned(o);
14502 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14503 o_conv = ShutdownScript_clone(&o_conv);
14504 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
14505 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv);
14506 return tag_ptr(ret_conv, true);
14509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14510 LDKDecodeError e_conv;
14511 e_conv.inner = untag_ptr(e);
14512 e_conv.is_owned = ptr_is_owned(e);
14513 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14514 e_conv = DecodeError_clone(&e_conv);
14515 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
14516 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
14517 return tag_ptr(ret_conv, true);
14520 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14521 LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o);
14522 jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv);
14526 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14527 if (!ptr_is_owned(_res)) return;
14528 void* _res_ptr = untag_ptr(_res);
14529 CHECK_ACCESS(_res_ptr);
14530 LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
14531 FREE(untag_ptr(_res));
14532 CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
14535 static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) {
14536 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
14537 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg);
14538 return tag_ptr(ret_conv, true);
14540 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14541 LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg);
14542 int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv);
14546 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14547 LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig);
14548 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
14549 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv);
14550 return tag_ptr(ret_conv, true);
14553 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14554 LDKShutdownScript o_conv;
14555 o_conv.inner = untag_ptr(o);
14556 o_conv.is_owned = ptr_is_owned(o);
14557 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14558 o_conv = ShutdownScript_clone(&o_conv);
14559 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
14560 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv);
14561 return tag_ptr(ret_conv, true);
14564 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14565 LDKInvalidShutdownScript e_conv;
14566 e_conv.inner = untag_ptr(e);
14567 e_conv.is_owned = ptr_is_owned(e);
14568 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14569 e_conv = InvalidShutdownScript_clone(&e_conv);
14570 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
14571 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
14572 return tag_ptr(ret_conv, true);
14575 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14576 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o);
14577 jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv);
14581 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14582 if (!ptr_is_owned(_res)) return;
14583 void* _res_ptr = untag_ptr(_res);
14584 CHECK_ACCESS(_res_ptr);
14585 LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
14586 FREE(untag_ptr(_res));
14587 CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
14590 static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) {
14591 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
14592 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg);
14593 return tag_ptr(ret_conv, true);
14595 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14596 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg);
14597 int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv);
14601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14602 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig);
14603 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
14604 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
14605 return tag_ptr(ret_conv, true);
14608 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1ok(JNIEnv *env, jclass clz) {
14609 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
14610 *ret_conv = CResult_NoneErrorZ_ok();
14611 return tag_ptr(ret_conv, true);
14614 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
14615 LDKIOError e_conv = LDKIOError_from_java(env, e);
14616 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
14617 *ret_conv = CResult_NoneErrorZ_err(e_conv);
14618 return tag_ptr(ret_conv, true);
14621 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14622 LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o);
14623 jboolean ret_conv = CResult_NoneErrorZ_is_ok(o_conv);
14627 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14628 if (!ptr_is_owned(_res)) return;
14629 void* _res_ptr = untag_ptr(_res);
14630 CHECK_ACCESS(_res_ptr);
14631 LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
14632 FREE(untag_ptr(_res));
14633 CResult_NoneErrorZ_free(_res_conv);
14636 static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) {
14637 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
14638 *ret_conv = CResult_NoneErrorZ_clone(arg);
14639 return tag_ptr(ret_conv, true);
14641 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14642 LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg);
14643 int64_t ret_conv = CResult_NoneErrorZ_clone_ptr(arg_conv);
14647 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14648 LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig);
14649 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
14650 *ret_conv = CResult_NoneErrorZ_clone(orig_conv);
14651 return tag_ptr(ret_conv, true);
14654 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14655 LDKRouteHop o_conv;
14656 o_conv.inner = untag_ptr(o);
14657 o_conv.is_owned = ptr_is_owned(o);
14658 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14659 o_conv = RouteHop_clone(&o_conv);
14660 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
14661 *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
14662 return tag_ptr(ret_conv, true);
14665 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14666 LDKDecodeError e_conv;
14667 e_conv.inner = untag_ptr(e);
14668 e_conv.is_owned = ptr_is_owned(e);
14669 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14670 e_conv = DecodeError_clone(&e_conv);
14671 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
14672 *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
14673 return tag_ptr(ret_conv, true);
14676 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14677 LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
14678 jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
14682 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14683 if (!ptr_is_owned(_res)) return;
14684 void* _res_ptr = untag_ptr(_res);
14685 CHECK_ACCESS(_res_ptr);
14686 LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
14687 FREE(untag_ptr(_res));
14688 CResult_RouteHopDecodeErrorZ_free(_res_conv);
14691 static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
14692 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
14693 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
14694 return tag_ptr(ret_conv, true);
14696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14697 LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
14698 int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
14702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14703 LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
14704 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
14705 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
14706 return tag_ptr(ret_conv, true);
14709 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
14710 LDKCVec_RouteHopZ _res_constr;
14711 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
14712 if (_res_constr.datalen > 0)
14713 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
14715 _res_constr.data = NULL;
14716 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
14717 for (size_t k = 0; k < _res_constr.datalen; k++) {
14718 int64_t _res_conv_10 = _res_vals[k];
14719 LDKRouteHop _res_conv_10_conv;
14720 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
14721 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
14722 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
14723 _res_constr.data[k] = _res_conv_10_conv;
14725 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
14726 CVec_RouteHopZ_free(_res_constr);
14729 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
14730 LDKCVec_CVec_RouteHopZZ _res_constr;
14731 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
14732 if (_res_constr.datalen > 0)
14733 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
14735 _res_constr.data = NULL;
14736 for (size_t m = 0; m < _res_constr.datalen; m++) {
14737 int64_tArray _res_conv_12 = (*env)->GetObjectArrayElement(env, _res, m);
14738 LDKCVec_RouteHopZ _res_conv_12_constr;
14739 _res_conv_12_constr.datalen = (*env)->GetArrayLength(env, _res_conv_12);
14740 if (_res_conv_12_constr.datalen > 0)
14741 _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
14743 _res_conv_12_constr.data = NULL;
14744 int64_t* _res_conv_12_vals = (*env)->GetLongArrayElements (env, _res_conv_12, NULL);
14745 for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
14746 int64_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
14747 LDKRouteHop _res_conv_12_conv_10_conv;
14748 _res_conv_12_conv_10_conv.inner = untag_ptr(_res_conv_12_conv_10);
14749 _res_conv_12_conv_10_conv.is_owned = ptr_is_owned(_res_conv_12_conv_10);
14750 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
14751 _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
14753 (*env)->ReleaseLongArrayElements(env, _res_conv_12, _res_conv_12_vals, 0);
14754 _res_constr.data[m] = _res_conv_12_constr;
14756 CVec_CVec_RouteHopZZ_free(_res_constr);
14759 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14761 o_conv.inner = untag_ptr(o);
14762 o_conv.is_owned = ptr_is_owned(o);
14763 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14764 o_conv = Route_clone(&o_conv);
14765 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
14766 *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv);
14767 return tag_ptr(ret_conv, true);
14770 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14771 LDKDecodeError e_conv;
14772 e_conv.inner = untag_ptr(e);
14773 e_conv.is_owned = ptr_is_owned(e);
14774 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14775 e_conv = DecodeError_clone(&e_conv);
14776 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
14777 *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
14778 return tag_ptr(ret_conv, true);
14781 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14782 LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(o);
14783 jboolean ret_conv = CResult_RouteDecodeErrorZ_is_ok(o_conv);
14787 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14788 if (!ptr_is_owned(_res)) return;
14789 void* _res_ptr = untag_ptr(_res);
14790 CHECK_ACCESS(_res_ptr);
14791 LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
14792 FREE(untag_ptr(_res));
14793 CResult_RouteDecodeErrorZ_free(_res_conv);
14796 static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) {
14797 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
14798 *ret_conv = CResult_RouteDecodeErrorZ_clone(arg);
14799 return tag_ptr(ret_conv, true);
14801 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14802 LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(arg);
14803 int64_t ret_conv = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv);
14807 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14808 LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(orig);
14809 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
14810 *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv);
14811 return tag_ptr(ret_conv, true);
14814 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14815 LDKRouteParameters o_conv;
14816 o_conv.inner = untag_ptr(o);
14817 o_conv.is_owned = ptr_is_owned(o);
14818 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14819 o_conv = RouteParameters_clone(&o_conv);
14820 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
14821 *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
14822 return tag_ptr(ret_conv, true);
14825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14826 LDKDecodeError e_conv;
14827 e_conv.inner = untag_ptr(e);
14828 e_conv.is_owned = ptr_is_owned(e);
14829 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14830 e_conv = DecodeError_clone(&e_conv);
14831 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
14832 *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
14833 return tag_ptr(ret_conv, true);
14836 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14837 LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(o);
14838 jboolean ret_conv = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv);
14842 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14843 if (!ptr_is_owned(_res)) return;
14844 void* _res_ptr = untag_ptr(_res);
14845 CHECK_ACCESS(_res_ptr);
14846 LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
14847 FREE(untag_ptr(_res));
14848 CResult_RouteParametersDecodeErrorZ_free(_res_conv);
14851 static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) {
14852 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
14853 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg);
14854 return tag_ptr(ret_conv, true);
14856 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14857 LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(arg);
14858 int64_t ret_conv = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv);
14862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14863 LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(orig);
14864 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
14865 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
14866 return tag_ptr(ret_conv, true);
14869 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
14870 LDKCVec_RouteHintZ _res_constr;
14871 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
14872 if (_res_constr.datalen > 0)
14873 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
14875 _res_constr.data = NULL;
14876 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
14877 for (size_t l = 0; l < _res_constr.datalen; l++) {
14878 int64_t _res_conv_11 = _res_vals[l];
14879 LDKRouteHint _res_conv_11_conv;
14880 _res_conv_11_conv.inner = untag_ptr(_res_conv_11);
14881 _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11);
14882 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
14883 _res_constr.data[l] = _res_conv_11_conv;
14885 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
14886 CVec_RouteHintZ_free(_res_constr);
14889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) {
14890 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
14891 *ret_copy = COption_u64Z_some(o);
14892 int64_t ret_ref = tag_ptr(ret_copy, true);
14896 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) {
14897 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
14898 *ret_copy = COption_u64Z_none();
14899 int64_t ret_ref = tag_ptr(ret_copy, true);
14903 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
14904 if (!ptr_is_owned(_res)) return;
14905 void* _res_ptr = untag_ptr(_res);
14906 CHECK_ACCESS(_res_ptr);
14907 LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
14908 FREE(untag_ptr(_res));
14909 COption_u64Z_free(_res_conv);
14912 static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
14913 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
14914 *ret_copy = COption_u64Z_clone(arg);
14915 int64_t ret_ref = tag_ptr(ret_copy, true);
14918 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14919 LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
14920 int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
14924 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14925 LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
14926 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
14927 *ret_copy = COption_u64Z_clone(orig_conv);
14928 int64_t ret_ref = tag_ptr(ret_copy, true);
14932 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
14933 LDKCVec_u64Z _res_constr;
14934 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
14935 if (_res_constr.datalen > 0)
14936 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
14938 _res_constr.data = NULL;
14939 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
14940 for (size_t g = 0; g < _res_constr.datalen; g++) {
14941 int64_t _res_conv_6 = _res_vals[g];
14942 _res_constr.data[g] = _res_conv_6;
14944 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
14945 CVec_u64Z_free(_res_constr);
14948 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
14949 LDKPaymentParameters o_conv;
14950 o_conv.inner = untag_ptr(o);
14951 o_conv.is_owned = ptr_is_owned(o);
14952 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14953 o_conv = PaymentParameters_clone(&o_conv);
14954 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
14955 *ret_conv = CResult_PaymentParametersDecodeErrorZ_ok(o_conv);
14956 return tag_ptr(ret_conv, true);
14959 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
14960 LDKDecodeError e_conv;
14961 e_conv.inner = untag_ptr(e);
14962 e_conv.is_owned = ptr_is_owned(e);
14963 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14964 e_conv = DecodeError_clone(&e_conv);
14965 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
14966 *ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
14967 return tag_ptr(ret_conv, true);
14970 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
14971 LDKCResult_PaymentParametersDecodeErrorZ* o_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(o);
14972 jboolean ret_conv = CResult_PaymentParametersDecodeErrorZ_is_ok(o_conv);
14976 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
14977 if (!ptr_is_owned(_res)) return;
14978 void* _res_ptr = untag_ptr(_res);
14979 CHECK_ACCESS(_res_ptr);
14980 LDKCResult_PaymentParametersDecodeErrorZ _res_conv = *(LDKCResult_PaymentParametersDecodeErrorZ*)(_res_ptr);
14981 FREE(untag_ptr(_res));
14982 CResult_PaymentParametersDecodeErrorZ_free(_res_conv);
14985 static inline uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg) {
14986 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
14987 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(arg);
14988 return tag_ptr(ret_conv, true);
14990 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
14991 LDKCResult_PaymentParametersDecodeErrorZ* arg_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(arg);
14992 int64_t ret_conv = CResult_PaymentParametersDecodeErrorZ_clone_ptr(arg_conv);
14996 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
14997 LDKCResult_PaymentParametersDecodeErrorZ* orig_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(orig);
14998 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
14999 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(orig_conv);
15000 return tag_ptr(ret_conv, true);
15003 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
15004 LDKCVec_RouteHintHopZ _res_constr;
15005 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15006 if (_res_constr.datalen > 0)
15007 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
15009 _res_constr.data = NULL;
15010 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
15011 for (size_t o = 0; o < _res_constr.datalen; o++) {
15012 int64_t _res_conv_14 = _res_vals[o];
15013 LDKRouteHintHop _res_conv_14_conv;
15014 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
15015 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
15016 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
15017 _res_constr.data[o] = _res_conv_14_conv;
15019 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
15020 CVec_RouteHintHopZ_free(_res_constr);
15023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15024 LDKRouteHint o_conv;
15025 o_conv.inner = untag_ptr(o);
15026 o_conv.is_owned = ptr_is_owned(o);
15027 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15028 o_conv = RouteHint_clone(&o_conv);
15029 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
15030 *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
15031 return tag_ptr(ret_conv, true);
15034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15035 LDKDecodeError e_conv;
15036 e_conv.inner = untag_ptr(e);
15037 e_conv.is_owned = ptr_is_owned(e);
15038 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15039 e_conv = DecodeError_clone(&e_conv);
15040 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
15041 *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
15042 return tag_ptr(ret_conv, true);
15045 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15046 LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(o);
15047 jboolean ret_conv = CResult_RouteHintDecodeErrorZ_is_ok(o_conv);
15051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15052 if (!ptr_is_owned(_res)) return;
15053 void* _res_ptr = untag_ptr(_res);
15054 CHECK_ACCESS(_res_ptr);
15055 LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
15056 FREE(untag_ptr(_res));
15057 CResult_RouteHintDecodeErrorZ_free(_res_conv);
15060 static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) {
15061 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
15062 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg);
15063 return tag_ptr(ret_conv, true);
15065 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15066 LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(arg);
15067 int64_t ret_conv = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv);
15071 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15072 LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(orig);
15073 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
15074 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
15075 return tag_ptr(ret_conv, true);
15078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15079 LDKRouteHintHop o_conv;
15080 o_conv.inner = untag_ptr(o);
15081 o_conv.is_owned = ptr_is_owned(o);
15082 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15083 o_conv = RouteHintHop_clone(&o_conv);
15084 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
15085 *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
15086 return tag_ptr(ret_conv, true);
15089 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15090 LDKDecodeError e_conv;
15091 e_conv.inner = untag_ptr(e);
15092 e_conv.is_owned = ptr_is_owned(e);
15093 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15094 e_conv = DecodeError_clone(&e_conv);
15095 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
15096 *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
15097 return tag_ptr(ret_conv, true);
15100 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15101 LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(o);
15102 jboolean ret_conv = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv);
15106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15107 if (!ptr_is_owned(_res)) return;
15108 void* _res_ptr = untag_ptr(_res);
15109 CHECK_ACCESS(_res_ptr);
15110 LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
15111 FREE(untag_ptr(_res));
15112 CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
15115 static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) {
15116 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
15117 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg);
15118 return tag_ptr(ret_conv, true);
15120 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15121 LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(arg);
15122 int64_t ret_conv = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv);
15126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15127 LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(orig);
15128 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
15129 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
15130 return tag_ptr(ret_conv, true);
15133 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
15134 LDKCVec_ChannelDetailsZ _res_constr;
15135 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15136 if (_res_constr.datalen > 0)
15137 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
15139 _res_constr.data = NULL;
15140 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
15141 for (size_t q = 0; q < _res_constr.datalen; q++) {
15142 int64_t _res_conv_16 = _res_vals[q];
15143 LDKChannelDetails _res_conv_16_conv;
15144 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
15145 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
15146 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
15147 _res_constr.data[q] = _res_conv_16_conv;
15149 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
15150 CVec_ChannelDetailsZ_free(_res_constr);
15153 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15155 o_conv.inner = untag_ptr(o);
15156 o_conv.is_owned = ptr_is_owned(o);
15157 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15158 o_conv = Route_clone(&o_conv);
15159 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
15160 *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
15161 return tag_ptr(ret_conv, true);
15164 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15165 LDKLightningError e_conv;
15166 e_conv.inner = untag_ptr(e);
15167 e_conv.is_owned = ptr_is_owned(e);
15168 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15169 e_conv = LightningError_clone(&e_conv);
15170 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
15171 *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
15172 return tag_ptr(ret_conv, true);
15175 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15176 LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
15177 jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
15181 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15182 if (!ptr_is_owned(_res)) return;
15183 void* _res_ptr = untag_ptr(_res);
15184 CHECK_ACCESS(_res_ptr);
15185 LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
15186 FREE(untag_ptr(_res));
15187 CResult_RouteLightningErrorZ_free(_res_conv);
15190 static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
15191 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
15192 *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
15193 return tag_ptr(ret_conv, true);
15195 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15196 LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
15197 int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
15201 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15202 LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
15203 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
15204 *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
15205 return tag_ptr(ret_conv, true);
15208 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
15209 LDKCVec_PublicKeyZ _res_constr;
15210 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15211 if (_res_constr.datalen > 0)
15212 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
15214 _res_constr.data = NULL;
15215 for (size_t i = 0; i < _res_constr.datalen; i++) {
15216 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
15217 LDKPublicKey _res_conv_8_ref;
15218 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33);
15219 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form);
15220 _res_constr.data[i] = _res_conv_8_ref;
15222 CVec_PublicKeyZ_free(_res_constr);
15225 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15226 void* o_ptr = untag_ptr(o);
15227 CHECK_ACCESS(o_ptr);
15228 LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
15229 o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
15230 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
15231 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
15232 return tag_ptr(ret_conv, true);
15235 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15236 LDKDecodeError e_conv;
15237 e_conv.inner = untag_ptr(e);
15238 e_conv.is_owned = ptr_is_owned(e);
15239 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15240 e_conv = DecodeError_clone(&e_conv);
15241 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
15242 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
15243 return tag_ptr(ret_conv, true);
15246 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15247 LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
15248 jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
15252 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15253 if (!ptr_is_owned(_res)) return;
15254 void* _res_ptr = untag_ptr(_res);
15255 CHECK_ACCESS(_res_ptr);
15256 LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
15257 FREE(untag_ptr(_res));
15258 CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
15261 static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
15262 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
15263 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
15264 return tag_ptr(ret_conv, true);
15266 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15267 LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
15268 int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
15272 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15273 LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
15274 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
15275 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
15276 return tag_ptr(ret_conv, true);
15279 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some(JNIEnv *env, jclass clz, int64_t o) {
15280 void* o_ptr = untag_ptr(o);
15281 CHECK_ACCESS(o_ptr);
15282 LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr);
15283 o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o));
15284 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
15285 *ret_copy = COption_ClosureReasonZ_some(o_conv);
15286 int64_t ret_ref = tag_ptr(ret_copy, true);
15290 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none(JNIEnv *env, jclass clz) {
15291 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
15292 *ret_copy = COption_ClosureReasonZ_none();
15293 int64_t ret_ref = tag_ptr(ret_copy, true);
15297 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15298 if (!ptr_is_owned(_res)) return;
15299 void* _res_ptr = untag_ptr(_res);
15300 CHECK_ACCESS(_res_ptr);
15301 LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr);
15302 FREE(untag_ptr(_res));
15303 COption_ClosureReasonZ_free(_res_conv);
15306 static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) {
15307 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
15308 *ret_copy = COption_ClosureReasonZ_clone(arg);
15309 int64_t ret_ref = tag_ptr(ret_copy, true);
15312 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15313 LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg);
15314 int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv);
15318 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15319 LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig);
15320 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
15321 *ret_copy = COption_ClosureReasonZ_clone(orig_conv);
15322 int64_t ret_ref = tag_ptr(ret_copy, true);
15326 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15327 void* o_ptr = untag_ptr(o);
15328 CHECK_ACCESS(o_ptr);
15329 LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr);
15330 o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o));
15331 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
15332 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv);
15333 return tag_ptr(ret_conv, true);
15336 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15337 LDKDecodeError e_conv;
15338 e_conv.inner = untag_ptr(e);
15339 e_conv.is_owned = ptr_is_owned(e);
15340 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15341 e_conv = DecodeError_clone(&e_conv);
15342 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
15343 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
15344 return tag_ptr(ret_conv, true);
15347 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15348 LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o);
15349 jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv);
15353 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15354 if (!ptr_is_owned(_res)) return;
15355 void* _res_ptr = untag_ptr(_res);
15356 CHECK_ACCESS(_res_ptr);
15357 LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr);
15358 FREE(untag_ptr(_res));
15359 CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv);
15362 static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) {
15363 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
15364 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg);
15365 return tag_ptr(ret_conv, true);
15367 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15368 LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg);
15369 int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv);
15373 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15374 LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig);
15375 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
15376 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv);
15377 return tag_ptr(ret_conv, true);
15380 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1some(JNIEnv *env, jclass clz, int64_t o) {
15381 void* o_ptr = untag_ptr(o);
15382 CHECK_ACCESS(o_ptr);
15383 LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr);
15384 o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o));
15385 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
15386 *ret_copy = COption_HTLCDestinationZ_some(o_conv);
15387 int64_t ret_ref = tag_ptr(ret_copy, true);
15391 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1none(JNIEnv *env, jclass clz) {
15392 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
15393 *ret_copy = COption_HTLCDestinationZ_none();
15394 int64_t ret_ref = tag_ptr(ret_copy, true);
15398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15399 if (!ptr_is_owned(_res)) return;
15400 void* _res_ptr = untag_ptr(_res);
15401 CHECK_ACCESS(_res_ptr);
15402 LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr);
15403 FREE(untag_ptr(_res));
15404 COption_HTLCDestinationZ_free(_res_conv);
15407 static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) {
15408 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
15409 *ret_copy = COption_HTLCDestinationZ_clone(arg);
15410 int64_t ret_ref = tag_ptr(ret_copy, true);
15413 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15414 LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg);
15415 int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv);
15419 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15420 LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig);
15421 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
15422 *ret_copy = COption_HTLCDestinationZ_clone(orig_conv);
15423 int64_t ret_ref = tag_ptr(ret_copy, true);
15427 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15428 void* o_ptr = untag_ptr(o);
15429 CHECK_ACCESS(o_ptr);
15430 LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr);
15431 o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o));
15432 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
15433 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv);
15434 return tag_ptr(ret_conv, true);
15437 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15438 LDKDecodeError e_conv;
15439 e_conv.inner = untag_ptr(e);
15440 e_conv.is_owned = ptr_is_owned(e);
15441 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15442 e_conv = DecodeError_clone(&e_conv);
15443 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
15444 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
15445 return tag_ptr(ret_conv, true);
15448 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15449 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o);
15450 jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv);
15454 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15455 if (!ptr_is_owned(_res)) return;
15456 void* _res_ptr = untag_ptr(_res);
15457 CHECK_ACCESS(_res_ptr);
15458 LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr);
15459 FREE(untag_ptr(_res));
15460 CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv);
15463 static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) {
15464 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
15465 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg);
15466 return tag_ptr(ret_conv, true);
15468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15469 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg);
15470 int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv);
15474 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15475 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig);
15476 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
15477 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv);
15478 return tag_ptr(ret_conv, true);
15481 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) {
15482 void* o_ptr = untag_ptr(o);
15483 CHECK_ACCESS(o_ptr);
15484 LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
15485 o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
15486 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
15487 *ret_copy = COption_NetworkUpdateZ_some(o_conv);
15488 int64_t ret_ref = tag_ptr(ret_copy, true);
15492 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1none(JNIEnv *env, jclass clz) {
15493 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
15494 *ret_copy = COption_NetworkUpdateZ_none();
15495 int64_t ret_ref = tag_ptr(ret_copy, true);
15499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15500 if (!ptr_is_owned(_res)) return;
15501 void* _res_ptr = untag_ptr(_res);
15502 CHECK_ACCESS(_res_ptr);
15503 LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
15504 FREE(untag_ptr(_res));
15505 COption_NetworkUpdateZ_free(_res_conv);
15508 static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
15509 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
15510 *ret_copy = COption_NetworkUpdateZ_clone(arg);
15511 int64_t ret_ref = tag_ptr(ret_copy, true);
15514 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15515 LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
15516 int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
15520 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15521 LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
15522 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
15523 *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
15524 int64_t ret_ref = tag_ptr(ret_copy, true);
15528 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
15529 LDKCVec_SpendableOutputDescriptorZ _res_constr;
15530 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15531 if (_res_constr.datalen > 0)
15532 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
15534 _res_constr.data = NULL;
15535 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
15536 for (size_t b = 0; b < _res_constr.datalen; b++) {
15537 int64_t _res_conv_27 = _res_vals[b];
15538 void* _res_conv_27_ptr = untag_ptr(_res_conv_27);
15539 CHECK_ACCESS(_res_conv_27_ptr);
15540 LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
15541 FREE(untag_ptr(_res_conv_27));
15542 _res_constr.data[b] = _res_conv_27_conv;
15544 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
15545 CVec_SpendableOutputDescriptorZ_free(_res_constr);
15548 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some(JNIEnv *env, jclass clz, int64_t o) {
15549 void* o_ptr = untag_ptr(o);
15550 CHECK_ACCESS(o_ptr);
15551 LDKEvent o_conv = *(LDKEvent*)(o_ptr);
15552 o_conv = Event_clone((LDKEvent*)untag_ptr(o));
15553 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
15554 *ret_copy = COption_EventZ_some(o_conv);
15555 int64_t ret_ref = tag_ptr(ret_copy, true);
15559 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none(JNIEnv *env, jclass clz) {
15560 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
15561 *ret_copy = COption_EventZ_none();
15562 int64_t ret_ref = tag_ptr(ret_copy, true);
15566 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15567 if (!ptr_is_owned(_res)) return;
15568 void* _res_ptr = untag_ptr(_res);
15569 CHECK_ACCESS(_res_ptr);
15570 LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr);
15571 FREE(untag_ptr(_res));
15572 COption_EventZ_free(_res_conv);
15575 static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) {
15576 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
15577 *ret_copy = COption_EventZ_clone(arg);
15578 int64_t ret_ref = tag_ptr(ret_copy, true);
15581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15582 LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg);
15583 int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv);
15587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15588 LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig);
15589 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
15590 *ret_copy = COption_EventZ_clone(orig_conv);
15591 int64_t ret_ref = tag_ptr(ret_copy, true);
15595 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15596 void* o_ptr = untag_ptr(o);
15597 CHECK_ACCESS(o_ptr);
15598 LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr);
15599 o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o));
15600 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
15601 *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv);
15602 return tag_ptr(ret_conv, true);
15605 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15606 LDKDecodeError e_conv;
15607 e_conv.inner = untag_ptr(e);
15608 e_conv.is_owned = ptr_is_owned(e);
15609 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15610 e_conv = DecodeError_clone(&e_conv);
15611 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
15612 *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
15613 return tag_ptr(ret_conv, true);
15616 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15617 LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o);
15618 jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv);
15622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15623 if (!ptr_is_owned(_res)) return;
15624 void* _res_ptr = untag_ptr(_res);
15625 CHECK_ACCESS(_res_ptr);
15626 LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr);
15627 FREE(untag_ptr(_res));
15628 CResult_COption_EventZDecodeErrorZ_free(_res_conv);
15631 static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) {
15632 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
15633 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg);
15634 return tag_ptr(ret_conv, true);
15636 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15637 LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg);
15638 int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv);
15642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15643 LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig);
15644 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
15645 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv);
15646 return tag_ptr(ret_conv, true);
15649 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
15650 LDKCVec_MessageSendEventZ _res_constr;
15651 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15652 if (_res_constr.datalen > 0)
15653 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
15655 _res_constr.data = NULL;
15656 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
15657 for (size_t s = 0; s < _res_constr.datalen; s++) {
15658 int64_t _res_conv_18 = _res_vals[s];
15659 void* _res_conv_18_ptr = untag_ptr(_res_conv_18);
15660 CHECK_ACCESS(_res_conv_18_ptr);
15661 LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
15662 FREE(untag_ptr(_res_conv_18));
15663 _res_constr.data[s] = _res_conv_18_conv;
15665 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
15666 CVec_MessageSendEventZ_free(_res_constr);
15669 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15670 void* o_ptr = untag_ptr(o);
15671 CHECK_ACCESS(o_ptr);
15672 LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
15673 o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
15674 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
15675 *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
15676 return tag_ptr(ret_conv, true);
15679 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
15680 LDKAccessError e_conv = LDKAccessError_from_java(env, e);
15681 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
15682 *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv);
15683 return tag_ptr(ret_conv, true);
15686 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15687 LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(o);
15688 jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv);
15692 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15693 if (!ptr_is_owned(_res)) return;
15694 void* _res_ptr = untag_ptr(_res);
15695 CHECK_ACCESS(_res_ptr);
15696 LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
15697 FREE(untag_ptr(_res));
15698 CResult_TxOutAccessErrorZ_free(_res_conv);
15701 static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) {
15702 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
15703 *ret_conv = CResult_TxOutAccessErrorZ_clone(arg);
15704 return tag_ptr(ret_conv, true);
15706 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15707 LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(arg);
15708 int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv);
15712 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15713 LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(orig);
15714 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
15715 *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv);
15716 return tag_ptr(ret_conv, true);
15719 static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
15720 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
15721 *ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
15722 return tag_ptr(ret_conv, true);
15724 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15725 LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg);
15726 int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv);
15730 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15731 LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig);
15732 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
15733 *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv);
15734 return tag_ptr(ret_conv, true);
15737 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
15738 LDKTransaction b_ref;
15739 b_ref.datalen = (*env)->GetArrayLength(env, b);
15740 b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
15741 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
15742 b_ref.data_is_owned = true;
15743 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
15744 *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref);
15745 return tag_ptr(ret_conv, true);
15748 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15749 if (!ptr_is_owned(_res)) return;
15750 void* _res_ptr = untag_ptr(_res);
15751 CHECK_ACCESS(_res_ptr);
15752 LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
15753 FREE(untag_ptr(_res));
15754 C2Tuple_usizeTransactionZ_free(_res_conv);
15757 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
15758 LDKCVec_C2Tuple_usizeTransactionZZ _res_constr;
15759 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15760 if (_res_constr.datalen > 0)
15761 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
15763 _res_constr.data = NULL;
15764 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
15765 for (size_t c = 0; c < _res_constr.datalen; c++) {
15766 int64_t _res_conv_28 = _res_vals[c];
15767 void* _res_conv_28_ptr = untag_ptr(_res_conv_28);
15768 CHECK_ACCESS(_res_conv_28_ptr);
15769 LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
15770 FREE(untag_ptr(_res_conv_28));
15771 _res_constr.data[c] = _res_conv_28_conv;
15773 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
15774 CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
15777 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxidZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
15778 LDKCVec_TxidZ _res_constr;
15779 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15780 if (_res_constr.datalen > 0)
15781 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
15783 _res_constr.data = NULL;
15784 for (size_t i = 0; i < _res_constr.datalen; i++) {
15785 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
15786 LDKThirtyTwoBytes _res_conv_8_ref;
15787 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
15788 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
15789 _res_constr.data[i] = _res_conv_8_ref;
15791 CVec_TxidZ_free(_res_constr);
15794 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv *env, jclass clz) {
15795 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
15796 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok();
15797 return tag_ptr(ret_conv, true);
15800 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv *env, jclass clz, jclass e) {
15801 LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_java(env, e);
15802 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
15803 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv);
15804 return tag_ptr(ret_conv, true);
15807 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15808 LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(o);
15809 jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv);
15813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15814 if (!ptr_is_owned(_res)) return;
15815 void* _res_ptr = untag_ptr(_res);
15816 CHECK_ACCESS(_res_ptr);
15817 LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
15818 FREE(untag_ptr(_res));
15819 CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
15822 static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) {
15823 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
15824 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg);
15825 return tag_ptr(ret_conv, true);
15827 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15828 LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(arg);
15829 int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv);
15833 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15834 LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(orig);
15835 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
15836 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv);
15837 return tag_ptr(ret_conv, true);
15840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
15841 LDKCVec_MonitorEventZ _res_constr;
15842 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15843 if (_res_constr.datalen > 0)
15844 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
15846 _res_constr.data = NULL;
15847 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
15848 for (size_t o = 0; o < _res_constr.datalen; o++) {
15849 int64_t _res_conv_14 = _res_vals[o];
15850 void* _res_conv_14_ptr = untag_ptr(_res_conv_14);
15851 CHECK_ACCESS(_res_conv_14_ptr);
15852 LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
15853 FREE(untag_ptr(_res_conv_14));
15854 _res_constr.data[o] = _res_conv_14_conv;
15856 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
15857 CVec_MonitorEventZ_free(_res_constr);
15860 static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) {
15861 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
15862 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg);
15863 return tag_ptr(ret_conv, true);
15865 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15866 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg);
15867 int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv);
15871 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15872 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig);
15873 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
15874 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv);
15875 return tag_ptr(ret_conv, true);
15878 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) {
15879 LDKOutPoint a_conv;
15880 a_conv.inner = untag_ptr(a);
15881 a_conv.is_owned = ptr_is_owned(a);
15882 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
15883 a_conv = OutPoint_clone(&a_conv);
15884 LDKCVec_MonitorEventZ b_constr;
15885 b_constr.datalen = (*env)->GetArrayLength(env, b);
15886 if (b_constr.datalen > 0)
15887 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
15889 b_constr.data = NULL;
15890 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
15891 for (size_t o = 0; o < b_constr.datalen; o++) {
15892 int64_t b_conv_14 = b_vals[o];
15893 void* b_conv_14_ptr = untag_ptr(b_conv_14);
15894 CHECK_ACCESS(b_conv_14_ptr);
15895 LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr);
15896 b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14));
15897 b_constr.data[o] = b_conv_14_conv;
15899 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
15900 LDKPublicKey c_ref;
15901 CHECK((*env)->GetArrayLength(env, c) == 33);
15902 (*env)->GetByteArrayRegion(env, c, 0, 33, c_ref.compressed_form);
15903 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
15904 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref);
15905 return tag_ptr(ret_conv, true);
15908 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15909 if (!ptr_is_owned(_res)) return;
15910 void* _res_ptr = untag_ptr(_res);
15911 CHECK_ACCESS(_res_ptr);
15912 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr);
15913 FREE(untag_ptr(_res));
15914 C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv);
15917 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
15918 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr;
15919 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15920 if (_res_constr.datalen > 0)
15921 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
15923 _res_constr.data = NULL;
15924 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
15925 for (size_t x = 0; x < _res_constr.datalen; x++) {
15926 int64_t _res_conv_49 = _res_vals[x];
15927 void* _res_conv_49_ptr = untag_ptr(_res_conv_49);
15928 CHECK_ACCESS(_res_conv_49_ptr);
15929 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr);
15930 FREE(untag_ptr(_res_conv_49));
15931 _res_constr.data[x] = _res_conv_49_conv;
15933 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
15934 CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr);
15937 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
15938 void* o_ptr = untag_ptr(o);
15939 CHECK_ACCESS(o_ptr);
15940 LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr);
15941 o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(o));
15942 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
15943 *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv);
15944 int64_t ret_ref = tag_ptr(ret_copy, true);
15948 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1none(JNIEnv *env, jclass clz) {
15949 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
15950 *ret_copy = COption_C2Tuple_usizeTransactionZZ_none();
15951 int64_t ret_ref = tag_ptr(ret_copy, true);
15955 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15956 if (!ptr_is_owned(_res)) return;
15957 void* _res_ptr = untag_ptr(_res);
15958 CHECK_ACCESS(_res_ptr);
15959 LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr);
15960 FREE(untag_ptr(_res));
15961 COption_C2Tuple_usizeTransactionZZ_free(_res_conv);
15964 static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) {
15965 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
15966 *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg);
15967 int64_t ret_ref = tag_ptr(ret_copy, true);
15970 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15971 LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(arg);
15972 int64_t ret_conv = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv);
15976 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15977 LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(orig);
15978 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
15979 *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv);
15980 int64_t ret_ref = tag_ptr(ret_copy, true);
15984 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
15985 LDKFixedPenaltyScorer o_conv;
15986 o_conv.inner = untag_ptr(o);
15987 o_conv.is_owned = ptr_is_owned(o);
15988 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15989 o_conv = FixedPenaltyScorer_clone(&o_conv);
15990 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
15991 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv);
15992 return tag_ptr(ret_conv, true);
15995 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15996 LDKDecodeError e_conv;
15997 e_conv.inner = untag_ptr(e);
15998 e_conv.is_owned = ptr_is_owned(e);
15999 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16000 e_conv = DecodeError_clone(&e_conv);
16001 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
16002 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
16003 return tag_ptr(ret_conv, true);
16006 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16007 LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o);
16008 jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv);
16012 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16013 if (!ptr_is_owned(_res)) return;
16014 void* _res_ptr = untag_ptr(_res);
16015 CHECK_ACCESS(_res_ptr);
16016 LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr);
16017 FREE(untag_ptr(_res));
16018 CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv);
16021 static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) {
16022 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
16023 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg);
16024 return tag_ptr(ret_conv, true);
16026 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16027 LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg);
16028 int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv);
16032 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16033 LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig);
16034 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
16035 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv);
16036 return tag_ptr(ret_conv, true);
16039 static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) {
16040 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
16041 *ret_conv = C2Tuple_u64u64Z_clone(arg);
16042 return tag_ptr(ret_conv, true);
16044 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16045 LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg);
16046 int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv);
16050 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16051 LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig);
16052 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
16053 *ret_conv = C2Tuple_u64u64Z_clone(orig_conv);
16054 return tag_ptr(ret_conv, true);
16057 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
16058 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
16059 *ret_conv = C2Tuple_u64u64Z_new(a, b);
16060 return tag_ptr(ret_conv, true);
16063 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
16064 if (!ptr_is_owned(_res)) return;
16065 void* _res_ptr = untag_ptr(_res);
16066 CHECK_ACCESS(_res_ptr);
16067 LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr);
16068 FREE(untag_ptr(_res));
16069 C2Tuple_u64u64Z_free(_res_conv);
16072 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
16073 void* o_ptr = untag_ptr(o);
16074 CHECK_ACCESS(o_ptr);
16075 LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr);
16076 o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o));
16077 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
16078 *ret_copy = COption_C2Tuple_u64u64ZZ_some(o_conv);
16079 int64_t ret_ref = tag_ptr(ret_copy, true);
16083 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1none(JNIEnv *env, jclass clz) {
16084 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
16085 *ret_copy = COption_C2Tuple_u64u64ZZ_none();
16086 int64_t ret_ref = tag_ptr(ret_copy, true);
16090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16091 if (!ptr_is_owned(_res)) return;
16092 void* _res_ptr = untag_ptr(_res);
16093 CHECK_ACCESS(_res_ptr);
16094 LDKCOption_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr);
16095 FREE(untag_ptr(_res));
16096 COption_C2Tuple_u64u64ZZ_free(_res_conv);
16099 static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) {
16100 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
16101 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg);
16102 int64_t ret_ref = tag_ptr(ret_copy, true);
16105 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16106 LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg);
16107 int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv);
16111 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16112 LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig);
16113 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
16114 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_conv);
16115 int64_t ret_ref = tag_ptr(ret_copy, true);
16119 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeIdZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16120 LDKCVec_NodeIdZ _res_constr;
16121 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16122 if (_res_constr.datalen > 0)
16123 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
16125 _res_constr.data = NULL;
16126 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16127 for (size_t i = 0; i < _res_constr.datalen; i++) {
16128 int64_t _res_conv_8 = _res_vals[i];
16129 LDKNodeId _res_conv_8_conv;
16130 _res_conv_8_conv.inner = untag_ptr(_res_conv_8);
16131 _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8);
16132 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv);
16133 _res_constr.data[i] = _res_conv_8_conv;
16135 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16136 CVec_NodeIdZ_free(_res_constr);
16139 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16140 LDKProbabilisticScorer o_conv;
16141 o_conv.inner = untag_ptr(o);
16142 o_conv.is_owned = ptr_is_owned(o);
16143 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16144 // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer
16146 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
16147 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv);
16148 return tag_ptr(ret_conv, true);
16151 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16152 LDKDecodeError e_conv;
16153 e_conv.inner = untag_ptr(e);
16154 e_conv.is_owned = ptr_is_owned(e);
16155 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16156 e_conv = DecodeError_clone(&e_conv);
16157 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
16158 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
16159 return tag_ptr(ret_conv, true);
16162 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16163 LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o);
16164 jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv);
16168 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16169 if (!ptr_is_owned(_res)) return;
16170 void* _res_ptr = untag_ptr(_res);
16171 CHECK_ACCESS(_res_ptr);
16172 LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr);
16173 FREE(untag_ptr(_res));
16174 CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv);
16177 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16178 LDKInitFeatures o_conv;
16179 o_conv.inner = untag_ptr(o);
16180 o_conv.is_owned = ptr_is_owned(o);
16181 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16182 o_conv = InitFeatures_clone(&o_conv);
16183 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
16184 *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
16185 return tag_ptr(ret_conv, true);
16188 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16189 LDKDecodeError e_conv;
16190 e_conv.inner = untag_ptr(e);
16191 e_conv.is_owned = ptr_is_owned(e);
16192 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16193 e_conv = DecodeError_clone(&e_conv);
16194 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
16195 *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
16196 return tag_ptr(ret_conv, true);
16199 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16200 LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o);
16201 jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
16205 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16206 if (!ptr_is_owned(_res)) return;
16207 void* _res_ptr = untag_ptr(_res);
16208 CHECK_ACCESS(_res_ptr);
16209 LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
16210 FREE(untag_ptr(_res));
16211 CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
16214 static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) {
16215 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
16216 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg);
16217 return tag_ptr(ret_conv, true);
16219 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16220 LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg);
16221 int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv);
16225 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16226 LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig);
16227 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
16228 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv);
16229 return tag_ptr(ret_conv, true);
16232 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16233 LDKChannelFeatures o_conv;
16234 o_conv.inner = untag_ptr(o);
16235 o_conv.is_owned = ptr_is_owned(o);
16236 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16237 o_conv = ChannelFeatures_clone(&o_conv);
16238 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
16239 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv);
16240 return tag_ptr(ret_conv, true);
16243 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16244 LDKDecodeError e_conv;
16245 e_conv.inner = untag_ptr(e);
16246 e_conv.is_owned = ptr_is_owned(e);
16247 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16248 e_conv = DecodeError_clone(&e_conv);
16249 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
16250 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
16251 return tag_ptr(ret_conv, true);
16254 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16255 LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o);
16256 jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv);
16260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16261 if (!ptr_is_owned(_res)) return;
16262 void* _res_ptr = untag_ptr(_res);
16263 CHECK_ACCESS(_res_ptr);
16264 LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
16265 FREE(untag_ptr(_res));
16266 CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
16269 static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) {
16270 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
16271 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg);
16272 return tag_ptr(ret_conv, true);
16274 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16275 LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg);
16276 int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv);
16280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16281 LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig);
16282 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
16283 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv);
16284 return tag_ptr(ret_conv, true);
16287 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16288 LDKNodeFeatures o_conv;
16289 o_conv.inner = untag_ptr(o);
16290 o_conv.is_owned = ptr_is_owned(o);
16291 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16292 o_conv = NodeFeatures_clone(&o_conv);
16293 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
16294 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
16295 return tag_ptr(ret_conv, true);
16298 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16299 LDKDecodeError e_conv;
16300 e_conv.inner = untag_ptr(e);
16301 e_conv.is_owned = ptr_is_owned(e);
16302 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16303 e_conv = DecodeError_clone(&e_conv);
16304 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
16305 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
16306 return tag_ptr(ret_conv, true);
16309 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16310 LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o);
16311 jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
16315 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16316 if (!ptr_is_owned(_res)) return;
16317 void* _res_ptr = untag_ptr(_res);
16318 CHECK_ACCESS(_res_ptr);
16319 LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
16320 FREE(untag_ptr(_res));
16321 CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
16324 static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
16325 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
16326 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg);
16327 return tag_ptr(ret_conv, true);
16329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16330 LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg);
16331 int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
16335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16336 LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig);
16337 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
16338 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv);
16339 return tag_ptr(ret_conv, true);
16342 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16343 LDKInvoiceFeatures o_conv;
16344 o_conv.inner = untag_ptr(o);
16345 o_conv.is_owned = ptr_is_owned(o);
16346 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16347 o_conv = InvoiceFeatures_clone(&o_conv);
16348 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
16349 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
16350 return tag_ptr(ret_conv, true);
16353 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16354 LDKDecodeError e_conv;
16355 e_conv.inner = untag_ptr(e);
16356 e_conv.is_owned = ptr_is_owned(e);
16357 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16358 e_conv = DecodeError_clone(&e_conv);
16359 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
16360 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
16361 return tag_ptr(ret_conv, true);
16364 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16365 LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o);
16366 jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
16370 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16371 if (!ptr_is_owned(_res)) return;
16372 void* _res_ptr = untag_ptr(_res);
16373 CHECK_ACCESS(_res_ptr);
16374 LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
16375 FREE(untag_ptr(_res));
16376 CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
16379 static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) {
16380 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
16381 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg);
16382 return tag_ptr(ret_conv, true);
16384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16385 LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg);
16386 int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv);
16390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16391 LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig);
16392 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
16393 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv);
16394 return tag_ptr(ret_conv, true);
16397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16398 LDKChannelTypeFeatures o_conv;
16399 o_conv.inner = untag_ptr(o);
16400 o_conv.is_owned = ptr_is_owned(o);
16401 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16402 o_conv = ChannelTypeFeatures_clone(&o_conv);
16403 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
16404 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
16405 return tag_ptr(ret_conv, true);
16408 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16409 LDKDecodeError e_conv;
16410 e_conv.inner = untag_ptr(e);
16411 e_conv.is_owned = ptr_is_owned(e);
16412 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16413 e_conv = DecodeError_clone(&e_conv);
16414 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
16415 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
16416 return tag_ptr(ret_conv, true);
16419 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16420 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o);
16421 jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
16425 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16426 if (!ptr_is_owned(_res)) return;
16427 void* _res_ptr = untag_ptr(_res);
16428 CHECK_ACCESS(_res_ptr);
16429 LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
16430 FREE(untag_ptr(_res));
16431 CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
16434 static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
16435 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
16436 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg);
16437 return tag_ptr(ret_conv, true);
16439 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16440 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg);
16441 int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
16445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16446 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig);
16447 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
16448 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv);
16449 return tag_ptr(ret_conv, true);
16452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16454 o_conv.inner = untag_ptr(o);
16455 o_conv.is_owned = ptr_is_owned(o);
16456 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16457 o_conv = NodeId_clone(&o_conv);
16458 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
16459 *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv);
16460 return tag_ptr(ret_conv, true);
16463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16464 LDKDecodeError e_conv;
16465 e_conv.inner = untag_ptr(e);
16466 e_conv.is_owned = ptr_is_owned(e);
16467 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16468 e_conv = DecodeError_clone(&e_conv);
16469 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
16470 *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
16471 return tag_ptr(ret_conv, true);
16474 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16475 LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o);
16476 jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv);
16480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16481 if (!ptr_is_owned(_res)) return;
16482 void* _res_ptr = untag_ptr(_res);
16483 CHECK_ACCESS(_res_ptr);
16484 LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
16485 FREE(untag_ptr(_res));
16486 CResult_NodeIdDecodeErrorZ_free(_res_conv);
16489 static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) {
16490 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
16491 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg);
16492 return tag_ptr(ret_conv, true);
16494 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16495 LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg);
16496 int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv);
16500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16501 LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(orig);
16502 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
16503 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv);
16504 return tag_ptr(ret_conv, true);
16507 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16508 void* o_ptr = untag_ptr(o);
16509 CHECK_ACCESS(o_ptr);
16510 LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr);
16511 o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(o));
16512 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
16513 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv);
16514 return tag_ptr(ret_conv, true);
16517 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16518 LDKDecodeError e_conv;
16519 e_conv.inner = untag_ptr(e);
16520 e_conv.is_owned = ptr_is_owned(e);
16521 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16522 e_conv = DecodeError_clone(&e_conv);
16523 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
16524 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
16525 return tag_ptr(ret_conv, true);
16528 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16529 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(o);
16530 jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv);
16534 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16535 if (!ptr_is_owned(_res)) return;
16536 void* _res_ptr = untag_ptr(_res);
16537 CHECK_ACCESS(_res_ptr);
16538 LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr);
16539 FREE(untag_ptr(_res));
16540 CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv);
16543 static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) {
16544 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
16545 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg);
16546 return tag_ptr(ret_conv, true);
16548 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16549 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(arg);
16550 int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv);
16554 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16555 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(orig);
16556 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
16557 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv);
16558 return tag_ptr(ret_conv, true);
16561 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) {
16562 void* o_ptr = untag_ptr(o);
16563 CHECK_ACCESS(o_ptr);
16564 LDKAccess o_conv = *(LDKAccess*)(o_ptr);
16565 if (o_conv.free == LDKAccess_JCalls_free) {
16566 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
16567 LDKAccess_JCalls_cloned(&o_conv);
16569 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
16570 *ret_copy = COption_AccessZ_some(o_conv);
16571 int64_t ret_ref = tag_ptr(ret_copy, true);
16575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1none(JNIEnv *env, jclass clz) {
16576 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
16577 *ret_copy = COption_AccessZ_none();
16578 int64_t ret_ref = tag_ptr(ret_copy, true);
16582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16583 if (!ptr_is_owned(_res)) return;
16584 void* _res_ptr = untag_ptr(_res);
16585 CHECK_ACCESS(_res_ptr);
16586 LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
16587 FREE(untag_ptr(_res));
16588 COption_AccessZ_free(_res_conv);
16591 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) {
16592 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
16593 *ret_conv = CResult_boolLightningErrorZ_ok(o);
16594 return tag_ptr(ret_conv, true);
16597 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16598 LDKLightningError e_conv;
16599 e_conv.inner = untag_ptr(e);
16600 e_conv.is_owned = ptr_is_owned(e);
16601 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16602 e_conv = LightningError_clone(&e_conv);
16603 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
16604 *ret_conv = CResult_boolLightningErrorZ_err(e_conv);
16605 return tag_ptr(ret_conv, true);
16608 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16609 LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(o);
16610 jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv);
16614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16615 if (!ptr_is_owned(_res)) return;
16616 void* _res_ptr = untag_ptr(_res);
16617 CHECK_ACCESS(_res_ptr);
16618 LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
16619 FREE(untag_ptr(_res));
16620 CResult_boolLightningErrorZ_free(_res_conv);
16623 static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) {
16624 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
16625 *ret_conv = CResult_boolLightningErrorZ_clone(arg);
16626 return tag_ptr(ret_conv, true);
16628 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16629 LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(arg);
16630 int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv);
16634 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16635 LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(orig);
16636 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
16637 *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv);
16638 return tag_ptr(ret_conv, true);
16641 static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) {
16642 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
16643 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg);
16644 return tag_ptr(ret_conv, true);
16646 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16647 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(arg);
16648 int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv);
16652 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16653 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(orig);
16654 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
16655 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv);
16656 return tag_ptr(ret_conv, true);
16659 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) {
16660 LDKChannelAnnouncement a_conv;
16661 a_conv.inner = untag_ptr(a);
16662 a_conv.is_owned = ptr_is_owned(a);
16663 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
16664 a_conv = ChannelAnnouncement_clone(&a_conv);
16665 LDKChannelUpdate b_conv;
16666 b_conv.inner = untag_ptr(b);
16667 b_conv.is_owned = ptr_is_owned(b);
16668 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
16669 b_conv = ChannelUpdate_clone(&b_conv);
16670 LDKChannelUpdate c_conv;
16671 c_conv.inner = untag_ptr(c);
16672 c_conv.is_owned = ptr_is_owned(c);
16673 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
16674 c_conv = ChannelUpdate_clone(&c_conv);
16675 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
16676 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
16677 return tag_ptr(ret_conv, true);
16680 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16681 if (!ptr_is_owned(_res)) return;
16682 void* _res_ptr = untag_ptr(_res);
16683 CHECK_ACCESS(_res_ptr);
16684 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
16685 FREE(untag_ptr(_res));
16686 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
16689 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16690 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_constr;
16691 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16692 if (_res_constr.datalen > 0)
16693 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
16695 _res_constr.data = NULL;
16696 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16697 for (size_t h = 0; h < _res_constr.datalen; h++) {
16698 int64_t _res_conv_59 = _res_vals[h];
16699 void* _res_conv_59_ptr = untag_ptr(_res_conv_59);
16700 CHECK_ACCESS(_res_conv_59_ptr);
16701 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr);
16702 FREE(untag_ptr(_res_conv_59));
16703 _res_constr.data[h] = _res_conv_59_conv;
16705 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16706 CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr);
16709 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16710 LDKCVec_NodeAnnouncementZ _res_constr;
16711 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16712 if (_res_constr.datalen > 0)
16713 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
16715 _res_constr.data = NULL;
16716 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16717 for (size_t s = 0; s < _res_constr.datalen; s++) {
16718 int64_t _res_conv_18 = _res_vals[s];
16719 LDKNodeAnnouncement _res_conv_18_conv;
16720 _res_conv_18_conv.inner = untag_ptr(_res_conv_18);
16721 _res_conv_18_conv.is_owned = ptr_is_owned(_res_conv_18);
16722 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv);
16723 _res_constr.data[s] = _res_conv_18_conv;
16725 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16726 CVec_NodeAnnouncementZ_free(_res_constr);
16729 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok(JNIEnv *env, jclass clz) {
16730 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
16731 *ret_conv = CResult_NoneLightningErrorZ_ok();
16732 return tag_ptr(ret_conv, true);
16735 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16736 LDKLightningError e_conv;
16737 e_conv.inner = untag_ptr(e);
16738 e_conv.is_owned = ptr_is_owned(e);
16739 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16740 e_conv = LightningError_clone(&e_conv);
16741 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
16742 *ret_conv = CResult_NoneLightningErrorZ_err(e_conv);
16743 return tag_ptr(ret_conv, true);
16746 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16747 LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(o);
16748 jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv);
16752 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16753 if (!ptr_is_owned(_res)) return;
16754 void* _res_ptr = untag_ptr(_res);
16755 CHECK_ACCESS(_res_ptr);
16756 LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
16757 FREE(untag_ptr(_res));
16758 CResult_NoneLightningErrorZ_free(_res_conv);
16761 static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) {
16762 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
16763 *ret_conv = CResult_NoneLightningErrorZ_clone(arg);
16764 return tag_ptr(ret_conv, true);
16766 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16767 LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(arg);
16768 int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv);
16772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16773 LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(orig);
16774 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
16775 *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv);
16776 return tag_ptr(ret_conv, true);
16779 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16780 LDKChannelUpdateInfo o_conv;
16781 o_conv.inner = untag_ptr(o);
16782 o_conv.is_owned = ptr_is_owned(o);
16783 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16784 o_conv = ChannelUpdateInfo_clone(&o_conv);
16785 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
16786 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv);
16787 return tag_ptr(ret_conv, true);
16790 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16791 LDKDecodeError e_conv;
16792 e_conv.inner = untag_ptr(e);
16793 e_conv.is_owned = ptr_is_owned(e);
16794 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16795 e_conv = DecodeError_clone(&e_conv);
16796 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
16797 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
16798 return tag_ptr(ret_conv, true);
16801 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16802 LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(o);
16803 jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv);
16807 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16808 if (!ptr_is_owned(_res)) return;
16809 void* _res_ptr = untag_ptr(_res);
16810 CHECK_ACCESS(_res_ptr);
16811 LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr);
16812 FREE(untag_ptr(_res));
16813 CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv);
16816 static inline uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) {
16817 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
16818 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg);
16819 return tag_ptr(ret_conv, true);
16821 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16822 LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(arg);
16823 int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv);
16827 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16828 LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(orig);
16829 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
16830 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv);
16831 return tag_ptr(ret_conv, true);
16834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16835 LDKChannelInfo o_conv;
16836 o_conv.inner = untag_ptr(o);
16837 o_conv.is_owned = ptr_is_owned(o);
16838 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16839 o_conv = ChannelInfo_clone(&o_conv);
16840 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
16841 *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
16842 return tag_ptr(ret_conv, true);
16845 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16846 LDKDecodeError e_conv;
16847 e_conv.inner = untag_ptr(e);
16848 e_conv.is_owned = ptr_is_owned(e);
16849 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16850 e_conv = DecodeError_clone(&e_conv);
16851 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
16852 *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
16853 return tag_ptr(ret_conv, true);
16856 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16857 LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(o);
16858 jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv);
16862 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16863 if (!ptr_is_owned(_res)) return;
16864 void* _res_ptr = untag_ptr(_res);
16865 CHECK_ACCESS(_res_ptr);
16866 LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
16867 FREE(untag_ptr(_res));
16868 CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
16871 static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
16872 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
16873 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg);
16874 return tag_ptr(ret_conv, true);
16876 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16877 LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(arg);
16878 int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
16882 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16883 LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(orig);
16884 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
16885 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
16886 return tag_ptr(ret_conv, true);
16889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16890 LDKRoutingFees o_conv;
16891 o_conv.inner = untag_ptr(o);
16892 o_conv.is_owned = ptr_is_owned(o);
16893 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16894 o_conv = RoutingFees_clone(&o_conv);
16895 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
16896 *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv);
16897 return tag_ptr(ret_conv, true);
16900 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16901 LDKDecodeError e_conv;
16902 e_conv.inner = untag_ptr(e);
16903 e_conv.is_owned = ptr_is_owned(e);
16904 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16905 e_conv = DecodeError_clone(&e_conv);
16906 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
16907 *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
16908 return tag_ptr(ret_conv, true);
16911 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16912 LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(o);
16913 jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv);
16917 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16918 if (!ptr_is_owned(_res)) return;
16919 void* _res_ptr = untag_ptr(_res);
16920 CHECK_ACCESS(_res_ptr);
16921 LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
16922 FREE(untag_ptr(_res));
16923 CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
16926 static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) {
16927 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
16928 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg);
16929 return tag_ptr(ret_conv, true);
16931 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16932 LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(arg);
16933 int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv);
16937 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16938 LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(orig);
16939 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
16940 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv);
16941 return tag_ptr(ret_conv, true);
16944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16945 LDKCVec_NetAddressZ _res_constr;
16946 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16947 if (_res_constr.datalen > 0)
16948 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
16950 _res_constr.data = NULL;
16951 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16952 for (size_t m = 0; m < _res_constr.datalen; m++) {
16953 int64_t _res_conv_12 = _res_vals[m];
16954 void* _res_conv_12_ptr = untag_ptr(_res_conv_12);
16955 CHECK_ACCESS(_res_conv_12_ptr);
16956 LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
16957 FREE(untag_ptr(_res_conv_12));
16958 _res_constr.data[m] = _res_conv_12_conv;
16960 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16961 CVec_NetAddressZ_free(_res_constr);
16964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16965 LDKNodeAnnouncementInfo o_conv;
16966 o_conv.inner = untag_ptr(o);
16967 o_conv.is_owned = ptr_is_owned(o);
16968 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16969 o_conv = NodeAnnouncementInfo_clone(&o_conv);
16970 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
16971 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv);
16972 return tag_ptr(ret_conv, true);
16975 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16976 LDKDecodeError e_conv;
16977 e_conv.inner = untag_ptr(e);
16978 e_conv.is_owned = ptr_is_owned(e);
16979 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16980 e_conv = DecodeError_clone(&e_conv);
16981 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
16982 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
16983 return tag_ptr(ret_conv, true);
16986 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16987 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(o);
16988 jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv);
16992 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16993 if (!ptr_is_owned(_res)) return;
16994 void* _res_ptr = untag_ptr(_res);
16995 CHECK_ACCESS(_res_ptr);
16996 LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
16997 FREE(untag_ptr(_res));
16998 CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
17001 static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) {
17002 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
17003 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg);
17004 return tag_ptr(ret_conv, true);
17006 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17007 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(arg);
17008 int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv);
17012 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17013 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(orig);
17014 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
17015 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv);
17016 return tag_ptr(ret_conv, true);
17019 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17020 LDKNodeAlias o_conv;
17021 o_conv.inner = untag_ptr(o);
17022 o_conv.is_owned = ptr_is_owned(o);
17023 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17024 o_conv = NodeAlias_clone(&o_conv);
17025 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
17026 *ret_conv = CResult_NodeAliasDecodeErrorZ_ok(o_conv);
17027 return tag_ptr(ret_conv, true);
17030 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17031 LDKDecodeError e_conv;
17032 e_conv.inner = untag_ptr(e);
17033 e_conv.is_owned = ptr_is_owned(e);
17034 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17035 e_conv = DecodeError_clone(&e_conv);
17036 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
17037 *ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
17038 return tag_ptr(ret_conv, true);
17041 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17042 LDKCResult_NodeAliasDecodeErrorZ* o_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(o);
17043 jboolean ret_conv = CResult_NodeAliasDecodeErrorZ_is_ok(o_conv);
17047 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17048 if (!ptr_is_owned(_res)) return;
17049 void* _res_ptr = untag_ptr(_res);
17050 CHECK_ACCESS(_res_ptr);
17051 LDKCResult_NodeAliasDecodeErrorZ _res_conv = *(LDKCResult_NodeAliasDecodeErrorZ*)(_res_ptr);
17052 FREE(untag_ptr(_res));
17053 CResult_NodeAliasDecodeErrorZ_free(_res_conv);
17056 static inline uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg) {
17057 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
17058 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(arg);
17059 return tag_ptr(ret_conv, true);
17061 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17062 LDKCResult_NodeAliasDecodeErrorZ* arg_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(arg);
17063 int64_t ret_conv = CResult_NodeAliasDecodeErrorZ_clone_ptr(arg_conv);
17067 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17068 LDKCResult_NodeAliasDecodeErrorZ* orig_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(orig);
17069 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
17070 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(orig_conv);
17071 return tag_ptr(ret_conv, true);
17074 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17075 LDKNodeInfo o_conv;
17076 o_conv.inner = untag_ptr(o);
17077 o_conv.is_owned = ptr_is_owned(o);
17078 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17079 o_conv = NodeInfo_clone(&o_conv);
17080 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
17081 *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv);
17082 return tag_ptr(ret_conv, true);
17085 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17086 LDKDecodeError e_conv;
17087 e_conv.inner = untag_ptr(e);
17088 e_conv.is_owned = ptr_is_owned(e);
17089 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17090 e_conv = DecodeError_clone(&e_conv);
17091 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
17092 *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
17093 return tag_ptr(ret_conv, true);
17096 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17097 LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(o);
17098 jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv);
17102 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17103 if (!ptr_is_owned(_res)) return;
17104 void* _res_ptr = untag_ptr(_res);
17105 CHECK_ACCESS(_res_ptr);
17106 LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
17107 FREE(untag_ptr(_res));
17108 CResult_NodeInfoDecodeErrorZ_free(_res_conv);
17111 static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) {
17112 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
17113 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg);
17114 return tag_ptr(ret_conv, true);
17116 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17117 LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(arg);
17118 int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv);
17122 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17123 LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(orig);
17124 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
17125 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv);
17126 return tag_ptr(ret_conv, true);
17129 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17130 LDKNetworkGraph o_conv;
17131 o_conv.inner = untag_ptr(o);
17132 o_conv.is_owned = ptr_is_owned(o);
17133 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17134 // WARNING: we need a move here but no clone is available for LDKNetworkGraph
17136 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
17137 *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
17138 return tag_ptr(ret_conv, true);
17141 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17142 LDKDecodeError e_conv;
17143 e_conv.inner = untag_ptr(e);
17144 e_conv.is_owned = ptr_is_owned(e);
17145 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17146 e_conv = DecodeError_clone(&e_conv);
17147 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
17148 *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
17149 return tag_ptr(ret_conv, true);
17152 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17153 LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(o);
17154 jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv);
17158 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17159 if (!ptr_is_owned(_res)) return;
17160 void* _res_ptr = untag_ptr(_res);
17161 CHECK_ACCESS(_res_ptr);
17162 LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
17163 FREE(untag_ptr(_res));
17164 CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
17167 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1some(JNIEnv *env, jclass clz, int64_tArray o) {
17168 LDKCVec_NetAddressZ o_constr;
17169 o_constr.datalen = (*env)->GetArrayLength(env, o);
17170 if (o_constr.datalen > 0)
17171 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
17173 o_constr.data = NULL;
17174 int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
17175 for (size_t m = 0; m < o_constr.datalen; m++) {
17176 int64_t o_conv_12 = o_vals[m];
17177 void* o_conv_12_ptr = untag_ptr(o_conv_12);
17178 CHECK_ACCESS(o_conv_12_ptr);
17179 LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
17180 o_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o_conv_12));
17181 o_constr.data[m] = o_conv_12_conv;
17183 (*env)->ReleaseLongArrayElements(env, o, o_vals, 0);
17184 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
17185 *ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
17186 int64_t ret_ref = tag_ptr(ret_copy, true);
17190 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1none(JNIEnv *env, jclass clz) {
17191 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
17192 *ret_copy = COption_CVec_NetAddressZZ_none();
17193 int64_t ret_ref = tag_ptr(ret_copy, true);
17197 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17198 if (!ptr_is_owned(_res)) return;
17199 void* _res_ptr = untag_ptr(_res);
17200 CHECK_ACCESS(_res_ptr);
17201 LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
17202 FREE(untag_ptr(_res));
17203 COption_CVec_NetAddressZZ_free(_res_conv);
17206 static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) {
17207 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
17208 *ret_copy = COption_CVec_NetAddressZZ_clone(arg);
17209 int64_t ret_ref = tag_ptr(ret_copy, true);
17212 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17213 LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(arg);
17214 int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv);
17218 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17219 LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(orig);
17220 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
17221 *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv);
17222 int64_t ret_ref = tag_ptr(ret_copy, true);
17226 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17227 LDKDelayedPaymentOutputDescriptor o_conv;
17228 o_conv.inner = untag_ptr(o);
17229 o_conv.is_owned = ptr_is_owned(o);
17230 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17231 o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv);
17232 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
17233 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
17234 return tag_ptr(ret_conv, true);
17237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17238 LDKDecodeError e_conv;
17239 e_conv.inner = untag_ptr(e);
17240 e_conv.is_owned = ptr_is_owned(e);
17241 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17242 e_conv = DecodeError_clone(&e_conv);
17243 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
17244 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
17245 return tag_ptr(ret_conv, true);
17248 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17249 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
17250 jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
17254 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17255 if (!ptr_is_owned(_res)) return;
17256 void* _res_ptr = untag_ptr(_res);
17257 CHECK_ACCESS(_res_ptr);
17258 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
17259 FREE(untag_ptr(_res));
17260 CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
17263 static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
17264 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
17265 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg);
17266 return tag_ptr(ret_conv, true);
17268 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17269 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
17270 int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
17274 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17275 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
17276 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
17277 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
17278 return tag_ptr(ret_conv, true);
17281 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17282 LDKStaticPaymentOutputDescriptor o_conv;
17283 o_conv.inner = untag_ptr(o);
17284 o_conv.is_owned = ptr_is_owned(o);
17285 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17286 o_conv = StaticPaymentOutputDescriptor_clone(&o_conv);
17287 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
17288 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
17289 return tag_ptr(ret_conv, true);
17292 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17293 LDKDecodeError e_conv;
17294 e_conv.inner = untag_ptr(e);
17295 e_conv.is_owned = ptr_is_owned(e);
17296 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17297 e_conv = DecodeError_clone(&e_conv);
17298 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
17299 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
17300 return tag_ptr(ret_conv, true);
17303 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17304 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
17305 jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
17309 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17310 if (!ptr_is_owned(_res)) return;
17311 void* _res_ptr = untag_ptr(_res);
17312 CHECK_ACCESS(_res_ptr);
17313 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
17314 FREE(untag_ptr(_res));
17315 CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
17318 static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
17319 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
17320 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg);
17321 return tag_ptr(ret_conv, true);
17323 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17324 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
17325 int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
17329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17330 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
17331 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
17332 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
17333 return tag_ptr(ret_conv, true);
17336 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17337 void* o_ptr = untag_ptr(o);
17338 CHECK_ACCESS(o_ptr);
17339 LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
17340 o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(o));
17341 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
17342 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
17343 return tag_ptr(ret_conv, true);
17346 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17347 LDKDecodeError e_conv;
17348 e_conv.inner = untag_ptr(e);
17349 e_conv.is_owned = ptr_is_owned(e);
17350 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17351 e_conv = DecodeError_clone(&e_conv);
17352 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
17353 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
17354 return tag_ptr(ret_conv, true);
17357 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17358 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(o);
17359 jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv);
17363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17364 if (!ptr_is_owned(_res)) return;
17365 void* _res_ptr = untag_ptr(_res);
17366 CHECK_ACCESS(_res_ptr);
17367 LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
17368 FREE(untag_ptr(_res));
17369 CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
17372 static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
17373 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
17374 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg);
17375 return tag_ptr(ret_conv, true);
17377 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17378 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
17379 int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
17383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17384 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
17385 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
17386 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv);
17387 return tag_ptr(ret_conv, true);
17390 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentPreimageZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
17391 LDKCVec_PaymentPreimageZ _res_constr;
17392 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17393 if (_res_constr.datalen > 0)
17394 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
17396 _res_constr.data = NULL;
17397 for (size_t i = 0; i < _res_constr.datalen; i++) {
17398 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
17399 LDKThirtyTwoBytes _res_conv_8_ref;
17400 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
17401 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
17402 _res_constr.data[i] = _res_conv_8_ref;
17404 CVec_PaymentPreimageZ_free(_res_constr);
17407 static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) {
17408 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
17409 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg);
17410 return tag_ptr(ret_conv, true);
17412 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17413 LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(arg);
17414 int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv);
17418 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17419 LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(orig);
17420 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
17421 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv);
17422 return tag_ptr(ret_conv, true);
17425 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, jobjectArray b) {
17426 LDKSignature a_ref;
17427 CHECK((*env)->GetArrayLength(env, a) == 64);
17428 (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form);
17429 LDKCVec_SignatureZ b_constr;
17430 b_constr.datalen = (*env)->GetArrayLength(env, b);
17431 if (b_constr.datalen > 0)
17432 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
17434 b_constr.data = NULL;
17435 for (size_t i = 0; i < b_constr.datalen; i++) {
17436 int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i);
17437 LDKSignature b_conv_8_ref;
17438 CHECK((*env)->GetArrayLength(env, b_conv_8) == 64);
17439 (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form);
17440 b_constr.data[i] = b_conv_8_ref;
17442 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
17443 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
17444 return tag_ptr(ret_conv, true);
17447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_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 LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
17452 FREE(untag_ptr(_res));
17453 C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
17456 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17457 void* o_ptr = untag_ptr(o);
17458 CHECK_ACCESS(o_ptr);
17459 LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
17460 o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(o));
17461 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
17462 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
17463 return tag_ptr(ret_conv, true);
17466 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv *env, jclass clz) {
17467 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
17468 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
17469 return tag_ptr(ret_conv, true);
17472 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17473 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(o);
17474 jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv);
17478 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17479 if (!ptr_is_owned(_res)) return;
17480 void* _res_ptr = untag_ptr(_res);
17481 CHECK_ACCESS(_res_ptr);
17482 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
17483 FREE(untag_ptr(_res));
17484 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
17487 static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) {
17488 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
17489 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg);
17490 return tag_ptr(ret_conv, true);
17492 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17493 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(arg);
17494 int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv);
17498 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17499 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(orig);
17500 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
17501 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv);
17502 return tag_ptr(ret_conv, true);
17505 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
17506 LDKSignature o_ref;
17507 CHECK((*env)->GetArrayLength(env, o) == 64);
17508 (*env)->GetByteArrayRegion(env, o, 0, 64, o_ref.compact_form);
17509 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
17510 *ret_conv = CResult_SignatureNoneZ_ok(o_ref);
17511 return tag_ptr(ret_conv, true);
17514 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv *env, jclass clz) {
17515 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
17516 *ret_conv = CResult_SignatureNoneZ_err();
17517 return tag_ptr(ret_conv, true);
17520 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17521 LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(o);
17522 jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv);
17526 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17527 if (!ptr_is_owned(_res)) return;
17528 void* _res_ptr = untag_ptr(_res);
17529 CHECK_ACCESS(_res_ptr);
17530 LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
17531 FREE(untag_ptr(_res));
17532 CResult_SignatureNoneZ_free(_res_conv);
17535 static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) {
17536 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
17537 *ret_conv = CResult_SignatureNoneZ_clone(arg);
17538 return tag_ptr(ret_conv, true);
17540 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17541 LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(arg);
17542 int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv);
17546 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17547 LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(orig);
17548 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
17549 *ret_conv = CResult_SignatureNoneZ_clone(orig_conv);
17550 return tag_ptr(ret_conv, true);
17553 static inline uint64_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) {
17554 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
17555 *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg);
17556 return tag_ptr(ret_conv, true);
17558 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17559 LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(arg);
17560 int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv);
17564 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17565 LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(orig);
17566 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
17567 *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv);
17568 return tag_ptr(ret_conv, true);
17571 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
17572 LDKSignature a_ref;
17573 CHECK((*env)->GetArrayLength(env, a) == 64);
17574 (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form);
17575 LDKSignature b_ref;
17576 CHECK((*env)->GetArrayLength(env, b) == 64);
17577 (*env)->GetByteArrayRegion(env, b, 0, 64, b_ref.compact_form);
17578 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
17579 *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref);
17580 return tag_ptr(ret_conv, true);
17583 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17584 if (!ptr_is_owned(_res)) return;
17585 void* _res_ptr = untag_ptr(_res);
17586 CHECK_ACCESS(_res_ptr);
17587 LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr);
17588 FREE(untag_ptr(_res));
17589 C2Tuple_SignatureSignatureZ_free(_res_conv);
17592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17593 void* o_ptr = untag_ptr(o);
17594 CHECK_ACCESS(o_ptr);
17595 LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr);
17596 o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)untag_ptr(o));
17597 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
17598 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv);
17599 return tag_ptr(ret_conv, true);
17602 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1err(JNIEnv *env, jclass clz) {
17603 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
17604 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err();
17605 return tag_ptr(ret_conv, true);
17608 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17609 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(o);
17610 jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(o_conv);
17614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17615 if (!ptr_is_owned(_res)) return;
17616 void* _res_ptr = untag_ptr(_res);
17617 CHECK_ACCESS(_res_ptr);
17618 LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr);
17619 FREE(untag_ptr(_res));
17620 CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv);
17623 static inline uint64_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) {
17624 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
17625 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg);
17626 return tag_ptr(ret_conv, true);
17628 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17629 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(arg);
17630 int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(arg_conv);
17634 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17635 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(orig);
17636 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
17637 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv);
17638 return tag_ptr(ret_conv, true);
17641 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
17642 LDKSecretKey o_ref;
17643 CHECK((*env)->GetArrayLength(env, o) == 32);
17644 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes);
17645 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
17646 *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref);
17647 return tag_ptr(ret_conv, true);
17650 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1err(JNIEnv *env, jclass clz) {
17651 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
17652 *ret_conv = CResult_SecretKeyNoneZ_err();
17653 return tag_ptr(ret_conv, true);
17656 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17657 LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(o);
17658 jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv);
17662 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17663 if (!ptr_is_owned(_res)) return;
17664 void* _res_ptr = untag_ptr(_res);
17665 CHECK_ACCESS(_res_ptr);
17666 LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr);
17667 FREE(untag_ptr(_res));
17668 CResult_SecretKeyNoneZ_free(_res_conv);
17671 static inline uint64_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) {
17672 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
17673 *ret_conv = CResult_SecretKeyNoneZ_clone(arg);
17674 return tag_ptr(ret_conv, true);
17676 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17677 LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(arg);
17678 int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv);
17682 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17683 LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(orig);
17684 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
17685 *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv);
17686 return tag_ptr(ret_conv, true);
17689 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17690 void* o_ptr = untag_ptr(o);
17691 CHECK_ACCESS(o_ptr);
17692 LDKSign o_conv = *(LDKSign*)(o_ptr);
17693 if (o_conv.free == LDKSign_JCalls_free) {
17694 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
17695 LDKSign_JCalls_cloned(&o_conv);
17697 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
17698 *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
17699 return tag_ptr(ret_conv, true);
17702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17703 LDKDecodeError e_conv;
17704 e_conv.inner = untag_ptr(e);
17705 e_conv.is_owned = ptr_is_owned(e);
17706 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17707 e_conv = DecodeError_clone(&e_conv);
17708 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
17709 *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
17710 return tag_ptr(ret_conv, true);
17713 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17714 LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(o);
17715 jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv);
17719 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17720 if (!ptr_is_owned(_res)) return;
17721 void* _res_ptr = untag_ptr(_res);
17722 CHECK_ACCESS(_res_ptr);
17723 LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
17724 FREE(untag_ptr(_res));
17725 CResult_SignDecodeErrorZ_free(_res_conv);
17728 static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) {
17729 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
17730 *ret_conv = CResult_SignDecodeErrorZ_clone(arg);
17731 return tag_ptr(ret_conv, true);
17733 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17734 LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(arg);
17735 int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv);
17739 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17740 LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(orig);
17741 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
17742 *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv);
17743 return tag_ptr(ret_conv, true);
17746 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
17747 LDKCVec_u5Z _res_constr;
17748 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17749 if (_res_constr.datalen > 0)
17750 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
17752 _res_constr.data = NULL;
17753 int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL);
17754 for (size_t h = 0; h < _res_constr.datalen; h++) {
17755 int8_t _res_conv_7 = _res_vals[h];
17757 _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 };
17759 (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0);
17760 CVec_u5Z_free(_res_constr);
17763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
17764 LDKRecoverableSignature o_ref;
17765 CHECK((*env)->GetArrayLength(env, o) == 68);
17766 (*env)->GetByteArrayRegion(env, o, 0, 68, o_ref.serialized_form);
17767 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
17768 *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref);
17769 return tag_ptr(ret_conv, true);
17772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err(JNIEnv *env, jclass clz) {
17773 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
17774 *ret_conv = CResult_RecoverableSignatureNoneZ_err();
17775 return tag_ptr(ret_conv, true);
17778 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17779 LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(o);
17780 jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv);
17784 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17785 if (!ptr_is_owned(_res)) return;
17786 void* _res_ptr = untag_ptr(_res);
17787 CHECK_ACCESS(_res_ptr);
17788 LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
17789 FREE(untag_ptr(_res));
17790 CResult_RecoverableSignatureNoneZ_free(_res_conv);
17793 static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) {
17794 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
17795 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg);
17796 return tag_ptr(ret_conv, true);
17798 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17799 LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(arg);
17800 int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv);
17804 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17805 LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(orig);
17806 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
17807 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv);
17808 return tag_ptr(ret_conv, true);
17811 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
17812 LDKCVec_u8Z _res_ref;
17813 _res_ref.datalen = (*env)->GetArrayLength(env, _res);
17814 _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes");
17815 (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
17816 CVec_u8Z_free(_res_ref);
17819 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
17820 LDKCVec_CVec_u8ZZ _res_constr;
17821 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17822 if (_res_constr.datalen > 0)
17823 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
17825 _res_constr.data = NULL;
17826 for (size_t i = 0; i < _res_constr.datalen; i++) {
17827 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
17828 LDKCVec_u8Z _res_conv_8_ref;
17829 _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8);
17830 _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKCVec_u8Z Bytes");
17831 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data);
17832 _res_constr.data[i] = _res_conv_8_ref;
17834 CVec_CVec_u8ZZ_free(_res_constr);
17837 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) {
17838 LDKCVec_CVec_u8ZZ o_constr;
17839 o_constr.datalen = (*env)->GetArrayLength(env, o);
17840 if (o_constr.datalen > 0)
17841 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
17843 o_constr.data = NULL;
17844 for (size_t i = 0; i < o_constr.datalen; i++) {
17845 int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
17846 LDKCVec_u8Z o_conv_8_ref;
17847 o_conv_8_ref.datalen = (*env)->GetArrayLength(env, o_conv_8);
17848 o_conv_8_ref.data = MALLOC(o_conv_8_ref.datalen, "LDKCVec_u8Z Bytes");
17849 (*env)->GetByteArrayRegion(env, o_conv_8, 0, o_conv_8_ref.datalen, o_conv_8_ref.data);
17850 o_constr.data[i] = o_conv_8_ref;
17852 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
17853 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
17854 return tag_ptr(ret_conv, true);
17857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err(JNIEnv *env, jclass clz) {
17858 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
17859 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
17860 return tag_ptr(ret_conv, true);
17863 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17864 LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(o);
17865 jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv);
17869 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17870 if (!ptr_is_owned(_res)) return;
17871 void* _res_ptr = untag_ptr(_res);
17872 CHECK_ACCESS(_res_ptr);
17873 LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
17874 FREE(untag_ptr(_res));
17875 CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
17878 static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) {
17879 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
17880 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg);
17881 return tag_ptr(ret_conv, true);
17883 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17884 LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(arg);
17885 int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv);
17889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17890 LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(orig);
17891 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
17892 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
17893 return tag_ptr(ret_conv, true);
17896 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17897 LDKInMemorySigner o_conv;
17898 o_conv.inner = untag_ptr(o);
17899 o_conv.is_owned = ptr_is_owned(o);
17900 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17901 o_conv = InMemorySigner_clone(&o_conv);
17902 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
17903 *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
17904 return tag_ptr(ret_conv, true);
17907 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17908 LDKDecodeError e_conv;
17909 e_conv.inner = untag_ptr(e);
17910 e_conv.is_owned = ptr_is_owned(e);
17911 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17912 e_conv = DecodeError_clone(&e_conv);
17913 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
17914 *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
17915 return tag_ptr(ret_conv, true);
17918 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17919 LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(o);
17920 jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv);
17924 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17925 if (!ptr_is_owned(_res)) return;
17926 void* _res_ptr = untag_ptr(_res);
17927 CHECK_ACCESS(_res_ptr);
17928 LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
17929 FREE(untag_ptr(_res));
17930 CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
17933 static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) {
17934 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
17935 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg);
17936 return tag_ptr(ret_conv, true);
17938 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17939 LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(arg);
17940 int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv);
17944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17945 LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(orig);
17946 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
17947 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
17948 return tag_ptr(ret_conv, true);
17951 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17952 LDKCVec_TxOutZ _res_constr;
17953 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17954 if (_res_constr.datalen > 0)
17955 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
17957 _res_constr.data = NULL;
17958 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17959 for (size_t h = 0; h < _res_constr.datalen; h++) {
17960 int64_t _res_conv_7 = _res_vals[h];
17961 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
17962 CHECK_ACCESS(_res_conv_7_ptr);
17963 LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
17964 FREE(untag_ptr(_res_conv_7));
17965 _res_constr.data[h] = _res_conv_7_conv;
17967 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17968 CVec_TxOutZ_free(_res_constr);
17971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
17972 LDKTransaction o_ref;
17973 o_ref.datalen = (*env)->GetArrayLength(env, o);
17974 o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
17975 (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data);
17976 o_ref.data_is_owned = true;
17977 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
17978 *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
17979 return tag_ptr(ret_conv, true);
17982 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err(JNIEnv *env, jclass clz) {
17983 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
17984 *ret_conv = CResult_TransactionNoneZ_err();
17985 return tag_ptr(ret_conv, true);
17988 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17989 LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o);
17990 jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv);
17994 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17995 if (!ptr_is_owned(_res)) return;
17996 void* _res_ptr = untag_ptr(_res);
17997 CHECK_ACCESS(_res_ptr);
17998 LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
17999 FREE(untag_ptr(_res));
18000 CResult_TransactionNoneZ_free(_res_conv);
18003 static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) {
18004 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
18005 *ret_conv = CResult_TransactionNoneZ_clone(arg);
18006 return tag_ptr(ret_conv, true);
18008 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18009 LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg);
18010 int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv);
18014 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18015 LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig);
18016 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
18017 *ret_conv = CResult_TransactionNoneZ_clone(orig_conv);
18018 return tag_ptr(ret_conv, true);
18021 static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) {
18022 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
18023 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg);
18024 return tag_ptr(ret_conv, true);
18026 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18027 LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(arg);
18028 int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv);
18032 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18033 LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(orig);
18034 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
18035 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv);
18036 return tag_ptr(ret_conv, true);
18039 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
18040 LDKThirtyTwoBytes a_ref;
18041 CHECK((*env)->GetArrayLength(env, a) == 32);
18042 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
18043 LDKChannelMonitor b_conv;
18044 b_conv.inner = untag_ptr(b);
18045 b_conv.is_owned = ptr_is_owned(b);
18046 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
18047 b_conv = ChannelMonitor_clone(&b_conv);
18048 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
18049 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv);
18050 return tag_ptr(ret_conv, true);
18053 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18054 if (!ptr_is_owned(_res)) return;
18055 void* _res_ptr = untag_ptr(_res);
18056 CHECK_ACCESS(_res_ptr);
18057 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
18058 FREE(untag_ptr(_res));
18059 C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
18062 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlockHashChannelMonitorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18063 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res_constr;
18064 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18065 if (_res_constr.datalen > 0)
18066 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements");
18068 _res_constr.data = NULL;
18069 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18070 for (size_t j = 0; j < _res_constr.datalen; j++) {
18071 int64_t _res_conv_35 = _res_vals[j];
18072 void* _res_conv_35_ptr = untag_ptr(_res_conv_35);
18073 CHECK_ACCESS(_res_conv_35_ptr);
18074 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr);
18075 FREE(untag_ptr(_res_conv_35));
18076 _res_constr.data[j] = _res_conv_35_conv;
18078 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18079 CVec_C2Tuple_BlockHashChannelMonitorZZ_free(_res_constr);
18082 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) {
18083 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o_constr;
18084 o_constr.datalen = (*env)->GetArrayLength(env, o);
18085 if (o_constr.datalen > 0)
18086 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements");
18088 o_constr.data = NULL;
18089 int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
18090 for (size_t j = 0; j < o_constr.datalen; j++) {
18091 int64_t o_conv_35 = o_vals[j];
18092 void* o_conv_35_ptr = untag_ptr(o_conv_35);
18093 CHECK_ACCESS(o_conv_35_ptr);
18094 LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr);
18095 o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o_conv_35));
18096 o_constr.data[j] = o_conv_35_conv;
18098 (*env)->ReleaseLongArrayElements(env, o, o_vals, 0);
18099 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
18100 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o_constr);
18101 return tag_ptr(ret_conv, true);
18104 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
18105 LDKIOError e_conv = LDKIOError_from_java(env, e);
18106 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
18107 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e_conv);
18108 return tag_ptr(ret_conv, true);
18111 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18112 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(o);
18113 jboolean ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv);
18117 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18118 if (!ptr_is_owned(_res)) return;
18119 void* _res_ptr = untag_ptr(_res);
18120 CHECK_ACCESS(_res_ptr);
18121 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr);
18122 FREE(untag_ptr(_res));
18123 CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv);
18126 static inline uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) {
18127 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
18128 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg);
18129 return tag_ptr(ret_conv, true);
18131 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18132 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(arg);
18133 int64_t ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv);
18137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18138 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(orig);
18139 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
18140 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig_conv);
18141 return tag_ptr(ret_conv, true);
18144 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) {
18145 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
18146 *ret_copy = COption_u16Z_some(o);
18147 int64_t ret_ref = tag_ptr(ret_copy, true);
18151 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none(JNIEnv *env, jclass clz) {
18152 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
18153 *ret_copy = COption_u16Z_none();
18154 int64_t ret_ref = tag_ptr(ret_copy, true);
18158 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
18159 if (!ptr_is_owned(_res)) return;
18160 void* _res_ptr = untag_ptr(_res);
18161 CHECK_ACCESS(_res_ptr);
18162 LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
18163 FREE(untag_ptr(_res));
18164 COption_u16Z_free(_res_conv);
18167 static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) {
18168 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
18169 *ret_copy = COption_u16Z_clone(arg);
18170 int64_t ret_ref = tag_ptr(ret_copy, true);
18173 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18174 LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)untag_ptr(arg);
18175 int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv);
18179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18180 LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)untag_ptr(orig);
18181 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
18182 *ret_copy = COption_u16Z_clone(orig_conv);
18183 int64_t ret_ref = tag_ptr(ret_copy, true);
18187 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv *env, jclass clz) {
18188 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
18189 *ret_conv = CResult_NoneAPIErrorZ_ok();
18190 return tag_ptr(ret_conv, true);
18193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18194 void* e_ptr = untag_ptr(e);
18195 CHECK_ACCESS(e_ptr);
18196 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
18197 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
18198 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
18199 *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
18200 return tag_ptr(ret_conv, true);
18203 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18204 LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
18205 jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
18209 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18210 if (!ptr_is_owned(_res)) return;
18211 void* _res_ptr = untag_ptr(_res);
18212 CHECK_ACCESS(_res_ptr);
18213 LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
18214 FREE(untag_ptr(_res));
18215 CResult_NoneAPIErrorZ_free(_res_conv);
18218 static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
18219 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
18220 *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
18221 return tag_ptr(ret_conv, true);
18223 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18224 LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
18225 int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
18229 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18230 LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
18231 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
18232 *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
18233 return tag_ptr(ret_conv, true);
18236 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18237 LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
18238 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18239 if (_res_constr.datalen > 0)
18240 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
18242 _res_constr.data = NULL;
18243 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18244 for (size_t w = 0; w < _res_constr.datalen; w++) {
18245 int64_t _res_conv_22 = _res_vals[w];
18246 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
18247 CHECK_ACCESS(_res_conv_22_ptr);
18248 LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
18249 FREE(untag_ptr(_res_conv_22));
18250 _res_constr.data[w] = _res_conv_22_conv;
18252 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18253 CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
18256 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18257 LDKCVec_APIErrorZ _res_constr;
18258 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18259 if (_res_constr.datalen > 0)
18260 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
18262 _res_constr.data = NULL;
18263 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18264 for (size_t k = 0; k < _res_constr.datalen; k++) {
18265 int64_t _res_conv_10 = _res_vals[k];
18266 void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
18267 CHECK_ACCESS(_res_conv_10_ptr);
18268 LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
18269 FREE(untag_ptr(_res_conv_10));
18270 _res_constr.data[k] = _res_conv_10_conv;
18272 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18273 CVec_APIErrorZ_free(_res_constr);
18276 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
18277 LDKThirtyTwoBytes o_ref;
18278 CHECK((*env)->GetArrayLength(env, o) == 32);
18279 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
18280 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
18281 *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
18282 return tag_ptr(ret_conv, true);
18285 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18286 void* e_ptr = untag_ptr(e);
18287 CHECK_ACCESS(e_ptr);
18288 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
18289 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
18290 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
18291 *ret_conv = CResult__u832APIErrorZ_err(e_conv);
18292 return tag_ptr(ret_conv, true);
18295 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18296 LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
18297 jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
18301 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18302 if (!ptr_is_owned(_res)) return;
18303 void* _res_ptr = untag_ptr(_res);
18304 CHECK_ACCESS(_res_ptr);
18305 LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
18306 FREE(untag_ptr(_res));
18307 CResult__u832APIErrorZ_free(_res_conv);
18310 static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
18311 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
18312 *ret_conv = CResult__u832APIErrorZ_clone(arg);
18313 return tag_ptr(ret_conv, true);
18315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18316 LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
18317 int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
18321 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18322 LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
18323 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
18324 *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
18325 return tag_ptr(ret_conv, true);
18328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
18329 LDKThirtyTwoBytes o_ref;
18330 CHECK((*env)->GetArrayLength(env, o) == 32);
18331 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
18332 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
18333 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
18334 return tag_ptr(ret_conv, true);
18337 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18338 void* e_ptr = untag_ptr(e);
18339 CHECK_ACCESS(e_ptr);
18340 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
18341 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
18342 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
18343 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
18344 return tag_ptr(ret_conv, true);
18347 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18348 LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(o);
18349 jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv);
18353 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18354 if (!ptr_is_owned(_res)) return;
18355 void* _res_ptr = untag_ptr(_res);
18356 CHECK_ACCESS(_res_ptr);
18357 LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
18358 FREE(untag_ptr(_res));
18359 CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
18362 static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) {
18363 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
18364 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg);
18365 return tag_ptr(ret_conv, true);
18367 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18368 LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(arg);
18369 int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv);
18373 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18374 LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(orig);
18375 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
18376 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv);
18377 return tag_ptr(ret_conv, true);
18380 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv *env, jclass clz) {
18381 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
18382 *ret_conv = CResult_NonePaymentSendFailureZ_ok();
18383 return tag_ptr(ret_conv, true);
18386 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18387 void* e_ptr = untag_ptr(e);
18388 CHECK_ACCESS(e_ptr);
18389 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
18390 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
18391 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
18392 *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
18393 return tag_ptr(ret_conv, true);
18396 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18397 LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
18398 jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
18402 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18403 if (!ptr_is_owned(_res)) return;
18404 void* _res_ptr = untag_ptr(_res);
18405 CHECK_ACCESS(_res_ptr);
18406 LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
18407 FREE(untag_ptr(_res));
18408 CResult_NonePaymentSendFailureZ_free(_res_conv);
18411 static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
18412 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
18413 *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
18414 return tag_ptr(ret_conv, true);
18416 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18417 LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
18418 int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
18422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18423 LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
18424 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
18425 *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
18426 return tag_ptr(ret_conv, true);
18429 static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) {
18430 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
18431 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg);
18432 return tag_ptr(ret_conv, true);
18434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18435 LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(arg);
18436 int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv);
18440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18441 LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(orig);
18442 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
18443 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv);
18444 return tag_ptr(ret_conv, true);
18447 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
18448 LDKThirtyTwoBytes a_ref;
18449 CHECK((*env)->GetArrayLength(env, a) == 32);
18450 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
18451 LDKThirtyTwoBytes b_ref;
18452 CHECK((*env)->GetArrayLength(env, b) == 32);
18453 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
18454 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
18455 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
18456 return tag_ptr(ret_conv, true);
18459 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_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 LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
18464 FREE(untag_ptr(_res));
18465 C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
18468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18469 void* o_ptr = untag_ptr(o);
18470 CHECK_ACCESS(o_ptr);
18471 LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
18472 o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(o));
18473 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
18474 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
18475 return tag_ptr(ret_conv, true);
18478 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18479 void* e_ptr = untag_ptr(e);
18480 CHECK_ACCESS(e_ptr);
18481 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
18482 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
18483 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
18484 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
18485 return tag_ptr(ret_conv, true);
18488 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18489 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(o);
18490 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv);
18494 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18495 if (!ptr_is_owned(_res)) return;
18496 void* _res_ptr = untag_ptr(_res);
18497 CHECK_ACCESS(_res_ptr);
18498 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
18499 FREE(untag_ptr(_res));
18500 CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
18503 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) {
18504 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
18505 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg);
18506 return tag_ptr(ret_conv, true);
18508 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18509 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(arg);
18510 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv);
18514 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18515 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(orig);
18516 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
18517 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv);
18518 return tag_ptr(ret_conv, true);
18521 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ThirtyTwoBytesZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
18522 LDKCVec_ThirtyTwoBytesZ _res_constr;
18523 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18524 if (_res_constr.datalen > 0)
18525 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
18527 _res_constr.data = NULL;
18528 for (size_t i = 0; i < _res_constr.datalen; i++) {
18529 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
18530 LDKThirtyTwoBytes _res_conv_8_ref;
18531 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
18532 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
18533 _res_constr.data[i] = _res_conv_8_ref;
18535 CVec_ThirtyTwoBytesZ_free(_res_constr);
18538 static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) {
18539 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
18540 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg);
18541 return tag_ptr(ret_conv, true);
18543 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18544 LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(arg);
18545 int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv);
18549 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18550 LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(orig);
18551 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
18552 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv);
18553 return tag_ptr(ret_conv, true);
18556 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
18557 LDKThirtyTwoBytes a_ref;
18558 CHECK((*env)->GetArrayLength(env, a) == 32);
18559 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
18560 LDKThirtyTwoBytes b_ref;
18561 CHECK((*env)->GetArrayLength(env, b) == 32);
18562 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
18563 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
18564 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref);
18565 return tag_ptr(ret_conv, true);
18568 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18569 if (!ptr_is_owned(_res)) return;
18570 void* _res_ptr = untag_ptr(_res);
18571 CHECK_ACCESS(_res_ptr);
18572 LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
18573 FREE(untag_ptr(_res));
18574 C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
18577 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18578 void* o_ptr = untag_ptr(o);
18579 CHECK_ACCESS(o_ptr);
18580 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
18581 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
18582 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
18583 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
18584 return tag_ptr(ret_conv, true);
18587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err(JNIEnv *env, jclass clz) {
18588 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
18589 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
18590 return tag_ptr(ret_conv, true);
18593 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18594 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(o);
18595 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
18599 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18600 if (!ptr_is_owned(_res)) return;
18601 void* _res_ptr = untag_ptr(_res);
18602 CHECK_ACCESS(_res_ptr);
18603 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
18604 FREE(untag_ptr(_res));
18605 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
18608 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
18609 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
18610 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
18611 return tag_ptr(ret_conv, true);
18613 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18614 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(arg);
18615 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
18619 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18620 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(orig);
18621 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
18622 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
18623 return tag_ptr(ret_conv, true);
18626 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18627 void* o_ptr = untag_ptr(o);
18628 CHECK_ACCESS(o_ptr);
18629 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
18630 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
18631 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
18632 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
18633 return tag_ptr(ret_conv, true);
18636 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18637 void* e_ptr = untag_ptr(e);
18638 CHECK_ACCESS(e_ptr);
18639 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
18640 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
18641 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
18642 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
18643 return tag_ptr(ret_conv, true);
18646 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18647 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(o);
18648 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
18652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18653 if (!ptr_is_owned(_res)) return;
18654 void* _res_ptr = untag_ptr(_res);
18655 CHECK_ACCESS(_res_ptr);
18656 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
18657 FREE(untag_ptr(_res));
18658 CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
18661 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
18662 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
18663 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
18664 return tag_ptr(ret_conv, true);
18666 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18667 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(arg);
18668 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
18672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18673 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(orig);
18674 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
18675 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
18676 return tag_ptr(ret_conv, true);
18679 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
18680 LDKThirtyTwoBytes o_ref;
18681 CHECK((*env)->GetArrayLength(env, o) == 32);
18682 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
18683 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
18684 *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
18685 return tag_ptr(ret_conv, true);
18688 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err(JNIEnv *env, jclass clz) {
18689 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
18690 *ret_conv = CResult_PaymentSecretNoneZ_err();
18691 return tag_ptr(ret_conv, true);
18694 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18695 LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(o);
18696 jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv);
18700 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18701 if (!ptr_is_owned(_res)) return;
18702 void* _res_ptr = untag_ptr(_res);
18703 CHECK_ACCESS(_res_ptr);
18704 LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
18705 FREE(untag_ptr(_res));
18706 CResult_PaymentSecretNoneZ_free(_res_conv);
18709 static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
18710 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
18711 *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
18712 return tag_ptr(ret_conv, true);
18714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18715 LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(arg);
18716 int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
18720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18721 LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(orig);
18722 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
18723 *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
18724 return tag_ptr(ret_conv, true);
18727 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
18728 LDKThirtyTwoBytes o_ref;
18729 CHECK((*env)->GetArrayLength(env, o) == 32);
18730 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
18731 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
18732 *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref);
18733 return tag_ptr(ret_conv, true);
18736 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18737 void* e_ptr = untag_ptr(e);
18738 CHECK_ACCESS(e_ptr);
18739 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
18740 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
18741 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
18742 *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
18743 return tag_ptr(ret_conv, true);
18746 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18747 LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(o);
18748 jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv);
18752 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18753 if (!ptr_is_owned(_res)) return;
18754 void* _res_ptr = untag_ptr(_res);
18755 CHECK_ACCESS(_res_ptr);
18756 LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
18757 FREE(untag_ptr(_res));
18758 CResult_PaymentSecretAPIErrorZ_free(_res_conv);
18761 static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) {
18762 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
18763 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg);
18764 return tag_ptr(ret_conv, true);
18766 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18767 LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(arg);
18768 int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv);
18772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18773 LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(orig);
18774 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
18775 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv);
18776 return tag_ptr(ret_conv, true);
18779 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
18780 LDKThirtyTwoBytes o_ref;
18781 CHECK((*env)->GetArrayLength(env, o) == 32);
18782 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
18783 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
18784 *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
18785 return tag_ptr(ret_conv, true);
18788 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18789 void* e_ptr = untag_ptr(e);
18790 CHECK_ACCESS(e_ptr);
18791 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
18792 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
18793 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
18794 *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
18795 return tag_ptr(ret_conv, true);
18798 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18799 LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(o);
18800 jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
18804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18805 if (!ptr_is_owned(_res)) return;
18806 void* _res_ptr = untag_ptr(_res);
18807 CHECK_ACCESS(_res_ptr);
18808 LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
18809 FREE(untag_ptr(_res));
18810 CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
18813 static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
18814 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
18815 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
18816 return tag_ptr(ret_conv, true);
18818 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18819 LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(arg);
18820 int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
18824 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18825 LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(orig);
18826 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
18827 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
18828 return tag_ptr(ret_conv, true);
18831 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18832 LDKCounterpartyForwardingInfo o_conv;
18833 o_conv.inner = untag_ptr(o);
18834 o_conv.is_owned = ptr_is_owned(o);
18835 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18836 o_conv = CounterpartyForwardingInfo_clone(&o_conv);
18837 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
18838 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv);
18839 return tag_ptr(ret_conv, true);
18842 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18843 LDKDecodeError e_conv;
18844 e_conv.inner = untag_ptr(e);
18845 e_conv.is_owned = ptr_is_owned(e);
18846 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18847 e_conv = DecodeError_clone(&e_conv);
18848 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
18849 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
18850 return tag_ptr(ret_conv, true);
18853 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18854 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o);
18855 jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv);
18859 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18860 if (!ptr_is_owned(_res)) return;
18861 void* _res_ptr = untag_ptr(_res);
18862 CHECK_ACCESS(_res_ptr);
18863 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr);
18864 FREE(untag_ptr(_res));
18865 CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv);
18868 static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) {
18869 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
18870 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg);
18871 return tag_ptr(ret_conv, true);
18873 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18874 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg);
18875 int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv);
18879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18880 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig);
18881 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
18882 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv);
18883 return tag_ptr(ret_conv, true);
18886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18887 LDKChannelCounterparty o_conv;
18888 o_conv.inner = untag_ptr(o);
18889 o_conv.is_owned = ptr_is_owned(o);
18890 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18891 o_conv = ChannelCounterparty_clone(&o_conv);
18892 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
18893 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv);
18894 return tag_ptr(ret_conv, true);
18897 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18898 LDKDecodeError e_conv;
18899 e_conv.inner = untag_ptr(e);
18900 e_conv.is_owned = ptr_is_owned(e);
18901 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18902 e_conv = DecodeError_clone(&e_conv);
18903 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
18904 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
18905 return tag_ptr(ret_conv, true);
18908 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18909 LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o);
18910 jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv);
18914 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18915 if (!ptr_is_owned(_res)) return;
18916 void* _res_ptr = untag_ptr(_res);
18917 CHECK_ACCESS(_res_ptr);
18918 LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr);
18919 FREE(untag_ptr(_res));
18920 CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv);
18923 static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) {
18924 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
18925 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg);
18926 return tag_ptr(ret_conv, true);
18928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18929 LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg);
18930 int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv);
18934 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18935 LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig);
18936 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
18937 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv);
18938 return tag_ptr(ret_conv, true);
18941 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18942 LDKChannelDetails o_conv;
18943 o_conv.inner = untag_ptr(o);
18944 o_conv.is_owned = ptr_is_owned(o);
18945 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18946 o_conv = ChannelDetails_clone(&o_conv);
18947 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
18948 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv);
18949 return tag_ptr(ret_conv, true);
18952 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18953 LDKDecodeError e_conv;
18954 e_conv.inner = untag_ptr(e);
18955 e_conv.is_owned = ptr_is_owned(e);
18956 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18957 e_conv = DecodeError_clone(&e_conv);
18958 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
18959 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
18960 return tag_ptr(ret_conv, true);
18963 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18964 LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o);
18965 jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv);
18969 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18970 if (!ptr_is_owned(_res)) return;
18971 void* _res_ptr = untag_ptr(_res);
18972 CHECK_ACCESS(_res_ptr);
18973 LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr);
18974 FREE(untag_ptr(_res));
18975 CResult_ChannelDetailsDecodeErrorZ_free(_res_conv);
18978 static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) {
18979 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
18980 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg);
18981 return tag_ptr(ret_conv, true);
18983 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18984 LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg);
18985 int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv);
18989 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18990 LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig);
18991 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
18992 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv);
18993 return tag_ptr(ret_conv, true);
18996 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18997 LDKPhantomRouteHints o_conv;
18998 o_conv.inner = untag_ptr(o);
18999 o_conv.is_owned = ptr_is_owned(o);
19000 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19001 o_conv = PhantomRouteHints_clone(&o_conv);
19002 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
19003 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv);
19004 return tag_ptr(ret_conv, true);
19007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19008 LDKDecodeError e_conv;
19009 e_conv.inner = untag_ptr(e);
19010 e_conv.is_owned = ptr_is_owned(e);
19011 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19012 e_conv = DecodeError_clone(&e_conv);
19013 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
19014 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
19015 return tag_ptr(ret_conv, true);
19018 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19019 LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o);
19020 jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv);
19024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19025 if (!ptr_is_owned(_res)) return;
19026 void* _res_ptr = untag_ptr(_res);
19027 CHECK_ACCESS(_res_ptr);
19028 LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr);
19029 FREE(untag_ptr(_res));
19030 CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv);
19033 static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) {
19034 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
19035 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg);
19036 return tag_ptr(ret_conv, true);
19038 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19039 LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg);
19040 int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv);
19044 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19045 LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig);
19046 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
19047 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv);
19048 return tag_ptr(ret_conv, true);
19051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
19052 LDKCVec_ChannelMonitorZ _res_constr;
19053 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
19054 if (_res_constr.datalen > 0)
19055 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
19057 _res_constr.data = NULL;
19058 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
19059 for (size_t q = 0; q < _res_constr.datalen; q++) {
19060 int64_t _res_conv_16 = _res_vals[q];
19061 LDKChannelMonitor _res_conv_16_conv;
19062 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
19063 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
19064 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
19065 _res_constr.data[q] = _res_conv_16_conv;
19067 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
19068 CVec_ChannelMonitorZ_free(_res_constr);
19071 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
19072 LDKThirtyTwoBytes a_ref;
19073 CHECK((*env)->GetArrayLength(env, a) == 32);
19074 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
19075 LDKChannelManager b_conv;
19076 b_conv.inner = untag_ptr(b);
19077 b_conv.is_owned = ptr_is_owned(b);
19078 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
19079 // WARNING: we need a move here but no clone is available for LDKChannelManager
19081 LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
19082 *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv);
19083 return tag_ptr(ret_conv, true);
19086 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19087 if (!ptr_is_owned(_res)) return;
19088 void* _res_ptr = untag_ptr(_res);
19089 CHECK_ACCESS(_res_ptr);
19090 LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
19091 FREE(untag_ptr(_res));
19092 C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
19095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19096 void* o_ptr = untag_ptr(o);
19097 CHECK_ACCESS(o_ptr);
19098 LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
19099 // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
19100 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
19101 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
19102 return tag_ptr(ret_conv, true);
19105 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19106 LDKDecodeError e_conv;
19107 e_conv.inner = untag_ptr(e);
19108 e_conv.is_owned = ptr_is_owned(e);
19109 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19110 e_conv = DecodeError_clone(&e_conv);
19111 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
19112 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
19113 return tag_ptr(ret_conv, true);
19116 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19117 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(o);
19118 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv);
19122 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19123 if (!ptr_is_owned(_res)) return;
19124 void* _res_ptr = untag_ptr(_res);
19125 CHECK_ACCESS(_res_ptr);
19126 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
19127 FREE(untag_ptr(_res));
19128 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
19131 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19132 LDKChannelConfig o_conv;
19133 o_conv.inner = untag_ptr(o);
19134 o_conv.is_owned = ptr_is_owned(o);
19135 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19136 o_conv = ChannelConfig_clone(&o_conv);
19137 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
19138 *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv);
19139 return tag_ptr(ret_conv, true);
19142 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19143 LDKDecodeError e_conv;
19144 e_conv.inner = untag_ptr(e);
19145 e_conv.is_owned = ptr_is_owned(e);
19146 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19147 e_conv = DecodeError_clone(&e_conv);
19148 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
19149 *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
19150 return tag_ptr(ret_conv, true);
19153 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19154 LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(o);
19155 jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv);
19159 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19160 if (!ptr_is_owned(_res)) return;
19161 void* _res_ptr = untag_ptr(_res);
19162 CHECK_ACCESS(_res_ptr);
19163 LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
19164 FREE(untag_ptr(_res));
19165 CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
19168 static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) {
19169 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
19170 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg);
19171 return tag_ptr(ret_conv, true);
19173 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19174 LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(arg);
19175 int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv);
19179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19180 LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(orig);
19181 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
19182 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv);
19183 return tag_ptr(ret_conv, true);
19186 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19187 LDKOutPoint o_conv;
19188 o_conv.inner = untag_ptr(o);
19189 o_conv.is_owned = ptr_is_owned(o);
19190 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19191 o_conv = OutPoint_clone(&o_conv);
19192 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
19193 *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv);
19194 return tag_ptr(ret_conv, true);
19197 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19198 LDKDecodeError e_conv;
19199 e_conv.inner = untag_ptr(e);
19200 e_conv.is_owned = ptr_is_owned(e);
19201 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19202 e_conv = DecodeError_clone(&e_conv);
19203 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
19204 *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
19205 return tag_ptr(ret_conv, true);
19208 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19209 LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o);
19210 jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv);
19214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19215 if (!ptr_is_owned(_res)) return;
19216 void* _res_ptr = untag_ptr(_res);
19217 CHECK_ACCESS(_res_ptr);
19218 LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
19219 FREE(untag_ptr(_res));
19220 CResult_OutPointDecodeErrorZ_free(_res_conv);
19223 static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) {
19224 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
19225 *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg);
19226 return tag_ptr(ret_conv, true);
19228 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19229 LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg);
19230 int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv);
19234 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19235 LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig);
19236 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
19237 *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv);
19238 return tag_ptr(ret_conv, true);
19241 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19242 void* o_ptr = untag_ptr(o);
19243 CHECK_ACCESS(o_ptr);
19244 LDKType o_conv = *(LDKType*)(o_ptr);
19245 if (o_conv.free == LDKType_JCalls_free) {
19246 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
19247 LDKType_JCalls_cloned(&o_conv);
19249 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
19250 *ret_copy = COption_TypeZ_some(o_conv);
19251 int64_t ret_ref = tag_ptr(ret_copy, true);
19255 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none(JNIEnv *env, jclass clz) {
19256 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
19257 *ret_copy = COption_TypeZ_none();
19258 int64_t ret_ref = tag_ptr(ret_copy, true);
19262 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19263 if (!ptr_is_owned(_res)) return;
19264 void* _res_ptr = untag_ptr(_res);
19265 CHECK_ACCESS(_res_ptr);
19266 LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
19267 FREE(untag_ptr(_res));
19268 COption_TypeZ_free(_res_conv);
19271 static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) {
19272 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
19273 *ret_copy = COption_TypeZ_clone(arg);
19274 int64_t ret_ref = tag_ptr(ret_copy, true);
19277 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19278 LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)untag_ptr(arg);
19279 int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv);
19283 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19284 LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)untag_ptr(orig);
19285 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
19286 *ret_copy = COption_TypeZ_clone(orig_conv);
19287 int64_t ret_ref = tag_ptr(ret_copy, true);
19291 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19292 void* o_ptr = untag_ptr(o);
19293 CHECK_ACCESS(o_ptr);
19294 LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
19295 o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)untag_ptr(o));
19296 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
19297 *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
19298 return tag_ptr(ret_conv, true);
19301 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19302 LDKDecodeError e_conv;
19303 e_conv.inner = untag_ptr(e);
19304 e_conv.is_owned = ptr_is_owned(e);
19305 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19306 e_conv = DecodeError_clone(&e_conv);
19307 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
19308 *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
19309 return tag_ptr(ret_conv, true);
19312 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19313 LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(o);
19314 jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv);
19318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19319 if (!ptr_is_owned(_res)) return;
19320 void* _res_ptr = untag_ptr(_res);
19321 CHECK_ACCESS(_res_ptr);
19322 LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
19323 FREE(untag_ptr(_res));
19324 CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
19327 static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) {
19328 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
19329 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg);
19330 return tag_ptr(ret_conv, true);
19332 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19333 LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(arg);
19334 int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv);
19338 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19339 LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(orig);
19340 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
19341 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv);
19342 return tag_ptr(ret_conv, true);
19345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
19346 LDKThirtyTwoBytes o_ref;
19347 CHECK((*env)->GetArrayLength(env, o) == 32);
19348 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
19349 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
19350 *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
19351 return tag_ptr(ret_conv, true);
19354 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19355 void* e_ptr = untag_ptr(e);
19356 CHECK_ACCESS(e_ptr);
19357 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
19358 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
19359 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
19360 *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
19361 return tag_ptr(ret_conv, true);
19364 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19365 LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(o);
19366 jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv);
19370 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19371 if (!ptr_is_owned(_res)) return;
19372 void* _res_ptr = untag_ptr(_res);
19373 CHECK_ACCESS(_res_ptr);
19374 LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
19375 FREE(untag_ptr(_res));
19376 CResult_PaymentIdPaymentErrorZ_free(_res_conv);
19379 static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) {
19380 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
19381 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg);
19382 return tag_ptr(ret_conv, true);
19384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19385 LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(arg);
19386 int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv);
19390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19391 LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(orig);
19392 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
19393 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
19394 return tag_ptr(ret_conv, true);
19397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) {
19398 LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o);
19399 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
19400 *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
19401 return tag_ptr(ret_conv, true);
19404 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19405 void* e_ptr = untag_ptr(e);
19406 CHECK_ACCESS(e_ptr);
19407 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
19408 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
19409 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
19410 *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
19411 return tag_ptr(ret_conv, true);
19414 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19415 LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
19416 jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
19420 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19421 if (!ptr_is_owned(_res)) return;
19422 void* _res_ptr = untag_ptr(_res);
19423 CHECK_ACCESS(_res_ptr);
19424 LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
19425 FREE(untag_ptr(_res));
19426 CResult_SiPrefixParseErrorZ_free(_res_conv);
19429 static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
19430 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
19431 *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
19432 return tag_ptr(ret_conv, true);
19434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19435 LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
19436 int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
19440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19441 LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
19442 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
19443 *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
19444 return tag_ptr(ret_conv, true);
19447 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19449 o_conv.inner = untag_ptr(o);
19450 o_conv.is_owned = ptr_is_owned(o);
19451 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19452 o_conv = Invoice_clone(&o_conv);
19453 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
19454 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
19455 return tag_ptr(ret_conv, true);
19458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19459 void* e_ptr = untag_ptr(e);
19460 CHECK_ACCESS(e_ptr);
19461 LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
19462 e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
19463 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
19464 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
19465 return tag_ptr(ret_conv, true);
19468 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19469 LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
19470 jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
19474 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19475 if (!ptr_is_owned(_res)) return;
19476 void* _res_ptr = untag_ptr(_res);
19477 CHECK_ACCESS(_res_ptr);
19478 LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
19479 FREE(untag_ptr(_res));
19480 CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
19483 static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
19484 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
19485 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
19486 return tag_ptr(ret_conv, true);
19488 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19489 LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
19490 int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
19494 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19495 LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
19496 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
19497 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
19498 return tag_ptr(ret_conv, true);
19501 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19502 LDKSignedRawInvoice o_conv;
19503 o_conv.inner = untag_ptr(o);
19504 o_conv.is_owned = ptr_is_owned(o);
19505 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19506 o_conv = SignedRawInvoice_clone(&o_conv);
19507 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
19508 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
19509 return tag_ptr(ret_conv, true);
19512 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19513 void* e_ptr = untag_ptr(e);
19514 CHECK_ACCESS(e_ptr);
19515 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
19516 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
19517 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
19518 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
19519 return tag_ptr(ret_conv, true);
19522 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19523 LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
19524 jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
19528 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19529 if (!ptr_is_owned(_res)) return;
19530 void* _res_ptr = untag_ptr(_res);
19531 CHECK_ACCESS(_res_ptr);
19532 LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
19533 FREE(untag_ptr(_res));
19534 CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
19537 static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
19538 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
19539 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
19540 return tag_ptr(ret_conv, true);
19542 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19543 LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
19544 int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
19548 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19549 LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
19550 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
19551 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
19552 return tag_ptr(ret_conv, true);
19555 static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
19556 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
19557 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
19558 return tag_ptr(ret_conv, true);
19560 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19561 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
19562 int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
19566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19567 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
19568 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
19569 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
19570 return tag_ptr(ret_conv, true);
19573 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) {
19574 LDKRawInvoice a_conv;
19575 a_conv.inner = untag_ptr(a);
19576 a_conv.is_owned = ptr_is_owned(a);
19577 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
19578 a_conv = RawInvoice_clone(&a_conv);
19579 LDKThirtyTwoBytes b_ref;
19580 CHECK((*env)->GetArrayLength(env, b) == 32);
19581 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
19582 LDKInvoiceSignature c_conv;
19583 c_conv.inner = untag_ptr(c);
19584 c_conv.is_owned = ptr_is_owned(c);
19585 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
19586 c_conv = InvoiceSignature_clone(&c_conv);
19587 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
19588 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
19589 return tag_ptr(ret_conv, true);
19592 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19593 if (!ptr_is_owned(_res)) return;
19594 void* _res_ptr = untag_ptr(_res);
19595 CHECK_ACCESS(_res_ptr);
19596 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
19597 FREE(untag_ptr(_res));
19598 C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
19601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19602 LDKPayeePubKey o_conv;
19603 o_conv.inner = untag_ptr(o);
19604 o_conv.is_owned = ptr_is_owned(o);
19605 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19606 o_conv = PayeePubKey_clone(&o_conv);
19607 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
19608 *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
19609 return tag_ptr(ret_conv, true);
19612 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
19613 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
19614 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
19615 *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
19616 return tag_ptr(ret_conv, true);
19619 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19620 LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
19621 jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
19625 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19626 if (!ptr_is_owned(_res)) return;
19627 void* _res_ptr = untag_ptr(_res);
19628 CHECK_ACCESS(_res_ptr);
19629 LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
19630 FREE(untag_ptr(_res));
19631 CResult_PayeePubKeyErrorZ_free(_res_conv);
19634 static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
19635 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
19636 *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
19637 return tag_ptr(ret_conv, true);
19639 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19640 LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
19641 int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
19645 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19646 LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
19647 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
19648 *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
19649 return tag_ptr(ret_conv, true);
19652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
19653 LDKCVec_PrivateRouteZ _res_constr;
19654 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
19655 if (_res_constr.datalen > 0)
19656 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
19658 _res_constr.data = NULL;
19659 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
19660 for (size_t o = 0; o < _res_constr.datalen; o++) {
19661 int64_t _res_conv_14 = _res_vals[o];
19662 LDKPrivateRoute _res_conv_14_conv;
19663 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
19664 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
19665 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
19666 _res_constr.data[o] = _res_conv_14_conv;
19668 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
19669 CVec_PrivateRouteZ_free(_res_constr);
19672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19673 LDKPositiveTimestamp o_conv;
19674 o_conv.inner = untag_ptr(o);
19675 o_conv.is_owned = ptr_is_owned(o);
19676 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19677 o_conv = PositiveTimestamp_clone(&o_conv);
19678 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
19679 *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
19680 return tag_ptr(ret_conv, true);
19683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
19684 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
19685 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
19686 *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
19687 return tag_ptr(ret_conv, true);
19690 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19691 LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
19692 jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
19696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19697 if (!ptr_is_owned(_res)) return;
19698 void* _res_ptr = untag_ptr(_res);
19699 CHECK_ACCESS(_res_ptr);
19700 LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
19701 FREE(untag_ptr(_res));
19702 CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
19705 static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
19706 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
19707 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
19708 return tag_ptr(ret_conv, true);
19710 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19711 LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
19712 int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
19716 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19717 LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
19718 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
19719 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
19720 return tag_ptr(ret_conv, true);
19723 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok(JNIEnv *env, jclass clz) {
19724 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
19725 *ret_conv = CResult_NoneSemanticErrorZ_ok();
19726 return tag_ptr(ret_conv, true);
19729 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
19730 LDKSemanticError e_conv = LDKSemanticError_from_java(env, e);
19731 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
19732 *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
19733 return tag_ptr(ret_conv, true);
19736 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19737 LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
19738 jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
19742 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19743 if (!ptr_is_owned(_res)) return;
19744 void* _res_ptr = untag_ptr(_res);
19745 CHECK_ACCESS(_res_ptr);
19746 LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
19747 FREE(untag_ptr(_res));
19748 CResult_NoneSemanticErrorZ_free(_res_conv);
19751 static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
19752 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
19753 *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
19754 return tag_ptr(ret_conv, true);
19756 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19757 LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
19758 int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
19762 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19763 LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
19764 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
19765 *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
19766 return tag_ptr(ret_conv, true);
19769 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19771 o_conv.inner = untag_ptr(o);
19772 o_conv.is_owned = ptr_is_owned(o);
19773 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19774 o_conv = Invoice_clone(&o_conv);
19775 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
19776 *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
19777 return tag_ptr(ret_conv, true);
19780 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
19781 LDKSemanticError e_conv = LDKSemanticError_from_java(env, e);
19782 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
19783 *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
19784 return tag_ptr(ret_conv, true);
19787 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19788 LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
19789 jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
19793 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19794 if (!ptr_is_owned(_res)) return;
19795 void* _res_ptr = untag_ptr(_res);
19796 CHECK_ACCESS(_res_ptr);
19797 LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
19798 FREE(untag_ptr(_res));
19799 CResult_InvoiceSemanticErrorZ_free(_res_conv);
19802 static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
19803 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
19804 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
19805 return tag_ptr(ret_conv, true);
19807 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19808 LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
19809 int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
19813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19814 LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
19815 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
19816 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
19817 return tag_ptr(ret_conv, true);
19820 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19821 LDKDescription o_conv;
19822 o_conv.inner = untag_ptr(o);
19823 o_conv.is_owned = ptr_is_owned(o);
19824 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19825 o_conv = Description_clone(&o_conv);
19826 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
19827 *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
19828 return tag_ptr(ret_conv, true);
19831 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
19832 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
19833 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
19834 *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
19835 return tag_ptr(ret_conv, true);
19838 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19839 LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
19840 jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
19844 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19845 if (!ptr_is_owned(_res)) return;
19846 void* _res_ptr = untag_ptr(_res);
19847 CHECK_ACCESS(_res_ptr);
19848 LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
19849 FREE(untag_ptr(_res));
19850 CResult_DescriptionCreationErrorZ_free(_res_conv);
19853 static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
19854 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
19855 *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
19856 return tag_ptr(ret_conv, true);
19858 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19859 LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
19860 int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
19864 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19865 LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
19866 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
19867 *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
19868 return tag_ptr(ret_conv, true);
19871 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19872 LDKPrivateRoute o_conv;
19873 o_conv.inner = untag_ptr(o);
19874 o_conv.is_owned = ptr_is_owned(o);
19875 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19876 o_conv = PrivateRoute_clone(&o_conv);
19877 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
19878 *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
19879 return tag_ptr(ret_conv, true);
19882 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
19883 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
19884 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
19885 *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
19886 return tag_ptr(ret_conv, true);
19889 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19890 LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
19891 jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
19895 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19896 if (!ptr_is_owned(_res)) return;
19897 void* _res_ptr = untag_ptr(_res);
19898 CHECK_ACCESS(_res_ptr);
19899 LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
19900 FREE(untag_ptr(_res));
19901 CResult_PrivateRouteCreationErrorZ_free(_res_conv);
19904 static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
19905 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
19906 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
19907 return tag_ptr(ret_conv, true);
19909 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19910 LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
19911 int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
19915 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19916 LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
19917 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
19918 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
19919 return tag_ptr(ret_conv, true);
19922 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok(JNIEnv *env, jclass clz, jstring o) {
19923 LDKStr o_conv = java_to_owned_str(env, o);
19924 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
19925 *ret_conv = CResult_StringErrorZ_ok(o_conv);
19926 return tag_ptr(ret_conv, true);
19929 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
19930 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
19931 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
19932 *ret_conv = CResult_StringErrorZ_err(e_conv);
19933 return tag_ptr(ret_conv, true);
19936 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19937 LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
19938 jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
19942 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19943 if (!ptr_is_owned(_res)) return;
19944 void* _res_ptr = untag_ptr(_res);
19945 CHECK_ACCESS(_res_ptr);
19946 LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
19947 FREE(untag_ptr(_res));
19948 CResult_StringErrorZ_free(_res_conv);
19951 static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
19952 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
19953 *ret_conv = CResult_StringErrorZ_clone(arg);
19954 return tag_ptr(ret_conv, true);
19956 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19957 LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
19958 int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
19962 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19963 LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
19964 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
19965 *ret_conv = CResult_StringErrorZ_clone(orig_conv);
19966 return tag_ptr(ret_conv, true);
19969 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19970 LDKChannelMonitorUpdate o_conv;
19971 o_conv.inner = untag_ptr(o);
19972 o_conv.is_owned = ptr_is_owned(o);
19973 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19974 o_conv = ChannelMonitorUpdate_clone(&o_conv);
19975 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
19976 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
19977 return tag_ptr(ret_conv, true);
19980 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19981 LDKDecodeError e_conv;
19982 e_conv.inner = untag_ptr(e);
19983 e_conv.is_owned = ptr_is_owned(e);
19984 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19985 e_conv = DecodeError_clone(&e_conv);
19986 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
19987 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
19988 return tag_ptr(ret_conv, true);
19991 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19992 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
19993 jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
19997 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19998 if (!ptr_is_owned(_res)) return;
19999 void* _res_ptr = untag_ptr(_res);
20000 CHECK_ACCESS(_res_ptr);
20001 LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
20002 FREE(untag_ptr(_res));
20003 CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
20006 static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
20007 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
20008 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
20009 return tag_ptr(ret_conv, true);
20011 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20012 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
20013 int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
20017 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20018 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
20019 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
20020 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
20021 return tag_ptr(ret_conv, true);
20024 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) {
20025 void* o_ptr = untag_ptr(o);
20026 CHECK_ACCESS(o_ptr);
20027 LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
20028 o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
20029 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
20030 *ret_copy = COption_MonitorEventZ_some(o_conv);
20031 int64_t ret_ref = tag_ptr(ret_copy, true);
20035 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) {
20036 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
20037 *ret_copy = COption_MonitorEventZ_none();
20038 int64_t ret_ref = tag_ptr(ret_copy, true);
20042 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20043 if (!ptr_is_owned(_res)) return;
20044 void* _res_ptr = untag_ptr(_res);
20045 CHECK_ACCESS(_res_ptr);
20046 LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
20047 FREE(untag_ptr(_res));
20048 COption_MonitorEventZ_free(_res_conv);
20051 static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
20052 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
20053 *ret_copy = COption_MonitorEventZ_clone(arg);
20054 int64_t ret_ref = tag_ptr(ret_copy, true);
20057 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20058 LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
20059 int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
20063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20064 LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
20065 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
20066 *ret_copy = COption_MonitorEventZ_clone(orig_conv);
20067 int64_t ret_ref = tag_ptr(ret_copy, true);
20071 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20072 void* o_ptr = untag_ptr(o);
20073 CHECK_ACCESS(o_ptr);
20074 LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
20075 o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
20076 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
20077 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
20078 return tag_ptr(ret_conv, true);
20081 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20082 LDKDecodeError e_conv;
20083 e_conv.inner = untag_ptr(e);
20084 e_conv.is_owned = ptr_is_owned(e);
20085 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20086 e_conv = DecodeError_clone(&e_conv);
20087 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
20088 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
20089 return tag_ptr(ret_conv, true);
20092 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20093 LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
20094 jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
20098 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20099 if (!ptr_is_owned(_res)) return;
20100 void* _res_ptr = untag_ptr(_res);
20101 CHECK_ACCESS(_res_ptr);
20102 LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
20103 FREE(untag_ptr(_res));
20104 CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
20107 static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
20108 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
20109 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
20110 return tag_ptr(ret_conv, true);
20112 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20113 LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
20114 int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
20118 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20119 LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
20120 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
20121 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
20122 return tag_ptr(ret_conv, true);
20125 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20126 LDKHTLCUpdate o_conv;
20127 o_conv.inner = untag_ptr(o);
20128 o_conv.is_owned = ptr_is_owned(o);
20129 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20130 o_conv = HTLCUpdate_clone(&o_conv);
20131 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
20132 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
20133 return tag_ptr(ret_conv, true);
20136 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20137 LDKDecodeError e_conv;
20138 e_conv.inner = untag_ptr(e);
20139 e_conv.is_owned = ptr_is_owned(e);
20140 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20141 e_conv = DecodeError_clone(&e_conv);
20142 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
20143 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
20144 return tag_ptr(ret_conv, true);
20147 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20148 LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(o);
20149 jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv);
20153 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20154 if (!ptr_is_owned(_res)) return;
20155 void* _res_ptr = untag_ptr(_res);
20156 CHECK_ACCESS(_res_ptr);
20157 LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
20158 FREE(untag_ptr(_res));
20159 CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
20162 static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) {
20163 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
20164 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg);
20165 return tag_ptr(ret_conv, true);
20167 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20168 LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(arg);
20169 int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv);
20173 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20174 LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(orig);
20175 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
20176 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv);
20177 return tag_ptr(ret_conv, true);
20180 static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
20181 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
20182 *ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
20183 return tag_ptr(ret_conv, true);
20185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20186 LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(arg);
20187 int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv);
20191 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20192 LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(orig);
20193 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
20194 *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv);
20195 return tag_ptr(ret_conv, true);
20198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
20199 LDKOutPoint a_conv;
20200 a_conv.inner = untag_ptr(a);
20201 a_conv.is_owned = ptr_is_owned(a);
20202 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
20203 a_conv = OutPoint_clone(&a_conv);
20205 b_ref.datalen = (*env)->GetArrayLength(env, b);
20206 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
20207 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
20208 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
20209 *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref);
20210 return tag_ptr(ret_conv, true);
20213 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20214 if (!ptr_is_owned(_res)) return;
20215 void* _res_ptr = untag_ptr(_res);
20216 CHECK_ACCESS(_res_ptr);
20217 LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
20218 FREE(untag_ptr(_res));
20219 C2Tuple_OutPointScriptZ_free(_res_conv);
20222 static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) {
20223 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
20224 *ret_conv = C2Tuple_u32ScriptZ_clone(arg);
20225 return tag_ptr(ret_conv, true);
20227 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20228 LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(arg);
20229 int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv);
20233 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20234 LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(orig);
20235 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
20236 *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv);
20237 return tag_ptr(ret_conv, true);
20240 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_t a, int8_tArray b) {
20242 b_ref.datalen = (*env)->GetArrayLength(env, b);
20243 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
20244 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
20245 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
20246 *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref);
20247 return tag_ptr(ret_conv, true);
20250 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20251 if (!ptr_is_owned(_res)) return;
20252 void* _res_ptr = untag_ptr(_res);
20253 CHECK_ACCESS(_res_ptr);
20254 LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
20255 FREE(untag_ptr(_res));
20256 C2Tuple_u32ScriptZ_free(_res_conv);
20259 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20260 LDKCVec_C2Tuple_u32ScriptZZ _res_constr;
20261 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20262 if (_res_constr.datalen > 0)
20263 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
20265 _res_constr.data = NULL;
20266 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20267 for (size_t v = 0; v < _res_constr.datalen; v++) {
20268 int64_t _res_conv_21 = _res_vals[v];
20269 void* _res_conv_21_ptr = untag_ptr(_res_conv_21);
20270 CHECK_ACCESS(_res_conv_21_ptr);
20271 LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
20272 FREE(untag_ptr(_res_conv_21));
20273 _res_constr.data[v] = _res_conv_21_conv;
20275 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20276 CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
20279 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) {
20280 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
20281 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg);
20282 return tag_ptr(ret_conv, true);
20284 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20285 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(arg);
20286 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv);
20290 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20291 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(orig);
20292 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
20293 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv);
20294 return tag_ptr(ret_conv, true);
20297 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
20298 LDKThirtyTwoBytes a_ref;
20299 CHECK((*env)->GetArrayLength(env, a) == 32);
20300 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
20301 LDKCVec_C2Tuple_u32ScriptZZ b_constr;
20302 b_constr.datalen = (*env)->GetArrayLength(env, b);
20303 if (b_constr.datalen > 0)
20304 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
20306 b_constr.data = NULL;
20307 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
20308 for (size_t v = 0; v < b_constr.datalen; v++) {
20309 int64_t b_conv_21 = b_vals[v];
20310 void* b_conv_21_ptr = untag_ptr(b_conv_21);
20311 CHECK_ACCESS(b_conv_21_ptr);
20312 LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
20313 b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)untag_ptr(b_conv_21));
20314 b_constr.data[v] = b_conv_21_conv;
20316 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
20317 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
20318 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
20319 return tag_ptr(ret_conv, true);
20322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20323 if (!ptr_is_owned(_res)) return;
20324 void* _res_ptr = untag_ptr(_res);
20325 CHECK_ACCESS(_res_ptr);
20326 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
20327 FREE(untag_ptr(_res));
20328 C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
20331 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20332 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr;
20333 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20334 if (_res_constr.datalen > 0)
20335 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
20337 _res_constr.data = NULL;
20338 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20339 for (size_t o = 0; o < _res_constr.datalen; o++) {
20340 int64_t _res_conv_40 = _res_vals[o];
20341 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
20342 CHECK_ACCESS(_res_conv_40_ptr);
20343 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
20344 FREE(untag_ptr(_res_conv_40));
20345 _res_constr.data[o] = _res_conv_40_conv;
20347 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20348 CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
20351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20352 LDKCVec_EventZ _res_constr;
20353 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20354 if (_res_constr.datalen > 0)
20355 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
20357 _res_constr.data = NULL;
20358 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20359 for (size_t h = 0; h < _res_constr.datalen; h++) {
20360 int64_t _res_conv_7 = _res_vals[h];
20361 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
20362 CHECK_ACCESS(_res_conv_7_ptr);
20363 LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
20364 FREE(untag_ptr(_res_conv_7));
20365 _res_constr.data[h] = _res_conv_7_conv;
20367 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20368 CVec_EventZ_free(_res_constr);
20371 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
20372 LDKCVec_TransactionZ _res_constr;
20373 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20374 if (_res_constr.datalen > 0)
20375 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
20377 _res_constr.data = NULL;
20378 for (size_t i = 0; i < _res_constr.datalen; i++) {
20379 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
20380 LDKTransaction _res_conv_8_ref;
20381 _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8);
20382 _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes");
20383 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data);
20384 _res_conv_8_ref.data_is_owned = true;
20385 _res_constr.data[i] = _res_conv_8_ref;
20387 CVec_TransactionZ_free(_res_constr);
20390 static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) {
20391 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
20392 *ret_conv = C2Tuple_u32TxOutZ_clone(arg);
20393 return tag_ptr(ret_conv, true);
20395 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20396 LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(arg);
20397 int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv);
20401 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20402 LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(orig);
20403 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
20404 *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv);
20405 return tag_ptr(ret_conv, true);
20408 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) {
20409 void* b_ptr = untag_ptr(b);
20410 CHECK_ACCESS(b_ptr);
20411 LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
20412 b_conv = TxOut_clone((LDKTxOut*)untag_ptr(b));
20413 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
20414 *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
20415 return tag_ptr(ret_conv, true);
20418 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20419 if (!ptr_is_owned(_res)) return;
20420 void* _res_ptr = untag_ptr(_res);
20421 CHECK_ACCESS(_res_ptr);
20422 LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
20423 FREE(untag_ptr(_res));
20424 C2Tuple_u32TxOutZ_free(_res_conv);
20427 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20428 LDKCVec_C2Tuple_u32TxOutZZ _res_constr;
20429 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20430 if (_res_constr.datalen > 0)
20431 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
20433 _res_constr.data = NULL;
20434 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20435 for (size_t u = 0; u < _res_constr.datalen; u++) {
20436 int64_t _res_conv_20 = _res_vals[u];
20437 void* _res_conv_20_ptr = untag_ptr(_res_conv_20);
20438 CHECK_ACCESS(_res_conv_20_ptr);
20439 LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
20440 FREE(untag_ptr(_res_conv_20));
20441 _res_constr.data[u] = _res_conv_20_conv;
20443 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20444 CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
20447 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) {
20448 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
20449 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg);
20450 return tag_ptr(ret_conv, true);
20452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20453 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(arg);
20454 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv);
20458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20459 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(orig);
20460 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
20461 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv);
20462 return tag_ptr(ret_conv, true);
20465 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
20466 LDKThirtyTwoBytes a_ref;
20467 CHECK((*env)->GetArrayLength(env, a) == 32);
20468 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
20469 LDKCVec_C2Tuple_u32TxOutZZ b_constr;
20470 b_constr.datalen = (*env)->GetArrayLength(env, b);
20471 if (b_constr.datalen > 0)
20472 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
20474 b_constr.data = NULL;
20475 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
20476 for (size_t u = 0; u < b_constr.datalen; u++) {
20477 int64_t b_conv_20 = b_vals[u];
20478 void* b_conv_20_ptr = untag_ptr(b_conv_20);
20479 CHECK_ACCESS(b_conv_20_ptr);
20480 LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
20481 b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)untag_ptr(b_conv_20));
20482 b_constr.data[u] = b_conv_20_conv;
20484 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
20485 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
20486 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
20487 return tag_ptr(ret_conv, true);
20490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20491 if (!ptr_is_owned(_res)) return;
20492 void* _res_ptr = untag_ptr(_res);
20493 CHECK_ACCESS(_res_ptr);
20494 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
20495 FREE(untag_ptr(_res));
20496 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
20499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20500 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr;
20501 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20502 if (_res_constr.datalen > 0)
20503 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
20505 _res_constr.data = NULL;
20506 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20507 for (size_t n = 0; n < _res_constr.datalen; n++) {
20508 int64_t _res_conv_39 = _res_vals[n];
20509 void* _res_conv_39_ptr = untag_ptr(_res_conv_39);
20510 CHECK_ACCESS(_res_conv_39_ptr);
20511 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
20512 FREE(untag_ptr(_res_conv_39));
20513 _res_constr.data[n] = _res_conv_39_conv;
20515 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20516 CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
20519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BalanceZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20520 LDKCVec_BalanceZ _res_constr;
20521 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20522 if (_res_constr.datalen > 0)
20523 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements");
20525 _res_constr.data = NULL;
20526 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20527 for (size_t j = 0; j < _res_constr.datalen; j++) {
20528 int64_t _res_conv_9 = _res_vals[j];
20529 void* _res_conv_9_ptr = untag_ptr(_res_conv_9);
20530 CHECK_ACCESS(_res_conv_9_ptr);
20531 LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
20532 FREE(untag_ptr(_res_conv_9));
20533 _res_constr.data[j] = _res_conv_9_conv;
20535 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20536 CVec_BalanceZ_free(_res_constr);
20539 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20540 void* o_ptr = untag_ptr(o);
20541 CHECK_ACCESS(o_ptr);
20542 LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
20543 o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o));
20544 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
20545 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
20546 return tag_ptr(ret_conv, true);
20549 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20550 LDKDecodeError e_conv;
20551 e_conv.inner = untag_ptr(e);
20552 e_conv.is_owned = ptr_is_owned(e);
20553 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20554 e_conv = DecodeError_clone(&e_conv);
20555 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
20556 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
20557 return tag_ptr(ret_conv, true);
20560 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20561 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(o);
20562 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv);
20566 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20567 if (!ptr_is_owned(_res)) return;
20568 void* _res_ptr = untag_ptr(_res);
20569 CHECK_ACCESS(_res_ptr);
20570 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
20571 FREE(untag_ptr(_res));
20572 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
20575 static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) {
20576 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
20577 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg);
20578 return tag_ptr(ret_conv, true);
20580 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20581 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(arg);
20582 int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv);
20586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20587 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(orig);
20588 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
20589 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv);
20590 return tag_ptr(ret_conv, true);
20593 static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) {
20594 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
20595 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg);
20596 return tag_ptr(ret_conv, true);
20598 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20599 LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(arg);
20600 int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv);
20604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20605 LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
20606 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
20607 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
20608 return tag_ptr(ret_conv, true);
20611 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
20612 LDKPublicKey a_ref;
20613 CHECK((*env)->GetArrayLength(env, a) == 33);
20614 (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
20615 void* b_ptr = untag_ptr(b);
20616 CHECK_ACCESS(b_ptr);
20617 LDKType b_conv = *(LDKType*)(b_ptr);
20618 if (b_conv.free == LDKType_JCalls_free) {
20619 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
20620 LDKType_JCalls_cloned(&b_conv);
20622 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
20623 *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
20624 return tag_ptr(ret_conv, true);
20627 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20628 if (!ptr_is_owned(_res)) return;
20629 void* _res_ptr = untag_ptr(_res);
20630 CHECK_ACCESS(_res_ptr);
20631 LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
20632 FREE(untag_ptr(_res));
20633 C2Tuple_PublicKeyTypeZ_free(_res_conv);
20636 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20637 LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
20638 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20639 if (_res_constr.datalen > 0)
20640 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
20642 _res_constr.data = NULL;
20643 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20644 for (size_t z = 0; z < _res_constr.datalen; z++) {
20645 int64_t _res_conv_25 = _res_vals[z];
20646 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
20647 CHECK_ACCESS(_res_conv_25_ptr);
20648 LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
20649 FREE(untag_ptr(_res_conv_25));
20650 _res_constr.data[z] = _res_conv_25_conv;
20652 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20653 CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
20656 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) {
20657 void* o_ptr = untag_ptr(o);
20658 CHECK_ACCESS(o_ptr);
20659 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
20660 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
20661 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
20662 *ret_copy = COption_NetAddressZ_some(o_conv);
20663 int64_t ret_ref = tag_ptr(ret_copy, true);
20667 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1none(JNIEnv *env, jclass clz) {
20668 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
20669 *ret_copy = COption_NetAddressZ_none();
20670 int64_t ret_ref = tag_ptr(ret_copy, true);
20674 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20675 if (!ptr_is_owned(_res)) return;
20676 void* _res_ptr = untag_ptr(_res);
20677 CHECK_ACCESS(_res_ptr);
20678 LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
20679 FREE(untag_ptr(_res));
20680 COption_NetAddressZ_free(_res_conv);
20683 static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
20684 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
20685 *ret_copy = COption_NetAddressZ_clone(arg);
20686 int64_t ret_ref = tag_ptr(ret_copy, true);
20689 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20690 LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
20691 int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
20695 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20696 LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
20697 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
20698 *ret_copy = COption_NetAddressZ_clone(orig_conv);
20699 int64_t ret_ref = tag_ptr(ret_copy, true);
20703 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20705 o_ref.datalen = (*env)->GetArrayLength(env, o);
20706 o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
20707 (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data);
20708 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
20709 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
20710 return tag_ptr(ret_conv, true);
20713 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20714 LDKPeerHandleError e_conv;
20715 e_conv.inner = untag_ptr(e);
20716 e_conv.is_owned = ptr_is_owned(e);
20717 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20718 e_conv = PeerHandleError_clone(&e_conv);
20719 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
20720 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
20721 return tag_ptr(ret_conv, true);
20724 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20725 LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
20726 jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
20730 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20731 if (!ptr_is_owned(_res)) return;
20732 void* _res_ptr = untag_ptr(_res);
20733 CHECK_ACCESS(_res_ptr);
20734 LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
20735 FREE(untag_ptr(_res));
20736 CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
20739 static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
20740 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
20741 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
20742 return tag_ptr(ret_conv, true);
20744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20745 LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
20746 int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
20750 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20751 LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
20752 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
20753 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
20754 return tag_ptr(ret_conv, true);
20757 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv *env, jclass clz) {
20758 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
20759 *ret_conv = CResult_NonePeerHandleErrorZ_ok();
20760 return tag_ptr(ret_conv, true);
20763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20764 LDKPeerHandleError e_conv;
20765 e_conv.inner = untag_ptr(e);
20766 e_conv.is_owned = ptr_is_owned(e);
20767 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20768 e_conv = PeerHandleError_clone(&e_conv);
20769 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
20770 *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
20771 return tag_ptr(ret_conv, true);
20774 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20775 LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
20776 jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
20780 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20781 if (!ptr_is_owned(_res)) return;
20782 void* _res_ptr = untag_ptr(_res);
20783 CHECK_ACCESS(_res_ptr);
20784 LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
20785 FREE(untag_ptr(_res));
20786 CResult_NonePeerHandleErrorZ_free(_res_conv);
20789 static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
20790 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
20791 *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
20792 return tag_ptr(ret_conv, true);
20794 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20795 LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
20796 int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
20800 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20801 LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
20802 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
20803 *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
20804 return tag_ptr(ret_conv, true);
20807 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) {
20808 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
20809 *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
20810 return tag_ptr(ret_conv, true);
20813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20814 LDKPeerHandleError e_conv;
20815 e_conv.inner = untag_ptr(e);
20816 e_conv.is_owned = ptr_is_owned(e);
20817 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20818 e_conv = PeerHandleError_clone(&e_conv);
20819 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
20820 *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
20821 return tag_ptr(ret_conv, true);
20824 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20825 LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
20826 jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
20830 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20831 if (!ptr_is_owned(_res)) return;
20832 void* _res_ptr = untag_ptr(_res);
20833 CHECK_ACCESS(_res_ptr);
20834 LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
20835 FREE(untag_ptr(_res));
20836 CResult_boolPeerHandleErrorZ_free(_res_conv);
20839 static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
20840 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
20841 *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
20842 return tag_ptr(ret_conv, true);
20844 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20845 LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
20846 int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
20850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20851 LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
20852 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
20853 *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
20854 return tag_ptr(ret_conv, true);
20857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1ok(JNIEnv *env, jclass clz, int32_t o) {
20858 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
20859 *ret_conv = CResult_u32GraphSyncErrorZ_ok(o);
20860 return tag_ptr(ret_conv, true);
20863 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20864 void* e_ptr = untag_ptr(e);
20865 CHECK_ACCESS(e_ptr);
20866 LDKGraphSyncError e_conv = *(LDKGraphSyncError*)(e_ptr);
20867 e_conv = GraphSyncError_clone((LDKGraphSyncError*)untag_ptr(e));
20868 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
20869 *ret_conv = CResult_u32GraphSyncErrorZ_err(e_conv);
20870 return tag_ptr(ret_conv, true);
20873 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20874 LDKCResult_u32GraphSyncErrorZ* o_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(o);
20875 jboolean ret_conv = CResult_u32GraphSyncErrorZ_is_ok(o_conv);
20879 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20880 if (!ptr_is_owned(_res)) return;
20881 void* _res_ptr = untag_ptr(_res);
20882 CHECK_ACCESS(_res_ptr);
20883 LDKCResult_u32GraphSyncErrorZ _res_conv = *(LDKCResult_u32GraphSyncErrorZ*)(_res_ptr);
20884 FREE(untag_ptr(_res));
20885 CResult_u32GraphSyncErrorZ_free(_res_conv);
20888 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20889 void* o_ptr = untag_ptr(o);
20890 CHECK_ACCESS(o_ptr);
20891 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
20892 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
20893 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
20894 *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
20895 return tag_ptr(ret_conv, true);
20898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20899 LDKDecodeError e_conv;
20900 e_conv.inner = untag_ptr(e);
20901 e_conv.is_owned = ptr_is_owned(e);
20902 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20903 e_conv = DecodeError_clone(&e_conv);
20904 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
20905 *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
20906 return tag_ptr(ret_conv, true);
20909 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20910 LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o);
20911 jboolean ret_conv = CResult_NetAddressDecodeErrorZ_is_ok(o_conv);
20915 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20916 if (!ptr_is_owned(_res)) return;
20917 void* _res_ptr = untag_ptr(_res);
20918 CHECK_ACCESS(_res_ptr);
20919 LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
20920 FREE(untag_ptr(_res));
20921 CResult_NetAddressDecodeErrorZ_free(_res_conv);
20924 static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) {
20925 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
20926 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg);
20927 return tag_ptr(ret_conv, true);
20929 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20930 LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg);
20931 int64_t ret_conv = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv);
20935 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20936 LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig);
20937 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
20938 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
20939 return tag_ptr(ret_conv, true);
20942 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20943 LDKCVec_UpdateAddHTLCZ _res_constr;
20944 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20945 if (_res_constr.datalen > 0)
20946 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
20948 _res_constr.data = NULL;
20949 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20950 for (size_t p = 0; p < _res_constr.datalen; p++) {
20951 int64_t _res_conv_15 = _res_vals[p];
20952 LDKUpdateAddHTLC _res_conv_15_conv;
20953 _res_conv_15_conv.inner = untag_ptr(_res_conv_15);
20954 _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15);
20955 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
20956 _res_constr.data[p] = _res_conv_15_conv;
20958 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20959 CVec_UpdateAddHTLCZ_free(_res_constr);
20962 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20963 LDKCVec_UpdateFulfillHTLCZ _res_constr;
20964 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20965 if (_res_constr.datalen > 0)
20966 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
20968 _res_constr.data = NULL;
20969 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20970 for (size_t t = 0; t < _res_constr.datalen; t++) {
20971 int64_t _res_conv_19 = _res_vals[t];
20972 LDKUpdateFulfillHTLC _res_conv_19_conv;
20973 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
20974 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
20975 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
20976 _res_constr.data[t] = _res_conv_19_conv;
20978 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20979 CVec_UpdateFulfillHTLCZ_free(_res_constr);
20982 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20983 LDKCVec_UpdateFailHTLCZ _res_constr;
20984 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20985 if (_res_constr.datalen > 0)
20986 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
20988 _res_constr.data = NULL;
20989 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20990 for (size_t q = 0; q < _res_constr.datalen; q++) {
20991 int64_t _res_conv_16 = _res_vals[q];
20992 LDKUpdateFailHTLC _res_conv_16_conv;
20993 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
20994 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
20995 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
20996 _res_constr.data[q] = _res_conv_16_conv;
20998 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20999 CVec_UpdateFailHTLCZ_free(_res_constr);
21002 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
21003 LDKCVec_UpdateFailMalformedHTLCZ _res_constr;
21004 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21005 if (_res_constr.datalen > 0)
21006 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
21008 _res_constr.data = NULL;
21009 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
21010 for (size_t z = 0; z < _res_constr.datalen; z++) {
21011 int64_t _res_conv_25 = _res_vals[z];
21012 LDKUpdateFailMalformedHTLC _res_conv_25_conv;
21013 _res_conv_25_conv.inner = untag_ptr(_res_conv_25);
21014 _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25);
21015 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
21016 _res_constr.data[z] = _res_conv_25_conv;
21018 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
21019 CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
21022 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21023 LDKAcceptChannel o_conv;
21024 o_conv.inner = untag_ptr(o);
21025 o_conv.is_owned = ptr_is_owned(o);
21026 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21027 o_conv = AcceptChannel_clone(&o_conv);
21028 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
21029 *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv);
21030 return tag_ptr(ret_conv, true);
21033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21034 LDKDecodeError e_conv;
21035 e_conv.inner = untag_ptr(e);
21036 e_conv.is_owned = ptr_is_owned(e);
21037 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21038 e_conv = DecodeError_clone(&e_conv);
21039 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
21040 *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
21041 return tag_ptr(ret_conv, true);
21044 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21045 LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o);
21046 jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv);
21050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21051 if (!ptr_is_owned(_res)) return;
21052 void* _res_ptr = untag_ptr(_res);
21053 CHECK_ACCESS(_res_ptr);
21054 LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
21055 FREE(untag_ptr(_res));
21056 CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
21059 static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) {
21060 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
21061 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg);
21062 return tag_ptr(ret_conv, true);
21064 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21065 LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg);
21066 int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv);
21070 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21071 LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig);
21072 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
21073 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv);
21074 return tag_ptr(ret_conv, true);
21077 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21078 LDKAnnouncementSignatures o_conv;
21079 o_conv.inner = untag_ptr(o);
21080 o_conv.is_owned = ptr_is_owned(o);
21081 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21082 o_conv = AnnouncementSignatures_clone(&o_conv);
21083 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
21084 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv);
21085 return tag_ptr(ret_conv, true);
21088 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21089 LDKDecodeError e_conv;
21090 e_conv.inner = untag_ptr(e);
21091 e_conv.is_owned = ptr_is_owned(e);
21092 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21093 e_conv = DecodeError_clone(&e_conv);
21094 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
21095 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
21096 return tag_ptr(ret_conv, true);
21099 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21100 LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o);
21101 jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv);
21105 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21106 if (!ptr_is_owned(_res)) return;
21107 void* _res_ptr = untag_ptr(_res);
21108 CHECK_ACCESS(_res_ptr);
21109 LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
21110 FREE(untag_ptr(_res));
21111 CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
21114 static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) {
21115 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
21116 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg);
21117 return tag_ptr(ret_conv, true);
21119 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21120 LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg);
21121 int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv);
21125 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21126 LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig);
21127 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
21128 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv);
21129 return tag_ptr(ret_conv, true);
21132 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21133 LDKChannelReestablish o_conv;
21134 o_conv.inner = untag_ptr(o);
21135 o_conv.is_owned = ptr_is_owned(o);
21136 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21137 o_conv = ChannelReestablish_clone(&o_conv);
21138 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
21139 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv);
21140 return tag_ptr(ret_conv, true);
21143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21144 LDKDecodeError e_conv;
21145 e_conv.inner = untag_ptr(e);
21146 e_conv.is_owned = ptr_is_owned(e);
21147 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21148 e_conv = DecodeError_clone(&e_conv);
21149 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
21150 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
21151 return tag_ptr(ret_conv, true);
21154 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21155 LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o);
21156 jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv);
21160 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21161 if (!ptr_is_owned(_res)) return;
21162 void* _res_ptr = untag_ptr(_res);
21163 CHECK_ACCESS(_res_ptr);
21164 LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
21165 FREE(untag_ptr(_res));
21166 CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
21169 static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) {
21170 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
21171 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg);
21172 return tag_ptr(ret_conv, true);
21174 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21175 LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg);
21176 int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv);
21180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21181 LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig);
21182 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
21183 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv);
21184 return tag_ptr(ret_conv, true);
21187 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21188 LDKClosingSigned o_conv;
21189 o_conv.inner = untag_ptr(o);
21190 o_conv.is_owned = ptr_is_owned(o);
21191 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21192 o_conv = ClosingSigned_clone(&o_conv);
21193 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
21194 *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv);
21195 return tag_ptr(ret_conv, true);
21198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21199 LDKDecodeError e_conv;
21200 e_conv.inner = untag_ptr(e);
21201 e_conv.is_owned = ptr_is_owned(e);
21202 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21203 e_conv = DecodeError_clone(&e_conv);
21204 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
21205 *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
21206 return tag_ptr(ret_conv, true);
21209 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21210 LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o);
21211 jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv);
21215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21216 if (!ptr_is_owned(_res)) return;
21217 void* _res_ptr = untag_ptr(_res);
21218 CHECK_ACCESS(_res_ptr);
21219 LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
21220 FREE(untag_ptr(_res));
21221 CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
21224 static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) {
21225 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
21226 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg);
21227 return tag_ptr(ret_conv, true);
21229 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21230 LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg);
21231 int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv);
21235 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21236 LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig);
21237 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
21238 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv);
21239 return tag_ptr(ret_conv, true);
21242 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21243 LDKClosingSignedFeeRange o_conv;
21244 o_conv.inner = untag_ptr(o);
21245 o_conv.is_owned = ptr_is_owned(o);
21246 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21247 o_conv = ClosingSignedFeeRange_clone(&o_conv);
21248 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
21249 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv);
21250 return tag_ptr(ret_conv, true);
21253 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21254 LDKDecodeError e_conv;
21255 e_conv.inner = untag_ptr(e);
21256 e_conv.is_owned = ptr_is_owned(e);
21257 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21258 e_conv = DecodeError_clone(&e_conv);
21259 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
21260 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
21261 return tag_ptr(ret_conv, true);
21264 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21265 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o);
21266 jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv);
21270 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21271 if (!ptr_is_owned(_res)) return;
21272 void* _res_ptr = untag_ptr(_res);
21273 CHECK_ACCESS(_res_ptr);
21274 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
21275 FREE(untag_ptr(_res));
21276 CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
21279 static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) {
21280 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
21281 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg);
21282 return tag_ptr(ret_conv, true);
21284 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21285 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg);
21286 int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv);
21290 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21291 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig);
21292 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
21293 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv);
21294 return tag_ptr(ret_conv, true);
21297 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21298 LDKCommitmentSigned o_conv;
21299 o_conv.inner = untag_ptr(o);
21300 o_conv.is_owned = ptr_is_owned(o);
21301 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21302 o_conv = CommitmentSigned_clone(&o_conv);
21303 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
21304 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv);
21305 return tag_ptr(ret_conv, true);
21308 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21309 LDKDecodeError e_conv;
21310 e_conv.inner = untag_ptr(e);
21311 e_conv.is_owned = ptr_is_owned(e);
21312 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21313 e_conv = DecodeError_clone(&e_conv);
21314 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
21315 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
21316 return tag_ptr(ret_conv, true);
21319 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21320 LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o);
21321 jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv);
21325 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_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_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
21330 FREE(untag_ptr(_res));
21331 CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
21334 static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) {
21335 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
21336 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg);
21337 return tag_ptr(ret_conv, true);
21339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21340 LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg);
21341 int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv);
21345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21346 LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig);
21347 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
21348 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv);
21349 return tag_ptr(ret_conv, true);
21352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21353 LDKFundingCreated 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 o_conv = FundingCreated_clone(&o_conv);
21358 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
21359 *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv);
21360 return tag_ptr(ret_conv, true);
21363 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21364 LDKDecodeError e_conv;
21365 e_conv.inner = untag_ptr(e);
21366 e_conv.is_owned = ptr_is_owned(e);
21367 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21368 e_conv = DecodeError_clone(&e_conv);
21369 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
21370 *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
21371 return tag_ptr(ret_conv, true);
21374 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21375 LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o);
21376 jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv);
21380 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_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_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
21385 FREE(untag_ptr(_res));
21386 CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
21389 static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) {
21390 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
21391 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg);
21392 return tag_ptr(ret_conv, true);
21394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21395 LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg);
21396 int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv);
21400 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21401 LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig);
21402 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
21403 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv);
21404 return tag_ptr(ret_conv, true);
21407 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21408 LDKFundingSigned o_conv;
21409 o_conv.inner = untag_ptr(o);
21410 o_conv.is_owned = ptr_is_owned(o);
21411 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21412 o_conv = FundingSigned_clone(&o_conv);
21413 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
21414 *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv);
21415 return tag_ptr(ret_conv, true);
21418 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21419 LDKDecodeError e_conv;
21420 e_conv.inner = untag_ptr(e);
21421 e_conv.is_owned = ptr_is_owned(e);
21422 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21423 e_conv = DecodeError_clone(&e_conv);
21424 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
21425 *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
21426 return tag_ptr(ret_conv, true);
21429 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21430 LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o);
21431 jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv);
21435 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21436 if (!ptr_is_owned(_res)) return;
21437 void* _res_ptr = untag_ptr(_res);
21438 CHECK_ACCESS(_res_ptr);
21439 LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
21440 FREE(untag_ptr(_res));
21441 CResult_FundingSignedDecodeErrorZ_free(_res_conv);
21444 static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) {
21445 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
21446 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg);
21447 return tag_ptr(ret_conv, true);
21449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21450 LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg);
21451 int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv);
21455 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21456 LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig);
21457 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
21458 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv);
21459 return tag_ptr(ret_conv, true);
21462 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21463 LDKChannelReady o_conv;
21464 o_conv.inner = untag_ptr(o);
21465 o_conv.is_owned = ptr_is_owned(o);
21466 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21467 o_conv = ChannelReady_clone(&o_conv);
21468 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
21469 *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv);
21470 return tag_ptr(ret_conv, true);
21473 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21474 LDKDecodeError e_conv;
21475 e_conv.inner = untag_ptr(e);
21476 e_conv.is_owned = ptr_is_owned(e);
21477 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21478 e_conv = DecodeError_clone(&e_conv);
21479 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
21480 *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
21481 return tag_ptr(ret_conv, true);
21484 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21485 LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o);
21486 jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv);
21490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21491 if (!ptr_is_owned(_res)) return;
21492 void* _res_ptr = untag_ptr(_res);
21493 CHECK_ACCESS(_res_ptr);
21494 LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr);
21495 FREE(untag_ptr(_res));
21496 CResult_ChannelReadyDecodeErrorZ_free(_res_conv);
21499 static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) {
21500 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
21501 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg);
21502 return tag_ptr(ret_conv, true);
21504 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21505 LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg);
21506 int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv);
21510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21511 LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig);
21512 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
21513 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv);
21514 return tag_ptr(ret_conv, true);
21517 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21519 o_conv.inner = untag_ptr(o);
21520 o_conv.is_owned = ptr_is_owned(o);
21521 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21522 o_conv = Init_clone(&o_conv);
21523 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
21524 *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv);
21525 return tag_ptr(ret_conv, true);
21528 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21529 LDKDecodeError e_conv;
21530 e_conv.inner = untag_ptr(e);
21531 e_conv.is_owned = ptr_is_owned(e);
21532 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21533 e_conv = DecodeError_clone(&e_conv);
21534 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
21535 *ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
21536 return tag_ptr(ret_conv, true);
21539 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21540 LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o);
21541 jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv);
21545 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21546 if (!ptr_is_owned(_res)) return;
21547 void* _res_ptr = untag_ptr(_res);
21548 CHECK_ACCESS(_res_ptr);
21549 LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
21550 FREE(untag_ptr(_res));
21551 CResult_InitDecodeErrorZ_free(_res_conv);
21554 static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) {
21555 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
21556 *ret_conv = CResult_InitDecodeErrorZ_clone(arg);
21557 return tag_ptr(ret_conv, true);
21559 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21560 LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg);
21561 int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv);
21565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21566 LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig);
21567 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
21568 *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv);
21569 return tag_ptr(ret_conv, true);
21572 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21573 LDKOpenChannel o_conv;
21574 o_conv.inner = untag_ptr(o);
21575 o_conv.is_owned = ptr_is_owned(o);
21576 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21577 o_conv = OpenChannel_clone(&o_conv);
21578 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
21579 *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv);
21580 return tag_ptr(ret_conv, true);
21583 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21584 LDKDecodeError e_conv;
21585 e_conv.inner = untag_ptr(e);
21586 e_conv.is_owned = ptr_is_owned(e);
21587 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21588 e_conv = DecodeError_clone(&e_conv);
21589 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
21590 *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
21591 return tag_ptr(ret_conv, true);
21594 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21595 LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o);
21596 jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv);
21600 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21601 if (!ptr_is_owned(_res)) return;
21602 void* _res_ptr = untag_ptr(_res);
21603 CHECK_ACCESS(_res_ptr);
21604 LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
21605 FREE(untag_ptr(_res));
21606 CResult_OpenChannelDecodeErrorZ_free(_res_conv);
21609 static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) {
21610 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
21611 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg);
21612 return tag_ptr(ret_conv, true);
21614 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21615 LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg);
21616 int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv);
21620 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21621 LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig);
21622 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
21623 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv);
21624 return tag_ptr(ret_conv, true);
21627 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21628 LDKRevokeAndACK o_conv;
21629 o_conv.inner = untag_ptr(o);
21630 o_conv.is_owned = ptr_is_owned(o);
21631 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21632 o_conv = RevokeAndACK_clone(&o_conv);
21633 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
21634 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv);
21635 return tag_ptr(ret_conv, true);
21638 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21639 LDKDecodeError e_conv;
21640 e_conv.inner = untag_ptr(e);
21641 e_conv.is_owned = ptr_is_owned(e);
21642 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21643 e_conv = DecodeError_clone(&e_conv);
21644 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
21645 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
21646 return tag_ptr(ret_conv, true);
21649 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21650 LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o);
21651 jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv);
21655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21656 if (!ptr_is_owned(_res)) return;
21657 void* _res_ptr = untag_ptr(_res);
21658 CHECK_ACCESS(_res_ptr);
21659 LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
21660 FREE(untag_ptr(_res));
21661 CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
21664 static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) {
21665 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
21666 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg);
21667 return tag_ptr(ret_conv, true);
21669 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21670 LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg);
21671 int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv);
21675 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21676 LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig);
21677 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
21678 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv);
21679 return tag_ptr(ret_conv, true);
21682 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21683 LDKShutdown o_conv;
21684 o_conv.inner = untag_ptr(o);
21685 o_conv.is_owned = ptr_is_owned(o);
21686 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21687 o_conv = Shutdown_clone(&o_conv);
21688 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
21689 *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv);
21690 return tag_ptr(ret_conv, true);
21693 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21694 LDKDecodeError e_conv;
21695 e_conv.inner = untag_ptr(e);
21696 e_conv.is_owned = ptr_is_owned(e);
21697 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21698 e_conv = DecodeError_clone(&e_conv);
21699 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
21700 *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
21701 return tag_ptr(ret_conv, true);
21704 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21705 LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o);
21706 jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv);
21710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21711 if (!ptr_is_owned(_res)) return;
21712 void* _res_ptr = untag_ptr(_res);
21713 CHECK_ACCESS(_res_ptr);
21714 LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
21715 FREE(untag_ptr(_res));
21716 CResult_ShutdownDecodeErrorZ_free(_res_conv);
21719 static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) {
21720 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
21721 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg);
21722 return tag_ptr(ret_conv, true);
21724 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21725 LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg);
21726 int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv);
21730 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21731 LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig);
21732 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
21733 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv);
21734 return tag_ptr(ret_conv, true);
21737 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21738 LDKUpdateFailHTLC o_conv;
21739 o_conv.inner = untag_ptr(o);
21740 o_conv.is_owned = ptr_is_owned(o);
21741 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21742 o_conv = UpdateFailHTLC_clone(&o_conv);
21743 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
21744 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv);
21745 return tag_ptr(ret_conv, true);
21748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21749 LDKDecodeError e_conv;
21750 e_conv.inner = untag_ptr(e);
21751 e_conv.is_owned = ptr_is_owned(e);
21752 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21753 e_conv = DecodeError_clone(&e_conv);
21754 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
21755 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
21756 return tag_ptr(ret_conv, true);
21759 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21760 LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(o);
21761 jboolean ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv);
21765 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21766 if (!ptr_is_owned(_res)) return;
21767 void* _res_ptr = untag_ptr(_res);
21768 CHECK_ACCESS(_res_ptr);
21769 LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
21770 FREE(untag_ptr(_res));
21771 CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
21774 static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) {
21775 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
21776 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg);
21777 return tag_ptr(ret_conv, true);
21779 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21780 LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(arg);
21781 int64_t ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv);
21785 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21786 LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(orig);
21787 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
21788 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv);
21789 return tag_ptr(ret_conv, true);
21792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21793 LDKUpdateFailMalformedHTLC o_conv;
21794 o_conv.inner = untag_ptr(o);
21795 o_conv.is_owned = ptr_is_owned(o);
21796 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21797 o_conv = UpdateFailMalformedHTLC_clone(&o_conv);
21798 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
21799 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv);
21800 return tag_ptr(ret_conv, true);
21803 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21804 LDKDecodeError e_conv;
21805 e_conv.inner = untag_ptr(e);
21806 e_conv.is_owned = ptr_is_owned(e);
21807 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21808 e_conv = DecodeError_clone(&e_conv);
21809 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
21810 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
21811 return tag_ptr(ret_conv, true);
21814 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21815 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(o);
21816 jboolean ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv);
21820 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21821 if (!ptr_is_owned(_res)) return;
21822 void* _res_ptr = untag_ptr(_res);
21823 CHECK_ACCESS(_res_ptr);
21824 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
21825 FREE(untag_ptr(_res));
21826 CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
21829 static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) {
21830 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
21831 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg);
21832 return tag_ptr(ret_conv, true);
21834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21835 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(arg);
21836 int64_t ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv);
21840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21841 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(orig);
21842 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
21843 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv);
21844 return tag_ptr(ret_conv, true);
21847 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21848 LDKUpdateFee o_conv;
21849 o_conv.inner = untag_ptr(o);
21850 o_conv.is_owned = ptr_is_owned(o);
21851 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21852 o_conv = UpdateFee_clone(&o_conv);
21853 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
21854 *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv);
21855 return tag_ptr(ret_conv, true);
21858 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21859 LDKDecodeError e_conv;
21860 e_conv.inner = untag_ptr(e);
21861 e_conv.is_owned = ptr_is_owned(e);
21862 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21863 e_conv = DecodeError_clone(&e_conv);
21864 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
21865 *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
21866 return tag_ptr(ret_conv, true);
21869 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21870 LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(o);
21871 jboolean ret_conv = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv);
21875 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21876 if (!ptr_is_owned(_res)) return;
21877 void* _res_ptr = untag_ptr(_res);
21878 CHECK_ACCESS(_res_ptr);
21879 LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
21880 FREE(untag_ptr(_res));
21881 CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
21884 static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) {
21885 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
21886 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg);
21887 return tag_ptr(ret_conv, true);
21889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21890 LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(arg);
21891 int64_t ret_conv = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv);
21895 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21896 LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(orig);
21897 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
21898 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv);
21899 return tag_ptr(ret_conv, true);
21902 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21903 LDKUpdateFulfillHTLC o_conv;
21904 o_conv.inner = untag_ptr(o);
21905 o_conv.is_owned = ptr_is_owned(o);
21906 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21907 o_conv = UpdateFulfillHTLC_clone(&o_conv);
21908 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
21909 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv);
21910 return tag_ptr(ret_conv, true);
21913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21914 LDKDecodeError e_conv;
21915 e_conv.inner = untag_ptr(e);
21916 e_conv.is_owned = ptr_is_owned(e);
21917 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21918 e_conv = DecodeError_clone(&e_conv);
21919 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
21920 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
21921 return tag_ptr(ret_conv, true);
21924 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21925 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(o);
21926 jboolean ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv);
21930 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21931 if (!ptr_is_owned(_res)) return;
21932 void* _res_ptr = untag_ptr(_res);
21933 CHECK_ACCESS(_res_ptr);
21934 LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
21935 FREE(untag_ptr(_res));
21936 CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
21939 static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) {
21940 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
21941 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg);
21942 return tag_ptr(ret_conv, true);
21944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21945 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(arg);
21946 int64_t ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv);
21950 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21951 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(orig);
21952 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
21953 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv);
21954 return tag_ptr(ret_conv, true);
21957 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21958 LDKUpdateAddHTLC o_conv;
21959 o_conv.inner = untag_ptr(o);
21960 o_conv.is_owned = ptr_is_owned(o);
21961 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21962 o_conv = UpdateAddHTLC_clone(&o_conv);
21963 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
21964 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv);
21965 return tag_ptr(ret_conv, true);
21968 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21969 LDKDecodeError e_conv;
21970 e_conv.inner = untag_ptr(e);
21971 e_conv.is_owned = ptr_is_owned(e);
21972 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
21973 e_conv = DecodeError_clone(&e_conv);
21974 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
21975 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
21976 return tag_ptr(ret_conv, true);
21979 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21980 LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(o);
21981 jboolean ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv);
21985 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21986 if (!ptr_is_owned(_res)) return;
21987 void* _res_ptr = untag_ptr(_res);
21988 CHECK_ACCESS(_res_ptr);
21989 LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
21990 FREE(untag_ptr(_res));
21991 CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
21994 static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) {
21995 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
21996 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg);
21997 return tag_ptr(ret_conv, true);
21999 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22000 LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(arg);
22001 int64_t ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv);
22005 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22006 LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(orig);
22007 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
22008 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv);
22009 return tag_ptr(ret_conv, true);
22012 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22014 o_conv.inner = untag_ptr(o);
22015 o_conv.is_owned = ptr_is_owned(o);
22016 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22017 o_conv = Ping_clone(&o_conv);
22018 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
22019 *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv);
22020 return tag_ptr(ret_conv, true);
22023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22024 LDKDecodeError e_conv;
22025 e_conv.inner = untag_ptr(e);
22026 e_conv.is_owned = ptr_is_owned(e);
22027 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22028 e_conv = DecodeError_clone(&e_conv);
22029 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
22030 *ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
22031 return tag_ptr(ret_conv, true);
22034 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22035 LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(o);
22036 jboolean ret_conv = CResult_PingDecodeErrorZ_is_ok(o_conv);
22040 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22041 if (!ptr_is_owned(_res)) return;
22042 void* _res_ptr = untag_ptr(_res);
22043 CHECK_ACCESS(_res_ptr);
22044 LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
22045 FREE(untag_ptr(_res));
22046 CResult_PingDecodeErrorZ_free(_res_conv);
22049 static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) {
22050 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
22051 *ret_conv = CResult_PingDecodeErrorZ_clone(arg);
22052 return tag_ptr(ret_conv, true);
22054 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22055 LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(arg);
22056 int64_t ret_conv = CResult_PingDecodeErrorZ_clone_ptr(arg_conv);
22060 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22061 LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(orig);
22062 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
22063 *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv);
22064 return tag_ptr(ret_conv, true);
22067 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22069 o_conv.inner = untag_ptr(o);
22070 o_conv.is_owned = ptr_is_owned(o);
22071 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22072 o_conv = Pong_clone(&o_conv);
22073 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
22074 *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv);
22075 return tag_ptr(ret_conv, true);
22078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22079 LDKDecodeError e_conv;
22080 e_conv.inner = untag_ptr(e);
22081 e_conv.is_owned = ptr_is_owned(e);
22082 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22083 e_conv = DecodeError_clone(&e_conv);
22084 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
22085 *ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
22086 return tag_ptr(ret_conv, true);
22089 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22090 LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(o);
22091 jboolean ret_conv = CResult_PongDecodeErrorZ_is_ok(o_conv);
22095 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22096 if (!ptr_is_owned(_res)) return;
22097 void* _res_ptr = untag_ptr(_res);
22098 CHECK_ACCESS(_res_ptr);
22099 LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
22100 FREE(untag_ptr(_res));
22101 CResult_PongDecodeErrorZ_free(_res_conv);
22104 static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) {
22105 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
22106 *ret_conv = CResult_PongDecodeErrorZ_clone(arg);
22107 return tag_ptr(ret_conv, true);
22109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22110 LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(arg);
22111 int64_t ret_conv = CResult_PongDecodeErrorZ_clone_ptr(arg_conv);
22115 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22116 LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(orig);
22117 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
22118 *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv);
22119 return tag_ptr(ret_conv, true);
22122 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22123 LDKUnsignedChannelAnnouncement o_conv;
22124 o_conv.inner = untag_ptr(o);
22125 o_conv.is_owned = ptr_is_owned(o);
22126 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22127 o_conv = UnsignedChannelAnnouncement_clone(&o_conv);
22128 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
22129 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv);
22130 return tag_ptr(ret_conv, true);
22133 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22134 LDKDecodeError e_conv;
22135 e_conv.inner = untag_ptr(e);
22136 e_conv.is_owned = ptr_is_owned(e);
22137 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22138 e_conv = DecodeError_clone(&e_conv);
22139 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
22140 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
22141 return tag_ptr(ret_conv, true);
22144 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22145 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
22146 jboolean ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
22150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22151 if (!ptr_is_owned(_res)) return;
22152 void* _res_ptr = untag_ptr(_res);
22153 CHECK_ACCESS(_res_ptr);
22154 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
22155 FREE(untag_ptr(_res));
22156 CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
22159 static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
22160 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
22161 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg);
22162 return tag_ptr(ret_conv, true);
22164 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22165 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
22166 int64_t ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
22170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22171 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
22172 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
22173 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv);
22174 return tag_ptr(ret_conv, true);
22177 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22178 LDKChannelAnnouncement o_conv;
22179 o_conv.inner = untag_ptr(o);
22180 o_conv.is_owned = ptr_is_owned(o);
22181 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22182 o_conv = ChannelAnnouncement_clone(&o_conv);
22183 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
22184 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv);
22185 return tag_ptr(ret_conv, true);
22188 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22189 LDKDecodeError e_conv;
22190 e_conv.inner = untag_ptr(e);
22191 e_conv.is_owned = ptr_is_owned(e);
22192 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22193 e_conv = DecodeError_clone(&e_conv);
22194 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
22195 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
22196 return tag_ptr(ret_conv, true);
22199 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22200 LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
22201 jboolean ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
22205 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22206 if (!ptr_is_owned(_res)) return;
22207 void* _res_ptr = untag_ptr(_res);
22208 CHECK_ACCESS(_res_ptr);
22209 LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
22210 FREE(untag_ptr(_res));
22211 CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
22214 static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
22215 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
22216 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg);
22217 return tag_ptr(ret_conv, true);
22219 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22220 LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
22221 int64_t ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
22225 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22226 LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
22227 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
22228 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv);
22229 return tag_ptr(ret_conv, true);
22232 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22233 LDKUnsignedChannelUpdate o_conv;
22234 o_conv.inner = untag_ptr(o);
22235 o_conv.is_owned = ptr_is_owned(o);
22236 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22237 o_conv = UnsignedChannelUpdate_clone(&o_conv);
22238 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
22239 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv);
22240 return tag_ptr(ret_conv, true);
22243 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22244 LDKDecodeError e_conv;
22245 e_conv.inner = untag_ptr(e);
22246 e_conv.is_owned = ptr_is_owned(e);
22247 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22248 e_conv = DecodeError_clone(&e_conv);
22249 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
22250 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
22251 return tag_ptr(ret_conv, true);
22254 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22255 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(o);
22256 jboolean ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv);
22260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22261 if (!ptr_is_owned(_res)) return;
22262 void* _res_ptr = untag_ptr(_res);
22263 CHECK_ACCESS(_res_ptr);
22264 LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
22265 FREE(untag_ptr(_res));
22266 CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
22269 static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
22270 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
22271 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg);
22272 return tag_ptr(ret_conv, true);
22274 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22275 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(arg);
22276 int64_t ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
22280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22281 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(orig);
22282 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
22283 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv);
22284 return tag_ptr(ret_conv, true);
22287 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22288 LDKChannelUpdate o_conv;
22289 o_conv.inner = untag_ptr(o);
22290 o_conv.is_owned = ptr_is_owned(o);
22291 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22292 o_conv = ChannelUpdate_clone(&o_conv);
22293 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
22294 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv);
22295 return tag_ptr(ret_conv, true);
22298 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22299 LDKDecodeError e_conv;
22300 e_conv.inner = untag_ptr(e);
22301 e_conv.is_owned = ptr_is_owned(e);
22302 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22303 e_conv = DecodeError_clone(&e_conv);
22304 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
22305 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
22306 return tag_ptr(ret_conv, true);
22309 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22310 LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(o);
22311 jboolean ret_conv = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv);
22315 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22316 if (!ptr_is_owned(_res)) return;
22317 void* _res_ptr = untag_ptr(_res);
22318 CHECK_ACCESS(_res_ptr);
22319 LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
22320 FREE(untag_ptr(_res));
22321 CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
22324 static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
22325 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
22326 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg);
22327 return tag_ptr(ret_conv, true);
22329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22330 LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(arg);
22331 int64_t ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
22335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22336 LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(orig);
22337 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
22338 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv);
22339 return tag_ptr(ret_conv, true);
22342 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22343 LDKErrorMessage o_conv;
22344 o_conv.inner = untag_ptr(o);
22345 o_conv.is_owned = ptr_is_owned(o);
22346 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22347 o_conv = ErrorMessage_clone(&o_conv);
22348 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
22349 *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv);
22350 return tag_ptr(ret_conv, true);
22353 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22354 LDKDecodeError e_conv;
22355 e_conv.inner = untag_ptr(e);
22356 e_conv.is_owned = ptr_is_owned(e);
22357 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22358 e_conv = DecodeError_clone(&e_conv);
22359 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
22360 *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
22361 return tag_ptr(ret_conv, true);
22364 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22365 LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(o);
22366 jboolean ret_conv = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv);
22370 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22371 if (!ptr_is_owned(_res)) return;
22372 void* _res_ptr = untag_ptr(_res);
22373 CHECK_ACCESS(_res_ptr);
22374 LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
22375 FREE(untag_ptr(_res));
22376 CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
22379 static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) {
22380 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
22381 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg);
22382 return tag_ptr(ret_conv, true);
22384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22385 LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(arg);
22386 int64_t ret_conv = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv);
22390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22391 LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(orig);
22392 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
22393 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv);
22394 return tag_ptr(ret_conv, true);
22397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22398 LDKWarningMessage o_conv;
22399 o_conv.inner = untag_ptr(o);
22400 o_conv.is_owned = ptr_is_owned(o);
22401 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22402 o_conv = WarningMessage_clone(&o_conv);
22403 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
22404 *ret_conv = CResult_WarningMessageDecodeErrorZ_ok(o_conv);
22405 return tag_ptr(ret_conv, true);
22408 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22409 LDKDecodeError e_conv;
22410 e_conv.inner = untag_ptr(e);
22411 e_conv.is_owned = ptr_is_owned(e);
22412 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22413 e_conv = DecodeError_clone(&e_conv);
22414 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
22415 *ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
22416 return tag_ptr(ret_conv, true);
22419 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22420 LDKCResult_WarningMessageDecodeErrorZ* o_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(o);
22421 jboolean ret_conv = CResult_WarningMessageDecodeErrorZ_is_ok(o_conv);
22425 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22426 if (!ptr_is_owned(_res)) return;
22427 void* _res_ptr = untag_ptr(_res);
22428 CHECK_ACCESS(_res_ptr);
22429 LDKCResult_WarningMessageDecodeErrorZ _res_conv = *(LDKCResult_WarningMessageDecodeErrorZ*)(_res_ptr);
22430 FREE(untag_ptr(_res));
22431 CResult_WarningMessageDecodeErrorZ_free(_res_conv);
22434 static inline uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg) {
22435 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
22436 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(arg);
22437 return tag_ptr(ret_conv, true);
22439 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22440 LDKCResult_WarningMessageDecodeErrorZ* arg_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(arg);
22441 int64_t ret_conv = CResult_WarningMessageDecodeErrorZ_clone_ptr(arg_conv);
22445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22446 LDKCResult_WarningMessageDecodeErrorZ* orig_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(orig);
22447 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
22448 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(orig_conv);
22449 return tag_ptr(ret_conv, true);
22452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22453 LDKUnsignedNodeAnnouncement o_conv;
22454 o_conv.inner = untag_ptr(o);
22455 o_conv.is_owned = ptr_is_owned(o);
22456 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22457 o_conv = UnsignedNodeAnnouncement_clone(&o_conv);
22458 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
22459 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv);
22460 return tag_ptr(ret_conv, true);
22463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22464 LDKDecodeError e_conv;
22465 e_conv.inner = untag_ptr(e);
22466 e_conv.is_owned = ptr_is_owned(e);
22467 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22468 e_conv = DecodeError_clone(&e_conv);
22469 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
22470 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
22471 return tag_ptr(ret_conv, true);
22474 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22475 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(o);
22476 jboolean ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv);
22480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22481 if (!ptr_is_owned(_res)) return;
22482 void* _res_ptr = untag_ptr(_res);
22483 CHECK_ACCESS(_res_ptr);
22484 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
22485 FREE(untag_ptr(_res));
22486 CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
22489 static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
22490 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
22491 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg);
22492 return tag_ptr(ret_conv, true);
22494 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22495 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
22496 int64_t ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
22500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22501 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
22502 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
22503 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv);
22504 return tag_ptr(ret_conv, true);
22507 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22508 LDKNodeAnnouncement o_conv;
22509 o_conv.inner = untag_ptr(o);
22510 o_conv.is_owned = ptr_is_owned(o);
22511 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22512 o_conv = NodeAnnouncement_clone(&o_conv);
22513 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
22514 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv);
22515 return tag_ptr(ret_conv, true);
22518 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22519 LDKDecodeError e_conv;
22520 e_conv.inner = untag_ptr(e);
22521 e_conv.is_owned = ptr_is_owned(e);
22522 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22523 e_conv = DecodeError_clone(&e_conv);
22524 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
22525 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
22526 return tag_ptr(ret_conv, true);
22529 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22530 LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(o);
22531 jboolean ret_conv = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv);
22535 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22536 if (!ptr_is_owned(_res)) return;
22537 void* _res_ptr = untag_ptr(_res);
22538 CHECK_ACCESS(_res_ptr);
22539 LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
22540 FREE(untag_ptr(_res));
22541 CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
22544 static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
22545 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
22546 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg);
22547 return tag_ptr(ret_conv, true);
22549 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22550 LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
22551 int64_t ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
22555 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22556 LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
22557 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
22558 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv);
22559 return tag_ptr(ret_conv, true);
22562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22563 LDKQueryShortChannelIds o_conv;
22564 o_conv.inner = untag_ptr(o);
22565 o_conv.is_owned = ptr_is_owned(o);
22566 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22567 o_conv = QueryShortChannelIds_clone(&o_conv);
22568 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
22569 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv);
22570 return tag_ptr(ret_conv, true);
22573 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22574 LDKDecodeError e_conv;
22575 e_conv.inner = untag_ptr(e);
22576 e_conv.is_owned = ptr_is_owned(e);
22577 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22578 e_conv = DecodeError_clone(&e_conv);
22579 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
22580 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
22581 return tag_ptr(ret_conv, true);
22584 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22585 LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(o);
22586 jboolean ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv);
22590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22591 if (!ptr_is_owned(_res)) return;
22592 void* _res_ptr = untag_ptr(_res);
22593 CHECK_ACCESS(_res_ptr);
22594 LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
22595 FREE(untag_ptr(_res));
22596 CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
22599 static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) {
22600 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
22601 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg);
22602 return tag_ptr(ret_conv, true);
22604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22605 LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(arg);
22606 int64_t ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv);
22610 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22611 LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(orig);
22612 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
22613 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv);
22614 return tag_ptr(ret_conv, true);
22617 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22618 LDKReplyShortChannelIdsEnd o_conv;
22619 o_conv.inner = untag_ptr(o);
22620 o_conv.is_owned = ptr_is_owned(o);
22621 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22622 o_conv = ReplyShortChannelIdsEnd_clone(&o_conv);
22623 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
22624 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv);
22625 return tag_ptr(ret_conv, true);
22628 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22629 LDKDecodeError e_conv;
22630 e_conv.inner = untag_ptr(e);
22631 e_conv.is_owned = ptr_is_owned(e);
22632 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22633 e_conv = DecodeError_clone(&e_conv);
22634 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
22635 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
22636 return tag_ptr(ret_conv, true);
22639 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22640 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(o);
22641 jboolean ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv);
22645 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22646 if (!ptr_is_owned(_res)) return;
22647 void* _res_ptr = untag_ptr(_res);
22648 CHECK_ACCESS(_res_ptr);
22649 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
22650 FREE(untag_ptr(_res));
22651 CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
22654 static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) {
22655 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
22656 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg);
22657 return tag_ptr(ret_conv, true);
22659 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22660 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(arg);
22661 int64_t ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv);
22665 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22666 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(orig);
22667 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
22668 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv);
22669 return tag_ptr(ret_conv, true);
22672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22673 LDKQueryChannelRange o_conv;
22674 o_conv.inner = untag_ptr(o);
22675 o_conv.is_owned = ptr_is_owned(o);
22676 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22677 o_conv = QueryChannelRange_clone(&o_conv);
22678 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
22679 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv);
22680 return tag_ptr(ret_conv, true);
22683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22684 LDKDecodeError e_conv;
22685 e_conv.inner = untag_ptr(e);
22686 e_conv.is_owned = ptr_is_owned(e);
22687 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22688 e_conv = DecodeError_clone(&e_conv);
22689 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
22690 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
22691 return tag_ptr(ret_conv, true);
22694 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22695 LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(o);
22696 jboolean ret_conv = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv);
22700 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22701 if (!ptr_is_owned(_res)) return;
22702 void* _res_ptr = untag_ptr(_res);
22703 CHECK_ACCESS(_res_ptr);
22704 LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
22705 FREE(untag_ptr(_res));
22706 CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
22709 static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
22710 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
22711 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg);
22712 return tag_ptr(ret_conv, true);
22714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22715 LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(arg);
22716 int64_t ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
22720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22721 LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(orig);
22722 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
22723 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv);
22724 return tag_ptr(ret_conv, true);
22727 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22728 LDKReplyChannelRange o_conv;
22729 o_conv.inner = untag_ptr(o);
22730 o_conv.is_owned = ptr_is_owned(o);
22731 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22732 o_conv = ReplyChannelRange_clone(&o_conv);
22733 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
22734 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv);
22735 return tag_ptr(ret_conv, true);
22738 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22739 LDKDecodeError e_conv;
22740 e_conv.inner = untag_ptr(e);
22741 e_conv.is_owned = ptr_is_owned(e);
22742 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22743 e_conv = DecodeError_clone(&e_conv);
22744 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
22745 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
22746 return tag_ptr(ret_conv, true);
22749 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22750 LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(o);
22751 jboolean ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv);
22755 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22756 if (!ptr_is_owned(_res)) return;
22757 void* _res_ptr = untag_ptr(_res);
22758 CHECK_ACCESS(_res_ptr);
22759 LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
22760 FREE(untag_ptr(_res));
22761 CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
22764 static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
22765 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
22766 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg);
22767 return tag_ptr(ret_conv, true);
22769 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22770 LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(arg);
22771 int64_t ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
22775 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22776 LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(orig);
22777 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
22778 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv);
22779 return tag_ptr(ret_conv, true);
22782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22783 LDKGossipTimestampFilter o_conv;
22784 o_conv.inner = untag_ptr(o);
22785 o_conv.is_owned = ptr_is_owned(o);
22786 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22787 o_conv = GossipTimestampFilter_clone(&o_conv);
22788 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
22789 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv);
22790 return tag_ptr(ret_conv, true);
22793 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22794 LDKDecodeError e_conv;
22795 e_conv.inner = untag_ptr(e);
22796 e_conv.is_owned = ptr_is_owned(e);
22797 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
22798 e_conv = DecodeError_clone(&e_conv);
22799 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
22800 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
22801 return tag_ptr(ret_conv, true);
22804 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22805 LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(o);
22806 jboolean ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv);
22810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22811 if (!ptr_is_owned(_res)) return;
22812 void* _res_ptr = untag_ptr(_res);
22813 CHECK_ACCESS(_res_ptr);
22814 LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
22815 FREE(untag_ptr(_res));
22816 CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
22819 static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) {
22820 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
22821 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg);
22822 return tag_ptr(ret_conv, true);
22824 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22825 LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(arg);
22826 int64_t ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv);
22830 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22831 LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(orig);
22832 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
22833 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv);
22834 return tag_ptr(ret_conv, true);
22837 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22838 LDKCVec_PhantomRouteHintsZ _res_constr;
22839 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22840 if (_res_constr.datalen > 0)
22841 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
22843 _res_constr.data = NULL;
22844 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22845 for (size_t t = 0; t < _res_constr.datalen; t++) {
22846 int64_t _res_conv_19 = _res_vals[t];
22847 LDKPhantomRouteHints _res_conv_19_conv;
22848 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
22849 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
22850 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
22851 _res_constr.data[t] = _res_conv_19_conv;
22853 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22854 CVec_PhantomRouteHintsZ_free(_res_constr);
22857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22859 o_conv.inner = untag_ptr(o);
22860 o_conv.is_owned = ptr_is_owned(o);
22861 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22862 o_conv = Invoice_clone(&o_conv);
22863 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
22864 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv);
22865 return tag_ptr(ret_conv, true);
22868 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22869 void* e_ptr = untag_ptr(e);
22870 CHECK_ACCESS(e_ptr);
22871 LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
22872 e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e));
22873 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
22874 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
22875 return tag_ptr(ret_conv, true);
22878 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22879 LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o);
22880 jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv);
22884 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22885 if (!ptr_is_owned(_res)) return;
22886 void* _res_ptr = untag_ptr(_res);
22887 CHECK_ACCESS(_res_ptr);
22888 LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
22889 FREE(untag_ptr(_res));
22890 CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
22893 static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) {
22894 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
22895 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg);
22896 return tag_ptr(ret_conv, true);
22898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22899 LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg);
22900 int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv);
22904 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22905 LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig);
22906 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
22907 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv);
22908 return tag_ptr(ret_conv, true);
22911 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1some(JNIEnv *env, jclass clz, int64_t o) {
22912 void* o_ptr = untag_ptr(o);
22913 CHECK_ACCESS(o_ptr);
22914 LDKFilter o_conv = *(LDKFilter*)(o_ptr);
22915 if (o_conv.free == LDKFilter_JCalls_free) {
22916 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22917 LDKFilter_JCalls_cloned(&o_conv);
22919 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
22920 *ret_copy = COption_FilterZ_some(o_conv);
22921 int64_t ret_ref = tag_ptr(ret_copy, true);
22925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1none(JNIEnv *env, jclass clz) {
22926 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
22927 *ret_copy = COption_FilterZ_none();
22928 int64_t ret_ref = tag_ptr(ret_copy, true);
22932 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22933 if (!ptr_is_owned(_res)) return;
22934 void* _res_ptr = untag_ptr(_res);
22935 CHECK_ACCESS(_res_ptr);
22936 LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
22937 FREE(untag_ptr(_res));
22938 COption_FilterZ_free(_res_conv);
22941 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22942 LDKLockedChannelMonitor o_conv;
22943 o_conv.inner = untag_ptr(o);
22944 o_conv.is_owned = ptr_is_owned(o);
22945 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22946 // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor
22948 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
22949 *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv);
22950 return tag_ptr(ret_conv, true);
22953 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1err(JNIEnv *env, jclass clz) {
22954 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
22955 *ret_conv = CResult_LockedChannelMonitorNoneZ_err();
22956 return tag_ptr(ret_conv, true);
22959 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22960 LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o);
22961 jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv);
22965 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22966 if (!ptr_is_owned(_res)) return;
22967 void* _res_ptr = untag_ptr(_res);
22968 CHECK_ACCESS(_res_ptr);
22969 LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
22970 FREE(untag_ptr(_res));
22971 CResult_LockedChannelMonitorNoneZ_free(_res_conv);
22974 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22975 LDKCVec_OutPointZ _res_constr;
22976 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22977 if (_res_constr.datalen > 0)
22978 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
22980 _res_constr.data = NULL;
22981 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22982 for (size_t k = 0; k < _res_constr.datalen; k++) {
22983 int64_t _res_conv_10 = _res_vals[k];
22984 LDKOutPoint _res_conv_10_conv;
22985 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
22986 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
22987 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
22988 _res_constr.data[k] = _res_conv_10_conv;
22990 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22991 CVec_OutPointZ_free(_res_constr);
22994 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
22995 if (!ptr_is_owned(this_ptr)) return;
22996 void* this_ptr_ptr = untag_ptr(this_ptr);
22997 CHECK_ACCESS(this_ptr_ptr);
22998 LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
22999 FREE(untag_ptr(this_ptr));
23000 PaymentPurpose_free(this_ptr_conv);
23003 static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) {
23004 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
23005 *ret_copy = PaymentPurpose_clone(arg);
23006 int64_t ret_ref = tag_ptr(ret_copy, true);
23009 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23010 LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg);
23011 int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv);
23015 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23016 LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig);
23017 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
23018 *ret_copy = PaymentPurpose_clone(orig_conv);
23019 int64_t ret_ref = tag_ptr(ret_copy, true);
23023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1invoice_1payment(JNIEnv *env, jclass clz, int8_tArray payment_preimage, int8_tArray payment_secret) {
23024 LDKThirtyTwoBytes payment_preimage_ref;
23025 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
23026 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
23027 LDKThirtyTwoBytes payment_secret_ref;
23028 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
23029 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
23030 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
23031 *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
23032 int64_t ret_ref = tag_ptr(ret_copy, true);
23036 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment(JNIEnv *env, jclass clz, int8_tArray a) {
23037 LDKThirtyTwoBytes a_ref;
23038 CHECK((*env)->GetArrayLength(env, a) == 32);
23039 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
23040 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
23041 *ret_copy = PaymentPurpose_spontaneous_payment(a_ref);
23042 int64_t ret_ref = tag_ptr(ret_copy, true);
23046 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write(JNIEnv *env, jclass clz, int64_t obj) {
23047 LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj);
23048 LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv);
23049 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
23050 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
23051 CVec_u8Z_free(ret_var);
23055 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
23056 LDKu8slice ser_ref;
23057 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
23058 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
23059 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
23060 *ret_conv = PaymentPurpose_read(ser_ref);
23061 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
23062 return tag_ptr(ret_conv, true);
23065 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
23066 if (!ptr_is_owned(this_ptr)) return;
23067 void* this_ptr_ptr = untag_ptr(this_ptr);
23068 CHECK_ACCESS(this_ptr_ptr);
23069 LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
23070 FREE(untag_ptr(this_ptr));
23071 ClosureReason_free(this_ptr_conv);
23074 static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) {
23075 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
23076 *ret_copy = ClosureReason_clone(arg);
23077 int64_t ret_ref = tag_ptr(ret_copy, true);
23080 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23081 LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg);
23082 int64_t ret_conv = ClosureReason_clone_ptr(arg_conv);
23086 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23087 LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig);
23088 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
23089 *ret_copy = ClosureReason_clone(orig_conv);
23090 int64_t ret_ref = tag_ptr(ret_copy, true);
23094 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1force_1closed(JNIEnv *env, jclass clz, jstring peer_msg) {
23095 LDKStr peer_msg_conv = java_to_owned_str(env, peer_msg);
23096 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
23097 *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv);
23098 int64_t ret_ref = tag_ptr(ret_copy, true);
23102 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1holder_1force_1closed(JNIEnv *env, jclass clz) {
23103 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
23104 *ret_copy = ClosureReason_holder_force_closed();
23105 int64_t ret_ref = tag_ptr(ret_copy, true);
23109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1cooperative_1closure(JNIEnv *env, jclass clz) {
23110 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
23111 *ret_copy = ClosureReason_cooperative_closure();
23112 int64_t ret_ref = tag_ptr(ret_copy, true);
23116 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz) {
23117 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
23118 *ret_copy = ClosureReason_commitment_tx_confirmed();
23119 int64_t ret_ref = tag_ptr(ret_copy, true);
23123 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out(JNIEnv *env, jclass clz) {
23124 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
23125 *ret_copy = ClosureReason_funding_timed_out();
23126 int64_t ret_ref = tag_ptr(ret_copy, true);
23130 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error(JNIEnv *env, jclass clz, jstring err) {
23131 LDKStr err_conv = java_to_owned_str(env, err);
23132 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
23133 *ret_copy = ClosureReason_processing_error(err_conv);
23134 int64_t ret_ref = tag_ptr(ret_copy, true);
23138 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1disconnected_1peer(JNIEnv *env, jclass clz) {
23139 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
23140 *ret_copy = ClosureReason_disconnected_peer();
23141 int64_t ret_ref = tag_ptr(ret_copy, true);
23145 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager(JNIEnv *env, jclass clz) {
23146 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
23147 *ret_copy = ClosureReason_outdated_channel_manager();
23148 int64_t ret_ref = tag_ptr(ret_copy, true);
23152 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JNIEnv *env, jclass clz, int64_t obj) {
23153 LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
23154 LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
23155 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
23156 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
23157 CVec_u8Z_free(ret_var);
23161 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
23162 LDKu8slice ser_ref;
23163 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
23164 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
23165 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
23166 *ret_conv = ClosureReason_read(ser_ref);
23167 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
23168 return tag_ptr(ret_conv, true);
23171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
23172 if (!ptr_is_owned(this_ptr)) return;
23173 void* this_ptr_ptr = untag_ptr(this_ptr);
23174 CHECK_ACCESS(this_ptr_ptr);
23175 LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr);
23176 FREE(untag_ptr(this_ptr));
23177 HTLCDestination_free(this_ptr_conv);
23180 static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) {
23181 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
23182 *ret_copy = HTLCDestination_clone(arg);
23183 int64_t ret_ref = tag_ptr(ret_copy, true);
23186 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23187 LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg);
23188 int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv);
23192 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23193 LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig);
23194 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
23195 *ret_copy = HTLCDestination_clone(orig_conv);
23196 int64_t ret_ref = tag_ptr(ret_copy, true);
23200 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) {
23201 LDKPublicKey node_id_ref;
23202 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23203 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23204 LDKThirtyTwoBytes channel_id_ref;
23205 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
23206 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
23207 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
23208 *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref);
23209 int64_t ret_ref = tag_ptr(ret_copy, true);
23213 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop(JNIEnv *env, jclass clz, int64_t requested_forward_scid) {
23214 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
23215 *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid);
23216 int64_t ret_ref = tag_ptr(ret_copy, true);
23220 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) {
23221 LDKThirtyTwoBytes payment_hash_ref;
23222 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
23223 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
23224 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
23225 *ret_copy = HTLCDestination_failed_payment(payment_hash_ref);
23226 int64_t ret_ref = tag_ptr(ret_copy, true);
23230 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write(JNIEnv *env, jclass clz, int64_t obj) {
23231 LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
23232 LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
23233 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
23234 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
23235 CVec_u8Z_free(ret_var);
23239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
23240 LDKu8slice ser_ref;
23241 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
23242 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
23243 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
23244 *ret_conv = HTLCDestination_read(ser_ref);
23245 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
23246 return tag_ptr(ret_conv, true);
23249 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
23250 if (!ptr_is_owned(this_ptr)) return;
23251 void* this_ptr_ptr = untag_ptr(this_ptr);
23252 CHECK_ACCESS(this_ptr_ptr);
23253 LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
23254 FREE(untag_ptr(this_ptr));
23255 Event_free(this_ptr_conv);
23258 static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) {
23259 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23260 *ret_copy = Event_clone(arg);
23261 int64_t ret_ref = tag_ptr(ret_copy, true);
23264 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23265 LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg);
23266 int64_t ret_conv = Event_clone_ptr(arg_conv);
23270 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23271 LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig);
23272 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23273 *ret_copy = Event_clone(orig_conv);
23274 int64_t ret_ref = tag_ptr(ret_copy, true);
23278 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) {
23279 LDKThirtyTwoBytes temporary_channel_id_ref;
23280 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
23281 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data);
23282 LDKPublicKey counterparty_node_id_ref;
23283 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
23284 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
23285 LDKCVec_u8Z output_script_ref;
23286 output_script_ref.datalen = (*env)->GetArrayLength(env, output_script);
23287 output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
23288 (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data);
23289 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23290 *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
23291 int64_t ret_ref = tag_ptr(ret_copy, true);
23295 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) {
23296 LDKThirtyTwoBytes payment_hash_ref;
23297 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
23298 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
23299 void* purpose_ptr = untag_ptr(purpose);
23300 CHECK_ACCESS(purpose_ptr);
23301 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
23302 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
23303 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23304 *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv);
23305 int64_t ret_ref = tag_ptr(ret_copy, true);
23309 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) {
23310 LDKThirtyTwoBytes payment_hash_ref;
23311 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
23312 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
23313 void* purpose_ptr = untag_ptr(purpose);
23314 CHECK_ACCESS(purpose_ptr);
23315 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
23316 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
23317 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23318 *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv);
23319 int64_t ret_ref = tag_ptr(ret_copy, true);
23323 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) {
23324 LDKThirtyTwoBytes payment_id_ref;
23325 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
23326 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
23327 LDKThirtyTwoBytes payment_preimage_ref;
23328 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
23329 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
23330 LDKThirtyTwoBytes payment_hash_ref;
23331 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
23332 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
23333 void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat);
23334 CHECK_ACCESS(fee_paid_msat_ptr);
23335 LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
23336 fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat));
23337 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23338 *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
23339 int64_t ret_ref = tag_ptr(ret_copy, true);
23343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash) {
23344 LDKThirtyTwoBytes payment_id_ref;
23345 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
23346 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
23347 LDKThirtyTwoBytes payment_hash_ref;
23348 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
23349 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
23350 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23351 *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
23352 int64_t ret_ref = tag_ptr(ret_copy, true);
23356 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) {
23357 LDKThirtyTwoBytes payment_id_ref;
23358 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
23359 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
23360 LDKThirtyTwoBytes payment_hash_ref;
23361 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
23362 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
23363 LDKCVec_RouteHopZ path_constr;
23364 path_constr.datalen = (*env)->GetArrayLength(env, path);
23365 if (path_constr.datalen > 0)
23366 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
23368 path_constr.data = NULL;
23369 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
23370 for (size_t k = 0; k < path_constr.datalen; k++) {
23371 int64_t path_conv_10 = path_vals[k];
23372 LDKRouteHop path_conv_10_conv;
23373 path_conv_10_conv.inner = untag_ptr(path_conv_10);
23374 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
23375 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
23376 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
23377 path_constr.data[k] = path_conv_10_conv;
23379 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
23380 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23381 *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
23382 int64_t ret_ref = tag_ptr(ret_copy, true);
23386 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 rejected_by_dest, int64_t network_update, jboolean all_paths_failed, int64_tArray path, int64_t short_channel_id, int64_t retry) {
23387 LDKThirtyTwoBytes payment_id_ref;
23388 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
23389 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
23390 LDKThirtyTwoBytes payment_hash_ref;
23391 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
23392 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
23393 void* network_update_ptr = untag_ptr(network_update);
23394 CHECK_ACCESS(network_update_ptr);
23395 LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
23396 network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
23397 LDKCVec_RouteHopZ path_constr;
23398 path_constr.datalen = (*env)->GetArrayLength(env, path);
23399 if (path_constr.datalen > 0)
23400 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
23402 path_constr.data = NULL;
23403 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
23404 for (size_t k = 0; k < path_constr.datalen; k++) {
23405 int64_t path_conv_10 = path_vals[k];
23406 LDKRouteHop path_conv_10_conv;
23407 path_conv_10_conv.inner = untag_ptr(path_conv_10);
23408 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
23409 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
23410 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
23411 path_constr.data[k] = path_conv_10_conv;
23413 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
23414 void* short_channel_id_ptr = untag_ptr(short_channel_id);
23415 CHECK_ACCESS(short_channel_id_ptr);
23416 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
23417 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
23418 LDKRouteParameters retry_conv;
23419 retry_conv.inner = untag_ptr(retry);
23420 retry_conv.is_owned = ptr_is_owned(retry);
23421 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv);
23422 retry_conv = RouteParameters_clone(&retry_conv);
23423 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23424 *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv);
23425 int64_t ret_ref = tag_ptr(ret_copy, true);
23429 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) {
23430 LDKThirtyTwoBytes payment_id_ref;
23431 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
23432 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
23433 LDKThirtyTwoBytes payment_hash_ref;
23434 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
23435 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
23436 LDKCVec_RouteHopZ path_constr;
23437 path_constr.datalen = (*env)->GetArrayLength(env, path);
23438 if (path_constr.datalen > 0)
23439 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
23441 path_constr.data = NULL;
23442 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
23443 for (size_t k = 0; k < path_constr.datalen; k++) {
23444 int64_t path_conv_10 = path_vals[k];
23445 LDKRouteHop path_conv_10_conv;
23446 path_conv_10_conv.inner = untag_ptr(path_conv_10);
23447 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
23448 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
23449 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
23450 path_constr.data[k] = path_conv_10_conv;
23452 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
23453 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23454 *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_constr);
23455 int64_t ret_ref = tag_ptr(ret_copy, true);
23459 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) {
23460 LDKThirtyTwoBytes payment_id_ref;
23461 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
23462 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
23463 LDKThirtyTwoBytes payment_hash_ref;
23464 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
23465 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
23466 LDKCVec_RouteHopZ path_constr;
23467 path_constr.datalen = (*env)->GetArrayLength(env, path);
23468 if (path_constr.datalen > 0)
23469 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
23471 path_constr.data = NULL;
23472 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
23473 for (size_t k = 0; k < path_constr.datalen; k++) {
23474 int64_t path_conv_10 = path_vals[k];
23475 LDKRouteHop path_conv_10_conv;
23476 path_conv_10_conv.inner = untag_ptr(path_conv_10);
23477 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
23478 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
23479 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
23480 path_constr.data[k] = path_conv_10_conv;
23482 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
23483 void* short_channel_id_ptr = untag_ptr(short_channel_id);
23484 CHECK_ACCESS(short_channel_id_ptr);
23485 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
23486 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
23487 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23488 *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_constr, short_channel_id_conv);
23489 int64_t ret_ref = tag_ptr(ret_copy, true);
23493 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) {
23494 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23495 *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
23496 int64_t ret_ref = tag_ptr(ret_copy, true);
23500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs) {
23501 LDKCVec_SpendableOutputDescriptorZ outputs_constr;
23502 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
23503 if (outputs_constr.datalen > 0)
23504 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
23506 outputs_constr.data = NULL;
23507 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
23508 for (size_t b = 0; b < outputs_constr.datalen; b++) {
23509 int64_t outputs_conv_27 = outputs_vals[b];
23510 void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27);
23511 CHECK_ACCESS(outputs_conv_27_ptr);
23512 LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
23513 outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27));
23514 outputs_constr.data[b] = outputs_conv_27_conv;
23516 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
23517 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23518 *ret_copy = Event_spendable_outputs(outputs_constr);
23519 int64_t ret_ref = tag_ptr(ret_copy, true);
23523 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) {
23524 LDKThirtyTwoBytes prev_channel_id_ref;
23525 CHECK((*env)->GetArrayLength(env, prev_channel_id) == 32);
23526 (*env)->GetByteArrayRegion(env, prev_channel_id, 0, 32, prev_channel_id_ref.data);
23527 LDKThirtyTwoBytes next_channel_id_ref;
23528 CHECK((*env)->GetArrayLength(env, next_channel_id) == 32);
23529 (*env)->GetByteArrayRegion(env, next_channel_id, 0, 32, next_channel_id_ref.data);
23530 void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat);
23531 CHECK_ACCESS(fee_earned_msat_ptr);
23532 LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
23533 fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat));
23534 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23535 *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx);
23536 int64_t ret_ref = tag_ptr(ret_copy, true);
23540 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) {
23541 LDKThirtyTwoBytes channel_id_ref;
23542 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
23543 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
23544 void* reason_ptr = untag_ptr(reason);
23545 CHECK_ACCESS(reason_ptr);
23546 LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
23547 reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason));
23548 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23549 *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
23550 int64_t ret_ref = tag_ptr(ret_copy, true);
23554 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray transaction) {
23555 LDKThirtyTwoBytes channel_id_ref;
23556 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
23557 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
23558 LDKTransaction transaction_ref;
23559 transaction_ref.datalen = (*env)->GetArrayLength(env, transaction);
23560 transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes");
23561 (*env)->GetByteArrayRegion(env, transaction, 0, transaction_ref.datalen, transaction_ref.data);
23562 transaction_ref.data_is_owned = true;
23563 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23564 *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref);
23565 int64_t ret_ref = tag_ptr(ret_copy, true);
23569 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) {
23570 LDKThirtyTwoBytes temporary_channel_id_ref;
23571 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
23572 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data);
23573 LDKPublicKey counterparty_node_id_ref;
23574 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
23575 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
23576 LDKChannelTypeFeatures channel_type_conv;
23577 channel_type_conv.inner = untag_ptr(channel_type);
23578 channel_type_conv.is_owned = ptr_is_owned(channel_type);
23579 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
23580 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
23581 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23582 *ret_copy = Event_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv);
23583 int64_t ret_ref = tag_ptr(ret_copy, true);
23587 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) {
23588 LDKThirtyTwoBytes prev_channel_id_ref;
23589 CHECK((*env)->GetArrayLength(env, prev_channel_id) == 32);
23590 (*env)->GetByteArrayRegion(env, prev_channel_id, 0, 32, prev_channel_id_ref.data);
23591 void* failed_next_destination_ptr = untag_ptr(failed_next_destination);
23592 CHECK_ACCESS(failed_next_destination_ptr);
23593 LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr);
23594 failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination));
23595 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
23596 *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv);
23597 int64_t ret_ref = tag_ptr(ret_copy, true);
23601 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) {
23602 LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj);
23603 LDKCVec_u8Z ret_var = Event_write(obj_conv);
23604 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
23605 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
23606 CVec_u8Z_free(ret_var);
23610 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
23611 LDKu8slice ser_ref;
23612 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
23613 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
23614 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
23615 *ret_conv = Event_read(ser_ref);
23616 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
23617 return tag_ptr(ret_conv, true);
23620 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
23621 if (!ptr_is_owned(this_ptr)) return;
23622 void* this_ptr_ptr = untag_ptr(this_ptr);
23623 CHECK_ACCESS(this_ptr_ptr);
23624 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
23625 FREE(untag_ptr(this_ptr));
23626 MessageSendEvent_free(this_ptr_conv);
23629 static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) {
23630 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23631 *ret_copy = MessageSendEvent_clone(arg);
23632 int64_t ret_ref = tag_ptr(ret_copy, true);
23635 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23636 LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg);
23637 int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv);
23641 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23642 LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig);
23643 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23644 *ret_copy = MessageSendEvent_clone(orig_conv);
23645 int64_t ret_ref = tag_ptr(ret_copy, true);
23649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
23650 LDKPublicKey node_id_ref;
23651 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23652 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23653 LDKAcceptChannel msg_conv;
23654 msg_conv.inner = untag_ptr(msg);
23655 msg_conv.is_owned = ptr_is_owned(msg);
23656 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23657 msg_conv = AcceptChannel_clone(&msg_conv);
23658 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23659 *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
23660 int64_t ret_ref = tag_ptr(ret_copy, true);
23664 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
23665 LDKPublicKey node_id_ref;
23666 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23667 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23668 LDKOpenChannel msg_conv;
23669 msg_conv.inner = untag_ptr(msg);
23670 msg_conv.is_owned = ptr_is_owned(msg);
23671 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23672 msg_conv = OpenChannel_clone(&msg_conv);
23673 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23674 *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
23675 int64_t ret_ref = tag_ptr(ret_copy, true);
23679 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
23680 LDKPublicKey node_id_ref;
23681 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23682 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23683 LDKFundingCreated msg_conv;
23684 msg_conv.inner = untag_ptr(msg);
23685 msg_conv.is_owned = ptr_is_owned(msg);
23686 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23687 msg_conv = FundingCreated_clone(&msg_conv);
23688 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23689 *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
23690 int64_t ret_ref = tag_ptr(ret_copy, true);
23694 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
23695 LDKPublicKey node_id_ref;
23696 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23697 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23698 LDKFundingSigned msg_conv;
23699 msg_conv.inner = untag_ptr(msg);
23700 msg_conv.is_owned = ptr_is_owned(msg);
23701 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23702 msg_conv = FundingSigned_clone(&msg_conv);
23703 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23704 *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
23705 int64_t ret_ref = tag_ptr(ret_copy, true);
23709 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
23710 LDKPublicKey node_id_ref;
23711 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23712 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23713 LDKChannelReady msg_conv;
23714 msg_conv.inner = untag_ptr(msg);
23715 msg_conv.is_owned = ptr_is_owned(msg);
23716 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23717 msg_conv = ChannelReady_clone(&msg_conv);
23718 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23719 *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv);
23720 int64_t ret_ref = tag_ptr(ret_copy, true);
23724 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
23725 LDKPublicKey node_id_ref;
23726 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23727 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23728 LDKAnnouncementSignatures msg_conv;
23729 msg_conv.inner = untag_ptr(msg);
23730 msg_conv.is_owned = ptr_is_owned(msg);
23731 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23732 msg_conv = AnnouncementSignatures_clone(&msg_conv);
23733 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23734 *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
23735 int64_t ret_ref = tag_ptr(ret_copy, true);
23739 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t updates) {
23740 LDKPublicKey node_id_ref;
23741 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23742 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23743 LDKCommitmentUpdate updates_conv;
23744 updates_conv.inner = untag_ptr(updates);
23745 updates_conv.is_owned = ptr_is_owned(updates);
23746 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
23747 updates_conv = CommitmentUpdate_clone(&updates_conv);
23748 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23749 *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
23750 int64_t ret_ref = tag_ptr(ret_copy, true);
23754 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) {
23755 LDKPublicKey node_id_ref;
23756 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23757 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23758 LDKRevokeAndACK msg_conv;
23759 msg_conv.inner = untag_ptr(msg);
23760 msg_conv.is_owned = ptr_is_owned(msg);
23761 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23762 msg_conv = RevokeAndACK_clone(&msg_conv);
23763 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23764 *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
23765 int64_t ret_ref = tag_ptr(ret_copy, true);
23769 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
23770 LDKPublicKey node_id_ref;
23771 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23772 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23773 LDKClosingSigned msg_conv;
23774 msg_conv.inner = untag_ptr(msg);
23775 msg_conv.is_owned = ptr_is_owned(msg);
23776 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23777 msg_conv = ClosingSigned_clone(&msg_conv);
23778 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23779 *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
23780 int64_t ret_ref = tag_ptr(ret_copy, true);
23784 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
23785 LDKPublicKey node_id_ref;
23786 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23787 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23788 LDKShutdown msg_conv;
23789 msg_conv.inner = untag_ptr(msg);
23790 msg_conv.is_owned = ptr_is_owned(msg);
23791 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23792 msg_conv = Shutdown_clone(&msg_conv);
23793 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23794 *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
23795 int64_t ret_ref = tag_ptr(ret_copy, true);
23799 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
23800 LDKPublicKey node_id_ref;
23801 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23802 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23803 LDKChannelReestablish msg_conv;
23804 msg_conv.inner = untag_ptr(msg);
23805 msg_conv.is_owned = ptr_is_owned(msg);
23806 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23807 msg_conv = ChannelReestablish_clone(&msg_conv);
23808 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23809 *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
23810 int64_t ret_ref = tag_ptr(ret_copy, true);
23814 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg, int64_t update_msg) {
23815 LDKChannelAnnouncement msg_conv;
23816 msg_conv.inner = untag_ptr(msg);
23817 msg_conv.is_owned = ptr_is_owned(msg);
23818 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23819 msg_conv = ChannelAnnouncement_clone(&msg_conv);
23820 LDKChannelUpdate update_msg_conv;
23821 update_msg_conv.inner = untag_ptr(update_msg);
23822 update_msg_conv.is_owned = ptr_is_owned(update_msg);
23823 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
23824 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
23825 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23826 *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
23827 int64_t ret_ref = tag_ptr(ret_copy, true);
23831 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) {
23832 LDKNodeAnnouncement msg_conv;
23833 msg_conv.inner = untag_ptr(msg);
23834 msg_conv.is_owned = ptr_is_owned(msg);
23835 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23836 msg_conv = NodeAnnouncement_clone(&msg_conv);
23837 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23838 *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
23839 int64_t ret_ref = tag_ptr(ret_copy, true);
23843 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update(JNIEnv *env, jclass clz, int64_t msg) {
23844 LDKChannelUpdate msg_conv;
23845 msg_conv.inner = untag_ptr(msg);
23846 msg_conv.is_owned = ptr_is_owned(msg);
23847 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23848 msg_conv = ChannelUpdate_clone(&msg_conv);
23849 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23850 *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
23851 int64_t ret_ref = tag_ptr(ret_copy, true);
23855 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
23856 LDKPublicKey node_id_ref;
23857 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23858 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23859 LDKChannelUpdate msg_conv;
23860 msg_conv.inner = untag_ptr(msg);
23861 msg_conv.is_owned = ptr_is_owned(msg);
23862 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23863 msg_conv = ChannelUpdate_clone(&msg_conv);
23864 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23865 *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
23866 int64_t ret_ref = tag_ptr(ret_copy, true);
23870 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t action) {
23871 LDKPublicKey node_id_ref;
23872 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23873 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23874 void* action_ptr = untag_ptr(action);
23875 CHECK_ACCESS(action_ptr);
23876 LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
23877 action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action));
23878 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23879 *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
23880 int64_t ret_ref = tag_ptr(ret_copy, true);
23884 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) {
23885 LDKPublicKey node_id_ref;
23886 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23887 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23888 LDKQueryChannelRange msg_conv;
23889 msg_conv.inner = untag_ptr(msg);
23890 msg_conv.is_owned = ptr_is_owned(msg);
23891 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23892 msg_conv = QueryChannelRange_clone(&msg_conv);
23893 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23894 *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
23895 int64_t ret_ref = tag_ptr(ret_copy, true);
23899 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) {
23900 LDKPublicKey node_id_ref;
23901 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23902 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23903 LDKQueryShortChannelIds msg_conv;
23904 msg_conv.inner = untag_ptr(msg);
23905 msg_conv.is_owned = ptr_is_owned(msg);
23906 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23907 msg_conv = QueryShortChannelIds_clone(&msg_conv);
23908 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23909 *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
23910 int64_t ret_ref = tag_ptr(ret_copy, true);
23914 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) {
23915 LDKPublicKey node_id_ref;
23916 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23917 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23918 LDKReplyChannelRange msg_conv;
23919 msg_conv.inner = untag_ptr(msg);
23920 msg_conv.is_owned = ptr_is_owned(msg);
23921 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23922 msg_conv = ReplyChannelRange_clone(&msg_conv);
23923 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23924 *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
23925 int64_t ret_ref = tag_ptr(ret_copy, true);
23929 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) {
23930 LDKPublicKey node_id_ref;
23931 CHECK((*env)->GetArrayLength(env, node_id) == 33);
23932 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
23933 LDKGossipTimestampFilter msg_conv;
23934 msg_conv.inner = untag_ptr(msg);
23935 msg_conv.is_owned = ptr_is_owned(msg);
23936 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
23937 msg_conv = GossipTimestampFilter_clone(&msg_conv);
23938 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
23939 *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv);
23940 int64_t ret_ref = tag_ptr(ret_copy, true);
23944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
23945 if (!ptr_is_owned(this_ptr)) return;
23946 void* this_ptr_ptr = untag_ptr(this_ptr);
23947 CHECK_ACCESS(this_ptr_ptr);
23948 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
23949 FREE(untag_ptr(this_ptr));
23950 MessageSendEventsProvider_free(this_ptr_conv);
23953 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
23954 if (!ptr_is_owned(this_ptr)) return;
23955 void* this_ptr_ptr = untag_ptr(this_ptr);
23956 CHECK_ACCESS(this_ptr_ptr);
23957 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
23958 FREE(untag_ptr(this_ptr));
23959 EventsProvider_free(this_ptr_conv);
23962 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
23963 if (!ptr_is_owned(this_ptr)) return;
23964 void* this_ptr_ptr = untag_ptr(this_ptr);
23965 CHECK_ACCESS(this_ptr_ptr);
23966 LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
23967 FREE(untag_ptr(this_ptr));
23968 EventHandler_free(this_ptr_conv);
23971 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
23972 if (!ptr_is_owned(this_ptr)) return;
23973 void* this_ptr_ptr = untag_ptr(this_ptr);
23974 CHECK_ACCESS(this_ptr_ptr);
23975 LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
23976 FREE(untag_ptr(this_ptr));
23977 APIError_free(this_ptr_conv);
23980 static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) {
23981 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
23982 *ret_copy = APIError_clone(arg);
23983 int64_t ret_ref = tag_ptr(ret_copy, true);
23986 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23987 LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg);
23988 int64_t ret_conv = APIError_clone_ptr(arg_conv);
23992 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23993 LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig);
23994 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
23995 *ret_copy = APIError_clone(orig_conv);
23996 int64_t ret_ref = tag_ptr(ret_copy, true);
24000 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error(JNIEnv *env, jclass clz, jstring err) {
24001 LDKStr err_conv = java_to_owned_str(env, err);
24002 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
24003 *ret_copy = APIError_apimisuse_error(err_conv);
24004 int64_t ret_ref = tag_ptr(ret_copy, true);
24008 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high(JNIEnv *env, jclass clz, jstring err, int32_t feerate) {
24009 LDKStr err_conv = java_to_owned_str(env, err);
24010 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
24011 *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
24012 int64_t ret_ref = tag_ptr(ret_copy, true);
24016 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error(JNIEnv *env, jclass clz, jstring err) {
24017 LDKStr err_conv = java_to_owned_str(env, err);
24018 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
24019 *ret_copy = APIError_route_error(err_conv);
24020 int64_t ret_ref = tag_ptr(ret_copy, true);
24024 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable(JNIEnv *env, jclass clz, jstring err) {
24025 LDKStr err_conv = java_to_owned_str(env, err);
24026 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
24027 *ret_copy = APIError_channel_unavailable(err_conv);
24028 int64_t ret_ref = tag_ptr(ret_copy, true);
24032 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed(JNIEnv *env, jclass clz) {
24033 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
24034 *ret_copy = APIError_monitor_update_failed();
24035 int64_t ret_ref = tag_ptr(ret_copy, true);
24039 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shutdown_1script(JNIEnv *env, jclass clz, int64_t script) {
24040 LDKShutdownScript script_conv;
24041 script_conv.inner = untag_ptr(script);
24042 script_conv.is_owned = ptr_is_owned(script);
24043 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv);
24044 script_conv = ShutdownScript_clone(&script_conv);
24045 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
24046 *ret_copy = APIError_incompatible_shutdown_script(script_conv);
24047 int64_t ret_ref = tag_ptr(ret_copy, true);
24051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
24052 LDKBigSize this_obj_conv;
24053 this_obj_conv.inner = untag_ptr(this_obj);
24054 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24056 BigSize_free(this_obj_conv);
24059 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
24060 LDKBigSize this_ptr_conv;
24061 this_ptr_conv.inner = untag_ptr(this_ptr);
24062 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24064 this_ptr_conv.is_owned = false;
24065 int64_t ret_conv = BigSize_get_a(&this_ptr_conv);
24069 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
24070 LDKBigSize this_ptr_conv;
24071 this_ptr_conv.inner = untag_ptr(this_ptr);
24072 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24074 this_ptr_conv.is_owned = false;
24075 BigSize_set_a(&this_ptr_conv, val);
24078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
24079 LDKBigSize ret_var = BigSize_new(a_arg);
24080 int64_t ret_ref = 0;
24081 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24082 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24086 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Hostname_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
24087 LDKHostname this_obj_conv;
24088 this_obj_conv.inner = untag_ptr(this_obj);
24089 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24090 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24091 Hostname_free(this_obj_conv);
24094 static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) {
24095 LDKHostname ret_var = Hostname_clone(arg);
24096 int64_t ret_ref = 0;
24097 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24098 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24101 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hostname_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24102 LDKHostname arg_conv;
24103 arg_conv.inner = untag_ptr(arg);
24104 arg_conv.is_owned = ptr_is_owned(arg);
24105 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24106 arg_conv.is_owned = false;
24107 int64_t ret_conv = Hostname_clone_ptr(&arg_conv);
24111 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hostname_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24112 LDKHostname orig_conv;
24113 orig_conv.inner = untag_ptr(orig);
24114 orig_conv.is_owned = ptr_is_owned(orig);
24115 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24116 orig_conv.is_owned = false;
24117 LDKHostname ret_var = Hostname_clone(&orig_conv);
24118 int64_t ret_ref = 0;
24119 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24120 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24124 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_Hostname_1len(JNIEnv *env, jclass clz, int64_t this_arg) {
24125 LDKHostname this_arg_conv;
24126 this_arg_conv.inner = untag_ptr(this_arg);
24127 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24128 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24129 this_arg_conv.is_owned = false;
24130 int8_t ret_conv = Hostname_len(&this_arg_conv);
24134 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) {
24135 LDKu8slice msg_ref;
24136 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
24137 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
24138 unsigned char sk_arr[32];
24139 CHECK((*env)->GetArrayLength(env, sk) == 32);
24140 (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr);
24141 unsigned char (*sk_ref)[32] = &sk_arr;
24142 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
24143 *ret_conv = sign(msg_ref, sk_ref);
24144 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
24145 return tag_ptr(ret_conv, true);
24148 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_recover_1pk(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig) {
24149 LDKu8slice msg_ref;
24150 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
24151 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
24152 LDKStr sig_conv = java_to_owned_str(env, sig);
24153 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
24154 *ret_conv = recover_pk(msg_ref, sig_conv);
24155 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
24156 return tag_ptr(ret_conv, true);
24159 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig, int8_tArray pk) {
24160 LDKu8slice msg_ref;
24161 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
24162 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
24163 LDKStr sig_conv = java_to_owned_str(env, sig);
24164 LDKPublicKey pk_ref;
24165 CHECK((*env)->GetArrayLength(env, pk) == 33);
24166 (*env)->GetByteArrayRegion(env, pk, 0, 33, pk_ref.compressed_form);
24167 jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
24168 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
24172 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage(JNIEnv *env, jclass clz, int8_tArray hrp_bytes, jobjectArray data_without_signature) {
24173 LDKu8slice hrp_bytes_ref;
24174 hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes);
24175 hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL);
24176 LDKCVec_u5Z data_without_signature_constr;
24177 data_without_signature_constr.datalen = (*env)->GetArrayLength(env, data_without_signature);
24178 if (data_without_signature_constr.datalen > 0)
24179 data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
24181 data_without_signature_constr.data = NULL;
24182 int8_t* data_without_signature_vals = (*env)->GetByteArrayElements (env, data_without_signature, NULL);
24183 for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
24184 int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
24186 data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 };
24188 (*env)->ReleaseByteArrayElements(env, data_without_signature, data_without_signature_vals, 0);
24189 LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
24190 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
24191 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
24192 CVec_u8Z_free(ret_var);
24193 (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0);
24197 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
24198 if (!ptr_is_owned(this_ptr)) return;
24199 void* this_ptr_ptr = untag_ptr(this_ptr);
24200 CHECK_ACCESS(this_ptr_ptr);
24201 LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr);
24202 FREE(untag_ptr(this_ptr));
24203 Persister_free(this_ptr_conv);
24206 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24207 LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig);
24208 jclass ret_conv = LDKLevel_to_java(env, Level_clone(orig_conv));
24212 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1gossip(JNIEnv *env, jclass clz) {
24213 jclass ret_conv = LDKLevel_to_java(env, Level_gossip());
24217 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) {
24218 jclass ret_conv = LDKLevel_to_java(env, Level_trace());
24222 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1debug(JNIEnv *env, jclass clz) {
24223 jclass ret_conv = LDKLevel_to_java(env, Level_debug());
24227 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1info(JNIEnv *env, jclass clz) {
24228 jclass ret_conv = LDKLevel_to_java(env, Level_info());
24232 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1warn(JNIEnv *env, jclass clz) {
24233 jclass ret_conv = LDKLevel_to_java(env, Level_warn());
24237 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1error(JNIEnv *env, jclass clz) {
24238 jclass ret_conv = LDKLevel_to_java(env, Level_error());
24242 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Level_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
24243 LDKLevel* a_conv = (LDKLevel*)untag_ptr(a);
24244 LDKLevel* b_conv = (LDKLevel*)untag_ptr(b);
24245 jboolean ret_conv = Level_eq(a_conv, b_conv);
24249 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Level_1hash(JNIEnv *env, jclass clz, int64_t o) {
24250 LDKLevel* o_conv = (LDKLevel*)untag_ptr(o);
24251 int64_t ret_conv = Level_hash(o_conv);
24255 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jclass clz) {
24256 jclass ret_conv = LDKLevel_to_java(env, Level_max());
24260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
24261 LDKRecord this_obj_conv;
24262 this_obj_conv.inner = untag_ptr(this_obj);
24263 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24265 Record_free(this_obj_conv);
24268 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) {
24269 LDKRecord this_ptr_conv;
24270 this_ptr_conv.inner = untag_ptr(this_ptr);
24271 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24273 this_ptr_conv.is_owned = false;
24274 jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv));
24278 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
24279 LDKRecord this_ptr_conv;
24280 this_ptr_conv.inner = untag_ptr(this_ptr);
24281 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24282 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24283 this_ptr_conv.is_owned = false;
24284 LDKLevel val_conv = LDKLevel_from_java(env, val);
24285 Record_set_level(&this_ptr_conv, val_conv);
24288 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) {
24289 LDKRecord this_ptr_conv;
24290 this_ptr_conv.inner = untag_ptr(this_ptr);
24291 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24293 this_ptr_conv.is_owned = false;
24294 LDKStr ret_str = Record_get_args(&this_ptr_conv);
24295 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
24300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
24301 LDKRecord this_ptr_conv;
24302 this_ptr_conv.inner = untag_ptr(this_ptr);
24303 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24304 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24305 this_ptr_conv.is_owned = false;
24306 LDKStr val_conv = java_to_owned_str(env, val);
24307 Record_set_args(&this_ptr_conv, val_conv);
24310 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) {
24311 LDKRecord this_ptr_conv;
24312 this_ptr_conv.inner = untag_ptr(this_ptr);
24313 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24314 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24315 this_ptr_conv.is_owned = false;
24316 LDKStr ret_str = Record_get_module_path(&this_ptr_conv);
24317 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
24322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
24323 LDKRecord this_ptr_conv;
24324 this_ptr_conv.inner = untag_ptr(this_ptr);
24325 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24326 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24327 this_ptr_conv.is_owned = false;
24328 LDKStr val_conv = java_to_owned_str(env, val);
24329 Record_set_module_path(&this_ptr_conv, val_conv);
24332 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) {
24333 LDKRecord this_ptr_conv;
24334 this_ptr_conv.inner = untag_ptr(this_ptr);
24335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24337 this_ptr_conv.is_owned = false;
24338 LDKStr ret_str = Record_get_file(&this_ptr_conv);
24339 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
24344 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
24345 LDKRecord this_ptr_conv;
24346 this_ptr_conv.inner = untag_ptr(this_ptr);
24347 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24349 this_ptr_conv.is_owned = false;
24350 LDKStr val_conv = java_to_owned_str(env, val);
24351 Record_set_file(&this_ptr_conv, val_conv);
24354 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) {
24355 LDKRecord this_ptr_conv;
24356 this_ptr_conv.inner = untag_ptr(this_ptr);
24357 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24358 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24359 this_ptr_conv.is_owned = false;
24360 int32_t ret_conv = Record_get_line(&this_ptr_conv);
24364 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
24365 LDKRecord this_ptr_conv;
24366 this_ptr_conv.inner = untag_ptr(this_ptr);
24367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24369 this_ptr_conv.is_owned = false;
24370 Record_set_line(&this_ptr_conv, val);
24373 static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) {
24374 LDKRecord ret_var = Record_clone(arg);
24375 int64_t ret_ref = 0;
24376 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24377 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24380 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24381 LDKRecord arg_conv;
24382 arg_conv.inner = untag_ptr(arg);
24383 arg_conv.is_owned = ptr_is_owned(arg);
24384 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24385 arg_conv.is_owned = false;
24386 int64_t ret_conv = Record_clone_ptr(&arg_conv);
24390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24391 LDKRecord orig_conv;
24392 orig_conv.inner = untag_ptr(orig);
24393 orig_conv.is_owned = ptr_is_owned(orig);
24394 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24395 orig_conv.is_owned = false;
24396 LDKRecord ret_var = Record_clone(&orig_conv);
24397 int64_t ret_ref = 0;
24398 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24399 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24403 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
24404 if (!ptr_is_owned(this_ptr)) return;
24405 void* this_ptr_ptr = untag_ptr(this_ptr);
24406 CHECK_ACCESS(this_ptr_ptr);
24407 LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
24408 FREE(untag_ptr(this_ptr));
24409 Logger_free(this_ptr_conv);
24412 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
24413 LDKChannelHandshakeConfig this_obj_conv;
24414 this_obj_conv.inner = untag_ptr(this_obj);
24415 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24417 ChannelHandshakeConfig_free(this_obj_conv);
24420 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
24421 LDKChannelHandshakeConfig this_ptr_conv;
24422 this_ptr_conv.inner = untag_ptr(this_ptr);
24423 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24425 this_ptr_conv.is_owned = false;
24426 int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
24430 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
24431 LDKChannelHandshakeConfig this_ptr_conv;
24432 this_ptr_conv.inner = untag_ptr(this_ptr);
24433 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24435 this_ptr_conv.is_owned = false;
24436 ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
24439 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
24440 LDKChannelHandshakeConfig this_ptr_conv;
24441 this_ptr_conv.inner = untag_ptr(this_ptr);
24442 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24444 this_ptr_conv.is_owned = false;
24445 int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
24449 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) {
24450 LDKChannelHandshakeConfig this_ptr_conv;
24451 this_ptr_conv.inner = untag_ptr(this_ptr);
24452 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24454 this_ptr_conv.is_owned = false;
24455 ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
24458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
24459 LDKChannelHandshakeConfig this_ptr_conv;
24460 this_ptr_conv.inner = untag_ptr(this_ptr);
24461 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24463 this_ptr_conv.is_owned = false;
24464 int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
24468 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) {
24469 LDKChannelHandshakeConfig this_ptr_conv;
24470 this_ptr_conv.inner = untag_ptr(this_ptr);
24471 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24473 this_ptr_conv.is_owned = false;
24474 ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
24477 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) {
24478 LDKChannelHandshakeConfig this_ptr_conv;
24479 this_ptr_conv.inner = untag_ptr(this_ptr);
24480 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24482 this_ptr_conv.is_owned = false;
24483 int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv);
24487 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) {
24488 LDKChannelHandshakeConfig this_ptr_conv;
24489 this_ptr_conv.inner = untag_ptr(this_ptr);
24490 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24491 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24492 this_ptr_conv.is_owned = false;
24493 ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val);
24496 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr) {
24497 LDKChannelHandshakeConfig this_ptr_conv;
24498 this_ptr_conv.inner = untag_ptr(this_ptr);
24499 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24500 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24501 this_ptr_conv.is_owned = false;
24502 jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv);
24506 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
24507 LDKChannelHandshakeConfig this_ptr_conv;
24508 this_ptr_conv.inner = untag_ptr(this_ptr);
24509 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24510 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24511 this_ptr_conv.is_owned = false;
24512 ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val);
24515 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) {
24516 LDKChannelHandshakeConfig this_ptr_conv;
24517 this_ptr_conv.inner = untag_ptr(this_ptr);
24518 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24519 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24520 this_ptr_conv.is_owned = false;
24521 jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv);
24525 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
24526 LDKChannelHandshakeConfig this_ptr_conv;
24527 this_ptr_conv.inner = untag_ptr(this_ptr);
24528 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24530 this_ptr_conv.is_owned = false;
24531 ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val);
24534 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
24535 LDKChannelHandshakeConfig this_ptr_conv;
24536 this_ptr_conv.inner = untag_ptr(this_ptr);
24537 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24538 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24539 this_ptr_conv.is_owned = false;
24540 jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
24544 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
24545 LDKChannelHandshakeConfig this_ptr_conv;
24546 this_ptr_conv.inner = untag_ptr(this_ptr);
24547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24549 this_ptr_conv.is_owned = false;
24550 ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
24553 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) {
24554 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);
24555 int64_t ret_ref = 0;
24556 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24557 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24561 static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) {
24562 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg);
24563 int64_t ret_ref = 0;
24564 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24565 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24568 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24569 LDKChannelHandshakeConfig arg_conv;
24570 arg_conv.inner = untag_ptr(arg);
24571 arg_conv.is_owned = ptr_is_owned(arg);
24572 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24573 arg_conv.is_owned = false;
24574 int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv);
24578 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24579 LDKChannelHandshakeConfig orig_conv;
24580 orig_conv.inner = untag_ptr(orig);
24581 orig_conv.is_owned = ptr_is_owned(orig);
24582 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24583 orig_conv.is_owned = false;
24584 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
24585 int64_t ret_ref = 0;
24586 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24587 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24591 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv *env, jclass clz) {
24592 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
24593 int64_t ret_ref = 0;
24594 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24595 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24599 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
24600 LDKChannelHandshakeLimits this_obj_conv;
24601 this_obj_conv.inner = untag_ptr(this_obj);
24602 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24604 ChannelHandshakeLimits_free(this_obj_conv);
24607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
24608 LDKChannelHandshakeLimits this_ptr_conv;
24609 this_ptr_conv.inner = untag_ptr(this_ptr);
24610 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24612 this_ptr_conv.is_owned = false;
24613 int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
24617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
24618 LDKChannelHandshakeLimits this_ptr_conv;
24619 this_ptr_conv.inner = untag_ptr(this_ptr);
24620 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24622 this_ptr_conv.is_owned = false;
24623 ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
24626 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
24627 LDKChannelHandshakeLimits this_ptr_conv;
24628 this_ptr_conv.inner = untag_ptr(this_ptr);
24629 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24630 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24631 this_ptr_conv.is_owned = false;
24632 int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv);
24636 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
24637 LDKChannelHandshakeLimits this_ptr_conv;
24638 this_ptr_conv.inner = untag_ptr(this_ptr);
24639 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24640 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24641 this_ptr_conv.is_owned = false;
24642 ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val);
24645 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
24646 LDKChannelHandshakeLimits this_ptr_conv;
24647 this_ptr_conv.inner = untag_ptr(this_ptr);
24648 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24649 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24650 this_ptr_conv.is_owned = false;
24651 int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
24655 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) {
24656 LDKChannelHandshakeLimits this_ptr_conv;
24657 this_ptr_conv.inner = untag_ptr(this_ptr);
24658 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24659 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24660 this_ptr_conv.is_owned = false;
24661 ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
24664 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) {
24665 LDKChannelHandshakeLimits this_ptr_conv;
24666 this_ptr_conv.inner = untag_ptr(this_ptr);
24667 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24668 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24669 this_ptr_conv.is_owned = false;
24670 int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
24674 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) {
24675 LDKChannelHandshakeLimits this_ptr_conv;
24676 this_ptr_conv.inner = untag_ptr(this_ptr);
24677 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24679 this_ptr_conv.is_owned = false;
24680 ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
24683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
24684 LDKChannelHandshakeLimits this_ptr_conv;
24685 this_ptr_conv.inner = untag_ptr(this_ptr);
24686 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24687 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24688 this_ptr_conv.is_owned = false;
24689 int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
24693 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) {
24694 LDKChannelHandshakeLimits this_ptr_conv;
24695 this_ptr_conv.inner = untag_ptr(this_ptr);
24696 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24698 this_ptr_conv.is_owned = false;
24699 ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
24702 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
24703 LDKChannelHandshakeLimits this_ptr_conv;
24704 this_ptr_conv.inner = untag_ptr(this_ptr);
24705 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24707 this_ptr_conv.is_owned = false;
24708 int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
24712 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) {
24713 LDKChannelHandshakeLimits this_ptr_conv;
24714 this_ptr_conv.inner = untag_ptr(this_ptr);
24715 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24717 this_ptr_conv.is_owned = false;
24718 ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
24721 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
24722 LDKChannelHandshakeLimits this_ptr_conv;
24723 this_ptr_conv.inner = untag_ptr(this_ptr);
24724 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24725 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24726 this_ptr_conv.is_owned = false;
24727 int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
24731 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
24732 LDKChannelHandshakeLimits this_ptr_conv;
24733 this_ptr_conv.inner = untag_ptr(this_ptr);
24734 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24735 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24736 this_ptr_conv.is_owned = false;
24737 ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
24740 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr) {
24741 LDKChannelHandshakeLimits this_ptr_conv;
24742 this_ptr_conv.inner = untag_ptr(this_ptr);
24743 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24745 this_ptr_conv.is_owned = false;
24746 jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv);
24750 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
24751 LDKChannelHandshakeLimits this_ptr_conv;
24752 this_ptr_conv.inner = untag_ptr(this_ptr);
24753 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24754 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24755 this_ptr_conv.is_owned = false;
24756 ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val);
24759 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr) {
24760 LDKChannelHandshakeLimits this_ptr_conv;
24761 this_ptr_conv.inner = untag_ptr(this_ptr);
24762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24764 this_ptr_conv.is_owned = false;
24765 jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
24769 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
24770 LDKChannelHandshakeLimits this_ptr_conv;
24771 this_ptr_conv.inner = untag_ptr(this_ptr);
24772 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24774 this_ptr_conv.is_owned = false;
24775 ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
24778 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
24779 LDKChannelHandshakeLimits this_ptr_conv;
24780 this_ptr_conv.inner = untag_ptr(this_ptr);
24781 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24782 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24783 this_ptr_conv.is_owned = false;
24784 int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
24788 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) {
24789 LDKChannelHandshakeLimits this_ptr_conv;
24790 this_ptr_conv.inner = untag_ptr(this_ptr);
24791 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24792 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24793 this_ptr_conv.is_owned = false;
24794 ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
24797 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) {
24798 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);
24799 int64_t ret_ref = 0;
24800 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24801 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24805 static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) {
24806 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg);
24807 int64_t ret_ref = 0;
24808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24809 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24812 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24813 LDKChannelHandshakeLimits arg_conv;
24814 arg_conv.inner = untag_ptr(arg);
24815 arg_conv.is_owned = ptr_is_owned(arg);
24816 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24817 arg_conv.is_owned = false;
24818 int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv);
24822 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24823 LDKChannelHandshakeLimits orig_conv;
24824 orig_conv.inner = untag_ptr(orig);
24825 orig_conv.is_owned = ptr_is_owned(orig);
24826 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24827 orig_conv.is_owned = false;
24828 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
24829 int64_t ret_ref = 0;
24830 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24831 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv *env, jclass clz) {
24836 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
24837 int64_t ret_ref = 0;
24838 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24839 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24843 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
24844 LDKChannelConfig this_obj_conv;
24845 this_obj_conv.inner = untag_ptr(this_obj);
24846 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24848 ChannelConfig_free(this_obj_conv);
24851 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
24852 LDKChannelConfig this_ptr_conv;
24853 this_ptr_conv.inner = untag_ptr(this_ptr);
24854 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24856 this_ptr_conv.is_owned = false;
24857 int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
24861 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) {
24862 LDKChannelConfig this_ptr_conv;
24863 this_ptr_conv.inner = untag_ptr(this_ptr);
24864 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24865 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24866 this_ptr_conv.is_owned = false;
24867 ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
24870 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
24871 LDKChannelConfig this_ptr_conv;
24872 this_ptr_conv.inner = untag_ptr(this_ptr);
24873 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24874 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24875 this_ptr_conv.is_owned = false;
24876 int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
24880 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) {
24881 LDKChannelConfig this_ptr_conv;
24882 this_ptr_conv.inner = untag_ptr(this_ptr);
24883 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24884 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24885 this_ptr_conv.is_owned = false;
24886 ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
24889 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
24890 LDKChannelConfig this_ptr_conv;
24891 this_ptr_conv.inner = untag_ptr(this_ptr);
24892 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24893 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24894 this_ptr_conv.is_owned = false;
24895 int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
24899 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
24900 LDKChannelConfig this_ptr_conv;
24901 this_ptr_conv.inner = untag_ptr(this_ptr);
24902 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24904 this_ptr_conv.is_owned = false;
24905 ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
24908 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
24909 LDKChannelConfig this_ptr_conv;
24910 this_ptr_conv.inner = untag_ptr(this_ptr);
24911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24913 this_ptr_conv.is_owned = false;
24914 int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
24918 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) {
24919 LDKChannelConfig this_ptr_conv;
24920 this_ptr_conv.inner = untag_ptr(this_ptr);
24921 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24922 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24923 this_ptr_conv.is_owned = false;
24924 ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
24927 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) {
24928 LDKChannelConfig this_ptr_conv;
24929 this_ptr_conv.inner = untag_ptr(this_ptr);
24930 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24931 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24932 this_ptr_conv.is_owned = false;
24933 int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
24937 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) {
24938 LDKChannelConfig this_ptr_conv;
24939 this_ptr_conv.inner = untag_ptr(this_ptr);
24940 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24942 this_ptr_conv.is_owned = false;
24943 ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
24946 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) {
24947 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);
24948 int64_t ret_ref = 0;
24949 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24950 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24954 static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) {
24955 LDKChannelConfig ret_var = ChannelConfig_clone(arg);
24956 int64_t ret_ref = 0;
24957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24961 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24962 LDKChannelConfig arg_conv;
24963 arg_conv.inner = untag_ptr(arg);
24964 arg_conv.is_owned = ptr_is_owned(arg);
24965 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24966 arg_conv.is_owned = false;
24967 int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv);
24971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24972 LDKChannelConfig orig_conv;
24973 orig_conv.inner = untag_ptr(orig);
24974 orig_conv.is_owned = ptr_is_owned(orig);
24975 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24976 orig_conv.is_owned = false;
24977 LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
24978 int64_t ret_ref = 0;
24979 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24980 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24984 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) {
24985 LDKChannelConfig ret_var = ChannelConfig_default();
24986 int64_t ret_ref = 0;
24987 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24988 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24992 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv *env, jclass clz, int64_t obj) {
24993 LDKChannelConfig obj_conv;
24994 obj_conv.inner = untag_ptr(obj);
24995 obj_conv.is_owned = ptr_is_owned(obj);
24996 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
24997 obj_conv.is_owned = false;
24998 LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
24999 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
25000 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
25001 CVec_u8Z_free(ret_var);
25005 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
25006 LDKu8slice ser_ref;
25007 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
25008 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
25009 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
25010 *ret_conv = ChannelConfig_read(ser_ref);
25011 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
25012 return tag_ptr(ret_conv, true);
25015 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
25016 LDKUserConfig this_obj_conv;
25017 this_obj_conv.inner = untag_ptr(this_obj);
25018 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25020 UserConfig_free(this_obj_conv);
25023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1handshake_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
25024 LDKUserConfig this_ptr_conv;
25025 this_ptr_conv.inner = untag_ptr(this_ptr);
25026 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25027 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25028 this_ptr_conv.is_owned = false;
25029 LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&this_ptr_conv);
25030 int64_t ret_ref = 0;
25031 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25032 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25036 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1handshake_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
25037 LDKUserConfig this_ptr_conv;
25038 this_ptr_conv.inner = untag_ptr(this_ptr);
25039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25041 this_ptr_conv.is_owned = false;
25042 LDKChannelHandshakeConfig val_conv;
25043 val_conv.inner = untag_ptr(val);
25044 val_conv.is_owned = ptr_is_owned(val);
25045 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25046 val_conv = ChannelHandshakeConfig_clone(&val_conv);
25047 UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv);
25050 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1handshake_1limits(JNIEnv *env, jclass clz, int64_t this_ptr) {
25051 LDKUserConfig this_ptr_conv;
25052 this_ptr_conv.inner = untag_ptr(this_ptr);
25053 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25055 this_ptr_conv.is_owned = false;
25056 LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&this_ptr_conv);
25057 int64_t ret_ref = 0;
25058 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25059 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25063 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1handshake_1limits(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
25064 LDKUserConfig this_ptr_conv;
25065 this_ptr_conv.inner = untag_ptr(this_ptr);
25066 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25067 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25068 this_ptr_conv.is_owned = false;
25069 LDKChannelHandshakeLimits val_conv;
25070 val_conv.inner = untag_ptr(val);
25071 val_conv.is_owned = ptr_is_owned(val);
25072 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25073 val_conv = ChannelHandshakeLimits_clone(&val_conv);
25074 UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv);
25077 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
25078 LDKUserConfig this_ptr_conv;
25079 this_ptr_conv.inner = untag_ptr(this_ptr);
25080 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25081 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25082 this_ptr_conv.is_owned = false;
25083 LDKChannelConfig ret_var = UserConfig_get_channel_config(&this_ptr_conv);
25084 int64_t ret_ref = 0;
25085 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25086 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
25091 LDKUserConfig this_ptr_conv;
25092 this_ptr_conv.inner = untag_ptr(this_ptr);
25093 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25095 this_ptr_conv.is_owned = false;
25096 LDKChannelConfig val_conv;
25097 val_conv.inner = untag_ptr(val);
25098 val_conv.is_owned = ptr_is_owned(val);
25099 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25100 val_conv = ChannelConfig_clone(&val_conv);
25101 UserConfig_set_channel_config(&this_ptr_conv, val_conv);
25104 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
25105 LDKUserConfig this_ptr_conv;
25106 this_ptr_conv.inner = untag_ptr(this_ptr);
25107 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25108 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25109 this_ptr_conv.is_owned = false;
25110 jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
25114 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) {
25115 LDKUserConfig this_ptr_conv;
25116 this_ptr_conv.inner = untag_ptr(this_ptr);
25117 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25118 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25119 this_ptr_conv.is_owned = false;
25120 UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
25123 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
25124 LDKUserConfig this_ptr_conv;
25125 this_ptr_conv.inner = untag_ptr(this_ptr);
25126 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25127 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25128 this_ptr_conv.is_owned = false;
25129 jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
25133 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
25134 LDKUserConfig this_ptr_conv;
25135 this_ptr_conv.inner = untag_ptr(this_ptr);
25136 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25137 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25138 this_ptr_conv.is_owned = false;
25139 UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
25142 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
25143 LDKUserConfig this_ptr_conv;
25144 this_ptr_conv.inner = untag_ptr(this_ptr);
25145 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25146 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25147 this_ptr_conv.is_owned = false;
25148 jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv);
25152 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
25153 LDKUserConfig this_ptr_conv;
25154 this_ptr_conv.inner = untag_ptr(this_ptr);
25155 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25156 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25157 this_ptr_conv.is_owned = false;
25158 UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val);
25161 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) {
25162 LDKChannelHandshakeConfig channel_handshake_config_arg_conv;
25163 channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg);
25164 channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg);
25165 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv);
25166 channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv);
25167 LDKChannelHandshakeLimits channel_handshake_limits_arg_conv;
25168 channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg);
25169 channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg);
25170 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv);
25171 channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv);
25172 LDKChannelConfig channel_config_arg_conv;
25173 channel_config_arg_conv.inner = untag_ptr(channel_config_arg);
25174 channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg);
25175 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv);
25176 channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv);
25177 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);
25178 int64_t ret_ref = 0;
25179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25184 static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) {
25185 LDKUserConfig ret_var = UserConfig_clone(arg);
25186 int64_t ret_ref = 0;
25187 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25188 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25191 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25192 LDKUserConfig arg_conv;
25193 arg_conv.inner = untag_ptr(arg);
25194 arg_conv.is_owned = ptr_is_owned(arg);
25195 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25196 arg_conv.is_owned = false;
25197 int64_t ret_conv = UserConfig_clone_ptr(&arg_conv);
25201 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25202 LDKUserConfig orig_conv;
25203 orig_conv.inner = untag_ptr(orig);
25204 orig_conv.is_owned = ptr_is_owned(orig);
25205 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25206 orig_conv.is_owned = false;
25207 LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
25208 int64_t ret_ref = 0;
25209 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25210 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25214 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv *env, jclass clz) {
25215 LDKUserConfig ret_var = UserConfig_default();
25216 int64_t ret_ref = 0;
25217 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25218 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25222 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
25223 LDKBestBlock this_obj_conv;
25224 this_obj_conv.inner = untag_ptr(this_obj);
25225 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25227 BestBlock_free(this_obj_conv);
25230 static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) {
25231 LDKBestBlock ret_var = BestBlock_clone(arg);
25232 int64_t ret_ref = 0;
25233 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25234 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25238 LDKBestBlock arg_conv;
25239 arg_conv.inner = untag_ptr(arg);
25240 arg_conv.is_owned = ptr_is_owned(arg);
25241 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25242 arg_conv.is_owned = false;
25243 int64_t ret_conv = BestBlock_clone_ptr(&arg_conv);
25247 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25248 LDKBestBlock orig_conv;
25249 orig_conv.inner = untag_ptr(orig);
25250 orig_conv.is_owned = ptr_is_owned(orig);
25251 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25252 orig_conv.is_owned = false;
25253 LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
25254 int64_t ret_ref = 0;
25255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25260 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) {
25261 LDKNetwork network_conv = LDKNetwork_from_java(env, network);
25262 LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
25263 int64_t ret_ref = 0;
25264 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25265 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25269 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, jclass clz, int8_tArray block_hash, int32_t height) {
25270 LDKThirtyTwoBytes block_hash_ref;
25271 CHECK((*env)->GetArrayLength(env, block_hash) == 32);
25272 (*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data);
25273 LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
25274 int64_t ret_ref = 0;
25275 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25276 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25280 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
25281 LDKBestBlock this_arg_conv;
25282 this_arg_conv.inner = untag_ptr(this_arg);
25283 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25285 this_arg_conv.is_owned = false;
25286 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
25287 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data);
25291 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *env, jclass clz, int64_t this_arg) {
25292 LDKBestBlock this_arg_conv;
25293 this_arg_conv.inner = untag_ptr(this_arg);
25294 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25296 this_arg_conv.is_owned = false;
25297 int32_t ret_conv = BestBlock_height(&this_arg_conv);
25301 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25302 LDKAccessError* orig_conv = (LDKAccessError*)untag_ptr(orig);
25303 jclass ret_conv = LDKAccessError_to_java(env, AccessError_clone(orig_conv));
25307 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1chain(JNIEnv *env, jclass clz) {
25308 jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_chain());
25312 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1tx(JNIEnv *env, jclass clz) {
25313 jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_tx());
25317 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25318 if (!ptr_is_owned(this_ptr)) return;
25319 void* this_ptr_ptr = untag_ptr(this_ptr);
25320 CHECK_ACCESS(this_ptr_ptr);
25321 LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
25322 FREE(untag_ptr(this_ptr));
25323 Access_free(this_ptr_conv);
25326 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25327 if (!ptr_is_owned(this_ptr)) return;
25328 void* this_ptr_ptr = untag_ptr(this_ptr);
25329 CHECK_ACCESS(this_ptr_ptr);
25330 LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
25331 FREE(untag_ptr(this_ptr));
25332 Listen_free(this_ptr_conv);
25335 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25336 if (!ptr_is_owned(this_ptr)) return;
25337 void* this_ptr_ptr = untag_ptr(this_ptr);
25338 CHECK_ACCESS(this_ptr_ptr);
25339 LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
25340 FREE(untag_ptr(this_ptr));
25341 Confirm_free(this_ptr_conv);
25344 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25345 LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)untag_ptr(orig);
25346 jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_clone(orig_conv));
25350 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure(JNIEnv *env, jclass clz) {
25351 jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_temporary_failure());
25355 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure(JNIEnv *env, jclass clz) {
25356 jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_permanent_failure());
25360 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25361 if (!ptr_is_owned(this_ptr)) return;
25362 void* this_ptr_ptr = untag_ptr(this_ptr);
25363 CHECK_ACCESS(this_ptr_ptr);
25364 LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
25365 FREE(untag_ptr(this_ptr));
25366 Watch_free(this_ptr_conv);
25369 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25370 if (!ptr_is_owned(this_ptr)) return;
25371 void* this_ptr_ptr = untag_ptr(this_ptr);
25372 CHECK_ACCESS(this_ptr_ptr);
25373 LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
25374 FREE(untag_ptr(this_ptr));
25375 Filter_free(this_ptr_conv);
25378 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
25379 LDKWatchedOutput this_obj_conv;
25380 this_obj_conv.inner = untag_ptr(this_obj);
25381 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25382 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25383 WatchedOutput_free(this_obj_conv);
25386 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
25387 LDKWatchedOutput this_ptr_conv;
25388 this_ptr_conv.inner = untag_ptr(this_ptr);
25389 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25391 this_ptr_conv.is_owned = false;
25392 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
25393 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data);
25397 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
25398 LDKWatchedOutput this_ptr_conv;
25399 this_ptr_conv.inner = untag_ptr(this_ptr);
25400 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25402 this_ptr_conv.is_owned = false;
25403 LDKThirtyTwoBytes val_ref;
25404 CHECK((*env)->GetArrayLength(env, val) == 32);
25405 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
25406 WatchedOutput_set_block_hash(&this_ptr_conv, val_ref);
25409 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
25410 LDKWatchedOutput this_ptr_conv;
25411 this_ptr_conv.inner = untag_ptr(this_ptr);
25412 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25414 this_ptr_conv.is_owned = false;
25415 LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv);
25416 int64_t ret_ref = 0;
25417 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25418 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25422 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
25423 LDKWatchedOutput this_ptr_conv;
25424 this_ptr_conv.inner = untag_ptr(this_ptr);
25425 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25427 this_ptr_conv.is_owned = false;
25428 LDKOutPoint val_conv;
25429 val_conv.inner = untag_ptr(val);
25430 val_conv.is_owned = ptr_is_owned(val);
25431 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25432 val_conv = OutPoint_clone(&val_conv);
25433 WatchedOutput_set_outpoint(&this_ptr_conv, val_conv);
25436 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
25437 LDKWatchedOutput this_ptr_conv;
25438 this_ptr_conv.inner = untag_ptr(this_ptr);
25439 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25440 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25441 this_ptr_conv.is_owned = false;
25442 LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv);
25443 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
25444 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
25448 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
25449 LDKWatchedOutput this_ptr_conv;
25450 this_ptr_conv.inner = untag_ptr(this_ptr);
25451 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25452 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25453 this_ptr_conv.is_owned = false;
25454 LDKCVec_u8Z val_ref;
25455 val_ref.datalen = (*env)->GetArrayLength(env, val);
25456 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
25457 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
25458 WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref);
25461 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) {
25462 LDKThirtyTwoBytes block_hash_arg_ref;
25463 CHECK((*env)->GetArrayLength(env, block_hash_arg) == 32);
25464 (*env)->GetByteArrayRegion(env, block_hash_arg, 0, 32, block_hash_arg_ref.data);
25465 LDKOutPoint outpoint_arg_conv;
25466 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
25467 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
25468 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
25469 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
25470 LDKCVec_u8Z script_pubkey_arg_ref;
25471 script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg);
25472 script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
25473 (*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data);
25474 LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
25475 int64_t ret_ref = 0;
25476 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25477 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25481 static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) {
25482 LDKWatchedOutput ret_var = WatchedOutput_clone(arg);
25483 int64_t ret_ref = 0;
25484 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25485 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25488 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25489 LDKWatchedOutput arg_conv;
25490 arg_conv.inner = untag_ptr(arg);
25491 arg_conv.is_owned = ptr_is_owned(arg);
25492 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25493 arg_conv.is_owned = false;
25494 int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv);
25498 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25499 LDKWatchedOutput orig_conv;
25500 orig_conv.inner = untag_ptr(orig);
25501 orig_conv.is_owned = ptr_is_owned(orig);
25502 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25503 orig_conv.is_owned = false;
25504 LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv);
25505 int64_t ret_ref = 0;
25506 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25507 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25511 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv *env, jclass clz, int64_t o) {
25512 LDKWatchedOutput o_conv;
25513 o_conv.inner = untag_ptr(o);
25514 o_conv.is_owned = ptr_is_owned(o);
25515 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25516 o_conv.is_owned = false;
25517 int64_t ret_conv = WatchedOutput_hash(&o_conv);
25521 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25522 if (!ptr_is_owned(this_ptr)) return;
25523 void* this_ptr_ptr = untag_ptr(this_ptr);
25524 CHECK_ACCESS(this_ptr_ptr);
25525 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
25526 FREE(untag_ptr(this_ptr));
25527 BroadcasterInterface_free(this_ptr_conv);
25530 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25531 LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig);
25532 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_clone(orig_conv));
25536 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background(JNIEnv *env, jclass clz) {
25537 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_background());
25541 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal(JNIEnv *env, jclass clz) {
25542 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_normal());
25546 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority(JNIEnv *env, jclass clz) {
25547 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_high_priority());
25551 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
25552 LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a);
25553 LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b);
25554 jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv);
25558 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25559 if (!ptr_is_owned(this_ptr)) return;
25560 void* this_ptr_ptr = untag_ptr(this_ptr);
25561 CHECK_ACCESS(this_ptr_ptr);
25562 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
25563 FREE(untag_ptr(this_ptr));
25564 FeeEstimator_free(this_ptr_conv);
25567 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
25568 LDKMonitorUpdateId this_obj_conv;
25569 this_obj_conv.inner = untag_ptr(this_obj);
25570 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25571 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25572 MonitorUpdateId_free(this_obj_conv);
25575 static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) {
25576 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg);
25577 int64_t ret_ref = 0;
25578 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25579 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25582 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25583 LDKMonitorUpdateId arg_conv;
25584 arg_conv.inner = untag_ptr(arg);
25585 arg_conv.is_owned = ptr_is_owned(arg);
25586 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25587 arg_conv.is_owned = false;
25588 int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv);
25592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25593 LDKMonitorUpdateId orig_conv;
25594 orig_conv.inner = untag_ptr(orig);
25595 orig_conv.is_owned = ptr_is_owned(orig);
25596 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25597 orig_conv.is_owned = false;
25598 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv);
25599 int64_t ret_ref = 0;
25600 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25601 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25605 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) {
25606 LDKMonitorUpdateId o_conv;
25607 o_conv.inner = untag_ptr(o);
25608 o_conv.is_owned = ptr_is_owned(o);
25609 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25610 o_conv.is_owned = false;
25611 int64_t ret_conv = MonitorUpdateId_hash(&o_conv);
25615 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
25616 LDKMonitorUpdateId a_conv;
25617 a_conv.inner = untag_ptr(a);
25618 a_conv.is_owned = ptr_is_owned(a);
25619 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
25620 a_conv.is_owned = false;
25621 LDKMonitorUpdateId b_conv;
25622 b_conv.inner = untag_ptr(b);
25623 b_conv.is_owned = ptr_is_owned(b);
25624 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
25625 b_conv.is_owned = false;
25626 jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv);
25630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25631 if (!ptr_is_owned(this_ptr)) return;
25632 void* this_ptr_ptr = untag_ptr(this_ptr);
25633 CHECK_ACCESS(this_ptr_ptr);
25634 LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
25635 FREE(untag_ptr(this_ptr));
25636 Persist_free(this_ptr_conv);
25639 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
25640 LDKLockedChannelMonitor this_obj_conv;
25641 this_obj_conv.inner = untag_ptr(this_obj);
25642 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25644 LockedChannelMonitor_free(this_obj_conv);
25647 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
25648 LDKChainMonitor this_obj_conv;
25649 this_obj_conv.inner = untag_ptr(this_obj);
25650 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25651 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25652 ChainMonitor_free(this_obj_conv);
25655 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) {
25656 void* chain_source_ptr = untag_ptr(chain_source);
25657 CHECK_ACCESS(chain_source_ptr);
25658 LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
25659 // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ
25660 if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
25661 // Manually implement clone for Java trait instances
25662 if (chain_source_conv.some.free == LDKFilter_JCalls_free) {
25663 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25664 LDKFilter_JCalls_cloned(&chain_source_conv.some);
25667 void* broadcaster_ptr = untag_ptr(broadcaster);
25668 CHECK_ACCESS(broadcaster_ptr);
25669 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
25670 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
25671 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25672 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
25674 void* logger_ptr = untag_ptr(logger);
25675 CHECK_ACCESS(logger_ptr);
25676 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
25677 if (logger_conv.free == LDKLogger_JCalls_free) {
25678 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25679 LDKLogger_JCalls_cloned(&logger_conv);
25681 void* feeest_ptr = untag_ptr(feeest);
25682 CHECK_ACCESS(feeest_ptr);
25683 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
25684 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
25685 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25686 LDKFeeEstimator_JCalls_cloned(&feeest_conv);
25688 void* persister_ptr = untag_ptr(persister);
25689 CHECK_ACCESS(persister_ptr);
25690 LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
25691 if (persister_conv.free == LDKPersist_JCalls_free) {
25692 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25693 LDKPersist_JCalls_cloned(&persister_conv);
25695 LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
25696 int64_t ret_ref = 0;
25697 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25698 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25702 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) {
25703 LDKChainMonitor this_arg_conv;
25704 this_arg_conv.inner = untag_ptr(this_arg);
25705 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25707 this_arg_conv.is_owned = false;
25708 LDKCVec_ChannelDetailsZ ignored_channels_constr;
25709 ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels);
25710 if (ignored_channels_constr.datalen > 0)
25711 ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
25713 ignored_channels_constr.data = NULL;
25714 int64_t* ignored_channels_vals = (*env)->GetLongArrayElements (env, ignored_channels, NULL);
25715 for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
25716 int64_t ignored_channels_conv_16 = ignored_channels_vals[q];
25717 LDKChannelDetails ignored_channels_conv_16_conv;
25718 ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16);
25719 ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16);
25720 CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv);
25721 ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
25722 ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
25724 (*env)->ReleaseLongArrayElements(env, ignored_channels, ignored_channels_vals, 0);
25725 LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
25726 int64_tArray ret_arr = NULL;
25727 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
25728 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
25729 for (size_t j = 0; j < ret_var.datalen; j++) {
25730 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
25731 *ret_conv_9_copy = ret_var.data[j];
25732 int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
25733 ret_arr_ptr[j] = ret_conv_9_ref;
25735 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
25736 FREE(ret_var.data);
25740 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo) {
25741 LDKChainMonitor this_arg_conv;
25742 this_arg_conv.inner = untag_ptr(this_arg);
25743 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25745 this_arg_conv.is_owned = false;
25746 LDKOutPoint funding_txo_conv;
25747 funding_txo_conv.inner = untag_ptr(funding_txo);
25748 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
25749 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
25750 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
25751 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
25752 *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv);
25753 return tag_ptr(ret_conv, true);
25756 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1monitors(JNIEnv *env, jclass clz, int64_t this_arg) {
25757 LDKChainMonitor this_arg_conv;
25758 this_arg_conv.inner = untag_ptr(this_arg);
25759 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25760 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25761 this_arg_conv.is_owned = false;
25762 LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
25763 int64_tArray ret_arr = NULL;
25764 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
25765 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
25766 for (size_t k = 0; k < ret_var.datalen; k++) {
25767 LDKOutPoint ret_conv_10_var = ret_var.data[k];
25768 int64_t ret_conv_10_ref = 0;
25769 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
25770 ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned);
25771 ret_arr_ptr[k] = ret_conv_10_ref;
25773 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
25774 FREE(ret_var.data);
25778 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) {
25779 LDKChainMonitor this_arg_conv;
25780 this_arg_conv.inner = untag_ptr(this_arg);
25781 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25782 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25783 this_arg_conv.is_owned = false;
25784 LDKOutPoint funding_txo_conv;
25785 funding_txo_conv.inner = untag_ptr(funding_txo);
25786 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
25787 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
25788 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
25789 LDKMonitorUpdateId completed_update_id_conv;
25790 completed_update_id_conv.inner = untag_ptr(completed_update_id);
25791 completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id);
25792 CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv);
25793 completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
25794 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
25795 *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
25796 return tag_ptr(ret_conv, true);
25799 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
25800 LDKChainMonitor this_arg_conv;
25801 this_arg_conv.inner = untag_ptr(this_arg);
25802 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25804 this_arg_conv.is_owned = false;
25805 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
25806 *ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
25807 return tag_ptr(ret_ret, true);
25810 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) {
25811 LDKChainMonitor this_arg_conv;
25812 this_arg_conv.inner = untag_ptr(this_arg);
25813 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25815 this_arg_conv.is_owned = false;
25816 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
25817 *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
25818 return tag_ptr(ret_ret, true);
25821 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv *env, jclass clz, int64_t this_arg) {
25822 LDKChainMonitor this_arg_conv;
25823 this_arg_conv.inner = untag_ptr(this_arg);
25824 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25826 this_arg_conv.is_owned = false;
25827 LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
25828 *ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
25829 return tag_ptr(ret_ret, true);
25832 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
25833 LDKChainMonitor this_arg_conv;
25834 this_arg_conv.inner = untag_ptr(this_arg);
25835 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25837 this_arg_conv.is_owned = false;
25838 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
25839 *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
25840 return tag_ptr(ret_ret, true);
25843 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
25844 LDKChannelMonitorUpdate this_obj_conv;
25845 this_obj_conv.inner = untag_ptr(this_obj);
25846 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25848 ChannelMonitorUpdate_free(this_obj_conv);
25851 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
25852 LDKChannelMonitorUpdate this_ptr_conv;
25853 this_ptr_conv.inner = untag_ptr(this_ptr);
25854 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25856 this_ptr_conv.is_owned = false;
25857 int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
25861 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
25862 LDKChannelMonitorUpdate this_ptr_conv;
25863 this_ptr_conv.inner = untag_ptr(this_ptr);
25864 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25865 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25866 this_ptr_conv.is_owned = false;
25867 ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
25870 static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) {
25871 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg);
25872 int64_t ret_ref = 0;
25873 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25874 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25877 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25878 LDKChannelMonitorUpdate arg_conv;
25879 arg_conv.inner = untag_ptr(arg);
25880 arg_conv.is_owned = ptr_is_owned(arg);
25881 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25882 arg_conv.is_owned = false;
25883 int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv);
25887 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25888 LDKChannelMonitorUpdate orig_conv;
25889 orig_conv.inner = untag_ptr(orig);
25890 orig_conv.is_owned = ptr_is_owned(orig);
25891 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25892 orig_conv.is_owned = false;
25893 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
25894 int64_t ret_ref = 0;
25895 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25896 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25900 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
25901 LDKChannelMonitorUpdate obj_conv;
25902 obj_conv.inner = untag_ptr(obj);
25903 obj_conv.is_owned = ptr_is_owned(obj);
25904 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
25905 obj_conv.is_owned = false;
25906 LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
25907 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
25908 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
25909 CVec_u8Z_free(ret_var);
25913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
25914 LDKu8slice ser_ref;
25915 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
25916 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
25917 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
25918 *ret_conv = ChannelMonitorUpdate_read(ser_ref);
25919 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
25920 return tag_ptr(ret_conv, true);
25923 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
25924 if (!ptr_is_owned(this_ptr)) return;
25925 void* this_ptr_ptr = untag_ptr(this_ptr);
25926 CHECK_ACCESS(this_ptr_ptr);
25927 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
25928 FREE(untag_ptr(this_ptr));
25929 MonitorEvent_free(this_ptr_conv);
25932 static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) {
25933 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
25934 *ret_copy = MonitorEvent_clone(arg);
25935 int64_t ret_ref = tag_ptr(ret_copy, true);
25938 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25939 LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg);
25940 int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv);
25944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25945 LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig);
25946 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
25947 *ret_copy = MonitorEvent_clone(orig_conv);
25948 int64_t ret_ref = tag_ptr(ret_copy, true);
25952 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNIEnv *env, jclass clz, int64_t a) {
25953 LDKHTLCUpdate a_conv;
25954 a_conv.inner = untag_ptr(a);
25955 a_conv.is_owned = ptr_is_owned(a);
25956 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
25957 a_conv = HTLCUpdate_clone(&a_conv);
25958 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
25959 *ret_copy = MonitorEvent_htlcevent(a_conv);
25960 int64_t ret_ref = tag_ptr(ret_copy, true);
25964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz, int64_t a) {
25965 LDKOutPoint a_conv;
25966 a_conv.inner = untag_ptr(a);
25967 a_conv.is_owned = ptr_is_owned(a);
25968 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
25969 a_conv = OutPoint_clone(&a_conv);
25970 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
25971 *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv);
25972 int64_t ret_ref = tag_ptr(ret_copy, true);
25976 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) {
25977 LDKOutPoint funding_txo_conv;
25978 funding_txo_conv.inner = untag_ptr(funding_txo);
25979 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
25980 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
25981 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
25982 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
25983 *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
25984 int64_t ret_ref = tag_ptr(ret_copy, true);
25988 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed(JNIEnv *env, jclass clz, int64_t a) {
25989 LDKOutPoint a_conv;
25990 a_conv.inner = untag_ptr(a);
25991 a_conv.is_owned = ptr_is_owned(a);
25992 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
25993 a_conv = OutPoint_clone(&a_conv);
25994 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
25995 *ret_copy = MonitorEvent_update_failed(a_conv);
25996 int64_t ret_ref = tag_ptr(ret_copy, true);
26000 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) {
26001 LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
26002 LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
26003 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
26004 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
26005 CVec_u8Z_free(ret_var);
26009 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
26010 LDKu8slice ser_ref;
26011 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
26012 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
26013 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
26014 *ret_conv = MonitorEvent_read(ser_ref);
26015 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
26016 return tag_ptr(ret_conv, true);
26019 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
26020 LDKHTLCUpdate this_obj_conv;
26021 this_obj_conv.inner = untag_ptr(this_obj);
26022 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26024 HTLCUpdate_free(this_obj_conv);
26027 static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) {
26028 LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg);
26029 int64_t ret_ref = 0;
26030 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26031 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26035 LDKHTLCUpdate arg_conv;
26036 arg_conv.inner = untag_ptr(arg);
26037 arg_conv.is_owned = ptr_is_owned(arg);
26038 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26039 arg_conv.is_owned = false;
26040 int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv);
26044 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26045 LDKHTLCUpdate orig_conv;
26046 orig_conv.inner = untag_ptr(orig);
26047 orig_conv.is_owned = ptr_is_owned(orig);
26048 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26049 orig_conv.is_owned = false;
26050 LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
26051 int64_t ret_ref = 0;
26052 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26053 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26057 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
26058 LDKHTLCUpdate obj_conv;
26059 obj_conv.inner = untag_ptr(obj);
26060 obj_conv.is_owned = ptr_is_owned(obj);
26061 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26062 obj_conv.is_owned = false;
26063 LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
26064 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
26065 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
26066 CVec_u8Z_free(ret_var);
26070 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
26071 LDKu8slice ser_ref;
26072 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
26073 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
26074 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
26075 *ret_conv = HTLCUpdate_read(ser_ref);
26076 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
26077 return tag_ptr(ret_conv, true);
26080 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26081 if (!ptr_is_owned(this_ptr)) return;
26082 void* this_ptr_ptr = untag_ptr(this_ptr);
26083 CHECK_ACCESS(this_ptr_ptr);
26084 LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
26085 FREE(untag_ptr(this_ptr));
26086 Balance_free(this_ptr_conv);
26089 static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) {
26090 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
26091 *ret_copy = Balance_clone(arg);
26092 int64_t ret_ref = tag_ptr(ret_copy, true);
26095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26096 LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg);
26097 int64_t ret_conv = Balance_clone_ptr(arg_conv);
26101 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26102 LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig);
26103 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
26104 *ret_copy = Balance_clone(orig_conv);
26105 int64_t ret_ref = tag_ptr(ret_copy, true);
26109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) {
26110 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
26111 *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis);
26112 int64_t ret_ref = tag_ptr(ret_copy, true);
26116 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) {
26117 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
26118 *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
26119 int64_t ret_ref = tag_ptr(ret_copy, true);
26123 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) {
26124 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
26125 *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
26126 int64_t ret_ref = tag_ptr(ret_copy, true);
26130 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1claimable_1htlcawaiting_1timeout(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t claimable_height) {
26131 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
26132 *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height);
26133 int64_t ret_ref = tag_ptr(ret_copy, true);
26137 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Balance_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
26138 LDKBalance* a_conv = (LDKBalance*)untag_ptr(a);
26139 LDKBalance* b_conv = (LDKBalance*)untag_ptr(b);
26140 jboolean ret_conv = Balance_eq(a_conv, b_conv);
26144 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
26145 LDKChannelMonitor this_obj_conv;
26146 this_obj_conv.inner = untag_ptr(this_obj);
26147 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26149 ChannelMonitor_free(this_obj_conv);
26152 static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) {
26153 LDKChannelMonitor ret_var = ChannelMonitor_clone(arg);
26154 int64_t ret_ref = 0;
26155 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26156 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26159 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26160 LDKChannelMonitor arg_conv;
26161 arg_conv.inner = untag_ptr(arg);
26162 arg_conv.is_owned = ptr_is_owned(arg);
26163 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26164 arg_conv.is_owned = false;
26165 int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv);
26169 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26170 LDKChannelMonitor orig_conv;
26171 orig_conv.inner = untag_ptr(orig);
26172 orig_conv.is_owned = ptr_is_owned(orig);
26173 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26174 orig_conv.is_owned = false;
26175 LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv);
26176 int64_t ret_ref = 0;
26177 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26178 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26182 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(JNIEnv *env, jclass clz, int64_t obj) {
26183 LDKChannelMonitor obj_conv;
26184 obj_conv.inner = untag_ptr(obj);
26185 obj_conv.is_owned = ptr_is_owned(obj);
26186 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26187 obj_conv.is_owned = false;
26188 LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
26189 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
26190 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
26191 CVec_u8Z_free(ret_var);
26195 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) {
26196 LDKChannelMonitor this_arg_conv;
26197 this_arg_conv.inner = untag_ptr(this_arg);
26198 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26200 this_arg_conv.is_owned = false;
26201 LDKChannelMonitorUpdate updates_conv;
26202 updates_conv.inner = untag_ptr(updates);
26203 updates_conv.is_owned = ptr_is_owned(updates);
26204 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
26205 updates_conv.is_owned = false;
26206 void* broadcaster_ptr = untag_ptr(broadcaster);
26207 if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); }
26208 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
26209 void* fee_estimator_ptr = untag_ptr(fee_estimator);
26210 CHECK_ACCESS(fee_estimator_ptr);
26211 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
26212 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
26213 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26214 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
26216 void* logger_ptr = untag_ptr(logger);
26217 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
26218 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
26219 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
26220 *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
26221 return tag_ptr(ret_conv, true);
26224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
26225 LDKChannelMonitor this_arg_conv;
26226 this_arg_conv.inner = untag_ptr(this_arg);
26227 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26228 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26229 this_arg_conv.is_owned = false;
26230 int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv);
26234 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_arg) {
26235 LDKChannelMonitor this_arg_conv;
26236 this_arg_conv.inner = untag_ptr(this_arg);
26237 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26238 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26239 this_arg_conv.is_owned = false;
26240 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
26241 *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv);
26242 return tag_ptr(ret_conv, true);
26245 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg) {
26246 LDKChannelMonitor this_arg_conv;
26247 this_arg_conv.inner = untag_ptr(this_arg);
26248 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26250 this_arg_conv.is_owned = false;
26251 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
26252 int64_tArray ret_arr = NULL;
26253 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
26254 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
26255 for (size_t o = 0; o < ret_var.datalen; o++) {
26256 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
26257 *ret_conv_40_conv = ret_var.data[o];
26258 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
26260 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
26261 FREE(ret_var.data);
26265 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg, int64_t filter) {
26266 LDKChannelMonitor this_arg_conv;
26267 this_arg_conv.inner = untag_ptr(this_arg);
26268 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26270 this_arg_conv.is_owned = false;
26271 void* filter_ptr = untag_ptr(filter);
26272 if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); }
26273 LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
26274 ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
26277 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
26278 LDKChannelMonitor this_arg_conv;
26279 this_arg_conv.inner = untag_ptr(this_arg);
26280 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26281 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26282 this_arg_conv.is_owned = false;
26283 LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
26284 int64_tArray ret_arr = NULL;
26285 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
26286 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
26287 for (size_t o = 0; o < ret_var.datalen; o++) {
26288 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
26289 *ret_conv_14_copy = ret_var.data[o];
26290 int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
26291 ret_arr_ptr[o] = ret_conv_14_ref;
26293 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
26294 FREE(ret_var.data);
26298 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
26299 LDKChannelMonitor this_arg_conv;
26300 this_arg_conv.inner = untag_ptr(this_arg);
26301 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26302 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26303 this_arg_conv.is_owned = false;
26304 LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
26305 int64_tArray ret_arr = NULL;
26306 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
26307 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
26308 for (size_t h = 0; h < ret_var.datalen; h++) {
26309 LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26310 *ret_conv_7_copy = ret_var.data[h];
26311 int64_t ret_conv_7_ref = tag_ptr(ret_conv_7_copy, true);
26312 ret_arr_ptr[h] = ret_conv_7_ref;
26314 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
26315 FREE(ret_var.data);
26319 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1counterparty_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
26320 LDKChannelMonitor 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_tArray ret_arr = (*env)->NewByteArray(env, 33);
26326 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form);
26330 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) {
26331 LDKChannelMonitor this_arg_conv;
26332 this_arg_conv.inner = untag_ptr(this_arg);
26333 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26335 this_arg_conv.is_owned = false;
26336 void* logger_ptr = untag_ptr(logger);
26337 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
26338 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
26339 LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
26340 jobjectArray ret_arr = NULL;
26341 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
26343 for (size_t i = 0; i < ret_var.datalen; i++) {
26344 LDKTransaction ret_conv_8_var = ret_var.data[i];
26345 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen);
26346 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data);
26347 Transaction_free(ret_conv_8_var);
26348 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
26351 FREE(ret_var.data);
26355 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) {
26356 LDKChannelMonitor this_arg_conv;
26357 this_arg_conv.inner = untag_ptr(this_arg);
26358 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26359 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26360 this_arg_conv.is_owned = false;
26361 unsigned char header_arr[80];
26362 CHECK((*env)->GetArrayLength(env, header) == 80);
26363 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
26364 unsigned char (*header_ref)[80] = &header_arr;
26365 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
26366 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
26367 if (txdata_constr.datalen > 0)
26368 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
26370 txdata_constr.data = NULL;
26371 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
26372 for (size_t c = 0; c < txdata_constr.datalen; c++) {
26373 int64_t txdata_conv_28 = txdata_vals[c];
26374 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
26375 CHECK_ACCESS(txdata_conv_28_ptr);
26376 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
26377 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
26378 txdata_constr.data[c] = txdata_conv_28_conv;
26380 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
26381 void* broadcaster_ptr = untag_ptr(broadcaster);
26382 CHECK_ACCESS(broadcaster_ptr);
26383 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
26384 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
26385 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26386 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
26388 void* fee_estimator_ptr = untag_ptr(fee_estimator);
26389 CHECK_ACCESS(fee_estimator_ptr);
26390 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
26391 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
26392 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26393 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
26395 void* logger_ptr = untag_ptr(logger);
26396 CHECK_ACCESS(logger_ptr);
26397 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
26398 if (logger_conv.free == LDKLogger_JCalls_free) {
26399 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26400 LDKLogger_JCalls_cloned(&logger_conv);
26402 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);
26403 int64_tArray ret_arr = NULL;
26404 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
26405 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
26406 for (size_t n = 0; n < ret_var.datalen; n++) {
26407 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
26408 *ret_conv_39_conv = ret_var.data[n];
26409 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
26411 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
26412 FREE(ret_var.data);
26416 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) {
26417 LDKChannelMonitor this_arg_conv;
26418 this_arg_conv.inner = untag_ptr(this_arg);
26419 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26421 this_arg_conv.is_owned = false;
26422 unsigned char header_arr[80];
26423 CHECK((*env)->GetArrayLength(env, header) == 80);
26424 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
26425 unsigned char (*header_ref)[80] = &header_arr;
26426 void* broadcaster_ptr = untag_ptr(broadcaster);
26427 CHECK_ACCESS(broadcaster_ptr);
26428 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
26429 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
26430 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26431 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
26433 void* fee_estimator_ptr = untag_ptr(fee_estimator);
26434 CHECK_ACCESS(fee_estimator_ptr);
26435 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
26436 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
26437 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26438 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
26440 void* logger_ptr = untag_ptr(logger);
26441 CHECK_ACCESS(logger_ptr);
26442 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
26443 if (logger_conv.free == LDKLogger_JCalls_free) {
26444 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26445 LDKLogger_JCalls_cloned(&logger_conv);
26447 ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
26450 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) {
26451 LDKChannelMonitor this_arg_conv;
26452 this_arg_conv.inner = untag_ptr(this_arg);
26453 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26455 this_arg_conv.is_owned = false;
26456 unsigned char header_arr[80];
26457 CHECK((*env)->GetArrayLength(env, header) == 80);
26458 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
26459 unsigned char (*header_ref)[80] = &header_arr;
26460 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
26461 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
26462 if (txdata_constr.datalen > 0)
26463 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
26465 txdata_constr.data = NULL;
26466 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
26467 for (size_t c = 0; c < txdata_constr.datalen; c++) {
26468 int64_t txdata_conv_28 = txdata_vals[c];
26469 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
26470 CHECK_ACCESS(txdata_conv_28_ptr);
26471 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
26472 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
26473 txdata_constr.data[c] = txdata_conv_28_conv;
26475 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
26476 void* broadcaster_ptr = untag_ptr(broadcaster);
26477 CHECK_ACCESS(broadcaster_ptr);
26478 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
26479 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
26480 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26481 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
26483 void* fee_estimator_ptr = untag_ptr(fee_estimator);
26484 CHECK_ACCESS(fee_estimator_ptr);
26485 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
26486 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
26487 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26488 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
26490 void* logger_ptr = untag_ptr(logger);
26491 CHECK_ACCESS(logger_ptr);
26492 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
26493 if (logger_conv.free == LDKLogger_JCalls_free) {
26494 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26495 LDKLogger_JCalls_cloned(&logger_conv);
26497 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);
26498 int64_tArray ret_arr = NULL;
26499 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
26500 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
26501 for (size_t n = 0; n < ret_var.datalen; n++) {
26502 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
26503 *ret_conv_39_conv = ret_var.data[n];
26504 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
26506 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
26507 FREE(ret_var.data);
26511 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) {
26512 LDKChannelMonitor this_arg_conv;
26513 this_arg_conv.inner = untag_ptr(this_arg);
26514 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26516 this_arg_conv.is_owned = false;
26517 unsigned char txid_arr[32];
26518 CHECK((*env)->GetArrayLength(env, txid) == 32);
26519 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
26520 unsigned char (*txid_ref)[32] = &txid_arr;
26521 void* broadcaster_ptr = untag_ptr(broadcaster);
26522 CHECK_ACCESS(broadcaster_ptr);
26523 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
26524 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
26525 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26526 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
26528 void* fee_estimator_ptr = untag_ptr(fee_estimator);
26529 CHECK_ACCESS(fee_estimator_ptr);
26530 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
26531 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
26532 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26533 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
26535 void* logger_ptr = untag_ptr(logger);
26536 CHECK_ACCESS(logger_ptr);
26537 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
26538 if (logger_conv.free == LDKLogger_JCalls_free) {
26539 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26540 LDKLogger_JCalls_cloned(&logger_conv);
26542 ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
26545 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) {
26546 LDKChannelMonitor this_arg_conv;
26547 this_arg_conv.inner = untag_ptr(this_arg);
26548 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26549 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26550 this_arg_conv.is_owned = false;
26551 unsigned char header_arr[80];
26552 CHECK((*env)->GetArrayLength(env, header) == 80);
26553 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
26554 unsigned char (*header_ref)[80] = &header_arr;
26555 void* broadcaster_ptr = untag_ptr(broadcaster);
26556 CHECK_ACCESS(broadcaster_ptr);
26557 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
26558 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
26559 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26560 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
26562 void* fee_estimator_ptr = untag_ptr(fee_estimator);
26563 CHECK_ACCESS(fee_estimator_ptr);
26564 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
26565 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
26566 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26567 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
26569 void* logger_ptr = untag_ptr(logger);
26570 CHECK_ACCESS(logger_ptr);
26571 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
26572 if (logger_conv.free == LDKLogger_JCalls_free) {
26573 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26574 LDKLogger_JCalls_cloned(&logger_conv);
26576 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
26577 int64_tArray ret_arr = NULL;
26578 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
26579 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
26580 for (size_t n = 0; n < ret_var.datalen; n++) {
26581 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
26582 *ret_conv_39_conv = ret_var.data[n];
26583 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
26585 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
26586 FREE(ret_var.data);
26590 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) {
26591 LDKChannelMonitor this_arg_conv;
26592 this_arg_conv.inner = untag_ptr(this_arg);
26593 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26595 this_arg_conv.is_owned = false;
26596 LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
26597 jobjectArray ret_arr = NULL;
26598 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
26600 for (size_t i = 0; i < ret_var.datalen; i++) {
26601 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32);
26602 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data);
26603 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
26606 FREE(ret_var.data);
26610 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) {
26611 LDKChannelMonitor this_arg_conv;
26612 this_arg_conv.inner = untag_ptr(this_arg);
26613 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26614 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26615 this_arg_conv.is_owned = false;
26616 LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
26617 int64_t ret_ref = 0;
26618 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26619 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26623 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg) {
26624 LDKChannelMonitor this_arg_conv;
26625 this_arg_conv.inner = untag_ptr(this_arg);
26626 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26627 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26628 this_arg_conv.is_owned = false;
26629 LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
26630 int64_tArray ret_arr = NULL;
26631 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
26632 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
26633 for (size_t j = 0; j < ret_var.datalen; j++) {
26634 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
26635 *ret_conv_9_copy = ret_var.data[j];
26636 int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
26637 ret_arr_ptr[j] = ret_conv_9_ref;
26639 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
26640 FREE(ret_var.data);
26644 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
26645 LDKu8slice ser_ref;
26646 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
26647 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
26648 void* arg_ptr = untag_ptr(arg);
26649 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
26650 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
26651 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
26652 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
26653 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
26654 return tag_ptr(ret_conv, true);
26657 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
26658 LDKOutPoint this_obj_conv;
26659 this_obj_conv.inner = untag_ptr(this_obj);
26660 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26662 OutPoint_free(this_obj_conv);
26665 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
26666 LDKOutPoint this_ptr_conv;
26667 this_ptr_conv.inner = untag_ptr(this_ptr);
26668 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26670 this_ptr_conv.is_owned = false;
26671 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
26672 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv));
26676 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
26677 LDKOutPoint this_ptr_conv;
26678 this_ptr_conv.inner = untag_ptr(this_ptr);
26679 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26681 this_ptr_conv.is_owned = false;
26682 LDKThirtyTwoBytes val_ref;
26683 CHECK((*env)->GetArrayLength(env, val) == 32);
26684 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
26685 OutPoint_set_txid(&this_ptr_conv, val_ref);
26688 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
26689 LDKOutPoint this_ptr_conv;
26690 this_ptr_conv.inner = untag_ptr(this_ptr);
26691 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26692 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26693 this_ptr_conv.is_owned = false;
26694 int16_t ret_conv = OutPoint_get_index(&this_ptr_conv);
26698 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
26699 LDKOutPoint this_ptr_conv;
26700 this_ptr_conv.inner = untag_ptr(this_ptr);
26701 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26703 this_ptr_conv.is_owned = false;
26704 OutPoint_set_index(&this_ptr_conv, val);
26707 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) {
26708 LDKThirtyTwoBytes txid_arg_ref;
26709 CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
26710 (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
26711 LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
26712 int64_t ret_ref = 0;
26713 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26714 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26718 static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) {
26719 LDKOutPoint ret_var = OutPoint_clone(arg);
26720 int64_t ret_ref = 0;
26721 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26722 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26725 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26726 LDKOutPoint arg_conv;
26727 arg_conv.inner = untag_ptr(arg);
26728 arg_conv.is_owned = ptr_is_owned(arg);
26729 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26730 arg_conv.is_owned = false;
26731 int64_t ret_conv = OutPoint_clone_ptr(&arg_conv);
26735 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26736 LDKOutPoint orig_conv;
26737 orig_conv.inner = untag_ptr(orig);
26738 orig_conv.is_owned = ptr_is_owned(orig);
26739 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26740 orig_conv.is_owned = false;
26741 LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
26742 int64_t ret_ref = 0;
26743 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26744 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26748 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
26749 LDKOutPoint a_conv;
26750 a_conv.inner = untag_ptr(a);
26751 a_conv.is_owned = ptr_is_owned(a);
26752 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
26753 a_conv.is_owned = false;
26754 LDKOutPoint b_conv;
26755 b_conv.inner = untag_ptr(b);
26756 b_conv.is_owned = ptr_is_owned(b);
26757 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
26758 b_conv.is_owned = false;
26759 jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv);
26763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, jclass clz, int64_t o) {
26764 LDKOutPoint o_conv;
26765 o_conv.inner = untag_ptr(o);
26766 o_conv.is_owned = ptr_is_owned(o);
26767 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26768 o_conv.is_owned = false;
26769 int64_t ret_conv = OutPoint_hash(&o_conv);
26773 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
26774 LDKOutPoint this_arg_conv;
26775 this_arg_conv.inner = untag_ptr(this_arg);
26776 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26777 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26778 this_arg_conv.is_owned = false;
26779 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
26780 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data);
26784 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *env, jclass clz, int64_t obj) {
26785 LDKOutPoint obj_conv;
26786 obj_conv.inner = untag_ptr(obj);
26787 obj_conv.is_owned = ptr_is_owned(obj);
26788 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26789 obj_conv.is_owned = false;
26790 LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
26791 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
26792 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
26793 CVec_u8Z_free(ret_var);
26797 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
26798 LDKu8slice ser_ref;
26799 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
26800 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
26801 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
26802 *ret_conv = OutPoint_read(ser_ref);
26803 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
26804 return tag_ptr(ret_conv, true);
26807 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
26808 LDKDelayedPaymentOutputDescriptor this_obj_conv;
26809 this_obj_conv.inner = untag_ptr(this_obj);
26810 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26811 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26812 DelayedPaymentOutputDescriptor_free(this_obj_conv);
26815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
26816 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26817 this_ptr_conv.inner = untag_ptr(this_ptr);
26818 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26820 this_ptr_conv.is_owned = false;
26821 LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
26822 int64_t ret_ref = 0;
26823 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26824 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26828 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
26829 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26830 this_ptr_conv.inner = untag_ptr(this_ptr);
26831 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26832 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26833 this_ptr_conv.is_owned = false;
26834 LDKOutPoint val_conv;
26835 val_conv.inner = untag_ptr(val);
26836 val_conv.is_owned = ptr_is_owned(val);
26837 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26838 val_conv = OutPoint_clone(&val_conv);
26839 DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
26842 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
26843 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26844 this_ptr_conv.inner = untag_ptr(this_ptr);
26845 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26846 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26847 this_ptr_conv.is_owned = false;
26848 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
26849 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form);
26853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
26854 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26855 this_ptr_conv.inner = untag_ptr(this_ptr);
26856 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26858 this_ptr_conv.is_owned = false;
26859 LDKPublicKey val_ref;
26860 CHECK((*env)->GetArrayLength(env, val) == 33);
26861 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
26862 DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
26865 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
26866 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26867 this_ptr_conv.inner = untag_ptr(this_ptr);
26868 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26869 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26870 this_ptr_conv.is_owned = false;
26871 int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
26875 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
26876 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26877 this_ptr_conv.inner = untag_ptr(this_ptr);
26878 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26880 this_ptr_conv.is_owned = false;
26881 DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
26884 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) {
26885 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26886 this_ptr_conv.inner = untag_ptr(this_ptr);
26887 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26888 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26889 this_ptr_conv.is_owned = false;
26890 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
26891 *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv);
26892 return tag_ptr(ret_ref, true);
26895 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
26896 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26897 this_ptr_conv.inner = untag_ptr(this_ptr);
26898 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26899 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26900 this_ptr_conv.is_owned = false;
26901 void* val_ptr = untag_ptr(val);
26902 CHECK_ACCESS(val_ptr);
26903 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
26904 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
26905 DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
26908 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
26909 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26910 this_ptr_conv.inner = untag_ptr(this_ptr);
26911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26913 this_ptr_conv.is_owned = false;
26914 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
26915 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form);
26919 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
26920 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26921 this_ptr_conv.inner = untag_ptr(this_ptr);
26922 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26924 this_ptr_conv.is_owned = false;
26925 LDKPublicKey val_ref;
26926 CHECK((*env)->GetArrayLength(env, val) == 33);
26927 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
26928 DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
26931 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
26932 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26933 this_ptr_conv.inner = untag_ptr(this_ptr);
26934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26936 this_ptr_conv.is_owned = false;
26937 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
26938 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
26942 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
26943 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26944 this_ptr_conv.inner = untag_ptr(this_ptr);
26945 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26946 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26947 this_ptr_conv.is_owned = false;
26948 LDKThirtyTwoBytes val_ref;
26949 CHECK((*env)->GetArrayLength(env, val) == 32);
26950 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
26951 DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
26954 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
26955 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26956 this_ptr_conv.inner = untag_ptr(this_ptr);
26957 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26959 this_ptr_conv.is_owned = false;
26960 int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
26964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
26965 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
26966 this_ptr_conv.inner = untag_ptr(this_ptr);
26967 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26969 this_ptr_conv.is_owned = false;
26970 DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
26973 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) {
26974 LDKOutPoint outpoint_arg_conv;
26975 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
26976 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
26977 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
26978 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
26979 LDKPublicKey per_commitment_point_arg_ref;
26980 CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
26981 (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
26982 void* output_arg_ptr = untag_ptr(output_arg);
26983 CHECK_ACCESS(output_arg_ptr);
26984 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
26985 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
26986 LDKPublicKey revocation_pubkey_arg_ref;
26987 CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33);
26988 (*env)->GetByteArrayRegion(env, revocation_pubkey_arg, 0, 33, revocation_pubkey_arg_ref.compressed_form);
26989 LDKThirtyTwoBytes channel_keys_id_arg_ref;
26990 CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
26991 (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
26992 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);
26993 int64_t ret_ref = 0;
26994 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26995 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26999 static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) {
27000 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg);
27001 int64_t ret_ref = 0;
27002 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27003 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27006 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27007 LDKDelayedPaymentOutputDescriptor arg_conv;
27008 arg_conv.inner = untag_ptr(arg);
27009 arg_conv.is_owned = ptr_is_owned(arg);
27010 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27011 arg_conv.is_owned = false;
27012 int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv);
27016 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27017 LDKDelayedPaymentOutputDescriptor orig_conv;
27018 orig_conv.inner = untag_ptr(orig);
27019 orig_conv.is_owned = ptr_is_owned(orig);
27020 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27021 orig_conv.is_owned = false;
27022 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
27023 int64_t ret_ref = 0;
27024 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27025 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27029 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
27030 LDKDelayedPaymentOutputDescriptor obj_conv;
27031 obj_conv.inner = untag_ptr(obj);
27032 obj_conv.is_owned = ptr_is_owned(obj);
27033 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
27034 obj_conv.is_owned = false;
27035 LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv);
27036 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27037 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27038 CVec_u8Z_free(ret_var);
27042 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
27043 LDKu8slice ser_ref;
27044 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
27045 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
27046 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
27047 *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
27048 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
27049 return tag_ptr(ret_conv, true);
27052 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27053 LDKStaticPaymentOutputDescriptor this_obj_conv;
27054 this_obj_conv.inner = untag_ptr(this_obj);
27055 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27057 StaticPaymentOutputDescriptor_free(this_obj_conv);
27060 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
27061 LDKStaticPaymentOutputDescriptor this_ptr_conv;
27062 this_ptr_conv.inner = untag_ptr(this_ptr);
27063 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27065 this_ptr_conv.is_owned = false;
27066 LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
27067 int64_t ret_ref = 0;
27068 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27069 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27073 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27074 LDKStaticPaymentOutputDescriptor this_ptr_conv;
27075 this_ptr_conv.inner = untag_ptr(this_ptr);
27076 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27077 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27078 this_ptr_conv.is_owned = false;
27079 LDKOutPoint val_conv;
27080 val_conv.inner = untag_ptr(val);
27081 val_conv.is_owned = ptr_is_owned(val);
27082 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27083 val_conv = OutPoint_clone(&val_conv);
27084 StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
27087 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) {
27088 LDKStaticPaymentOutputDescriptor this_ptr_conv;
27089 this_ptr_conv.inner = untag_ptr(this_ptr);
27090 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27092 this_ptr_conv.is_owned = false;
27093 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
27094 *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv);
27095 return tag_ptr(ret_ref, true);
27098 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27099 LDKStaticPaymentOutputDescriptor 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 void* val_ptr = untag_ptr(val);
27105 CHECK_ACCESS(val_ptr);
27106 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
27107 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
27108 StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
27111 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
27112 LDKStaticPaymentOutputDescriptor this_ptr_conv;
27113 this_ptr_conv.inner = untag_ptr(this_ptr);
27114 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27116 this_ptr_conv.is_owned = false;
27117 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
27118 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
27122 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
27123 LDKStaticPaymentOutputDescriptor this_ptr_conv;
27124 this_ptr_conv.inner = untag_ptr(this_ptr);
27125 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27126 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27127 this_ptr_conv.is_owned = false;
27128 LDKThirtyTwoBytes val_ref;
27129 CHECK((*env)->GetArrayLength(env, val) == 32);
27130 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
27131 StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
27134 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
27135 LDKStaticPaymentOutputDescriptor this_ptr_conv;
27136 this_ptr_conv.inner = untag_ptr(this_ptr);
27137 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27138 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27139 this_ptr_conv.is_owned = false;
27140 int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
27144 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27145 LDKStaticPaymentOutputDescriptor this_ptr_conv;
27146 this_ptr_conv.inner = untag_ptr(this_ptr);
27147 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27149 this_ptr_conv.is_owned = false;
27150 StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
27153 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) {
27154 LDKOutPoint outpoint_arg_conv;
27155 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
27156 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
27157 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
27158 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
27159 void* output_arg_ptr = untag_ptr(output_arg);
27160 CHECK_ACCESS(output_arg_ptr);
27161 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
27162 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
27163 LDKThirtyTwoBytes channel_keys_id_arg_ref;
27164 CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
27165 (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
27166 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
27167 int64_t ret_ref = 0;
27168 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27169 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27173 static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) {
27174 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg);
27175 int64_t ret_ref = 0;
27176 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27177 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27181 LDKStaticPaymentOutputDescriptor arg_conv;
27182 arg_conv.inner = untag_ptr(arg);
27183 arg_conv.is_owned = ptr_is_owned(arg);
27184 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27185 arg_conv.is_owned = false;
27186 int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv);
27190 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27191 LDKStaticPaymentOutputDescriptor orig_conv;
27192 orig_conv.inner = untag_ptr(orig);
27193 orig_conv.is_owned = ptr_is_owned(orig);
27194 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27195 orig_conv.is_owned = false;
27196 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
27197 int64_t ret_ref = 0;
27198 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27199 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27203 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
27204 LDKStaticPaymentOutputDescriptor obj_conv;
27205 obj_conv.inner = untag_ptr(obj);
27206 obj_conv.is_owned = ptr_is_owned(obj);
27207 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
27208 obj_conv.is_owned = false;
27209 LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv);
27210 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27211 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27212 CVec_u8Z_free(ret_var);
27216 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
27217 LDKu8slice ser_ref;
27218 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
27219 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
27220 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
27221 *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
27222 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
27223 return tag_ptr(ret_conv, true);
27226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27227 if (!ptr_is_owned(this_ptr)) return;
27228 void* this_ptr_ptr = untag_ptr(this_ptr);
27229 CHECK_ACCESS(this_ptr_ptr);
27230 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
27231 FREE(untag_ptr(this_ptr));
27232 SpendableOutputDescriptor_free(this_ptr_conv);
27235 static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) {
27236 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
27237 *ret_copy = SpendableOutputDescriptor_clone(arg);
27238 int64_t ret_ref = tag_ptr(ret_copy, true);
27241 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27242 LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg);
27243 int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv);
27247 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27248 LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig);
27249 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
27250 *ret_copy = SpendableOutputDescriptor_clone(orig_conv);
27251 int64_t ret_ref = tag_ptr(ret_copy, true);
27255 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output) {
27256 LDKOutPoint outpoint_conv;
27257 outpoint_conv.inner = untag_ptr(outpoint);
27258 outpoint_conv.is_owned = ptr_is_owned(outpoint);
27259 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv);
27260 outpoint_conv = OutPoint_clone(&outpoint_conv);
27261 void* output_ptr = untag_ptr(output);
27262 CHECK_ACCESS(output_ptr);
27263 LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
27264 output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output));
27265 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
27266 *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
27267 int64_t ret_ref = tag_ptr(ret_copy, true);
27271 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
27272 LDKDelayedPaymentOutputDescriptor a_conv;
27273 a_conv.inner = untag_ptr(a);
27274 a_conv.is_owned = ptr_is_owned(a);
27275 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
27276 a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
27277 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
27278 *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
27279 int64_t ret_ref = tag_ptr(ret_copy, true);
27283 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
27284 LDKStaticPaymentOutputDescriptor a_conv;
27285 a_conv.inner = untag_ptr(a);
27286 a_conv.is_owned = ptr_is_owned(a);
27287 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
27288 a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
27289 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
27290 *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
27291 int64_t ret_ref = tag_ptr(ret_copy, true);
27295 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
27296 LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
27297 LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
27298 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27299 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27300 CVec_u8Z_free(ret_var);
27304 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
27305 LDKu8slice ser_ref;
27306 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
27307 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
27308 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
27309 *ret_conv = SpendableOutputDescriptor_read(ser_ref);
27310 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
27311 return tag_ptr(ret_conv, true);
27314 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27315 if (!ptr_is_owned(this_ptr)) return;
27316 void* this_ptr_ptr = untag_ptr(this_ptr);
27317 CHECK_ACCESS(this_ptr_ptr);
27318 LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
27319 FREE(untag_ptr(this_ptr));
27320 BaseSign_free(this_ptr_conv);
27323 static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) {
27324 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
27325 *ret_ret = Sign_clone(arg);
27326 return tag_ptr(ret_ret, true);
27328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27329 void* arg_ptr = untag_ptr(arg);
27330 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
27331 LDKSign* arg_conv = (LDKSign*)arg_ptr;
27332 int64_t ret_conv = Sign_clone_ptr(arg_conv);
27336 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27337 void* orig_ptr = untag_ptr(orig);
27338 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
27339 LDKSign* orig_conv = (LDKSign*)orig_ptr;
27340 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
27341 *ret_ret = Sign_clone(orig_conv);
27342 return tag_ptr(ret_ret, true);
27345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27346 if (!ptr_is_owned(this_ptr)) return;
27347 void* this_ptr_ptr = untag_ptr(this_ptr);
27348 CHECK_ACCESS(this_ptr_ptr);
27349 LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
27350 FREE(untag_ptr(this_ptr));
27351 Sign_free(this_ptr_conv);
27354 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27355 LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig);
27356 jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv));
27360 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) {
27361 jclass ret_conv = LDKRecipient_to_java(env, Recipient_node());
27365 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) {
27366 jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node());
27370 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27371 if (!ptr_is_owned(this_ptr)) return;
27372 void* this_ptr_ptr = untag_ptr(this_ptr);
27373 CHECK_ACCESS(this_ptr_ptr);
27374 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
27375 FREE(untag_ptr(this_ptr));
27376 KeysInterface_free(this_ptr_conv);
27379 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27380 LDKInMemorySigner this_obj_conv;
27381 this_obj_conv.inner = untag_ptr(this_obj);
27382 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27384 InMemorySigner_free(this_obj_conv);
27387 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
27388 LDKInMemorySigner this_ptr_conv;
27389 this_ptr_conv.inner = untag_ptr(this_ptr);
27390 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27392 this_ptr_conv.is_owned = false;
27393 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
27394 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv));
27398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
27399 LDKInMemorySigner this_ptr_conv;
27400 this_ptr_conv.inner = untag_ptr(this_ptr);
27401 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27402 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27403 this_ptr_conv.is_owned = false;
27404 LDKSecretKey val_ref;
27405 CHECK((*env)->GetArrayLength(env, val) == 32);
27406 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
27407 InMemorySigner_set_funding_key(&this_ptr_conv, val_ref);
27410 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
27411 LDKInMemorySigner this_ptr_conv;
27412 this_ptr_conv.inner = untag_ptr(this_ptr);
27413 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27415 this_ptr_conv.is_owned = false;
27416 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
27417 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv));
27421 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
27422 LDKInMemorySigner this_ptr_conv;
27423 this_ptr_conv.inner = untag_ptr(this_ptr);
27424 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27426 this_ptr_conv.is_owned = false;
27427 LDKSecretKey val_ref;
27428 CHECK((*env)->GetArrayLength(env, val) == 32);
27429 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
27430 InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref);
27433 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
27434 LDKInMemorySigner this_ptr_conv;
27435 this_ptr_conv.inner = untag_ptr(this_ptr);
27436 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27438 this_ptr_conv.is_owned = false;
27439 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
27440 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv));
27444 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
27445 LDKInMemorySigner this_ptr_conv;
27446 this_ptr_conv.inner = untag_ptr(this_ptr);
27447 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27449 this_ptr_conv.is_owned = false;
27450 LDKSecretKey val_ref;
27451 CHECK((*env)->GetArrayLength(env, val) == 32);
27452 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
27453 InMemorySigner_set_payment_key(&this_ptr_conv, val_ref);
27456 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
27457 LDKInMemorySigner this_ptr_conv;
27458 this_ptr_conv.inner = untag_ptr(this_ptr);
27459 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27461 this_ptr_conv.is_owned = false;
27462 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
27463 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv));
27467 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) {
27468 LDKInMemorySigner this_ptr_conv;
27469 this_ptr_conv.inner = untag_ptr(this_ptr);
27470 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27471 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27472 this_ptr_conv.is_owned = false;
27473 LDKSecretKey val_ref;
27474 CHECK((*env)->GetArrayLength(env, val) == 32);
27475 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
27476 InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
27479 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
27480 LDKInMemorySigner this_ptr_conv;
27481 this_ptr_conv.inner = untag_ptr(this_ptr);
27482 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27484 this_ptr_conv.is_owned = false;
27485 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
27486 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv));
27490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
27491 LDKInMemorySigner this_ptr_conv;
27492 this_ptr_conv.inner = untag_ptr(this_ptr);
27493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27495 this_ptr_conv.is_owned = false;
27496 LDKSecretKey val_ref;
27497 CHECK((*env)->GetArrayLength(env, val) == 32);
27498 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
27499 InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
27502 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) {
27503 LDKInMemorySigner this_ptr_conv;
27504 this_ptr_conv.inner = untag_ptr(this_ptr);
27505 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27507 this_ptr_conv.is_owned = false;
27508 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
27509 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv));
27513 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
27514 LDKInMemorySigner this_ptr_conv;
27515 this_ptr_conv.inner = untag_ptr(this_ptr);
27516 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27518 this_ptr_conv.is_owned = false;
27519 LDKThirtyTwoBytes val_ref;
27520 CHECK((*env)->GetArrayLength(env, val) == 32);
27521 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
27522 InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
27525 static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) {
27526 LDKInMemorySigner ret_var = InMemorySigner_clone(arg);
27527 int64_t ret_ref = 0;
27528 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27529 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27533 LDKInMemorySigner arg_conv;
27534 arg_conv.inner = untag_ptr(arg);
27535 arg_conv.is_owned = ptr_is_owned(arg);
27536 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27537 arg_conv.is_owned = false;
27538 int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv);
27542 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27543 LDKInMemorySigner orig_conv;
27544 orig_conv.inner = untag_ptr(orig);
27545 orig_conv.is_owned = ptr_is_owned(orig);
27546 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27547 orig_conv.is_owned = false;
27548 LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
27549 int64_t ret_ref = 0;
27550 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27551 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27555 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) {
27556 LDKSecretKey node_secret_ref;
27557 CHECK((*env)->GetArrayLength(env, node_secret) == 32);
27558 (*env)->GetByteArrayRegion(env, node_secret, 0, 32, node_secret_ref.bytes);
27559 LDKSecretKey funding_key_ref;
27560 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
27561 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes);
27562 LDKSecretKey revocation_base_key_ref;
27563 CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32);
27564 (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes);
27565 LDKSecretKey payment_key_ref;
27566 CHECK((*env)->GetArrayLength(env, payment_key) == 32);
27567 (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes);
27568 LDKSecretKey delayed_payment_base_key_ref;
27569 CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32);
27570 (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes);
27571 LDKSecretKey htlc_base_key_ref;
27572 CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32);
27573 (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes);
27574 LDKThirtyTwoBytes commitment_seed_ref;
27575 CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
27576 (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data);
27577 LDKThirtyTwoBytes channel_keys_id_ref;
27578 CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32);
27579 (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data);
27580 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);
27581 int64_t ret_ref = 0;
27582 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27583 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
27588 LDKInMemorySigner this_arg_conv;
27589 this_arg_conv.inner = untag_ptr(this_arg);
27590 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27591 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27592 this_arg_conv.is_owned = false;
27593 LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
27594 int64_t ret_ref = 0;
27595 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27596 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27600 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
27601 LDKInMemorySigner this_arg_conv;
27602 this_arg_conv.inner = untag_ptr(this_arg);
27603 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27604 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27605 this_arg_conv.is_owned = false;
27606 int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
27610 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
27611 LDKInMemorySigner this_arg_conv;
27612 this_arg_conv.inner = untag_ptr(this_arg);
27613 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27614 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27615 this_arg_conv.is_owned = false;
27616 int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
27620 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) {
27621 LDKInMemorySigner this_arg_conv;
27622 this_arg_conv.inner = untag_ptr(this_arg);
27623 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27625 this_arg_conv.is_owned = false;
27626 jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv);
27630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) {
27631 LDKInMemorySigner this_arg_conv;
27632 this_arg_conv.inner = untag_ptr(this_arg);
27633 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27635 this_arg_conv.is_owned = false;
27636 LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
27637 int64_t ret_ref = 0;
27638 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27639 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27643 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) {
27644 LDKInMemorySigner this_arg_conv;
27645 this_arg_conv.inner = untag_ptr(this_arg);
27646 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27648 this_arg_conv.is_owned = false;
27649 LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
27650 int64_t ret_ref = 0;
27651 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27652 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27656 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
27657 LDKInMemorySigner this_arg_conv;
27658 this_arg_conv.inner = untag_ptr(this_arg);
27659 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27661 this_arg_conv.is_owned = false;
27662 jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv);
27666 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) {
27667 LDKInMemorySigner this_arg_conv;
27668 this_arg_conv.inner = untag_ptr(this_arg);
27669 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27670 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27671 this_arg_conv.is_owned = false;
27672 LDKTransaction spend_tx_ref;
27673 spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
27674 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
27675 (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data);
27676 spend_tx_ref.data_is_owned = true;
27677 LDKStaticPaymentOutputDescriptor descriptor_conv;
27678 descriptor_conv.inner = untag_ptr(descriptor);
27679 descriptor_conv.is_owned = ptr_is_owned(descriptor);
27680 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
27681 descriptor_conv.is_owned = false;
27682 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
27683 *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
27684 return tag_ptr(ret_conv, true);
27687 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) {
27688 LDKInMemorySigner this_arg_conv;
27689 this_arg_conv.inner = untag_ptr(this_arg);
27690 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27692 this_arg_conv.is_owned = false;
27693 LDKTransaction spend_tx_ref;
27694 spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
27695 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
27696 (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data);
27697 spend_tx_ref.data_is_owned = true;
27698 LDKDelayedPaymentOutputDescriptor descriptor_conv;
27699 descriptor_conv.inner = untag_ptr(descriptor);
27700 descriptor_conv.is_owned = ptr_is_owned(descriptor);
27701 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
27702 descriptor_conv.is_owned = false;
27703 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
27704 *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
27705 return tag_ptr(ret_conv, true);
27708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1BaseSign(JNIEnv *env, jclass clz, int64_t this_arg) {
27709 LDKInMemorySigner this_arg_conv;
27710 this_arg_conv.inner = untag_ptr(this_arg);
27711 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27712 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27713 this_arg_conv.is_owned = false;
27714 LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
27715 *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
27716 return tag_ptr(ret_ret, true);
27719 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JNIEnv *env, jclass clz, int64_t this_arg) {
27720 LDKInMemorySigner this_arg_conv;
27721 this_arg_conv.inner = untag_ptr(this_arg);
27722 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27724 this_arg_conv.is_owned = false;
27725 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
27726 *ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
27727 return tag_ptr(ret_ret, true);
27730 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) {
27731 LDKInMemorySigner obj_conv;
27732 obj_conv.inner = untag_ptr(obj);
27733 obj_conv.is_owned = ptr_is_owned(obj);
27734 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
27735 obj_conv.is_owned = false;
27736 LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
27737 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27738 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27739 CVec_u8Z_free(ret_var);
27743 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int8_tArray arg) {
27744 LDKu8slice ser_ref;
27745 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
27746 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
27747 LDKSecretKey arg_ref;
27748 CHECK((*env)->GetArrayLength(env, arg) == 32);
27749 (*env)->GetByteArrayRegion(env, arg, 0, 32, arg_ref.bytes);
27750 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
27751 *ret_conv = InMemorySigner_read(ser_ref, arg_ref);
27752 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
27753 return tag_ptr(ret_conv, true);
27756 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27757 LDKKeysManager this_obj_conv;
27758 this_obj_conv.inner = untag_ptr(this_obj);
27759 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27760 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27761 KeysManager_free(this_obj_conv);
27764 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) {
27765 unsigned char seed_arr[32];
27766 CHECK((*env)->GetArrayLength(env, seed) == 32);
27767 (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
27768 unsigned char (*seed_ref)[32] = &seed_arr;
27769 LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
27770 int64_t ret_ref = 0;
27771 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27772 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27776 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) {
27777 LDKKeysManager this_arg_conv;
27778 this_arg_conv.inner = untag_ptr(this_arg);
27779 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27781 this_arg_conv.is_owned = false;
27782 unsigned char params_arr[32];
27783 CHECK((*env)->GetArrayLength(env, params) == 32);
27784 (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
27785 unsigned char (*params_ref)[32] = ¶ms_arr;
27786 LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
27787 int64_t ret_ref = 0;
27788 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27789 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27793 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) {
27794 LDKKeysManager this_arg_conv;
27795 this_arg_conv.inner = untag_ptr(this_arg);
27796 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27798 this_arg_conv.is_owned = false;
27799 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
27800 descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors);
27801 if (descriptors_constr.datalen > 0)
27802 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
27804 descriptors_constr.data = NULL;
27805 int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
27806 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
27807 int64_t descriptors_conv_27 = descriptors_vals[b];
27808 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
27809 CHECK_ACCESS(descriptors_conv_27_ptr);
27810 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
27811 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
27812 descriptors_constr.data[b] = descriptors_conv_27_conv;
27814 (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0);
27815 LDKCVec_TxOutZ outputs_constr;
27816 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
27817 if (outputs_constr.datalen > 0)
27818 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
27820 outputs_constr.data = NULL;
27821 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
27822 for (size_t h = 0; h < outputs_constr.datalen; h++) {
27823 int64_t outputs_conv_7 = outputs_vals[h];
27824 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
27825 CHECK_ACCESS(outputs_conv_7_ptr);
27826 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
27827 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
27828 outputs_constr.data[h] = outputs_conv_7_conv;
27830 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
27831 LDKCVec_u8Z change_destination_script_ref;
27832 change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script);
27833 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
27834 (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data);
27835 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
27836 *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
27837 return tag_ptr(ret_conv, true);
27840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) {
27841 LDKKeysManager this_arg_conv;
27842 this_arg_conv.inner = untag_ptr(this_arg);
27843 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27845 this_arg_conv.is_owned = false;
27846 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
27847 *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
27848 return tag_ptr(ret_ret, true);
27851 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27852 LDKPhantomKeysManager this_obj_conv;
27853 this_obj_conv.inner = untag_ptr(this_obj);
27854 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27856 PhantomKeysManager_free(this_obj_conv);
27859 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) {
27860 LDKPhantomKeysManager this_arg_conv;
27861 this_arg_conv.inner = untag_ptr(this_arg);
27862 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27863 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27864 this_arg_conv.is_owned = false;
27865 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
27866 *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv);
27867 return tag_ptr(ret_ret, true);
27870 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) {
27871 unsigned char seed_arr[32];
27872 CHECK((*env)->GetArrayLength(env, seed) == 32);
27873 (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
27874 unsigned char (*seed_ref)[32] = &seed_arr;
27875 unsigned char cross_node_seed_arr[32];
27876 CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32);
27877 (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr);
27878 unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
27879 LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref);
27880 int64_t ret_ref = 0;
27881 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27882 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27886 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) {
27887 LDKPhantomKeysManager this_arg_conv;
27888 this_arg_conv.inner = untag_ptr(this_arg);
27889 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27891 this_arg_conv.is_owned = false;
27892 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
27893 descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors);
27894 if (descriptors_constr.datalen > 0)
27895 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
27897 descriptors_constr.data = NULL;
27898 int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
27899 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
27900 int64_t descriptors_conv_27 = descriptors_vals[b];
27901 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
27902 CHECK_ACCESS(descriptors_conv_27_ptr);
27903 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
27904 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
27905 descriptors_constr.data[b] = descriptors_conv_27_conv;
27907 (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0);
27908 LDKCVec_TxOutZ outputs_constr;
27909 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
27910 if (outputs_constr.datalen > 0)
27911 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
27913 outputs_constr.data = NULL;
27914 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
27915 for (size_t h = 0; h < outputs_constr.datalen; h++) {
27916 int64_t outputs_conv_7 = outputs_vals[h];
27917 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
27918 CHECK_ACCESS(outputs_conv_7_ptr);
27919 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
27920 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
27921 outputs_constr.data[h] = outputs_conv_7_conv;
27923 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
27924 LDKCVec_u8Z change_destination_script_ref;
27925 change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script);
27926 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
27927 (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data);
27928 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
27929 *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
27930 return tag_ptr(ret_conv, true);
27933 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) {
27934 LDKPhantomKeysManager this_arg_conv;
27935 this_arg_conv.inner = untag_ptr(this_arg);
27936 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27938 this_arg_conv.is_owned = false;
27939 unsigned char params_arr[32];
27940 CHECK((*env)->GetArrayLength(env, params) == 32);
27941 (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
27942 unsigned char (*params_ref)[32] = ¶ms_arr;
27943 LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
27944 int64_t ret_ref = 0;
27945 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27946 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27950 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27951 LDKChannelManager this_obj_conv;
27952 this_obj_conv.inner = untag_ptr(this_obj);
27953 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27955 ChannelManager_free(this_obj_conv);
27958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27959 LDKChainParameters this_obj_conv;
27960 this_obj_conv.inner = untag_ptr(this_obj);
27961 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27963 ChainParameters_free(this_obj_conv);
27966 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1network(JNIEnv *env, jclass clz, int64_t this_ptr) {
27967 LDKChainParameters this_ptr_conv;
27968 this_ptr_conv.inner = untag_ptr(this_ptr);
27969 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27971 this_ptr_conv.is_owned = false;
27972 jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv));
27976 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
27977 LDKChainParameters this_ptr_conv;
27978 this_ptr_conv.inner = untag_ptr(this_ptr);
27979 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27980 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27981 this_ptr_conv.is_owned = false;
27982 LDKNetwork val_conv = LDKNetwork_from_java(env, val);
27983 ChainParameters_set_network(&this_ptr_conv, val_conv);
27986 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr) {
27987 LDKChainParameters this_ptr_conv;
27988 this_ptr_conv.inner = untag_ptr(this_ptr);
27989 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27990 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27991 this_ptr_conv.is_owned = false;
27992 LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv);
27993 int64_t ret_ref = 0;
27994 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27995 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28000 LDKChainParameters this_ptr_conv;
28001 this_ptr_conv.inner = untag_ptr(this_ptr);
28002 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28004 this_ptr_conv.is_owned = false;
28005 LDKBestBlock val_conv;
28006 val_conv.inner = untag_ptr(val);
28007 val_conv.is_owned = ptr_is_owned(val);
28008 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28009 val_conv = BestBlock_clone(&val_conv);
28010 ChainParameters_set_best_block(&this_ptr_conv, val_conv);
28013 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv *env, jclass clz, jclass network_arg, int64_t best_block_arg) {
28014 LDKNetwork network_arg_conv = LDKNetwork_from_java(env, network_arg);
28015 LDKBestBlock best_block_arg_conv;
28016 best_block_arg_conv.inner = untag_ptr(best_block_arg);
28017 best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg);
28018 CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv);
28019 best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
28020 LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv);
28021 int64_t ret_ref = 0;
28022 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28023 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28027 static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) {
28028 LDKChainParameters ret_var = ChainParameters_clone(arg);
28029 int64_t ret_ref = 0;
28030 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28031 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28035 LDKChainParameters arg_conv;
28036 arg_conv.inner = untag_ptr(arg);
28037 arg_conv.is_owned = ptr_is_owned(arg);
28038 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28039 arg_conv.is_owned = false;
28040 int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv);
28044 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28045 LDKChainParameters orig_conv;
28046 orig_conv.inner = untag_ptr(orig);
28047 orig_conv.is_owned = ptr_is_owned(orig);
28048 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28049 orig_conv.is_owned = false;
28050 LDKChainParameters ret_var = ChainParameters_clone(&orig_conv);
28051 int64_t ret_ref = 0;
28052 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28053 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28057 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28058 LDKCounterpartyForwardingInfo this_obj_conv;
28059 this_obj_conv.inner = untag_ptr(this_obj);
28060 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28061 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28062 CounterpartyForwardingInfo_free(this_obj_conv);
28065 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28066 LDKCounterpartyForwardingInfo this_ptr_conv;
28067 this_ptr_conv.inner = untag_ptr(this_ptr);
28068 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28070 this_ptr_conv.is_owned = false;
28071 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv);
28075 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
28076 LDKCounterpartyForwardingInfo this_ptr_conv;
28077 this_ptr_conv.inner = untag_ptr(this_ptr);
28078 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28080 this_ptr_conv.is_owned = false;
28081 CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val);
28084 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
28085 LDKCounterpartyForwardingInfo this_ptr_conv;
28086 this_ptr_conv.inner = untag_ptr(this_ptr);
28087 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28088 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28089 this_ptr_conv.is_owned = false;
28090 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv);
28094 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
28095 LDKCounterpartyForwardingInfo this_ptr_conv;
28096 this_ptr_conv.inner = untag_ptr(this_ptr);
28097 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28098 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28099 this_ptr_conv.is_owned = false;
28100 CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
28103 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
28104 LDKCounterpartyForwardingInfo this_ptr_conv;
28105 this_ptr_conv.inner = untag_ptr(this_ptr);
28106 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28108 this_ptr_conv.is_owned = false;
28109 int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv);
28113 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
28114 LDKCounterpartyForwardingInfo this_ptr_conv;
28115 this_ptr_conv.inner = untag_ptr(this_ptr);
28116 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28118 this_ptr_conv.is_owned = false;
28119 CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
28122 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) {
28123 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
28124 int64_t ret_ref = 0;
28125 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28126 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28130 static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) {
28131 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg);
28132 int64_t ret_ref = 0;
28133 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28134 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28138 LDKCounterpartyForwardingInfo arg_conv;
28139 arg_conv.inner = untag_ptr(arg);
28140 arg_conv.is_owned = ptr_is_owned(arg);
28141 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28142 arg_conv.is_owned = false;
28143 int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv);
28147 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28148 LDKCounterpartyForwardingInfo orig_conv;
28149 orig_conv.inner = untag_ptr(orig);
28150 orig_conv.is_owned = ptr_is_owned(orig);
28151 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28152 orig_conv.is_owned = false;
28153 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv);
28154 int64_t ret_ref = 0;
28155 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28156 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28160 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28161 LDKChannelCounterparty this_obj_conv;
28162 this_obj_conv.inner = untag_ptr(this_obj);
28163 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28164 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28165 ChannelCounterparty_free(this_obj_conv);
28168 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
28169 LDKChannelCounterparty this_ptr_conv;
28170 this_ptr_conv.inner = untag_ptr(this_ptr);
28171 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28172 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28173 this_ptr_conv.is_owned = false;
28174 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
28175 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form);
28179 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
28180 LDKChannelCounterparty this_ptr_conv;
28181 this_ptr_conv.inner = untag_ptr(this_ptr);
28182 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28183 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28184 this_ptr_conv.is_owned = false;
28185 LDKPublicKey val_ref;
28186 CHECK((*env)->GetArrayLength(env, val) == 33);
28187 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
28188 ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref);
28191 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
28192 LDKChannelCounterparty this_ptr_conv;
28193 this_ptr_conv.inner = untag_ptr(this_ptr);
28194 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28196 this_ptr_conv.is_owned = false;
28197 LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_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 void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28205 LDKChannelCounterparty this_ptr_conv;
28206 this_ptr_conv.inner = untag_ptr(this_ptr);
28207 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28208 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28209 this_ptr_conv.is_owned = false;
28210 LDKInitFeatures val_conv;
28211 val_conv.inner = untag_ptr(val);
28212 val_conv.is_owned = ptr_is_owned(val);
28213 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28214 val_conv = InitFeatures_clone(&val_conv);
28215 ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
28218 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) {
28219 LDKChannelCounterparty this_ptr_conv;
28220 this_ptr_conv.inner = untag_ptr(this_ptr);
28221 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28223 this_ptr_conv.is_owned = false;
28224 int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
28228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28229 LDKChannelCounterparty this_ptr_conv;
28230 this_ptr_conv.inner = untag_ptr(this_ptr);
28231 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28232 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28233 this_ptr_conv.is_owned = false;
28234 ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
28237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr) {
28238 LDKChannelCounterparty this_ptr_conv;
28239 this_ptr_conv.inner = untag_ptr(this_ptr);
28240 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28242 this_ptr_conv.is_owned = false;
28243 LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
28244 int64_t ret_ref = 0;
28245 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28246 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28250 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28251 LDKChannelCounterparty this_ptr_conv;
28252 this_ptr_conv.inner = untag_ptr(this_ptr);
28253 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28255 this_ptr_conv.is_owned = false;
28256 LDKCounterpartyForwardingInfo val_conv;
28257 val_conv.inner = untag_ptr(val);
28258 val_conv.is_owned = ptr_is_owned(val);
28259 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28260 val_conv = CounterpartyForwardingInfo_clone(&val_conv);
28261 ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv);
28264 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28265 LDKChannelCounterparty this_ptr_conv;
28266 this_ptr_conv.inner = untag_ptr(this_ptr);
28267 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28269 this_ptr_conv.is_owned = false;
28270 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28271 *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv);
28272 int64_t ret_ref = tag_ptr(ret_copy, true);
28276 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) {
28277 LDKChannelCounterparty this_ptr_conv;
28278 this_ptr_conv.inner = untag_ptr(this_ptr);
28279 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28280 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28281 this_ptr_conv.is_owned = false;
28282 void* val_ptr = untag_ptr(val);
28283 CHECK_ACCESS(val_ptr);
28284 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28285 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28286 ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
28289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28290 LDKChannelCounterparty this_ptr_conv;
28291 this_ptr_conv.inner = untag_ptr(this_ptr);
28292 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28293 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28294 this_ptr_conv.is_owned = false;
28295 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28296 *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv);
28297 int64_t ret_ref = tag_ptr(ret_copy, true);
28301 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) {
28302 LDKChannelCounterparty this_ptr_conv;
28303 this_ptr_conv.inner = untag_ptr(this_ptr);
28304 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28306 this_ptr_conv.is_owned = false;
28307 void* val_ptr = untag_ptr(val);
28308 CHECK_ACCESS(val_ptr);
28309 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28310 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28311 ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
28314 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) {
28315 LDKPublicKey node_id_arg_ref;
28316 CHECK((*env)->GetArrayLength(env, node_id_arg) == 33);
28317 (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form);
28318 LDKInitFeatures features_arg_conv;
28319 features_arg_conv.inner = untag_ptr(features_arg);
28320 features_arg_conv.is_owned = ptr_is_owned(features_arg);
28321 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
28322 features_arg_conv = InitFeatures_clone(&features_arg_conv);
28323 LDKCounterpartyForwardingInfo forwarding_info_arg_conv;
28324 forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg);
28325 forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg);
28326 CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv);
28327 forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
28328 void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg);
28329 CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr);
28330 LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr);
28331 outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg));
28332 void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg);
28333 CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr);
28334 LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr);
28335 outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg));
28336 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);
28337 int64_t ret_ref = 0;
28338 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28339 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28343 static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) {
28344 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg);
28345 int64_t ret_ref = 0;
28346 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28347 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28351 LDKChannelCounterparty arg_conv;
28352 arg_conv.inner = untag_ptr(arg);
28353 arg_conv.is_owned = ptr_is_owned(arg);
28354 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28355 arg_conv.is_owned = false;
28356 int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv);
28360 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28361 LDKChannelCounterparty orig_conv;
28362 orig_conv.inner = untag_ptr(orig);
28363 orig_conv.is_owned = ptr_is_owned(orig);
28364 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28365 orig_conv.is_owned = false;
28366 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv);
28367 int64_t ret_ref = 0;
28368 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28369 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28373 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28374 LDKChannelDetails this_obj_conv;
28375 this_obj_conv.inner = untag_ptr(this_obj);
28376 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28378 ChannelDetails_free(this_obj_conv);
28381 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
28382 LDKChannelDetails this_ptr_conv;
28383 this_ptr_conv.inner = untag_ptr(this_ptr);
28384 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28386 this_ptr_conv.is_owned = false;
28387 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
28388 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv));
28392 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
28393 LDKChannelDetails this_ptr_conv;
28394 this_ptr_conv.inner = untag_ptr(this_ptr);
28395 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28396 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28397 this_ptr_conv.is_owned = false;
28398 LDKThirtyTwoBytes val_ref;
28399 CHECK((*env)->GetArrayLength(env, val) == 32);
28400 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
28401 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref);
28404 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr) {
28405 LDKChannelDetails this_ptr_conv;
28406 this_ptr_conv.inner = untag_ptr(this_ptr);
28407 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28408 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28409 this_ptr_conv.is_owned = false;
28410 LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
28411 int64_t ret_ref = 0;
28412 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28413 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28418 LDKChannelDetails this_ptr_conv;
28419 this_ptr_conv.inner = untag_ptr(this_ptr);
28420 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28422 this_ptr_conv.is_owned = false;
28423 LDKChannelCounterparty val_conv;
28424 val_conv.inner = untag_ptr(val);
28425 val_conv.is_owned = ptr_is_owned(val);
28426 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28427 val_conv = ChannelCounterparty_clone(&val_conv);
28428 ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
28431 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr) {
28432 LDKChannelDetails this_ptr_conv;
28433 this_ptr_conv.inner = untag_ptr(this_ptr);
28434 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28436 this_ptr_conv.is_owned = false;
28437 LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
28438 int64_t ret_ref = 0;
28439 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28440 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28444 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28445 LDKChannelDetails this_ptr_conv;
28446 this_ptr_conv.inner = untag_ptr(this_ptr);
28447 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28449 this_ptr_conv.is_owned = false;
28450 LDKOutPoint val_conv;
28451 val_conv.inner = untag_ptr(val);
28452 val_conv.is_owned = ptr_is_owned(val);
28453 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28454 val_conv = OutPoint_clone(&val_conv);
28455 ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv);
28458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
28459 LDKChannelDetails this_ptr_conv;
28460 this_ptr_conv.inner = untag_ptr(this_ptr);
28461 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28463 this_ptr_conv.is_owned = false;
28464 LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv);
28465 int64_t ret_ref = 0;
28466 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28467 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28472 LDKChannelDetails this_ptr_conv;
28473 this_ptr_conv.inner = untag_ptr(this_ptr);
28474 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28476 this_ptr_conv.is_owned = false;
28477 LDKChannelTypeFeatures val_conv;
28478 val_conv.inner = untag_ptr(val);
28479 val_conv.is_owned = ptr_is_owned(val);
28480 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28481 val_conv = ChannelTypeFeatures_clone(&val_conv);
28482 ChannelDetails_set_channel_type(&this_ptr_conv, val_conv);
28485 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
28486 LDKChannelDetails this_ptr_conv;
28487 this_ptr_conv.inner = untag_ptr(this_ptr);
28488 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28489 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28490 this_ptr_conv.is_owned = false;
28491 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28492 *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv);
28493 int64_t ret_ref = tag_ptr(ret_copy, true);
28497 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28498 LDKChannelDetails this_ptr_conv;
28499 this_ptr_conv.inner = untag_ptr(this_ptr);
28500 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28501 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28502 this_ptr_conv.is_owned = false;
28503 void* val_ptr = untag_ptr(val);
28504 CHECK_ACCESS(val_ptr);
28505 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28506 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28507 ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
28510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
28511 LDKChannelDetails this_ptr_conv;
28512 this_ptr_conv.inner = untag_ptr(this_ptr);
28513 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28514 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28515 this_ptr_conv.is_owned = false;
28516 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28517 *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv);
28518 int64_t ret_ref = tag_ptr(ret_copy, true);
28522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28523 LDKChannelDetails this_ptr_conv;
28524 this_ptr_conv.inner = untag_ptr(this_ptr);
28525 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28526 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28527 this_ptr_conv.is_owned = false;
28528 void* val_ptr = untag_ptr(val);
28529 CHECK_ACCESS(val_ptr);
28530 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28531 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28532 ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv);
28535 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
28536 LDKChannelDetails this_ptr_conv;
28537 this_ptr_conv.inner = untag_ptr(this_ptr);
28538 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28540 this_ptr_conv.is_owned = false;
28541 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28542 *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv);
28543 int64_t ret_ref = tag_ptr(ret_copy, true);
28547 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28548 LDKChannelDetails this_ptr_conv;
28549 this_ptr_conv.inner = untag_ptr(this_ptr);
28550 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28552 this_ptr_conv.is_owned = false;
28553 void* val_ptr = untag_ptr(val);
28554 CHECK_ACCESS(val_ptr);
28555 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28556 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28557 ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv);
28560 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
28561 LDKChannelDetails this_ptr_conv;
28562 this_ptr_conv.inner = untag_ptr(this_ptr);
28563 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28564 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28565 this_ptr_conv.is_owned = false;
28566 int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
28570 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28571 LDKChannelDetails this_ptr_conv;
28572 this_ptr_conv.inner = untag_ptr(this_ptr);
28573 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28574 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28575 this_ptr_conv.is_owned = false;
28576 ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
28579 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) {
28580 LDKChannelDetails this_ptr_conv;
28581 this_ptr_conv.inner = untag_ptr(this_ptr);
28582 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28584 this_ptr_conv.is_owned = false;
28585 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28586 *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv);
28587 int64_t ret_ref = tag_ptr(ret_copy, true);
28591 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28592 LDKChannelDetails this_ptr_conv;
28593 this_ptr_conv.inner = untag_ptr(this_ptr);
28594 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28595 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28596 this_ptr_conv.is_owned = false;
28597 void* val_ptr = untag_ptr(val);
28598 CHECK_ACCESS(val_ptr);
28599 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28600 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28601 ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
28604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
28605 LDKChannelDetails this_ptr_conv;
28606 this_ptr_conv.inner = untag_ptr(this_ptr);
28607 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28608 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28609 this_ptr_conv.is_owned = false;
28610 int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv);
28614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28615 LDKChannelDetails this_ptr_conv;
28616 this_ptr_conv.inner = untag_ptr(this_ptr);
28617 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28618 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28619 this_ptr_conv.is_owned = false;
28620 ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
28623 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28624 LDKChannelDetails this_ptr_conv;
28625 this_ptr_conv.inner = untag_ptr(this_ptr);
28626 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28627 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28628 this_ptr_conv.is_owned = false;
28629 int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv);
28633 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28634 LDKChannelDetails this_ptr_conv;
28635 this_ptr_conv.inner = untag_ptr(this_ptr);
28636 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28638 this_ptr_conv.is_owned = false;
28639 ChannelDetails_set_balance_msat(&this_ptr_conv, val);
28642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28643 LDKChannelDetails this_ptr_conv;
28644 this_ptr_conv.inner = untag_ptr(this_ptr);
28645 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28646 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28647 this_ptr_conv.is_owned = false;
28648 int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
28652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28653 LDKChannelDetails this_ptr_conv;
28654 this_ptr_conv.inner = untag_ptr(this_ptr);
28655 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28657 this_ptr_conv.is_owned = false;
28658 ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
28661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1next_1outbound_1htlc_1limit_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28662 LDKChannelDetails this_ptr_conv;
28663 this_ptr_conv.inner = untag_ptr(this_ptr);
28664 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28666 this_ptr_conv.is_owned = false;
28667 int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv);
28671 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) {
28672 LDKChannelDetails this_ptr_conv;
28673 this_ptr_conv.inner = untag_ptr(this_ptr);
28674 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28676 this_ptr_conv.is_owned = false;
28677 ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val);
28680 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28681 LDKChannelDetails this_ptr_conv;
28682 this_ptr_conv.inner = untag_ptr(this_ptr);
28683 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28685 this_ptr_conv.is_owned = false;
28686 int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
28690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28691 LDKChannelDetails this_ptr_conv;
28692 this_ptr_conv.inner = untag_ptr(this_ptr);
28693 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28695 this_ptr_conv.is_owned = false;
28696 ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
28699 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr) {
28700 LDKChannelDetails this_ptr_conv;
28701 this_ptr_conv.inner = untag_ptr(this_ptr);
28702 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28704 this_ptr_conv.is_owned = false;
28705 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
28706 *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv);
28707 int64_t ret_ref = tag_ptr(ret_copy, true);
28711 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28712 LDKChannelDetails this_ptr_conv;
28713 this_ptr_conv.inner = untag_ptr(this_ptr);
28714 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28716 this_ptr_conv.is_owned = false;
28717 void* val_ptr = untag_ptr(val);
28718 CHECK_ACCESS(val_ptr);
28719 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
28720 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
28721 ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
28724 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
28725 LDKChannelDetails this_ptr_conv;
28726 this_ptr_conv.inner = untag_ptr(this_ptr);
28727 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28729 this_ptr_conv.is_owned = false;
28730 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
28731 *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv);
28732 int64_t ret_ref = tag_ptr(ret_copy, true);
28736 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) {
28737 LDKChannelDetails this_ptr_conv;
28738 this_ptr_conv.inner = untag_ptr(this_ptr);
28739 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28741 this_ptr_conv.is_owned = false;
28742 void* val_ptr = untag_ptr(val);
28743 CHECK_ACCESS(val_ptr);
28744 LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
28745 val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val));
28746 ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
28749 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr) {
28750 LDKChannelDetails this_ptr_conv;
28751 this_ptr_conv.inner = untag_ptr(this_ptr);
28752 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28754 this_ptr_conv.is_owned = false;
28755 jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv);
28759 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28760 LDKChannelDetails this_ptr_conv;
28761 this_ptr_conv.inner = untag_ptr(this_ptr);
28762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28764 this_ptr_conv.is_owned = false;
28765 ChannelDetails_set_is_outbound(&this_ptr_conv, val);
28768 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr) {
28769 LDKChannelDetails this_ptr_conv;
28770 this_ptr_conv.inner = untag_ptr(this_ptr);
28771 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28773 this_ptr_conv.is_owned = false;
28774 jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv);
28778 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28779 LDKChannelDetails this_ptr_conv;
28780 this_ptr_conv.inner = untag_ptr(this_ptr);
28781 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28782 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28783 this_ptr_conv.is_owned = false;
28784 ChannelDetails_set_is_channel_ready(&this_ptr_conv, val);
28787 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr) {
28788 LDKChannelDetails this_ptr_conv;
28789 this_ptr_conv.inner = untag_ptr(this_ptr);
28790 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28791 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28792 this_ptr_conv.is_owned = false;
28793 jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv);
28797 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28798 LDKChannelDetails this_ptr_conv;
28799 this_ptr_conv.inner = untag_ptr(this_ptr);
28800 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28802 this_ptr_conv.is_owned = false;
28803 ChannelDetails_set_is_usable(&this_ptr_conv, val);
28806 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr) {
28807 LDKChannelDetails this_ptr_conv;
28808 this_ptr_conv.inner = untag_ptr(this_ptr);
28809 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28810 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28811 this_ptr_conv.is_owned = false;
28812 jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv);
28816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28817 LDKChannelDetails this_ptr_conv;
28818 this_ptr_conv.inner = untag_ptr(this_ptr);
28819 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28820 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28821 this_ptr_conv.is_owned = false;
28822 ChannelDetails_set_is_public(&this_ptr_conv, val);
28825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28826 LDKChannelDetails this_ptr_conv;
28827 this_ptr_conv.inner = untag_ptr(this_ptr);
28828 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28829 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28830 this_ptr_conv.is_owned = false;
28831 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28832 *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv);
28833 int64_t ret_ref = tag_ptr(ret_copy, true);
28837 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) {
28838 LDKChannelDetails this_ptr_conv;
28839 this_ptr_conv.inner = untag_ptr(this_ptr);
28840 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28841 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28842 this_ptr_conv.is_owned = false;
28843 void* val_ptr = untag_ptr(val);
28844 CHECK_ACCESS(val_ptr);
28845 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28846 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28847 ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
28850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28851 LDKChannelDetails this_ptr_conv;
28852 this_ptr_conv.inner = untag_ptr(this_ptr);
28853 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28854 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28855 this_ptr_conv.is_owned = false;
28856 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28857 *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv);
28858 int64_t ret_ref = tag_ptr(ret_copy, true);
28862 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) {
28863 LDKChannelDetails this_ptr_conv;
28864 this_ptr_conv.inner = untag_ptr(this_ptr);
28865 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28867 this_ptr_conv.is_owned = false;
28868 void* val_ptr = untag_ptr(val);
28869 CHECK_ACCESS(val_ptr);
28870 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28871 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28872 ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
28875 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
28876 LDKChannelDetails this_ptr_conv;
28877 this_ptr_conv.inner = untag_ptr(this_ptr);
28878 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28880 this_ptr_conv.is_owned = false;
28881 LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv);
28882 int64_t ret_ref = 0;
28883 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28884 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28889 LDKChannelDetails this_ptr_conv;
28890 this_ptr_conv.inner = untag_ptr(this_ptr);
28891 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28893 this_ptr_conv.is_owned = false;
28894 LDKChannelConfig val_conv;
28895 val_conv.inner = untag_ptr(val);
28896 val_conv.is_owned = ptr_is_owned(val);
28897 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28898 val_conv = ChannelConfig_clone(&val_conv);
28899 ChannelDetails_set_config(&this_ptr_conv, val_conv);
28902 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) {
28903 LDKThirtyTwoBytes channel_id_arg_ref;
28904 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
28905 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
28906 LDKChannelCounterparty counterparty_arg_conv;
28907 counterparty_arg_conv.inner = untag_ptr(counterparty_arg);
28908 counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg);
28909 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv);
28910 counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
28911 LDKOutPoint funding_txo_arg_conv;
28912 funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg);
28913 funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg);
28914 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv);
28915 funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
28916 LDKChannelTypeFeatures channel_type_arg_conv;
28917 channel_type_arg_conv.inner = untag_ptr(channel_type_arg);
28918 channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg);
28919 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv);
28920 channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv);
28921 void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg);
28922 CHECK_ACCESS(short_channel_id_arg_ptr);
28923 LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
28924 short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg));
28925 void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg);
28926 CHECK_ACCESS(outbound_scid_alias_arg_ptr);
28927 LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr);
28928 outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg));
28929 void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg);
28930 CHECK_ACCESS(inbound_scid_alias_arg_ptr);
28931 LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr);
28932 inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg));
28933 void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg);
28934 CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
28935 LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
28936 void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg);
28937 CHECK_ACCESS(confirmations_required_arg_ptr);
28938 LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
28939 confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg));
28940 void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg);
28941 CHECK_ACCESS(force_close_spend_delay_arg_ptr);
28942 LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
28943 force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg));
28944 void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg);
28945 CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr);
28946 LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr);
28947 inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg));
28948 void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg);
28949 CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr);
28950 LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr);
28951 inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg));
28952 LDKChannelConfig config_arg_conv;
28953 config_arg_conv.inner = untag_ptr(config_arg);
28954 config_arg_conv.is_owned = ptr_is_owned(config_arg);
28955 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv);
28956 config_arg_conv = ChannelConfig_clone(&config_arg_conv);
28957 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);
28958 int64_t ret_ref = 0;
28959 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28960 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28964 static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) {
28965 LDKChannelDetails ret_var = ChannelDetails_clone(arg);
28966 int64_t ret_ref = 0;
28967 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28968 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28972 LDKChannelDetails arg_conv;
28973 arg_conv.inner = untag_ptr(arg);
28974 arg_conv.is_owned = ptr_is_owned(arg);
28975 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28976 arg_conv.is_owned = false;
28977 int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv);
28981 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28982 LDKChannelDetails orig_conv;
28983 orig_conv.inner = untag_ptr(orig);
28984 orig_conv.is_owned = ptr_is_owned(orig);
28985 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28986 orig_conv.is_owned = false;
28987 LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
28988 int64_t ret_ref = 0;
28989 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28990 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28994 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
28995 LDKChannelDetails this_arg_conv;
28996 this_arg_conv.inner = untag_ptr(this_arg);
28997 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28999 this_arg_conv.is_owned = false;
29000 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
29001 *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv);
29002 int64_t ret_ref = tag_ptr(ret_copy, true);
29006 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
29007 LDKChannelDetails this_arg_conv;
29008 this_arg_conv.inner = untag_ptr(this_arg);
29009 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29010 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29011 this_arg_conv.is_owned = false;
29012 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
29013 *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv);
29014 int64_t ret_ref = tag_ptr(ret_copy, true);
29018 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29019 if (!ptr_is_owned(this_ptr)) return;
29020 void* this_ptr_ptr = untag_ptr(this_ptr);
29021 CHECK_ACCESS(this_ptr_ptr);
29022 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
29023 FREE(untag_ptr(this_ptr));
29024 PaymentSendFailure_free(this_ptr_conv);
29027 static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
29028 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
29029 *ret_copy = PaymentSendFailure_clone(arg);
29030 int64_t ret_ref = tag_ptr(ret_copy, true);
29033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29034 LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
29035 int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
29039 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29040 LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
29041 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
29042 *ret_copy = PaymentSendFailure_clone(orig_conv);
29043 int64_t ret_ref = tag_ptr(ret_copy, true);
29047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) {
29048 void* a_ptr = untag_ptr(a);
29049 CHECK_ACCESS(a_ptr);
29050 LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
29051 a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
29052 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
29053 *ret_copy = PaymentSendFailure_parameter_error(a_conv);
29054 int64_t ret_ref = tag_ptr(ret_copy, true);
29058 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) {
29059 LDKCVec_CResult_NoneAPIErrorZZ a_constr;
29060 a_constr.datalen = (*env)->GetArrayLength(env, a);
29061 if (a_constr.datalen > 0)
29062 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
29064 a_constr.data = NULL;
29065 int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
29066 for (size_t w = 0; w < a_constr.datalen; w++) {
29067 int64_t a_conv_22 = a_vals[w];
29068 void* a_conv_22_ptr = untag_ptr(a_conv_22);
29069 CHECK_ACCESS(a_conv_22_ptr);
29070 LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
29071 a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
29072 a_constr.data[w] = a_conv_22_conv;
29074 (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
29075 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
29076 *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
29077 int64_t ret_ref = tag_ptr(ret_copy, true);
29081 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_1safe(JNIEnv *env, jclass clz, int64_tArray a) {
29082 LDKCVec_APIErrorZ a_constr;
29083 a_constr.datalen = (*env)->GetArrayLength(env, a);
29084 if (a_constr.datalen > 0)
29085 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
29087 a_constr.data = NULL;
29088 int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
29089 for (size_t k = 0; k < a_constr.datalen; k++) {
29090 int64_t a_conv_10 = a_vals[k];
29091 void* a_conv_10_ptr = untag_ptr(a_conv_10);
29092 CHECK_ACCESS(a_conv_10_ptr);
29093 LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
29094 a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
29095 a_constr.data[k] = a_conv_10_conv;
29097 (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
29098 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
29099 *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
29100 int64_t ret_ref = tag_ptr(ret_copy, true);
29104 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) {
29105 LDKCVec_CResult_NoneAPIErrorZZ results_constr;
29106 results_constr.datalen = (*env)->GetArrayLength(env, results);
29107 if (results_constr.datalen > 0)
29108 results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
29110 results_constr.data = NULL;
29111 int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL);
29112 for (size_t w = 0; w < results_constr.datalen; w++) {
29113 int64_t results_conv_22 = results_vals[w];
29114 void* results_conv_22_ptr = untag_ptr(results_conv_22);
29115 CHECK_ACCESS(results_conv_22_ptr);
29116 LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
29117 results_constr.data[w] = results_conv_22_conv;
29119 (*env)->ReleaseLongArrayElements(env, results, results_vals, 0);
29120 LDKRouteParameters failed_paths_retry_conv;
29121 failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
29122 failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
29123 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
29124 failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
29125 LDKThirtyTwoBytes payment_id_ref;
29126 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
29127 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
29128 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
29129 *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
29130 int64_t ret_ref = tag_ptr(ret_copy, true);
29134 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29135 LDKPhantomRouteHints this_obj_conv;
29136 this_obj_conv.inner = untag_ptr(this_obj);
29137 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29138 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29139 PhantomRouteHints_free(this_obj_conv);
29142 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
29143 LDKPhantomRouteHints this_ptr_conv;
29144 this_ptr_conv.inner = untag_ptr(this_ptr);
29145 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29146 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29147 this_ptr_conv.is_owned = false;
29148 LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv);
29149 int64_tArray ret_arr = NULL;
29150 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29151 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29152 for (size_t q = 0; q < ret_var.datalen; q++) {
29153 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
29154 int64_t ret_conv_16_ref = 0;
29155 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
29156 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
29157 ret_arr_ptr[q] = ret_conv_16_ref;
29159 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29160 FREE(ret_var.data);
29164 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
29165 LDKPhantomRouteHints this_ptr_conv;
29166 this_ptr_conv.inner = untag_ptr(this_ptr);
29167 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29168 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29169 this_ptr_conv.is_owned = false;
29170 LDKCVec_ChannelDetailsZ val_constr;
29171 val_constr.datalen = (*env)->GetArrayLength(env, val);
29172 if (val_constr.datalen > 0)
29173 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
29175 val_constr.data = NULL;
29176 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
29177 for (size_t q = 0; q < val_constr.datalen; q++) {
29178 int64_t val_conv_16 = val_vals[q];
29179 LDKChannelDetails val_conv_16_conv;
29180 val_conv_16_conv.inner = untag_ptr(val_conv_16);
29181 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
29182 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
29183 val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
29184 val_constr.data[q] = val_conv_16_conv;
29186 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
29187 PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
29190 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr) {
29191 LDKPhantomRouteHints this_ptr_conv;
29192 this_ptr_conv.inner = untag_ptr(this_ptr);
29193 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29194 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29195 this_ptr_conv.is_owned = false;
29196 int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv);
29200 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
29201 LDKPhantomRouteHints this_ptr_conv;
29202 this_ptr_conv.inner = untag_ptr(this_ptr);
29203 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29205 this_ptr_conv.is_owned = false;
29206 PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val);
29209 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
29210 LDKPhantomRouteHints this_ptr_conv;
29211 this_ptr_conv.inner = untag_ptr(this_ptr);
29212 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29214 this_ptr_conv.is_owned = false;
29215 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
29216 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form);
29220 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29221 LDKPhantomRouteHints this_ptr_conv;
29222 this_ptr_conv.inner = untag_ptr(this_ptr);
29223 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29224 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29225 this_ptr_conv.is_owned = false;
29226 LDKPublicKey val_ref;
29227 CHECK((*env)->GetArrayLength(env, val) == 33);
29228 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
29229 PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref);
29232 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) {
29233 LDKCVec_ChannelDetailsZ channels_arg_constr;
29234 channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg);
29235 if (channels_arg_constr.datalen > 0)
29236 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
29238 channels_arg_constr.data = NULL;
29239 int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL);
29240 for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
29241 int64_t channels_arg_conv_16 = channels_arg_vals[q];
29242 LDKChannelDetails channels_arg_conv_16_conv;
29243 channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16);
29244 channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16);
29245 CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv);
29246 channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
29247 channels_arg_constr.data[q] = channels_arg_conv_16_conv;
29249 (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0);
29250 LDKPublicKey real_node_pubkey_arg_ref;
29251 CHECK((*env)->GetArrayLength(env, real_node_pubkey_arg) == 33);
29252 (*env)->GetByteArrayRegion(env, real_node_pubkey_arg, 0, 33, real_node_pubkey_arg_ref.compressed_form);
29253 LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref);
29254 int64_t ret_ref = 0;
29255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29260 static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) {
29261 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg);
29262 int64_t ret_ref = 0;
29263 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29264 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29267 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29268 LDKPhantomRouteHints arg_conv;
29269 arg_conv.inner = untag_ptr(arg);
29270 arg_conv.is_owned = ptr_is_owned(arg);
29271 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29272 arg_conv.is_owned = false;
29273 int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv);
29277 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29278 LDKPhantomRouteHints orig_conv;
29279 orig_conv.inner = untag_ptr(orig);
29280 orig_conv.is_owned = ptr_is_owned(orig);
29281 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29282 orig_conv.is_owned = false;
29283 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv);
29284 int64_t ret_ref = 0;
29285 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29286 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29290 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) {
29291 void* fee_est_ptr = untag_ptr(fee_est);
29292 CHECK_ACCESS(fee_est_ptr);
29293 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
29294 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
29295 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29296 LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
29298 void* chain_monitor_ptr = untag_ptr(chain_monitor);
29299 CHECK_ACCESS(chain_monitor_ptr);
29300 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
29301 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
29302 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29303 LDKWatch_JCalls_cloned(&chain_monitor_conv);
29305 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
29306 CHECK_ACCESS(tx_broadcaster_ptr);
29307 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
29308 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
29309 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29310 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
29312 void* logger_ptr = untag_ptr(logger);
29313 CHECK_ACCESS(logger_ptr);
29314 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
29315 if (logger_conv.free == LDKLogger_JCalls_free) {
29316 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29317 LDKLogger_JCalls_cloned(&logger_conv);
29319 void* keys_manager_ptr = untag_ptr(keys_manager);
29320 CHECK_ACCESS(keys_manager_ptr);
29321 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
29322 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
29323 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29324 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
29326 LDKUserConfig config_conv;
29327 config_conv.inner = untag_ptr(config);
29328 config_conv.is_owned = ptr_is_owned(config);
29329 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
29330 config_conv = UserConfig_clone(&config_conv);
29331 LDKChainParameters params_conv;
29332 params_conv.inner = untag_ptr(params);
29333 params_conv.is_owned = ptr_is_owned(params);
29334 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
29335 params_conv = ChainParameters_clone(¶ms_conv);
29336 LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv);
29337 int64_t ret_ref = 0;
29338 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29339 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1current_1default_1configuration(JNIEnv *env, jclass clz, int64_t this_arg) {
29344 LDKChannelManager this_arg_conv;
29345 this_arg_conv.inner = untag_ptr(this_arg);
29346 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29348 this_arg_conv.is_owned = false;
29349 LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv);
29350 int64_t ret_ref = 0;
29351 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29352 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29356 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) {
29357 LDKChannelManager this_arg_conv;
29358 this_arg_conv.inner = untag_ptr(this_arg);
29359 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29361 this_arg_conv.is_owned = false;
29362 LDKPublicKey their_network_key_ref;
29363 CHECK((*env)->GetArrayLength(env, their_network_key) == 33);
29364 (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form);
29365 LDKUserConfig override_config_conv;
29366 override_config_conv.inner = untag_ptr(override_config);
29367 override_config_conv.is_owned = ptr_is_owned(override_config);
29368 CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
29369 override_config_conv = UserConfig_clone(&override_config_conv);
29370 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
29371 *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv);
29372 return tag_ptr(ret_conv, true);
29375 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
29376 LDKChannelManager this_arg_conv;
29377 this_arg_conv.inner = untag_ptr(this_arg);
29378 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29380 this_arg_conv.is_owned = false;
29381 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
29382 int64_tArray ret_arr = NULL;
29383 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29384 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29385 for (size_t q = 0; q < ret_var.datalen; q++) {
29386 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
29387 int64_t ret_conv_16_ref = 0;
29388 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
29389 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
29390 ret_arr_ptr[q] = ret_conv_16_ref;
29392 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29393 FREE(ret_var.data);
29397 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
29398 LDKChannelManager this_arg_conv;
29399 this_arg_conv.inner = untag_ptr(this_arg);
29400 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29402 this_arg_conv.is_owned = false;
29403 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
29404 int64_tArray ret_arr = NULL;
29405 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29406 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29407 for (size_t q = 0; q < ret_var.datalen; q++) {
29408 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
29409 int64_t ret_conv_16_ref = 0;
29410 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
29411 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
29412 ret_arr_ptr[q] = ret_conv_16_ref;
29414 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29415 FREE(ret_var.data);
29419 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) {
29420 LDKChannelManager this_arg_conv;
29421 this_arg_conv.inner = untag_ptr(this_arg);
29422 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29423 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29424 this_arg_conv.is_owned = false;
29425 unsigned char channel_id_arr[32];
29426 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
29427 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
29428 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
29429 LDKPublicKey counterparty_node_id_ref;
29430 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
29431 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
29432 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
29433 *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
29434 return tag_ptr(ret_conv, true);
29437 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) {
29438 LDKChannelManager this_arg_conv;
29439 this_arg_conv.inner = untag_ptr(this_arg);
29440 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29442 this_arg_conv.is_owned = false;
29443 unsigned char channel_id_arr[32];
29444 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
29445 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
29446 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
29447 LDKPublicKey counterparty_node_id_ref;
29448 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
29449 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
29450 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
29451 *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight);
29452 return tag_ptr(ret_conv, true);
29455 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) {
29456 LDKChannelManager this_arg_conv;
29457 this_arg_conv.inner = untag_ptr(this_arg);
29458 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29460 this_arg_conv.is_owned = false;
29461 unsigned char channel_id_arr[32];
29462 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
29463 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
29464 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
29465 LDKPublicKey counterparty_node_id_ref;
29466 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
29467 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
29468 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
29469 *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
29470 return tag_ptr(ret_conv, true);
29473 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) {
29474 LDKChannelManager this_arg_conv;
29475 this_arg_conv.inner = untag_ptr(this_arg);
29476 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29478 this_arg_conv.is_owned = false;
29479 unsigned char channel_id_arr[32];
29480 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
29481 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
29482 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
29483 LDKPublicKey counterparty_node_id_ref;
29484 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
29485 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
29486 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
29487 *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
29488 return tag_ptr(ret_conv, true);
29491 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg) {
29492 LDKChannelManager this_arg_conv;
29493 this_arg_conv.inner = untag_ptr(this_arg);
29494 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29496 this_arg_conv.is_owned = false;
29497 ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv);
29500 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg) {
29501 LDKChannelManager this_arg_conv;
29502 this_arg_conv.inner = untag_ptr(this_arg);
29503 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29505 this_arg_conv.is_owned = false;
29506 ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv);
29509 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) {
29510 LDKChannelManager this_arg_conv;
29511 this_arg_conv.inner = untag_ptr(this_arg);
29512 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29514 this_arg_conv.is_owned = false;
29515 LDKRoute route_conv;
29516 route_conv.inner = untag_ptr(route);
29517 route_conv.is_owned = ptr_is_owned(route);
29518 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
29519 route_conv.is_owned = false;
29520 LDKThirtyTwoBytes payment_hash_ref;
29521 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
29522 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
29523 LDKThirtyTwoBytes payment_secret_ref;
29524 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
29525 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
29526 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
29527 *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref);
29528 return tag_ptr(ret_conv, true);
29531 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) {
29532 LDKChannelManager this_arg_conv;
29533 this_arg_conv.inner = untag_ptr(this_arg);
29534 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29535 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29536 this_arg_conv.is_owned = false;
29537 LDKRoute route_conv;
29538 route_conv.inner = untag_ptr(route);
29539 route_conv.is_owned = ptr_is_owned(route);
29540 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
29541 route_conv.is_owned = false;
29542 LDKThirtyTwoBytes payment_id_ref;
29543 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
29544 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
29545 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
29546 *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
29547 return tag_ptr(ret_conv, true);
29550 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) {
29551 LDKChannelManager this_arg_conv;
29552 this_arg_conv.inner = untag_ptr(this_arg);
29553 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29554 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29555 this_arg_conv.is_owned = false;
29556 LDKThirtyTwoBytes payment_id_ref;
29557 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
29558 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
29559 ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
29562 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) {
29563 LDKChannelManager this_arg_conv;
29564 this_arg_conv.inner = untag_ptr(this_arg);
29565 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29566 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29567 this_arg_conv.is_owned = false;
29568 LDKRoute route_conv;
29569 route_conv.inner = untag_ptr(route);
29570 route_conv.is_owned = ptr_is_owned(route);
29571 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
29572 route_conv.is_owned = false;
29573 LDKThirtyTwoBytes payment_preimage_ref;
29574 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
29575 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
29576 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
29577 *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
29578 return tag_ptr(ret_conv, true);
29581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1probe(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray hops) {
29582 LDKChannelManager this_arg_conv;
29583 this_arg_conv.inner = untag_ptr(this_arg);
29584 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29586 this_arg_conv.is_owned = false;
29587 LDKCVec_RouteHopZ hops_constr;
29588 hops_constr.datalen = (*env)->GetArrayLength(env, hops);
29589 if (hops_constr.datalen > 0)
29590 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
29592 hops_constr.data = NULL;
29593 int64_t* hops_vals = (*env)->GetLongArrayElements (env, hops, NULL);
29594 for (size_t k = 0; k < hops_constr.datalen; k++) {
29595 int64_t hops_conv_10 = hops_vals[k];
29596 LDKRouteHop hops_conv_10_conv;
29597 hops_conv_10_conv.inner = untag_ptr(hops_conv_10);
29598 hops_conv_10_conv.is_owned = ptr_is_owned(hops_conv_10);
29599 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv_10_conv);
29600 hops_conv_10_conv = RouteHop_clone(&hops_conv_10_conv);
29601 hops_constr.data[k] = hops_conv_10_conv;
29603 (*env)->ReleaseLongArrayElements(env, hops, hops_vals, 0);
29604 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
29605 *ret_conv = ChannelManager_send_probe(&this_arg_conv, hops_constr);
29606 return tag_ptr(ret_conv, true);
29609 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) {
29610 LDKChannelManager this_arg_conv;
29611 this_arg_conv.inner = untag_ptr(this_arg);
29612 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29613 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29614 this_arg_conv.is_owned = false;
29615 unsigned char temporary_channel_id_arr[32];
29616 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
29617 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
29618 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
29619 LDKPublicKey counterparty_node_id_ref;
29620 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
29621 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
29622 LDKTransaction funding_transaction_ref;
29623 funding_transaction_ref.datalen = (*env)->GetArrayLength(env, funding_transaction);
29624 funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes");
29625 (*env)->GetByteArrayRegion(env, funding_transaction, 0, funding_transaction_ref.datalen, funding_transaction_ref.data);
29626 funding_transaction_ref.data_is_owned = true;
29627 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
29628 *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref);
29629 return tag_ptr(ret_conv, true);
29632 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray rgb, int8_tArray alias, int64_tArray addresses) {
29633 LDKChannelManager this_arg_conv;
29634 this_arg_conv.inner = untag_ptr(this_arg);
29635 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29637 this_arg_conv.is_owned = false;
29638 LDKThreeBytes rgb_ref;
29639 CHECK((*env)->GetArrayLength(env, rgb) == 3);
29640 (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data);
29641 LDKThirtyTwoBytes alias_ref;
29642 CHECK((*env)->GetArrayLength(env, alias) == 32);
29643 (*env)->GetByteArrayRegion(env, alias, 0, 32, alias_ref.data);
29644 LDKCVec_NetAddressZ addresses_constr;
29645 addresses_constr.datalen = (*env)->GetArrayLength(env, addresses);
29646 if (addresses_constr.datalen > 0)
29647 addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
29649 addresses_constr.data = NULL;
29650 int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL);
29651 for (size_t m = 0; m < addresses_constr.datalen; m++) {
29652 int64_t addresses_conv_12 = addresses_vals[m];
29653 void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
29654 CHECK_ACCESS(addresses_conv_12_ptr);
29655 LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
29656 addresses_constr.data[m] = addresses_conv_12_conv;
29658 (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0);
29659 ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
29662 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) {
29663 LDKChannelManager this_arg_conv;
29664 this_arg_conv.inner = untag_ptr(this_arg);
29665 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29667 this_arg_conv.is_owned = false;
29668 LDKPublicKey counterparty_node_id_ref;
29669 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
29670 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
29671 LDKCVec_ThirtyTwoBytesZ channel_ids_constr;
29672 channel_ids_constr.datalen = (*env)->GetArrayLength(env, channel_ids);
29673 if (channel_ids_constr.datalen > 0)
29674 channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
29676 channel_ids_constr.data = NULL;
29677 for (size_t i = 0; i < channel_ids_constr.datalen; i++) {
29678 int8_tArray channel_ids_conv_8 = (*env)->GetObjectArrayElement(env, channel_ids, i);
29679 LDKThirtyTwoBytes channel_ids_conv_8_ref;
29680 CHECK((*env)->GetArrayLength(env, channel_ids_conv_8) == 32);
29681 (*env)->GetByteArrayRegion(env, channel_ids_conv_8, 0, 32, channel_ids_conv_8_ref.data);
29682 channel_ids_constr.data[i] = channel_ids_conv_8_ref;
29684 LDKChannelConfig config_conv;
29685 config_conv.inner = untag_ptr(config);
29686 config_conv.is_owned = ptr_is_owned(config);
29687 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
29688 config_conv.is_owned = false;
29689 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
29690 *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv);
29691 return tag_ptr(ret_conv, true);
29694 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv *env, jclass clz, int64_t this_arg) {
29695 LDKChannelManager this_arg_conv;
29696 this_arg_conv.inner = untag_ptr(this_arg);
29697 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29699 this_arg_conv.is_owned = false;
29700 ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
29703 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
29704 LDKChannelManager this_arg_conv;
29705 this_arg_conv.inner = untag_ptr(this_arg);
29706 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29708 this_arg_conv.is_owned = false;
29709 ChannelManager_timer_tick_occurred(&this_arg_conv);
29712 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) {
29713 LDKChannelManager this_arg_conv;
29714 this_arg_conv.inner = untag_ptr(this_arg);
29715 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29717 this_arg_conv.is_owned = false;
29718 unsigned char payment_hash_arr[32];
29719 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
29720 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
29721 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
29722 ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref);
29725 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_preimage) {
29726 LDKChannelManager this_arg_conv;
29727 this_arg_conv.inner = untag_ptr(this_arg);
29728 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29730 this_arg_conv.is_owned = false;
29731 LDKThirtyTwoBytes payment_preimage_ref;
29732 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
29733 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
29734 ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref);
29737 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
29738 LDKChannelManager this_arg_conv;
29739 this_arg_conv.inner = untag_ptr(this_arg);
29740 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29742 this_arg_conv.is_owned = false;
29743 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
29744 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form);
29748 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) {
29749 LDKChannelManager this_arg_conv;
29750 this_arg_conv.inner = untag_ptr(this_arg);
29751 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29752 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29753 this_arg_conv.is_owned = false;
29754 unsigned char temporary_channel_id_arr[32];
29755 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
29756 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
29757 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
29758 LDKPublicKey counterparty_node_id_ref;
29759 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
29760 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
29761 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
29762 *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
29763 return tag_ptr(ret_conv, true);
29766 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) {
29767 LDKChannelManager this_arg_conv;
29768 this_arg_conv.inner = untag_ptr(this_arg);
29769 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29770 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29771 this_arg_conv.is_owned = false;
29772 unsigned char temporary_channel_id_arr[32];
29773 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
29774 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
29775 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
29776 LDKPublicKey counterparty_node_id_ref;
29777 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
29778 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
29779 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
29780 *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
29781 return tag_ptr(ret_conv, true);
29784 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) {
29785 LDKChannelManager this_arg_conv;
29786 this_arg_conv.inner = untag_ptr(this_arg);
29787 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29789 this_arg_conv.is_owned = false;
29790 void* min_value_msat_ptr = untag_ptr(min_value_msat);
29791 CHECK_ACCESS(min_value_msat_ptr);
29792 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
29793 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
29794 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
29795 *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
29796 return tag_ptr(ret_conv, true);
29799 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) {
29800 LDKChannelManager this_arg_conv;
29801 this_arg_conv.inner = untag_ptr(this_arg);
29802 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29804 this_arg_conv.is_owned = false;
29805 void* min_value_msat_ptr = untag_ptr(min_value_msat);
29806 CHECK_ACCESS(min_value_msat_ptr);
29807 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
29808 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
29809 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
29810 *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
29811 return tag_ptr(ret_conv, true);
29814 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) {
29815 LDKChannelManager this_arg_conv;
29816 this_arg_conv.inner = untag_ptr(this_arg);
29817 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29818 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29819 this_arg_conv.is_owned = false;
29820 LDKThirtyTwoBytes payment_hash_ref;
29821 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
29822 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
29823 void* min_value_msat_ptr = untag_ptr(min_value_msat);
29824 CHECK_ACCESS(min_value_msat_ptr);
29825 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
29826 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
29827 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
29828 *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
29829 return tag_ptr(ret_conv, true);
29832 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) {
29833 LDKChannelManager this_arg_conv;
29834 this_arg_conv.inner = untag_ptr(this_arg);
29835 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29837 this_arg_conv.is_owned = false;
29838 LDKThirtyTwoBytes payment_hash_ref;
29839 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
29840 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
29841 void* min_value_msat_ptr = untag_ptr(min_value_msat);
29842 CHECK_ACCESS(min_value_msat_ptr);
29843 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
29844 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
29845 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
29846 *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
29847 return tag_ptr(ret_conv, true);
29850 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) {
29851 LDKChannelManager this_arg_conv;
29852 this_arg_conv.inner = untag_ptr(this_arg);
29853 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29854 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29855 this_arg_conv.is_owned = false;
29856 LDKThirtyTwoBytes payment_hash_ref;
29857 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
29858 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
29859 LDKThirtyTwoBytes payment_secret_ref;
29860 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
29861 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
29862 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
29863 *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
29864 return tag_ptr(ret_conv, true);
29867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
29868 LDKChannelManager this_arg_conv;
29869 this_arg_conv.inner = untag_ptr(this_arg);
29870 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29872 this_arg_conv.is_owned = false;
29873 int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv);
29877 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) {
29878 LDKChannelManager this_arg_conv;
29879 this_arg_conv.inner = untag_ptr(this_arg);
29880 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29881 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29882 this_arg_conv.is_owned = false;
29883 LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv);
29884 int64_t ret_ref = 0;
29885 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29886 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29890 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
29891 LDKChannelManager this_arg_conv;
29892 this_arg_conv.inner = untag_ptr(this_arg);
29893 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29895 this_arg_conv.is_owned = false;
29896 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
29897 *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
29898 return tag_ptr(ret_ret, true);
29901 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
29902 LDKChannelManager this_arg_conv;
29903 this_arg_conv.inner = untag_ptr(this_arg);
29904 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29906 this_arg_conv.is_owned = false;
29907 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
29908 *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
29909 return tag_ptr(ret_ret, true);
29912 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
29913 LDKChannelManager this_arg_conv;
29914 this_arg_conv.inner = untag_ptr(this_arg);
29915 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29917 this_arg_conv.is_owned = false;
29918 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
29919 *ret_ret = ChannelManager_as_Listen(&this_arg_conv);
29920 return tag_ptr(ret_ret, true);
29923 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) {
29924 LDKChannelManager this_arg_conv;
29925 this_arg_conv.inner = untag_ptr(this_arg);
29926 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29927 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29928 this_arg_conv.is_owned = false;
29929 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
29930 *ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
29931 return tag_ptr(ret_ret, true);
29934 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) {
29935 LDKChannelManager this_arg_conv;
29936 this_arg_conv.inner = untag_ptr(this_arg);
29937 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29939 this_arg_conv.is_owned = false;
29940 jboolean ret_conv = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait);
29944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update(JNIEnv *env, jclass clz, int64_t this_arg) {
29945 LDKChannelManager this_arg_conv;
29946 this_arg_conv.inner = untag_ptr(this_arg);
29947 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29948 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29949 this_arg_conv.is_owned = false;
29950 ChannelManager_await_persistable_update(&this_arg_conv);
29953 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) {
29954 LDKChannelManager this_arg_conv;
29955 this_arg_conv.inner = untag_ptr(this_arg);
29956 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29958 this_arg_conv.is_owned = false;
29959 LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
29960 int64_t ret_ref = 0;
29961 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29962 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
29967 LDKChannelManager this_arg_conv;
29968 this_arg_conv.inner = untag_ptr(this_arg);
29969 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29971 this_arg_conv.is_owned = false;
29972 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
29973 *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
29974 return tag_ptr(ret_ret, true);
29977 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
29978 LDKCounterpartyForwardingInfo obj_conv;
29979 obj_conv.inner = untag_ptr(obj);
29980 obj_conv.is_owned = ptr_is_owned(obj);
29981 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
29982 obj_conv.is_owned = false;
29983 LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv);
29984 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29985 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29986 CVec_u8Z_free(ret_var);
29990 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29991 LDKu8slice ser_ref;
29992 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29993 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29994 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
29995 *ret_conv = CounterpartyForwardingInfo_read(ser_ref);
29996 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29997 return tag_ptr(ret_conv, true);
30000 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1write(JNIEnv *env, jclass clz, int64_t obj) {
30001 LDKChannelCounterparty obj_conv;
30002 obj_conv.inner = untag_ptr(obj);
30003 obj_conv.is_owned = ptr_is_owned(obj);
30004 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30005 obj_conv.is_owned = false;
30006 LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv);
30007 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30008 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30009 CVec_u8Z_free(ret_var);
30013 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
30014 LDKu8slice ser_ref;
30015 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30016 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30017 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
30018 *ret_conv = ChannelCounterparty_read(ser_ref);
30019 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30020 return tag_ptr(ret_conv, true);
30023 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1write(JNIEnv *env, jclass clz, int64_t obj) {
30024 LDKChannelDetails obj_conv;
30025 obj_conv.inner = untag_ptr(obj);
30026 obj_conv.is_owned = ptr_is_owned(obj);
30027 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30028 obj_conv.is_owned = false;
30029 LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv);
30030 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30031 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30032 CVec_u8Z_free(ret_var);
30036 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
30037 LDKu8slice ser_ref;
30038 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30039 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30040 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
30041 *ret_conv = ChannelDetails_read(ser_ref);
30042 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30043 return tag_ptr(ret_conv, true);
30046 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1write(JNIEnv *env, jclass clz, int64_t obj) {
30047 LDKPhantomRouteHints obj_conv;
30048 obj_conv.inner = untag_ptr(obj);
30049 obj_conv.is_owned = ptr_is_owned(obj);
30050 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30051 obj_conv.is_owned = false;
30052 LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv);
30053 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30054 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30055 CVec_u8Z_free(ret_var);
30059 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
30060 LDKu8slice ser_ref;
30061 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30062 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30063 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
30064 *ret_conv = PhantomRouteHints_read(ser_ref);
30065 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30066 return tag_ptr(ret_conv, true);
30069 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(JNIEnv *env, jclass clz, int64_t obj) {
30070 LDKChannelManager obj_conv;
30071 obj_conv.inner = untag_ptr(obj);
30072 obj_conv.is_owned = ptr_is_owned(obj);
30073 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30074 obj_conv.is_owned = false;
30075 LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
30076 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30077 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30078 CVec_u8Z_free(ret_var);
30082 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30083 LDKChannelManagerReadArgs this_obj_conv;
30084 this_obj_conv.inner = untag_ptr(this_obj);
30085 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30087 ChannelManagerReadArgs_free(this_obj_conv);
30090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr) {
30091 LDKChannelManagerReadArgs this_ptr_conv;
30092 this_ptr_conv.inner = untag_ptr(this_ptr);
30093 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30095 this_ptr_conv.is_owned = false;
30096 // WARNING: This object doesn't live past this scope, needs clone!
30097 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv), false);
30101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30102 LDKChannelManagerReadArgs this_ptr_conv;
30103 this_ptr_conv.inner = untag_ptr(this_ptr);
30104 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30105 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30106 this_ptr_conv.is_owned = false;
30107 void* val_ptr = untag_ptr(val);
30108 CHECK_ACCESS(val_ptr);
30109 LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
30110 if (val_conv.free == LDKKeysInterface_JCalls_free) {
30111 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30112 LDKKeysInterface_JCalls_cloned(&val_conv);
30114 ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
30117 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr) {
30118 LDKChannelManagerReadArgs this_ptr_conv;
30119 this_ptr_conv.inner = untag_ptr(this_ptr);
30120 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30122 this_ptr_conv.is_owned = false;
30123 // WARNING: This object doesn't live past this scope, needs clone!
30124 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false);
30128 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30129 LDKChannelManagerReadArgs this_ptr_conv;
30130 this_ptr_conv.inner = untag_ptr(this_ptr);
30131 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30133 this_ptr_conv.is_owned = false;
30134 void* val_ptr = untag_ptr(val);
30135 CHECK_ACCESS(val_ptr);
30136 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
30137 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
30138 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30139 LDKFeeEstimator_JCalls_cloned(&val_conv);
30141 ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
30144 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr) {
30145 LDKChannelManagerReadArgs this_ptr_conv;
30146 this_ptr_conv.inner = untag_ptr(this_ptr);
30147 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30149 this_ptr_conv.is_owned = false;
30150 // WARNING: This object doesn't live past this scope, needs clone!
30151 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false);
30155 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30156 LDKChannelManagerReadArgs this_ptr_conv;
30157 this_ptr_conv.inner = untag_ptr(this_ptr);
30158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30160 this_ptr_conv.is_owned = false;
30161 void* val_ptr = untag_ptr(val);
30162 CHECK_ACCESS(val_ptr);
30163 LDKWatch val_conv = *(LDKWatch*)(val_ptr);
30164 if (val_conv.free == LDKWatch_JCalls_free) {
30165 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30166 LDKWatch_JCalls_cloned(&val_conv);
30168 ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
30171 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr) {
30172 LDKChannelManagerReadArgs this_ptr_conv;
30173 this_ptr_conv.inner = untag_ptr(this_ptr);
30174 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30175 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30176 this_ptr_conv.is_owned = false;
30177 // WARNING: This object doesn't live past this scope, needs clone!
30178 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false);
30182 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30183 LDKChannelManagerReadArgs this_ptr_conv;
30184 this_ptr_conv.inner = untag_ptr(this_ptr);
30185 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30186 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30187 this_ptr_conv.is_owned = false;
30188 void* val_ptr = untag_ptr(val);
30189 CHECK_ACCESS(val_ptr);
30190 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
30191 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
30192 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30193 LDKBroadcasterInterface_JCalls_cloned(&val_conv);
30195 ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
30198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv *env, jclass clz, int64_t this_ptr) {
30199 LDKChannelManagerReadArgs this_ptr_conv;
30200 this_ptr_conv.inner = untag_ptr(this_ptr);
30201 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30202 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30203 this_ptr_conv.is_owned = false;
30204 // WARNING: This object doesn't live past this scope, needs clone!
30205 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false);
30209 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30210 LDKChannelManagerReadArgs this_ptr_conv;
30211 this_ptr_conv.inner = untag_ptr(this_ptr);
30212 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30214 this_ptr_conv.is_owned = false;
30215 void* val_ptr = untag_ptr(val);
30216 CHECK_ACCESS(val_ptr);
30217 LDKLogger val_conv = *(LDKLogger*)(val_ptr);
30218 if (val_conv.free == LDKLogger_JCalls_free) {
30219 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30220 LDKLogger_JCalls_cloned(&val_conv);
30222 ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
30225 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
30226 LDKChannelManagerReadArgs this_ptr_conv;
30227 this_ptr_conv.inner = untag_ptr(this_ptr);
30228 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30229 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30230 this_ptr_conv.is_owned = false;
30231 LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
30232 int64_t ret_ref = 0;
30233 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30234 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30238 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30239 LDKChannelManagerReadArgs this_ptr_conv;
30240 this_ptr_conv.inner = untag_ptr(this_ptr);
30241 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30242 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30243 this_ptr_conv.is_owned = false;
30244 LDKUserConfig val_conv;
30245 val_conv.inner = untag_ptr(val);
30246 val_conv.is_owned = ptr_is_owned(val);
30247 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30248 val_conv = UserConfig_clone(&val_conv);
30249 ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
30252 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) {
30253 void* keys_manager_ptr = untag_ptr(keys_manager);
30254 CHECK_ACCESS(keys_manager_ptr);
30255 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
30256 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
30257 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30258 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
30260 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30261 CHECK_ACCESS(fee_estimator_ptr);
30262 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30263 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30264 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30265 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30267 void* chain_monitor_ptr = untag_ptr(chain_monitor);
30268 CHECK_ACCESS(chain_monitor_ptr);
30269 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
30270 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
30271 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30272 LDKWatch_JCalls_cloned(&chain_monitor_conv);
30274 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
30275 CHECK_ACCESS(tx_broadcaster_ptr);
30276 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
30277 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30278 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30279 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
30281 void* logger_ptr = untag_ptr(logger);
30282 CHECK_ACCESS(logger_ptr);
30283 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30284 if (logger_conv.free == LDKLogger_JCalls_free) {
30285 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30286 LDKLogger_JCalls_cloned(&logger_conv);
30288 LDKUserConfig default_config_conv;
30289 default_config_conv.inner = untag_ptr(default_config);
30290 default_config_conv.is_owned = ptr_is_owned(default_config);
30291 CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv);
30292 default_config_conv = UserConfig_clone(&default_config_conv);
30293 LDKCVec_ChannelMonitorZ channel_monitors_constr;
30294 channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors);
30295 if (channel_monitors_constr.datalen > 0)
30296 channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
30298 channel_monitors_constr.data = NULL;
30299 int64_t* channel_monitors_vals = (*env)->GetLongArrayElements (env, channel_monitors, NULL);
30300 for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
30301 int64_t channel_monitors_conv_16 = channel_monitors_vals[q];
30302 LDKChannelMonitor channel_monitors_conv_16_conv;
30303 channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16);
30304 channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16);
30305 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
30306 channel_monitors_conv_16_conv.is_owned = false;
30307 channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
30309 (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0);
30310 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);
30311 int64_t ret_ref = 0;
30312 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30313 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30317 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
30318 LDKu8slice ser_ref;
30319 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30320 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30321 LDKChannelManagerReadArgs arg_conv;
30322 arg_conv.inner = untag_ptr(arg);
30323 arg_conv.is_owned = ptr_is_owned(arg);
30324 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30325 // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
30327 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
30328 *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
30329 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30330 return tag_ptr(ret_conv, true);
30333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30334 LDKExpandedKey this_obj_conv;
30335 this_obj_conv.inner = untag_ptr(this_obj);
30336 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30337 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30338 ExpandedKey_free(this_obj_conv);
30341 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1new(JNIEnv *env, jclass clz, int8_tArray key_material) {
30342 unsigned char key_material_arr[32];
30343 CHECK((*env)->GetArrayLength(env, key_material) == 32);
30344 (*env)->GetByteArrayRegion(env, key_material, 0, 32, key_material_arr);
30345 unsigned char (*key_material_ref)[32] = &key_material_arr;
30346 LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref);
30347 int64_t ret_ref = 0;
30348 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30349 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30353 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) {
30354 LDKExpandedKey keys_conv;
30355 keys_conv.inner = untag_ptr(keys);
30356 keys_conv.is_owned = ptr_is_owned(keys);
30357 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
30358 keys_conv.is_owned = false;
30359 void* min_value_msat_ptr = untag_ptr(min_value_msat);
30360 CHECK_ACCESS(min_value_msat_ptr);
30361 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
30362 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
30363 void* keys_manager_ptr = untag_ptr(keys_manager);
30364 if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
30365 LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
30366 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
30367 *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, keys_manager_conv, current_time);
30368 return tag_ptr(ret_conv, true);
30371 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) {
30372 LDKExpandedKey keys_conv;
30373 keys_conv.inner = untag_ptr(keys);
30374 keys_conv.is_owned = ptr_is_owned(keys);
30375 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
30376 keys_conv.is_owned = false;
30377 void* min_value_msat_ptr = untag_ptr(min_value_msat);
30378 CHECK_ACCESS(min_value_msat_ptr);
30379 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
30380 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
30381 LDKThirtyTwoBytes payment_hash_ref;
30382 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
30383 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
30384 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
30385 *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time);
30386 return tag_ptr(ret_conv, true);
30389 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30390 LDKDecodeError this_obj_conv;
30391 this_obj_conv.inner = untag_ptr(this_obj);
30392 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30394 DecodeError_free(this_obj_conv);
30397 static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
30398 LDKDecodeError ret_var = DecodeError_clone(arg);
30399 int64_t ret_ref = 0;
30400 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30401 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30404 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30405 LDKDecodeError arg_conv;
30406 arg_conv.inner = untag_ptr(arg);
30407 arg_conv.is_owned = ptr_is_owned(arg);
30408 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30409 arg_conv.is_owned = false;
30410 int64_t ret_conv = DecodeError_clone_ptr(&arg_conv);
30414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30415 LDKDecodeError orig_conv;
30416 orig_conv.inner = untag_ptr(orig);
30417 orig_conv.is_owned = ptr_is_owned(orig);
30418 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30419 orig_conv.is_owned = false;
30420 LDKDecodeError ret_var = DecodeError_clone(&orig_conv);
30421 int64_t ret_ref = 0;
30422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30423 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30427 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30428 LDKInit this_obj_conv;
30429 this_obj_conv.inner = untag_ptr(this_obj);
30430 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30431 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30432 Init_free(this_obj_conv);
30435 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
30436 LDKInit this_ptr_conv;
30437 this_ptr_conv.inner = untag_ptr(this_ptr);
30438 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30440 this_ptr_conv.is_owned = false;
30441 LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
30442 int64_t ret_ref = 0;
30443 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30444 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30448 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30449 LDKInit this_ptr_conv;
30450 this_ptr_conv.inner = untag_ptr(this_ptr);
30451 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30452 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30453 this_ptr_conv.is_owned = false;
30454 LDKInitFeatures val_conv;
30455 val_conv.inner = untag_ptr(val);
30456 val_conv.is_owned = ptr_is_owned(val);
30457 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30458 val_conv = InitFeatures_clone(&val_conv);
30459 Init_set_features(&this_ptr_conv, val_conv);
30462 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr) {
30463 LDKInit this_ptr_conv;
30464 this_ptr_conv.inner = untag_ptr(this_ptr);
30465 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30467 this_ptr_conv.is_owned = false;
30468 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
30469 *ret_copy = Init_get_remote_network_address(&this_ptr_conv);
30470 int64_t ret_ref = tag_ptr(ret_copy, true);
30474 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30475 LDKInit this_ptr_conv;
30476 this_ptr_conv.inner = untag_ptr(this_ptr);
30477 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30478 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30479 this_ptr_conv.is_owned = false;
30480 void* val_ptr = untag_ptr(val);
30481 CHECK_ACCESS(val_ptr);
30482 LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr);
30483 val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(val));
30484 Init_set_remote_network_address(&this_ptr_conv, val_conv);
30487 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) {
30488 LDKInitFeatures features_arg_conv;
30489 features_arg_conv.inner = untag_ptr(features_arg);
30490 features_arg_conv.is_owned = ptr_is_owned(features_arg);
30491 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
30492 features_arg_conv = InitFeatures_clone(&features_arg_conv);
30493 void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg);
30494 CHECK_ACCESS(remote_network_address_arg_ptr);
30495 LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr);
30496 LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv);
30497 int64_t ret_ref = 0;
30498 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30499 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30503 static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) {
30504 LDKInit ret_var = Init_clone(arg);
30505 int64_t ret_ref = 0;
30506 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30507 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30512 arg_conv.inner = untag_ptr(arg);
30513 arg_conv.is_owned = ptr_is_owned(arg);
30514 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30515 arg_conv.is_owned = false;
30516 int64_t ret_conv = Init_clone_ptr(&arg_conv);
30520 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30522 orig_conv.inner = untag_ptr(orig);
30523 orig_conv.is_owned = ptr_is_owned(orig);
30524 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30525 orig_conv.is_owned = false;
30526 LDKInit ret_var = Init_clone(&orig_conv);
30527 int64_t ret_ref = 0;
30528 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30529 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30533 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30534 LDKErrorMessage this_obj_conv;
30535 this_obj_conv.inner = untag_ptr(this_obj);
30536 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30537 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30538 ErrorMessage_free(this_obj_conv);
30541 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
30542 LDKErrorMessage this_ptr_conv;
30543 this_ptr_conv.inner = untag_ptr(this_ptr);
30544 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30545 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30546 this_ptr_conv.is_owned = false;
30547 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30548 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv));
30552 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30553 LDKErrorMessage this_ptr_conv;
30554 this_ptr_conv.inner = untag_ptr(this_ptr);
30555 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30556 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30557 this_ptr_conv.is_owned = false;
30558 LDKThirtyTwoBytes val_ref;
30559 CHECK((*env)->GetArrayLength(env, val) == 32);
30560 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30561 ErrorMessage_set_channel_id(&this_ptr_conv, val_ref);
30564 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
30565 LDKErrorMessage this_ptr_conv;
30566 this_ptr_conv.inner = untag_ptr(this_ptr);
30567 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30568 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30569 this_ptr_conv.is_owned = false;
30570 LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
30571 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
30576 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
30577 LDKErrorMessage this_ptr_conv;
30578 this_ptr_conv.inner = untag_ptr(this_ptr);
30579 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30580 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30581 this_ptr_conv.is_owned = false;
30582 LDKStr val_conv = java_to_owned_str(env, val);
30583 ErrorMessage_set_data(&this_ptr_conv, val_conv);
30586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) {
30587 LDKThirtyTwoBytes channel_id_arg_ref;
30588 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
30589 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
30590 LDKStr data_arg_conv = java_to_owned_str(env, data_arg);
30591 LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
30592 int64_t ret_ref = 0;
30593 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30594 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30598 static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) {
30599 LDKErrorMessage ret_var = ErrorMessage_clone(arg);
30600 int64_t ret_ref = 0;
30601 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30602 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30605 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30606 LDKErrorMessage arg_conv;
30607 arg_conv.inner = untag_ptr(arg);
30608 arg_conv.is_owned = ptr_is_owned(arg);
30609 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30610 arg_conv.is_owned = false;
30611 int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv);
30615 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30616 LDKErrorMessage orig_conv;
30617 orig_conv.inner = untag_ptr(orig);
30618 orig_conv.is_owned = ptr_is_owned(orig);
30619 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30620 orig_conv.is_owned = false;
30621 LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv);
30622 int64_t ret_ref = 0;
30623 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30624 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30628 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30629 LDKWarningMessage this_obj_conv;
30630 this_obj_conv.inner = untag_ptr(this_obj);
30631 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30633 WarningMessage_free(this_obj_conv);
30636 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
30637 LDKWarningMessage this_ptr_conv;
30638 this_ptr_conv.inner = untag_ptr(this_ptr);
30639 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30640 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30641 this_ptr_conv.is_owned = false;
30642 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30643 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *WarningMessage_get_channel_id(&this_ptr_conv));
30647 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30648 LDKWarningMessage this_ptr_conv;
30649 this_ptr_conv.inner = untag_ptr(this_ptr);
30650 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30651 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30652 this_ptr_conv.is_owned = false;
30653 LDKThirtyTwoBytes val_ref;
30654 CHECK((*env)->GetArrayLength(env, val) == 32);
30655 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30656 WarningMessage_set_channel_id(&this_ptr_conv, val_ref);
30659 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
30660 LDKWarningMessage this_ptr_conv;
30661 this_ptr_conv.inner = untag_ptr(this_ptr);
30662 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30664 this_ptr_conv.is_owned = false;
30665 LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv);
30666 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
30671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
30672 LDKWarningMessage this_ptr_conv;
30673 this_ptr_conv.inner = untag_ptr(this_ptr);
30674 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30676 this_ptr_conv.is_owned = false;
30677 LDKStr val_conv = java_to_owned_str(env, val);
30678 WarningMessage_set_data(&this_ptr_conv, val_conv);
30681 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) {
30682 LDKThirtyTwoBytes channel_id_arg_ref;
30683 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
30684 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
30685 LDKStr data_arg_conv = java_to_owned_str(env, data_arg);
30686 LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv);
30687 int64_t ret_ref = 0;
30688 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30689 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30693 static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) {
30694 LDKWarningMessage ret_var = WarningMessage_clone(arg);
30695 int64_t ret_ref = 0;
30696 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30697 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30700 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30701 LDKWarningMessage arg_conv;
30702 arg_conv.inner = untag_ptr(arg);
30703 arg_conv.is_owned = ptr_is_owned(arg);
30704 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30705 arg_conv.is_owned = false;
30706 int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv);
30710 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30711 LDKWarningMessage orig_conv;
30712 orig_conv.inner = untag_ptr(orig);
30713 orig_conv.is_owned = ptr_is_owned(orig);
30714 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30715 orig_conv.is_owned = false;
30716 LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv);
30717 int64_t ret_ref = 0;
30718 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30719 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30723 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30724 LDKPing this_obj_conv;
30725 this_obj_conv.inner = untag_ptr(this_obj);
30726 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30728 Ping_free(this_obj_conv);
30731 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) {
30732 LDKPing this_ptr_conv;
30733 this_ptr_conv.inner = untag_ptr(this_ptr);
30734 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30735 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30736 this_ptr_conv.is_owned = false;
30737 int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv);
30741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
30742 LDKPing this_ptr_conv;
30743 this_ptr_conv.inner = untag_ptr(this_ptr);
30744 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30746 this_ptr_conv.is_owned = false;
30747 Ping_set_ponglen(&this_ptr_conv, val);
30750 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) {
30751 LDKPing this_ptr_conv;
30752 this_ptr_conv.inner = untag_ptr(this_ptr);
30753 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30754 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30755 this_ptr_conv.is_owned = false;
30756 int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv);
30760 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
30761 LDKPing this_ptr_conv;
30762 this_ptr_conv.inner = untag_ptr(this_ptr);
30763 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30765 this_ptr_conv.is_owned = false;
30766 Ping_set_byteslen(&this_ptr_conv, val);
30769 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) {
30770 LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg);
30771 int64_t ret_ref = 0;
30772 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30773 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30777 static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) {
30778 LDKPing ret_var = Ping_clone(arg);
30779 int64_t ret_ref = 0;
30780 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30781 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30784 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30786 arg_conv.inner = untag_ptr(arg);
30787 arg_conv.is_owned = ptr_is_owned(arg);
30788 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30789 arg_conv.is_owned = false;
30790 int64_t ret_conv = Ping_clone_ptr(&arg_conv);
30794 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30796 orig_conv.inner = untag_ptr(orig);
30797 orig_conv.is_owned = ptr_is_owned(orig);
30798 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30799 orig_conv.is_owned = false;
30800 LDKPing ret_var = Ping_clone(&orig_conv);
30801 int64_t ret_ref = 0;
30802 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30803 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30807 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30808 LDKPong this_obj_conv;
30809 this_obj_conv.inner = untag_ptr(this_obj);
30810 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30811 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30812 Pong_free(this_obj_conv);
30815 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) {
30816 LDKPong this_ptr_conv;
30817 this_ptr_conv.inner = untag_ptr(this_ptr);
30818 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30820 this_ptr_conv.is_owned = false;
30821 int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv);
30825 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
30826 LDKPong this_ptr_conv;
30827 this_ptr_conv.inner = untag_ptr(this_ptr);
30828 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30829 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30830 this_ptr_conv.is_owned = false;
30831 Pong_set_byteslen(&this_ptr_conv, val);
30834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) {
30835 LDKPong ret_var = Pong_new(byteslen_arg);
30836 int64_t ret_ref = 0;
30837 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30838 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30842 static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) {
30843 LDKPong ret_var = Pong_clone(arg);
30844 int64_t ret_ref = 0;
30845 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30846 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30849 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30851 arg_conv.inner = untag_ptr(arg);
30852 arg_conv.is_owned = ptr_is_owned(arg);
30853 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30854 arg_conv.is_owned = false;
30855 int64_t ret_conv = Pong_clone_ptr(&arg_conv);
30859 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30861 orig_conv.inner = untag_ptr(orig);
30862 orig_conv.is_owned = ptr_is_owned(orig);
30863 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30864 orig_conv.is_owned = false;
30865 LDKPong ret_var = Pong_clone(&orig_conv);
30866 int64_t ret_ref = 0;
30867 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30868 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30872 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30873 LDKOpenChannel this_obj_conv;
30874 this_obj_conv.inner = untag_ptr(this_obj);
30875 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30876 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30877 OpenChannel_free(this_obj_conv);
30880 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
30881 LDKOpenChannel this_ptr_conv;
30882 this_ptr_conv.inner = untag_ptr(this_ptr);
30883 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30884 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30885 this_ptr_conv.is_owned = false;
30886 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30887 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv));
30891 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30892 LDKOpenChannel this_ptr_conv;
30893 this_ptr_conv.inner = untag_ptr(this_ptr);
30894 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30895 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30896 this_ptr_conv.is_owned = false;
30897 LDKThirtyTwoBytes val_ref;
30898 CHECK((*env)->GetArrayLength(env, val) == 32);
30899 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30900 OpenChannel_set_chain_hash(&this_ptr_conv, val_ref);
30903 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
30904 LDKOpenChannel this_ptr_conv;
30905 this_ptr_conv.inner = untag_ptr(this_ptr);
30906 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30908 this_ptr_conv.is_owned = false;
30909 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30910 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv));
30914 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30915 LDKOpenChannel this_ptr_conv;
30916 this_ptr_conv.inner = untag_ptr(this_ptr);
30917 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30918 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30919 this_ptr_conv.is_owned = false;
30920 LDKThirtyTwoBytes val_ref;
30921 CHECK((*env)->GetArrayLength(env, val) == 32);
30922 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30923 OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
30926 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
30927 LDKOpenChannel this_ptr_conv;
30928 this_ptr_conv.inner = untag_ptr(this_ptr);
30929 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30931 this_ptr_conv.is_owned = false;
30932 int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv);
30936 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30937 LDKOpenChannel this_ptr_conv;
30938 this_ptr_conv.inner = untag_ptr(this_ptr);
30939 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30940 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30941 this_ptr_conv.is_owned = false;
30942 OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
30945 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
30946 LDKOpenChannel this_ptr_conv;
30947 this_ptr_conv.inner = untag_ptr(this_ptr);
30948 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30950 this_ptr_conv.is_owned = false;
30951 int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv);
30955 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30956 LDKOpenChannel this_ptr_conv;
30957 this_ptr_conv.inner = untag_ptr(this_ptr);
30958 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30960 this_ptr_conv.is_owned = false;
30961 OpenChannel_set_push_msat(&this_ptr_conv, val);
30964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
30965 LDKOpenChannel this_ptr_conv;
30966 this_ptr_conv.inner = untag_ptr(this_ptr);
30967 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30969 this_ptr_conv.is_owned = false;
30970 int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
30974 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30975 LDKOpenChannel this_ptr_conv;
30976 this_ptr_conv.inner = untag_ptr(this_ptr);
30977 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30978 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30979 this_ptr_conv.is_owned = false;
30980 OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
30983 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) {
30984 LDKOpenChannel this_ptr_conv;
30985 this_ptr_conv.inner = untag_ptr(this_ptr);
30986 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30987 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30988 this_ptr_conv.is_owned = false;
30989 int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
30993 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) {
30994 LDKOpenChannel this_ptr_conv;
30995 this_ptr_conv.inner = untag_ptr(this_ptr);
30996 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30998 this_ptr_conv.is_owned = false;
30999 OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
31002 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
31003 LDKOpenChannel this_ptr_conv;
31004 this_ptr_conv.inner = untag_ptr(this_ptr);
31005 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31007 this_ptr_conv.is_owned = false;
31008 int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
31012 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31013 LDKOpenChannel this_ptr_conv;
31014 this_ptr_conv.inner = untag_ptr(this_ptr);
31015 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31017 this_ptr_conv.is_owned = false;
31018 OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
31021 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
31022 LDKOpenChannel this_ptr_conv;
31023 this_ptr_conv.inner = untag_ptr(this_ptr);
31024 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31025 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31026 this_ptr_conv.is_owned = false;
31027 int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
31031 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31032 LDKOpenChannel this_ptr_conv;
31033 this_ptr_conv.inner = untag_ptr(this_ptr);
31034 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31036 this_ptr_conv.is_owned = false;
31037 OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
31040 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) {
31041 LDKOpenChannel this_ptr_conv;
31042 this_ptr_conv.inner = untag_ptr(this_ptr);
31043 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31044 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31045 this_ptr_conv.is_owned = false;
31046 int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
31050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
31051 LDKOpenChannel this_ptr_conv;
31052 this_ptr_conv.inner = untag_ptr(this_ptr);
31053 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31055 this_ptr_conv.is_owned = false;
31056 OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
31059 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
31060 LDKOpenChannel this_ptr_conv;
31061 this_ptr_conv.inner = untag_ptr(this_ptr);
31062 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31064 this_ptr_conv.is_owned = false;
31065 int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv);
31069 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
31070 LDKOpenChannel this_ptr_conv;
31071 this_ptr_conv.inner = untag_ptr(this_ptr);
31072 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31074 this_ptr_conv.is_owned = false;
31075 OpenChannel_set_to_self_delay(&this_ptr_conv, val);
31078 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
31079 LDKOpenChannel this_ptr_conv;
31080 this_ptr_conv.inner = untag_ptr(this_ptr);
31081 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31083 this_ptr_conv.is_owned = false;
31084 int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
31088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
31089 LDKOpenChannel 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 OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
31097 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
31098 LDKOpenChannel this_ptr_conv;
31099 this_ptr_conv.inner = untag_ptr(this_ptr);
31100 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31101 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31102 this_ptr_conv.is_owned = false;
31103 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31104 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
31108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31109 LDKOpenChannel this_ptr_conv;
31110 this_ptr_conv.inner = untag_ptr(this_ptr);
31111 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31112 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31113 this_ptr_conv.is_owned = false;
31114 LDKPublicKey val_ref;
31115 CHECK((*env)->GetArrayLength(env, val) == 33);
31116 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31117 OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
31120 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
31121 LDKOpenChannel this_ptr_conv;
31122 this_ptr_conv.inner = untag_ptr(this_ptr);
31123 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31125 this_ptr_conv.is_owned = false;
31126 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31127 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
31131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31132 LDKOpenChannel this_ptr_conv;
31133 this_ptr_conv.inner = untag_ptr(this_ptr);
31134 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31136 this_ptr_conv.is_owned = false;
31137 LDKPublicKey val_ref;
31138 CHECK((*env)->GetArrayLength(env, val) == 33);
31139 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31140 OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
31143 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
31144 LDKOpenChannel this_ptr_conv;
31145 this_ptr_conv.inner = untag_ptr(this_ptr);
31146 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31147 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31148 this_ptr_conv.is_owned = false;
31149 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31150 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form);
31154 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31155 LDKOpenChannel this_ptr_conv;
31156 this_ptr_conv.inner = untag_ptr(this_ptr);
31157 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31158 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31159 this_ptr_conv.is_owned = false;
31160 LDKPublicKey val_ref;
31161 CHECK((*env)->GetArrayLength(env, val) == 33);
31162 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31163 OpenChannel_set_payment_point(&this_ptr_conv, val_ref);
31166 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
31167 LDKOpenChannel this_ptr_conv;
31168 this_ptr_conv.inner = untag_ptr(this_ptr);
31169 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31171 this_ptr_conv.is_owned = false;
31172 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31173 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
31177 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31178 LDKOpenChannel this_ptr_conv;
31179 this_ptr_conv.inner = untag_ptr(this_ptr);
31180 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31181 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31182 this_ptr_conv.is_owned = false;
31183 LDKPublicKey val_ref;
31184 CHECK((*env)->GetArrayLength(env, val) == 33);
31185 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31186 OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
31189 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
31190 LDKOpenChannel this_ptr_conv;
31191 this_ptr_conv.inner = untag_ptr(this_ptr);
31192 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31193 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31194 this_ptr_conv.is_owned = false;
31195 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31196 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
31200 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31201 LDKOpenChannel this_ptr_conv;
31202 this_ptr_conv.inner = untag_ptr(this_ptr);
31203 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31205 this_ptr_conv.is_owned = false;
31206 LDKPublicKey val_ref;
31207 CHECK((*env)->GetArrayLength(env, val) == 33);
31208 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31209 OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
31212 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
31213 LDKOpenChannel this_ptr_conv;
31214 this_ptr_conv.inner = untag_ptr(this_ptr);
31215 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31216 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31217 this_ptr_conv.is_owned = false;
31218 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31219 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
31223 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) {
31224 LDKOpenChannel this_ptr_conv;
31225 this_ptr_conv.inner = untag_ptr(this_ptr);
31226 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31228 this_ptr_conv.is_owned = false;
31229 LDKPublicKey val_ref;
31230 CHECK((*env)->GetArrayLength(env, val) == 33);
31231 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31232 OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
31235 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) {
31236 LDKOpenChannel this_ptr_conv;
31237 this_ptr_conv.inner = untag_ptr(this_ptr);
31238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31240 this_ptr_conv.is_owned = false;
31241 int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv);
31245 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
31246 LDKOpenChannel this_ptr_conv;
31247 this_ptr_conv.inner = untag_ptr(this_ptr);
31248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31250 this_ptr_conv.is_owned = false;
31251 OpenChannel_set_channel_flags(&this_ptr_conv, val);
31254 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
31255 LDKOpenChannel this_ptr_conv;
31256 this_ptr_conv.inner = untag_ptr(this_ptr);
31257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31259 this_ptr_conv.is_owned = false;
31260 LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
31261 int64_t ret_ref = 0;
31262 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31263 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31267 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31268 LDKOpenChannel this_ptr_conv;
31269 this_ptr_conv.inner = untag_ptr(this_ptr);
31270 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31272 this_ptr_conv.is_owned = false;
31273 LDKChannelTypeFeatures val_conv;
31274 val_conv.inner = untag_ptr(val);
31275 val_conv.is_owned = ptr_is_owned(val);
31276 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
31277 val_conv = ChannelTypeFeatures_clone(&val_conv);
31278 OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
31281 static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
31282 LDKOpenChannel ret_var = OpenChannel_clone(arg);
31283 int64_t ret_ref = 0;
31284 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31285 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31288 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31289 LDKOpenChannel arg_conv;
31290 arg_conv.inner = untag_ptr(arg);
31291 arg_conv.is_owned = ptr_is_owned(arg);
31292 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31293 arg_conv.is_owned = false;
31294 int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv);
31298 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31299 LDKOpenChannel orig_conv;
31300 orig_conv.inner = untag_ptr(orig);
31301 orig_conv.is_owned = ptr_is_owned(orig);
31302 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31303 orig_conv.is_owned = false;
31304 LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
31305 int64_t ret_ref = 0;
31306 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31307 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31311 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31312 LDKAcceptChannel this_obj_conv;
31313 this_obj_conv.inner = untag_ptr(this_obj);
31314 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31316 AcceptChannel_free(this_obj_conv);
31319 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
31320 LDKAcceptChannel this_ptr_conv;
31321 this_ptr_conv.inner = untag_ptr(this_ptr);
31322 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31324 this_ptr_conv.is_owned = false;
31325 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31326 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv));
31330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31331 LDKAcceptChannel this_ptr_conv;
31332 this_ptr_conv.inner = untag_ptr(this_ptr);
31333 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31335 this_ptr_conv.is_owned = false;
31336 LDKThirtyTwoBytes val_ref;
31337 CHECK((*env)->GetArrayLength(env, val) == 32);
31338 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
31339 AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
31342 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
31343 LDKAcceptChannel this_ptr_conv;
31344 this_ptr_conv.inner = untag_ptr(this_ptr);
31345 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31346 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31347 this_ptr_conv.is_owned = false;
31348 int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
31352 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31353 LDKAcceptChannel this_ptr_conv;
31354 this_ptr_conv.inner = untag_ptr(this_ptr);
31355 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31356 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31357 this_ptr_conv.is_owned = false;
31358 AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
31361 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) {
31362 LDKAcceptChannel this_ptr_conv;
31363 this_ptr_conv.inner = untag_ptr(this_ptr);
31364 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31365 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31366 this_ptr_conv.is_owned = false;
31367 int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
31371 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) {
31372 LDKAcceptChannel this_ptr_conv;
31373 this_ptr_conv.inner = untag_ptr(this_ptr);
31374 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31375 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31376 this_ptr_conv.is_owned = false;
31377 AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
31380 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
31381 LDKAcceptChannel this_ptr_conv;
31382 this_ptr_conv.inner = untag_ptr(this_ptr);
31383 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31384 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31385 this_ptr_conv.is_owned = false;
31386 int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
31390 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31391 LDKAcceptChannel this_ptr_conv;
31392 this_ptr_conv.inner = untag_ptr(this_ptr);
31393 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31394 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31395 this_ptr_conv.is_owned = false;
31396 AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
31399 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
31400 LDKAcceptChannel this_ptr_conv;
31401 this_ptr_conv.inner = untag_ptr(this_ptr);
31402 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31403 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31404 this_ptr_conv.is_owned = false;
31405 int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
31409 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31410 LDKAcceptChannel this_ptr_conv;
31411 this_ptr_conv.inner = untag_ptr(this_ptr);
31412 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31414 this_ptr_conv.is_owned = false;
31415 AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
31418 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
31419 LDKAcceptChannel this_ptr_conv;
31420 this_ptr_conv.inner = untag_ptr(this_ptr);
31421 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31423 this_ptr_conv.is_owned = false;
31424 int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv);
31428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
31429 LDKAcceptChannel this_ptr_conv;
31430 this_ptr_conv.inner = untag_ptr(this_ptr);
31431 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31432 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31433 this_ptr_conv.is_owned = false;
31434 AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
31437 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
31438 LDKAcceptChannel this_ptr_conv;
31439 this_ptr_conv.inner = untag_ptr(this_ptr);
31440 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31442 this_ptr_conv.is_owned = false;
31443 int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv);
31447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
31448 LDKAcceptChannel this_ptr_conv;
31449 this_ptr_conv.inner = untag_ptr(this_ptr);
31450 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31452 this_ptr_conv.is_owned = false;
31453 AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
31456 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
31457 LDKAcceptChannel this_ptr_conv;
31458 this_ptr_conv.inner = untag_ptr(this_ptr);
31459 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31461 this_ptr_conv.is_owned = false;
31462 int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
31466 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
31467 LDKAcceptChannel this_ptr_conv;
31468 this_ptr_conv.inner = untag_ptr(this_ptr);
31469 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31471 this_ptr_conv.is_owned = false;
31472 AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
31475 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
31476 LDKAcceptChannel this_ptr_conv;
31477 this_ptr_conv.inner = untag_ptr(this_ptr);
31478 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31479 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31480 this_ptr_conv.is_owned = false;
31481 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31482 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
31486 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31487 LDKAcceptChannel this_ptr_conv;
31488 this_ptr_conv.inner = untag_ptr(this_ptr);
31489 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31490 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31491 this_ptr_conv.is_owned = false;
31492 LDKPublicKey val_ref;
31493 CHECK((*env)->GetArrayLength(env, val) == 33);
31494 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31495 AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
31498 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
31499 LDKAcceptChannel this_ptr_conv;
31500 this_ptr_conv.inner = untag_ptr(this_ptr);
31501 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31503 this_ptr_conv.is_owned = false;
31504 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31505 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
31509 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31510 LDKAcceptChannel this_ptr_conv;
31511 this_ptr_conv.inner = untag_ptr(this_ptr);
31512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31514 this_ptr_conv.is_owned = false;
31515 LDKPublicKey val_ref;
31516 CHECK((*env)->GetArrayLength(env, val) == 33);
31517 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31518 AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
31521 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
31522 LDKAcceptChannel this_ptr_conv;
31523 this_ptr_conv.inner = untag_ptr(this_ptr);
31524 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31526 this_ptr_conv.is_owned = false;
31527 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31528 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form);
31532 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31533 LDKAcceptChannel this_ptr_conv;
31534 this_ptr_conv.inner = untag_ptr(this_ptr);
31535 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31537 this_ptr_conv.is_owned = false;
31538 LDKPublicKey val_ref;
31539 CHECK((*env)->GetArrayLength(env, val) == 33);
31540 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31541 AcceptChannel_set_payment_point(&this_ptr_conv, val_ref);
31544 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
31545 LDKAcceptChannel this_ptr_conv;
31546 this_ptr_conv.inner = untag_ptr(this_ptr);
31547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31549 this_ptr_conv.is_owned = false;
31550 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31551 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
31555 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31556 LDKAcceptChannel this_ptr_conv;
31557 this_ptr_conv.inner = untag_ptr(this_ptr);
31558 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31560 this_ptr_conv.is_owned = false;
31561 LDKPublicKey val_ref;
31562 CHECK((*env)->GetArrayLength(env, val) == 33);
31563 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31564 AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
31567 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
31568 LDKAcceptChannel 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 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31574 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
31578 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31579 LDKAcceptChannel this_ptr_conv;
31580 this_ptr_conv.inner = untag_ptr(this_ptr);
31581 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31582 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31583 this_ptr_conv.is_owned = false;
31584 LDKPublicKey val_ref;
31585 CHECK((*env)->GetArrayLength(env, val) == 33);
31586 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31587 AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
31590 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
31591 LDKAcceptChannel this_ptr_conv;
31592 this_ptr_conv.inner = untag_ptr(this_ptr);
31593 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31595 this_ptr_conv.is_owned = false;
31596 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31597 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
31601 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) {
31602 LDKAcceptChannel this_ptr_conv;
31603 this_ptr_conv.inner = untag_ptr(this_ptr);
31604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31606 this_ptr_conv.is_owned = false;
31607 LDKPublicKey val_ref;
31608 CHECK((*env)->GetArrayLength(env, val) == 33);
31609 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31610 AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
31613 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
31614 LDKAcceptChannel this_ptr_conv;
31615 this_ptr_conv.inner = untag_ptr(this_ptr);
31616 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31618 this_ptr_conv.is_owned = false;
31619 LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv);
31620 int64_t ret_ref = 0;
31621 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31622 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31627 LDKAcceptChannel this_ptr_conv;
31628 this_ptr_conv.inner = untag_ptr(this_ptr);
31629 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31630 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31631 this_ptr_conv.is_owned = false;
31632 LDKChannelTypeFeatures val_conv;
31633 val_conv.inner = untag_ptr(val);
31634 val_conv.is_owned = ptr_is_owned(val);
31635 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
31636 val_conv = ChannelTypeFeatures_clone(&val_conv);
31637 AcceptChannel_set_channel_type(&this_ptr_conv, val_conv);
31640 static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) {
31641 LDKAcceptChannel ret_var = AcceptChannel_clone(arg);
31642 int64_t ret_ref = 0;
31643 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31644 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31647 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31648 LDKAcceptChannel arg_conv;
31649 arg_conv.inner = untag_ptr(arg);
31650 arg_conv.is_owned = ptr_is_owned(arg);
31651 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31652 arg_conv.is_owned = false;
31653 int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv);
31657 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31658 LDKAcceptChannel orig_conv;
31659 orig_conv.inner = untag_ptr(orig);
31660 orig_conv.is_owned = ptr_is_owned(orig);
31661 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31662 orig_conv.is_owned = false;
31663 LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
31664 int64_t ret_ref = 0;
31665 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31666 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31670 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31671 LDKFundingCreated this_obj_conv;
31672 this_obj_conv.inner = untag_ptr(this_obj);
31673 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31675 FundingCreated_free(this_obj_conv);
31678 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
31679 LDKFundingCreated this_ptr_conv;
31680 this_ptr_conv.inner = untag_ptr(this_ptr);
31681 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31683 this_ptr_conv.is_owned = false;
31684 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31685 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv));
31689 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31690 LDKFundingCreated this_ptr_conv;
31691 this_ptr_conv.inner = untag_ptr(this_ptr);
31692 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31694 this_ptr_conv.is_owned = false;
31695 LDKThirtyTwoBytes val_ref;
31696 CHECK((*env)->GetArrayLength(env, val) == 32);
31697 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
31698 FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref);
31701 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
31702 LDKFundingCreated this_ptr_conv;
31703 this_ptr_conv.inner = untag_ptr(this_ptr);
31704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31706 this_ptr_conv.is_owned = false;
31707 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31708 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv));
31712 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31713 LDKFundingCreated this_ptr_conv;
31714 this_ptr_conv.inner = untag_ptr(this_ptr);
31715 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31717 this_ptr_conv.is_owned = false;
31718 LDKThirtyTwoBytes val_ref;
31719 CHECK((*env)->GetArrayLength(env, val) == 32);
31720 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
31721 FundingCreated_set_funding_txid(&this_ptr_conv, val_ref);
31724 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
31725 LDKFundingCreated this_ptr_conv;
31726 this_ptr_conv.inner = untag_ptr(this_ptr);
31727 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31729 this_ptr_conv.is_owned = false;
31730 int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv);
31734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
31735 LDKFundingCreated this_ptr_conv;
31736 this_ptr_conv.inner = untag_ptr(this_ptr);
31737 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31738 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31739 this_ptr_conv.is_owned = false;
31740 FundingCreated_set_funding_output_index(&this_ptr_conv, val);
31743 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
31744 LDKFundingCreated this_ptr_conv;
31745 this_ptr_conv.inner = untag_ptr(this_ptr);
31746 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31747 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31748 this_ptr_conv.is_owned = false;
31749 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
31750 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form);
31754 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31755 LDKFundingCreated this_ptr_conv;
31756 this_ptr_conv.inner = untag_ptr(this_ptr);
31757 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31759 this_ptr_conv.is_owned = false;
31760 LDKSignature val_ref;
31761 CHECK((*env)->GetArrayLength(env, val) == 64);
31762 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
31763 FundingCreated_set_signature(&this_ptr_conv, val_ref);
31766 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) {
31767 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
31768 CHECK((*env)->GetArrayLength(env, temporary_channel_id_arg) == 32);
31769 (*env)->GetByteArrayRegion(env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data);
31770 LDKThirtyTwoBytes funding_txid_arg_ref;
31771 CHECK((*env)->GetArrayLength(env, funding_txid_arg) == 32);
31772 (*env)->GetByteArrayRegion(env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data);
31773 LDKSignature signature_arg_ref;
31774 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
31775 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
31776 LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
31777 int64_t ret_ref = 0;
31778 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31779 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31783 static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) {
31784 LDKFundingCreated ret_var = FundingCreated_clone(arg);
31785 int64_t ret_ref = 0;
31786 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31787 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31790 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31791 LDKFundingCreated arg_conv;
31792 arg_conv.inner = untag_ptr(arg);
31793 arg_conv.is_owned = ptr_is_owned(arg);
31794 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31795 arg_conv.is_owned = false;
31796 int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv);
31800 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31801 LDKFundingCreated orig_conv;
31802 orig_conv.inner = untag_ptr(orig);
31803 orig_conv.is_owned = ptr_is_owned(orig);
31804 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31805 orig_conv.is_owned = false;
31806 LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
31807 int64_t ret_ref = 0;
31808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31809 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31814 LDKFundingSigned this_obj_conv;
31815 this_obj_conv.inner = untag_ptr(this_obj);
31816 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31818 FundingSigned_free(this_obj_conv);
31821 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
31822 LDKFundingSigned this_ptr_conv;
31823 this_ptr_conv.inner = untag_ptr(this_ptr);
31824 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31826 this_ptr_conv.is_owned = false;
31827 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31828 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv));
31832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31833 LDKFundingSigned this_ptr_conv;
31834 this_ptr_conv.inner = untag_ptr(this_ptr);
31835 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31837 this_ptr_conv.is_owned = false;
31838 LDKThirtyTwoBytes val_ref;
31839 CHECK((*env)->GetArrayLength(env, val) == 32);
31840 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
31841 FundingSigned_set_channel_id(&this_ptr_conv, val_ref);
31844 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
31845 LDKFundingSigned this_ptr_conv;
31846 this_ptr_conv.inner = untag_ptr(this_ptr);
31847 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31849 this_ptr_conv.is_owned = false;
31850 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
31851 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form);
31855 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31856 LDKFundingSigned this_ptr_conv;
31857 this_ptr_conv.inner = untag_ptr(this_ptr);
31858 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31860 this_ptr_conv.is_owned = false;
31861 LDKSignature val_ref;
31862 CHECK((*env)->GetArrayLength(env, val) == 64);
31863 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
31864 FundingSigned_set_signature(&this_ptr_conv, val_ref);
31867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg) {
31868 LDKThirtyTwoBytes channel_id_arg_ref;
31869 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
31870 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
31871 LDKSignature signature_arg_ref;
31872 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
31873 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
31874 LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
31875 int64_t ret_ref = 0;
31876 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31877 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31881 static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) {
31882 LDKFundingSigned ret_var = FundingSigned_clone(arg);
31883 int64_t ret_ref = 0;
31884 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31885 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31888 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31889 LDKFundingSigned arg_conv;
31890 arg_conv.inner = untag_ptr(arg);
31891 arg_conv.is_owned = ptr_is_owned(arg);
31892 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31893 arg_conv.is_owned = false;
31894 int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv);
31898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31899 LDKFundingSigned orig_conv;
31900 orig_conv.inner = untag_ptr(orig);
31901 orig_conv.is_owned = ptr_is_owned(orig);
31902 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31903 orig_conv.is_owned = false;
31904 LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
31905 int64_t ret_ref = 0;
31906 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31907 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31911 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31912 LDKChannelReady this_obj_conv;
31913 this_obj_conv.inner = untag_ptr(this_obj);
31914 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31916 ChannelReady_free(this_obj_conv);
31919 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
31920 LDKChannelReady this_ptr_conv;
31921 this_ptr_conv.inner = untag_ptr(this_ptr);
31922 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31924 this_ptr_conv.is_owned = false;
31925 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31926 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReady_get_channel_id(&this_ptr_conv));
31930 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31931 LDKChannelReady this_ptr_conv;
31932 this_ptr_conv.inner = untag_ptr(this_ptr);
31933 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31935 this_ptr_conv.is_owned = false;
31936 LDKThirtyTwoBytes val_ref;
31937 CHECK((*env)->GetArrayLength(env, val) == 32);
31938 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
31939 ChannelReady_set_channel_id(&this_ptr_conv, val_ref);
31942 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
31943 LDKChannelReady this_ptr_conv;
31944 this_ptr_conv.inner = untag_ptr(this_ptr);
31945 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31946 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31947 this_ptr_conv.is_owned = false;
31948 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31949 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
31953 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) {
31954 LDKChannelReady this_ptr_conv;
31955 this_ptr_conv.inner = untag_ptr(this_ptr);
31956 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31958 this_ptr_conv.is_owned = false;
31959 LDKPublicKey val_ref;
31960 CHECK((*env)->GetArrayLength(env, val) == 33);
31961 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31962 ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref);
31965 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
31966 LDKChannelReady this_ptr_conv;
31967 this_ptr_conv.inner = untag_ptr(this_ptr);
31968 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31970 this_ptr_conv.is_owned = false;
31971 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
31972 *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv);
31973 int64_t ret_ref = tag_ptr(ret_copy, true);
31977 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) {
31978 LDKChannelReady this_ptr_conv;
31979 this_ptr_conv.inner = untag_ptr(this_ptr);
31980 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31982 this_ptr_conv.is_owned = false;
31983 void* val_ptr = untag_ptr(val);
31984 CHECK_ACCESS(val_ptr);
31985 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
31986 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
31987 ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv);
31990 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) {
31991 LDKThirtyTwoBytes channel_id_arg_ref;
31992 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
31993 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
31994 LDKPublicKey next_per_commitment_point_arg_ref;
31995 CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
31996 (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
31997 void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg);
31998 CHECK_ACCESS(short_channel_id_alias_arg_ptr);
31999 LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr);
32000 short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg));
32001 LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv);
32002 int64_t ret_ref = 0;
32003 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32004 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32008 static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) {
32009 LDKChannelReady ret_var = ChannelReady_clone(arg);
32010 int64_t ret_ref = 0;
32011 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32012 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32015 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32016 LDKChannelReady arg_conv;
32017 arg_conv.inner = untag_ptr(arg);
32018 arg_conv.is_owned = ptr_is_owned(arg);
32019 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32020 arg_conv.is_owned = false;
32021 int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv);
32025 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32026 LDKChannelReady orig_conv;
32027 orig_conv.inner = untag_ptr(orig);
32028 orig_conv.is_owned = ptr_is_owned(orig);
32029 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32030 orig_conv.is_owned = false;
32031 LDKChannelReady ret_var = ChannelReady_clone(&orig_conv);
32032 int64_t ret_ref = 0;
32033 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32034 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32039 LDKShutdown this_obj_conv;
32040 this_obj_conv.inner = untag_ptr(this_obj);
32041 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32043 Shutdown_free(this_obj_conv);
32046 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32047 LDKShutdown this_ptr_conv;
32048 this_ptr_conv.inner = untag_ptr(this_ptr);
32049 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32050 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32051 this_ptr_conv.is_owned = false;
32052 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32053 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv));
32057 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32058 LDKShutdown this_ptr_conv;
32059 this_ptr_conv.inner = untag_ptr(this_ptr);
32060 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32061 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32062 this_ptr_conv.is_owned = false;
32063 LDKThirtyTwoBytes val_ref;
32064 CHECK((*env)->GetArrayLength(env, val) == 32);
32065 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32066 Shutdown_set_channel_id(&this_ptr_conv, val_ref);
32069 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
32070 LDKShutdown this_ptr_conv;
32071 this_ptr_conv.inner = untag_ptr(this_ptr);
32072 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32074 this_ptr_conv.is_owned = false;
32075 LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
32076 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
32077 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
32081 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32082 LDKShutdown this_ptr_conv;
32083 this_ptr_conv.inner = untag_ptr(this_ptr);
32084 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32086 this_ptr_conv.is_owned = false;
32087 LDKCVec_u8Z val_ref;
32088 val_ref.datalen = (*env)->GetArrayLength(env, val);
32089 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
32090 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
32091 Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref);
32094 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) {
32095 LDKThirtyTwoBytes channel_id_arg_ref;
32096 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
32097 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
32098 LDKCVec_u8Z scriptpubkey_arg_ref;
32099 scriptpubkey_arg_ref.datalen = (*env)->GetArrayLength(env, scriptpubkey_arg);
32100 scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
32101 (*env)->GetByteArrayRegion(env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data);
32102 LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
32103 int64_t ret_ref = 0;
32104 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32105 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32109 static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) {
32110 LDKShutdown ret_var = Shutdown_clone(arg);
32111 int64_t ret_ref = 0;
32112 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32113 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32116 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32117 LDKShutdown arg_conv;
32118 arg_conv.inner = untag_ptr(arg);
32119 arg_conv.is_owned = ptr_is_owned(arg);
32120 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32121 arg_conv.is_owned = false;
32122 int64_t ret_conv = Shutdown_clone_ptr(&arg_conv);
32126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32127 LDKShutdown orig_conv;
32128 orig_conv.inner = untag_ptr(orig);
32129 orig_conv.is_owned = ptr_is_owned(orig);
32130 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32131 orig_conv.is_owned = false;
32132 LDKShutdown ret_var = Shutdown_clone(&orig_conv);
32133 int64_t ret_ref = 0;
32134 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32135 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32139 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32140 LDKClosingSignedFeeRange this_obj_conv;
32141 this_obj_conv.inner = untag_ptr(this_obj);
32142 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32144 ClosingSignedFeeRange_free(this_obj_conv);
32147 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
32148 LDKClosingSignedFeeRange this_ptr_conv;
32149 this_ptr_conv.inner = untag_ptr(this_ptr);
32150 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32152 this_ptr_conv.is_owned = false;
32153 int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
32157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32158 LDKClosingSignedFeeRange this_ptr_conv;
32159 this_ptr_conv.inner = untag_ptr(this_ptr);
32160 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32162 this_ptr_conv.is_owned = false;
32163 ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
32166 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
32167 LDKClosingSignedFeeRange this_ptr_conv;
32168 this_ptr_conv.inner = untag_ptr(this_ptr);
32169 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32171 this_ptr_conv.is_owned = false;
32172 int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
32176 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32177 LDKClosingSignedFeeRange this_ptr_conv;
32178 this_ptr_conv.inner = untag_ptr(this_ptr);
32179 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32181 this_ptr_conv.is_owned = false;
32182 ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
32185 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) {
32186 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
32187 int64_t ret_ref = 0;
32188 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32189 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32193 static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) {
32194 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg);
32195 int64_t ret_ref = 0;
32196 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32197 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32200 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32201 LDKClosingSignedFeeRange arg_conv;
32202 arg_conv.inner = untag_ptr(arg);
32203 arg_conv.is_owned = ptr_is_owned(arg);
32204 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32205 arg_conv.is_owned = false;
32206 int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv);
32210 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32211 LDKClosingSignedFeeRange orig_conv;
32212 orig_conv.inner = untag_ptr(orig);
32213 orig_conv.is_owned = ptr_is_owned(orig);
32214 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32215 orig_conv.is_owned = false;
32216 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
32217 int64_t ret_ref = 0;
32218 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32219 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32223 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32224 LDKClosingSigned this_obj_conv;
32225 this_obj_conv.inner = untag_ptr(this_obj);
32226 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32228 ClosingSigned_free(this_obj_conv);
32231 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32232 LDKClosingSigned this_ptr_conv;
32233 this_ptr_conv.inner = untag_ptr(this_ptr);
32234 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32236 this_ptr_conv.is_owned = false;
32237 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32238 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv));
32242 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32243 LDKClosingSigned this_ptr_conv;
32244 this_ptr_conv.inner = untag_ptr(this_ptr);
32245 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32247 this_ptr_conv.is_owned = false;
32248 LDKThirtyTwoBytes val_ref;
32249 CHECK((*env)->GetArrayLength(env, val) == 32);
32250 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32251 ClosingSigned_set_channel_id(&this_ptr_conv, val_ref);
32254 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
32255 LDKClosingSigned this_ptr_conv;
32256 this_ptr_conv.inner = untag_ptr(this_ptr);
32257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32259 this_ptr_conv.is_owned = false;
32260 int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
32264 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32265 LDKClosingSigned this_ptr_conv;
32266 this_ptr_conv.inner = untag_ptr(this_ptr);
32267 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32269 this_ptr_conv.is_owned = false;
32270 ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
32273 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
32274 LDKClosingSigned this_ptr_conv;
32275 this_ptr_conv.inner = untag_ptr(this_ptr);
32276 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32278 this_ptr_conv.is_owned = false;
32279 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
32280 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form);
32284 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32285 LDKClosingSigned this_ptr_conv;
32286 this_ptr_conv.inner = untag_ptr(this_ptr);
32287 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32288 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32289 this_ptr_conv.is_owned = false;
32290 LDKSignature val_ref;
32291 CHECK((*env)->GetArrayLength(env, val) == 64);
32292 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
32293 ClosingSigned_set_signature(&this_ptr_conv, val_ref);
32296 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr) {
32297 LDKClosingSigned this_ptr_conv;
32298 this_ptr_conv.inner = untag_ptr(this_ptr);
32299 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32301 this_ptr_conv.is_owned = false;
32302 LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
32303 int64_t ret_ref = 0;
32304 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32305 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32309 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32310 LDKClosingSigned this_ptr_conv;
32311 this_ptr_conv.inner = untag_ptr(this_ptr);
32312 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32314 this_ptr_conv.is_owned = false;
32315 LDKClosingSignedFeeRange val_conv;
32316 val_conv.inner = untag_ptr(val);
32317 val_conv.is_owned = ptr_is_owned(val);
32318 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32319 val_conv = ClosingSignedFeeRange_clone(&val_conv);
32320 ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
32323 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) {
32324 LDKThirtyTwoBytes channel_id_arg_ref;
32325 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
32326 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
32327 LDKSignature signature_arg_ref;
32328 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
32329 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
32330 LDKClosingSignedFeeRange fee_range_arg_conv;
32331 fee_range_arg_conv.inner = untag_ptr(fee_range_arg);
32332 fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg);
32333 CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv);
32334 fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
32335 LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv);
32336 int64_t ret_ref = 0;
32337 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32338 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32342 static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) {
32343 LDKClosingSigned ret_var = ClosingSigned_clone(arg);
32344 int64_t ret_ref = 0;
32345 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32346 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32349 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32350 LDKClosingSigned arg_conv;
32351 arg_conv.inner = untag_ptr(arg);
32352 arg_conv.is_owned = ptr_is_owned(arg);
32353 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32354 arg_conv.is_owned = false;
32355 int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv);
32359 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32360 LDKClosingSigned orig_conv;
32361 orig_conv.inner = untag_ptr(orig);
32362 orig_conv.is_owned = ptr_is_owned(orig);
32363 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32364 orig_conv.is_owned = false;
32365 LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
32366 int64_t ret_ref = 0;
32367 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32368 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32372 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32373 LDKUpdateAddHTLC this_obj_conv;
32374 this_obj_conv.inner = untag_ptr(this_obj);
32375 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32376 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32377 UpdateAddHTLC_free(this_obj_conv);
32380 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32381 LDKUpdateAddHTLC this_ptr_conv;
32382 this_ptr_conv.inner = untag_ptr(this_ptr);
32383 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32384 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32385 this_ptr_conv.is_owned = false;
32386 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32387 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv));
32391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32392 LDKUpdateAddHTLC this_ptr_conv;
32393 this_ptr_conv.inner = untag_ptr(this_ptr);
32394 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32396 this_ptr_conv.is_owned = false;
32397 LDKThirtyTwoBytes val_ref;
32398 CHECK((*env)->GetArrayLength(env, val) == 32);
32399 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32400 UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref);
32403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32404 LDKUpdateAddHTLC this_ptr_conv;
32405 this_ptr_conv.inner = untag_ptr(this_ptr);
32406 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32408 this_ptr_conv.is_owned = false;
32409 int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
32413 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32414 LDKUpdateAddHTLC this_ptr_conv;
32415 this_ptr_conv.inner = untag_ptr(this_ptr);
32416 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32418 this_ptr_conv.is_owned = false;
32419 UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
32422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32423 LDKUpdateAddHTLC this_ptr_conv;
32424 this_ptr_conv.inner = untag_ptr(this_ptr);
32425 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32427 this_ptr_conv.is_owned = false;
32428 int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
32432 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32433 LDKUpdateAddHTLC this_ptr_conv;
32434 this_ptr_conv.inner = untag_ptr(this_ptr);
32435 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32437 this_ptr_conv.is_owned = false;
32438 UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
32441 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
32442 LDKUpdateAddHTLC this_ptr_conv;
32443 this_ptr_conv.inner = untag_ptr(this_ptr);
32444 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32446 this_ptr_conv.is_owned = false;
32447 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32448 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv));
32452 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32453 LDKUpdateAddHTLC this_ptr_conv;
32454 this_ptr_conv.inner = untag_ptr(this_ptr);
32455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32457 this_ptr_conv.is_owned = false;
32458 LDKThirtyTwoBytes val_ref;
32459 CHECK((*env)->GetArrayLength(env, val) == 32);
32460 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32461 UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref);
32464 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) {
32465 LDKUpdateAddHTLC this_ptr_conv;
32466 this_ptr_conv.inner = untag_ptr(this_ptr);
32467 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32469 this_ptr_conv.is_owned = false;
32470 int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
32474 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
32475 LDKUpdateAddHTLC 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 UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
32483 static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) {
32484 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg);
32485 int64_t ret_ref = 0;
32486 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32487 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32490 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32491 LDKUpdateAddHTLC arg_conv;
32492 arg_conv.inner = untag_ptr(arg);
32493 arg_conv.is_owned = ptr_is_owned(arg);
32494 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32495 arg_conv.is_owned = false;
32496 int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv);
32500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32501 LDKUpdateAddHTLC orig_conv;
32502 orig_conv.inner = untag_ptr(orig);
32503 orig_conv.is_owned = ptr_is_owned(orig);
32504 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32505 orig_conv.is_owned = false;
32506 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
32507 int64_t ret_ref = 0;
32508 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32509 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32513 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32514 LDKUpdateFulfillHTLC this_obj_conv;
32515 this_obj_conv.inner = untag_ptr(this_obj);
32516 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32518 UpdateFulfillHTLC_free(this_obj_conv);
32521 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32522 LDKUpdateFulfillHTLC this_ptr_conv;
32523 this_ptr_conv.inner = untag_ptr(this_ptr);
32524 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32526 this_ptr_conv.is_owned = false;
32527 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32528 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv));
32532 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32533 LDKUpdateFulfillHTLC this_ptr_conv;
32534 this_ptr_conv.inner = untag_ptr(this_ptr);
32535 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32537 this_ptr_conv.is_owned = false;
32538 LDKThirtyTwoBytes val_ref;
32539 CHECK((*env)->GetArrayLength(env, val) == 32);
32540 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32541 UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref);
32544 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32545 LDKUpdateFulfillHTLC this_ptr_conv;
32546 this_ptr_conv.inner = untag_ptr(this_ptr);
32547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32549 this_ptr_conv.is_owned = false;
32550 int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
32554 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32555 LDKUpdateFulfillHTLC this_ptr_conv;
32556 this_ptr_conv.inner = untag_ptr(this_ptr);
32557 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32558 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32559 this_ptr_conv.is_owned = false;
32560 UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
32563 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) {
32564 LDKUpdateFulfillHTLC this_ptr_conv;
32565 this_ptr_conv.inner = untag_ptr(this_ptr);
32566 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32567 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32568 this_ptr_conv.is_owned = false;
32569 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32570 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv));
32574 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32575 LDKUpdateFulfillHTLC this_ptr_conv;
32576 this_ptr_conv.inner = untag_ptr(this_ptr);
32577 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32579 this_ptr_conv.is_owned = false;
32580 LDKThirtyTwoBytes val_ref;
32581 CHECK((*env)->GetArrayLength(env, val) == 32);
32582 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32583 UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref);
32586 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) {
32587 LDKThirtyTwoBytes channel_id_arg_ref;
32588 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
32589 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
32590 LDKThirtyTwoBytes payment_preimage_arg_ref;
32591 CHECK((*env)->GetArrayLength(env, payment_preimage_arg) == 32);
32592 (*env)->GetByteArrayRegion(env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data);
32593 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
32594 int64_t ret_ref = 0;
32595 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32596 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32600 static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) {
32601 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg);
32602 int64_t ret_ref = 0;
32603 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32604 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32608 LDKUpdateFulfillHTLC arg_conv;
32609 arg_conv.inner = untag_ptr(arg);
32610 arg_conv.is_owned = ptr_is_owned(arg);
32611 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32612 arg_conv.is_owned = false;
32613 int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv);
32617 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32618 LDKUpdateFulfillHTLC orig_conv;
32619 orig_conv.inner = untag_ptr(orig);
32620 orig_conv.is_owned = ptr_is_owned(orig);
32621 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32622 orig_conv.is_owned = false;
32623 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
32624 int64_t ret_ref = 0;
32625 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32626 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32631 LDKUpdateFailHTLC this_obj_conv;
32632 this_obj_conv.inner = untag_ptr(this_obj);
32633 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32635 UpdateFailHTLC_free(this_obj_conv);
32638 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32639 LDKUpdateFailHTLC this_ptr_conv;
32640 this_ptr_conv.inner = untag_ptr(this_ptr);
32641 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32643 this_ptr_conv.is_owned = false;
32644 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32645 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv));
32649 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32650 LDKUpdateFailHTLC this_ptr_conv;
32651 this_ptr_conv.inner = untag_ptr(this_ptr);
32652 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32653 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32654 this_ptr_conv.is_owned = false;
32655 LDKThirtyTwoBytes val_ref;
32656 CHECK((*env)->GetArrayLength(env, val) == 32);
32657 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32658 UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref);
32661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32662 LDKUpdateFailHTLC this_ptr_conv;
32663 this_ptr_conv.inner = untag_ptr(this_ptr);
32664 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32666 this_ptr_conv.is_owned = false;
32667 int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
32671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32672 LDKUpdateFailHTLC this_ptr_conv;
32673 this_ptr_conv.inner = untag_ptr(this_ptr);
32674 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32676 this_ptr_conv.is_owned = false;
32677 UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
32680 static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) {
32681 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg);
32682 int64_t ret_ref = 0;
32683 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32684 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32687 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32688 LDKUpdateFailHTLC arg_conv;
32689 arg_conv.inner = untag_ptr(arg);
32690 arg_conv.is_owned = ptr_is_owned(arg);
32691 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32692 arg_conv.is_owned = false;
32693 int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv);
32697 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32698 LDKUpdateFailHTLC orig_conv;
32699 orig_conv.inner = untag_ptr(orig);
32700 orig_conv.is_owned = ptr_is_owned(orig);
32701 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32702 orig_conv.is_owned = false;
32703 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
32704 int64_t ret_ref = 0;
32705 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32706 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32711 LDKUpdateFailMalformedHTLC this_obj_conv;
32712 this_obj_conv.inner = untag_ptr(this_obj);
32713 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32714 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32715 UpdateFailMalformedHTLC_free(this_obj_conv);
32718 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32719 LDKUpdateFailMalformedHTLC this_ptr_conv;
32720 this_ptr_conv.inner = untag_ptr(this_ptr);
32721 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32722 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32723 this_ptr_conv.is_owned = false;
32724 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32725 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv));
32729 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32730 LDKUpdateFailMalformedHTLC this_ptr_conv;
32731 this_ptr_conv.inner = untag_ptr(this_ptr);
32732 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32734 this_ptr_conv.is_owned = false;
32735 LDKThirtyTwoBytes val_ref;
32736 CHECK((*env)->GetArrayLength(env, val) == 32);
32737 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32738 UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref);
32741 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32742 LDKUpdateFailMalformedHTLC this_ptr_conv;
32743 this_ptr_conv.inner = untag_ptr(this_ptr);
32744 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32746 this_ptr_conv.is_owned = false;
32747 int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
32751 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32752 LDKUpdateFailMalformedHTLC this_ptr_conv;
32753 this_ptr_conv.inner = untag_ptr(this_ptr);
32754 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32755 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32756 this_ptr_conv.is_owned = false;
32757 UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
32760 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr) {
32761 LDKUpdateFailMalformedHTLC this_ptr_conv;
32762 this_ptr_conv.inner = untag_ptr(this_ptr);
32763 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32765 this_ptr_conv.is_owned = false;
32766 int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
32770 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
32771 LDKUpdateFailMalformedHTLC this_ptr_conv;
32772 this_ptr_conv.inner = untag_ptr(this_ptr);
32773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32775 this_ptr_conv.is_owned = false;
32776 UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
32779 static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) {
32780 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg);
32781 int64_t ret_ref = 0;
32782 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32783 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32787 LDKUpdateFailMalformedHTLC arg_conv;
32788 arg_conv.inner = untag_ptr(arg);
32789 arg_conv.is_owned = ptr_is_owned(arg);
32790 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32791 arg_conv.is_owned = false;
32792 int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv);
32796 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32797 LDKUpdateFailMalformedHTLC orig_conv;
32798 orig_conv.inner = untag_ptr(orig);
32799 orig_conv.is_owned = ptr_is_owned(orig);
32800 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32801 orig_conv.is_owned = false;
32802 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
32803 int64_t ret_ref = 0;
32804 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32805 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32809 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32810 LDKCommitmentSigned this_obj_conv;
32811 this_obj_conv.inner = untag_ptr(this_obj);
32812 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32814 CommitmentSigned_free(this_obj_conv);
32817 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32818 LDKCommitmentSigned this_ptr_conv;
32819 this_ptr_conv.inner = untag_ptr(this_ptr);
32820 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32821 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32822 this_ptr_conv.is_owned = false;
32823 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32824 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv));
32828 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32829 LDKCommitmentSigned this_ptr_conv;
32830 this_ptr_conv.inner = untag_ptr(this_ptr);
32831 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32832 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32833 this_ptr_conv.is_owned = false;
32834 LDKThirtyTwoBytes val_ref;
32835 CHECK((*env)->GetArrayLength(env, val) == 32);
32836 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32837 CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref);
32840 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
32841 LDKCommitmentSigned this_ptr_conv;
32842 this_ptr_conv.inner = untag_ptr(this_ptr);
32843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32845 this_ptr_conv.is_owned = false;
32846 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
32847 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form);
32851 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32852 LDKCommitmentSigned this_ptr_conv;
32853 this_ptr_conv.inner = untag_ptr(this_ptr);
32854 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32856 this_ptr_conv.is_owned = false;
32857 LDKSignature val_ref;
32858 CHECK((*env)->GetArrayLength(env, val) == 64);
32859 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
32860 CommitmentSigned_set_signature(&this_ptr_conv, val_ref);
32863 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr) {
32864 LDKCommitmentSigned this_ptr_conv;
32865 this_ptr_conv.inner = untag_ptr(this_ptr);
32866 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32867 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32868 this_ptr_conv.is_owned = false;
32869 LDKCVec_SignatureZ ret_var = CommitmentSigned_get_htlc_signatures(&this_ptr_conv);
32870 jobjectArray ret_arr = NULL;
32871 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
32873 for (size_t i = 0; i < ret_var.datalen; i++) {
32874 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
32875 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
32876 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
32879 FREE(ret_var.data);
32883 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
32884 LDKCommitmentSigned this_ptr_conv;
32885 this_ptr_conv.inner = untag_ptr(this_ptr);
32886 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32888 this_ptr_conv.is_owned = false;
32889 LDKCVec_SignatureZ val_constr;
32890 val_constr.datalen = (*env)->GetArrayLength(env, val);
32891 if (val_constr.datalen > 0)
32892 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
32894 val_constr.data = NULL;
32895 for (size_t i = 0; i < val_constr.datalen; i++) {
32896 int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
32897 LDKSignature val_conv_8_ref;
32898 CHECK((*env)->GetArrayLength(env, val_conv_8) == 64);
32899 (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form);
32900 val_constr.data[i] = val_conv_8_ref;
32902 CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
32905 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) {
32906 LDKThirtyTwoBytes channel_id_arg_ref;
32907 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
32908 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
32909 LDKSignature signature_arg_ref;
32910 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
32911 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
32912 LDKCVec_SignatureZ htlc_signatures_arg_constr;
32913 htlc_signatures_arg_constr.datalen = (*env)->GetArrayLength(env, htlc_signatures_arg);
32914 if (htlc_signatures_arg_constr.datalen > 0)
32915 htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
32917 htlc_signatures_arg_constr.data = NULL;
32918 for (size_t i = 0; i < htlc_signatures_arg_constr.datalen; i++) {
32919 int8_tArray htlc_signatures_arg_conv_8 = (*env)->GetObjectArrayElement(env, htlc_signatures_arg, i);
32920 LDKSignature htlc_signatures_arg_conv_8_ref;
32921 CHECK((*env)->GetArrayLength(env, htlc_signatures_arg_conv_8) == 64);
32922 (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form);
32923 htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref;
32925 LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
32926 int64_t ret_ref = 0;
32927 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32928 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32932 static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) {
32933 LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg);
32934 int64_t ret_ref = 0;
32935 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32936 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32939 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32940 LDKCommitmentSigned arg_conv;
32941 arg_conv.inner = untag_ptr(arg);
32942 arg_conv.is_owned = ptr_is_owned(arg);
32943 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32944 arg_conv.is_owned = false;
32945 int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv);
32949 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32950 LDKCommitmentSigned orig_conv;
32951 orig_conv.inner = untag_ptr(orig);
32952 orig_conv.is_owned = ptr_is_owned(orig);
32953 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32954 orig_conv.is_owned = false;
32955 LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
32956 int64_t ret_ref = 0;
32957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32962 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32963 LDKRevokeAndACK this_obj_conv;
32964 this_obj_conv.inner = untag_ptr(this_obj);
32965 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32966 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32967 RevokeAndACK_free(this_obj_conv);
32970 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32971 LDKRevokeAndACK this_ptr_conv;
32972 this_ptr_conv.inner = untag_ptr(this_ptr);
32973 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32975 this_ptr_conv.is_owned = false;
32976 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32977 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv));
32981 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32982 LDKRevokeAndACK this_ptr_conv;
32983 this_ptr_conv.inner = untag_ptr(this_ptr);
32984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32986 this_ptr_conv.is_owned = false;
32987 LDKThirtyTwoBytes val_ref;
32988 CHECK((*env)->GetArrayLength(env, val) == 32);
32989 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32990 RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref);
32993 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) {
32994 LDKRevokeAndACK this_ptr_conv;
32995 this_ptr_conv.inner = untag_ptr(this_ptr);
32996 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32998 this_ptr_conv.is_owned = false;
32999 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33000 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv));
33004 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33005 LDKRevokeAndACK this_ptr_conv;
33006 this_ptr_conv.inner = untag_ptr(this_ptr);
33007 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33009 this_ptr_conv.is_owned = false;
33010 LDKThirtyTwoBytes val_ref;
33011 CHECK((*env)->GetArrayLength(env, val) == 32);
33012 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33013 RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref);
33016 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
33017 LDKRevokeAndACK this_ptr_conv;
33018 this_ptr_conv.inner = untag_ptr(this_ptr);
33019 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33021 this_ptr_conv.is_owned = false;
33022 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33023 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
33027 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) {
33028 LDKRevokeAndACK this_ptr_conv;
33029 this_ptr_conv.inner = untag_ptr(this_ptr);
33030 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33032 this_ptr_conv.is_owned = false;
33033 LDKPublicKey val_ref;
33034 CHECK((*env)->GetArrayLength(env, val) == 33);
33035 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33036 RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref);
33039 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) {
33040 LDKThirtyTwoBytes channel_id_arg_ref;
33041 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
33042 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
33043 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
33044 CHECK((*env)->GetArrayLength(env, per_commitment_secret_arg) == 32);
33045 (*env)->GetByteArrayRegion(env, per_commitment_secret_arg, 0, 32, per_commitment_secret_arg_ref.data);
33046 LDKPublicKey next_per_commitment_point_arg_ref;
33047 CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
33048 (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
33049 LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
33050 int64_t ret_ref = 0;
33051 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33052 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33056 static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) {
33057 LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg);
33058 int64_t ret_ref = 0;
33059 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33060 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33064 LDKRevokeAndACK arg_conv;
33065 arg_conv.inner = untag_ptr(arg);
33066 arg_conv.is_owned = ptr_is_owned(arg);
33067 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33068 arg_conv.is_owned = false;
33069 int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv);
33073 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33074 LDKRevokeAndACK orig_conv;
33075 orig_conv.inner = untag_ptr(orig);
33076 orig_conv.is_owned = ptr_is_owned(orig);
33077 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33078 orig_conv.is_owned = false;
33079 LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
33080 int64_t ret_ref = 0;
33081 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33082 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33086 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33087 LDKUpdateFee this_obj_conv;
33088 this_obj_conv.inner = untag_ptr(this_obj);
33089 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33090 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33091 UpdateFee_free(this_obj_conv);
33094 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
33095 LDKUpdateFee this_ptr_conv;
33096 this_ptr_conv.inner = untag_ptr(this_ptr);
33097 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33098 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33099 this_ptr_conv.is_owned = false;
33100 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33101 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv));
33105 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33106 LDKUpdateFee this_ptr_conv;
33107 this_ptr_conv.inner = untag_ptr(this_ptr);
33108 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33110 this_ptr_conv.is_owned = false;
33111 LDKThirtyTwoBytes val_ref;
33112 CHECK((*env)->GetArrayLength(env, val) == 32);
33113 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33114 UpdateFee_set_channel_id(&this_ptr_conv, val_ref);
33117 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) {
33118 LDKUpdateFee this_ptr_conv;
33119 this_ptr_conv.inner = untag_ptr(this_ptr);
33120 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33122 this_ptr_conv.is_owned = false;
33123 int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
33127 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
33128 LDKUpdateFee this_ptr_conv;
33129 this_ptr_conv.inner = untag_ptr(this_ptr);
33130 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33131 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33132 this_ptr_conv.is_owned = false;
33133 UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
33136 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) {
33137 LDKThirtyTwoBytes channel_id_arg_ref;
33138 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
33139 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
33140 LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
33141 int64_t ret_ref = 0;
33142 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33143 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33147 static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) {
33148 LDKUpdateFee ret_var = UpdateFee_clone(arg);
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);
33154 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33155 LDKUpdateFee arg_conv;
33156 arg_conv.inner = untag_ptr(arg);
33157 arg_conv.is_owned = ptr_is_owned(arg);
33158 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33159 arg_conv.is_owned = false;
33160 int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv);
33164 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33165 LDKUpdateFee orig_conv;
33166 orig_conv.inner = untag_ptr(orig);
33167 orig_conv.is_owned = ptr_is_owned(orig);
33168 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33169 orig_conv.is_owned = false;
33170 LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
33171 int64_t ret_ref = 0;
33172 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33173 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33177 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33178 LDKDataLossProtect this_obj_conv;
33179 this_obj_conv.inner = untag_ptr(this_obj);
33180 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33181 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33182 DataLossProtect_free(this_obj_conv);
33185 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) {
33186 LDKDataLossProtect this_ptr_conv;
33187 this_ptr_conv.inner = untag_ptr(this_ptr);
33188 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33190 this_ptr_conv.is_owned = false;
33191 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33192 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv));
33196 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) {
33197 LDKDataLossProtect this_ptr_conv;
33198 this_ptr_conv.inner = untag_ptr(this_ptr);
33199 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33201 this_ptr_conv.is_owned = false;
33202 LDKThirtyTwoBytes val_ref;
33203 CHECK((*env)->GetArrayLength(env, val) == 32);
33204 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33205 DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref);
33208 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
33209 LDKDataLossProtect 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 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33215 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form);
33219 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) {
33220 LDKDataLossProtect this_ptr_conv;
33221 this_ptr_conv.inner = untag_ptr(this_ptr);
33222 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33224 this_ptr_conv.is_owned = false;
33225 LDKPublicKey val_ref;
33226 CHECK((*env)->GetArrayLength(env, val) == 33);
33227 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33228 DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref);
33231 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) {
33232 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
33233 CHECK((*env)->GetArrayLength(env, your_last_per_commitment_secret_arg) == 32);
33234 (*env)->GetByteArrayRegion(env, your_last_per_commitment_secret_arg, 0, 32, your_last_per_commitment_secret_arg_ref.data);
33235 LDKPublicKey my_current_per_commitment_point_arg_ref;
33236 CHECK((*env)->GetArrayLength(env, my_current_per_commitment_point_arg) == 33);
33237 (*env)->GetByteArrayRegion(env, my_current_per_commitment_point_arg, 0, 33, my_current_per_commitment_point_arg_ref.compressed_form);
33238 LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
33239 int64_t ret_ref = 0;
33240 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33241 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33245 static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) {
33246 LDKDataLossProtect ret_var = DataLossProtect_clone(arg);
33247 int64_t ret_ref = 0;
33248 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33249 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33252 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33253 LDKDataLossProtect arg_conv;
33254 arg_conv.inner = untag_ptr(arg);
33255 arg_conv.is_owned = ptr_is_owned(arg);
33256 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33257 arg_conv.is_owned = false;
33258 int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv);
33262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33263 LDKDataLossProtect orig_conv;
33264 orig_conv.inner = untag_ptr(orig);
33265 orig_conv.is_owned = ptr_is_owned(orig);
33266 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33267 orig_conv.is_owned = false;
33268 LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
33269 int64_t ret_ref = 0;
33270 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33271 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33275 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33276 LDKChannelReestablish this_obj_conv;
33277 this_obj_conv.inner = untag_ptr(this_obj);
33278 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33280 ChannelReestablish_free(this_obj_conv);
33283 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
33284 LDKChannelReestablish this_ptr_conv;
33285 this_ptr_conv.inner = untag_ptr(this_ptr);
33286 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33288 this_ptr_conv.is_owned = false;
33289 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33290 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv));
33294 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33295 LDKChannelReestablish this_ptr_conv;
33296 this_ptr_conv.inner = untag_ptr(this_ptr);
33297 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33298 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33299 this_ptr_conv.is_owned = false;
33300 LDKThirtyTwoBytes val_ref;
33301 CHECK((*env)->GetArrayLength(env, val) == 32);
33302 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33303 ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref);
33306 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) {
33307 LDKChannelReestablish this_ptr_conv;
33308 this_ptr_conv.inner = untag_ptr(this_ptr);
33309 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33311 this_ptr_conv.is_owned = false;
33312 int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
33316 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) {
33317 LDKChannelReestablish this_ptr_conv;
33318 this_ptr_conv.inner = untag_ptr(this_ptr);
33319 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33321 this_ptr_conv.is_owned = false;
33322 ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
33325 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) {
33326 LDKChannelReestablish this_ptr_conv;
33327 this_ptr_conv.inner = untag_ptr(this_ptr);
33328 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33330 this_ptr_conv.is_owned = false;
33331 int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
33335 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) {
33336 LDKChannelReestablish this_ptr_conv;
33337 this_ptr_conv.inner = untag_ptr(this_ptr);
33338 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33339 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33340 this_ptr_conv.is_owned = false;
33341 ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
33344 static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) {
33345 LDKChannelReestablish ret_var = ChannelReestablish_clone(arg);
33346 int64_t ret_ref = 0;
33347 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33348 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33351 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33352 LDKChannelReestablish arg_conv;
33353 arg_conv.inner = untag_ptr(arg);
33354 arg_conv.is_owned = ptr_is_owned(arg);
33355 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33356 arg_conv.is_owned = false;
33357 int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv);
33361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33362 LDKChannelReestablish orig_conv;
33363 orig_conv.inner = untag_ptr(orig);
33364 orig_conv.is_owned = ptr_is_owned(orig);
33365 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33366 orig_conv.is_owned = false;
33367 LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
33368 int64_t ret_ref = 0;
33369 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33370 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33374 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33375 LDKAnnouncementSignatures this_obj_conv;
33376 this_obj_conv.inner = untag_ptr(this_obj);
33377 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33379 AnnouncementSignatures_free(this_obj_conv);
33382 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
33383 LDKAnnouncementSignatures this_ptr_conv;
33384 this_ptr_conv.inner = untag_ptr(this_ptr);
33385 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33386 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33387 this_ptr_conv.is_owned = false;
33388 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33389 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv));
33393 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33394 LDKAnnouncementSignatures this_ptr_conv;
33395 this_ptr_conv.inner = untag_ptr(this_ptr);
33396 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33398 this_ptr_conv.is_owned = false;
33399 LDKThirtyTwoBytes val_ref;
33400 CHECK((*env)->GetArrayLength(env, val) == 32);
33401 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33402 AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref);
33405 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
33406 LDKAnnouncementSignatures this_ptr_conv;
33407 this_ptr_conv.inner = untag_ptr(this_ptr);
33408 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33410 this_ptr_conv.is_owned = false;
33411 int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
33415 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33416 LDKAnnouncementSignatures this_ptr_conv;
33417 this_ptr_conv.inner = untag_ptr(this_ptr);
33418 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33420 this_ptr_conv.is_owned = false;
33421 AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
33424 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
33425 LDKAnnouncementSignatures this_ptr_conv;
33426 this_ptr_conv.inner = untag_ptr(this_ptr);
33427 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33428 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33429 this_ptr_conv.is_owned = false;
33430 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
33431 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form);
33435 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33436 LDKAnnouncementSignatures this_ptr_conv;
33437 this_ptr_conv.inner = untag_ptr(this_ptr);
33438 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33440 this_ptr_conv.is_owned = false;
33441 LDKSignature val_ref;
33442 CHECK((*env)->GetArrayLength(env, val) == 64);
33443 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
33444 AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref);
33447 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
33448 LDKAnnouncementSignatures this_ptr_conv;
33449 this_ptr_conv.inner = untag_ptr(this_ptr);
33450 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33452 this_ptr_conv.is_owned = false;
33453 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
33454 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form);
33458 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33459 LDKAnnouncementSignatures this_ptr_conv;
33460 this_ptr_conv.inner = untag_ptr(this_ptr);
33461 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33463 this_ptr_conv.is_owned = false;
33464 LDKSignature val_ref;
33465 CHECK((*env)->GetArrayLength(env, val) == 64);
33466 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
33467 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref);
33470 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) {
33471 LDKThirtyTwoBytes channel_id_arg_ref;
33472 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
33473 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
33474 LDKSignature node_signature_arg_ref;
33475 CHECK((*env)->GetArrayLength(env, node_signature_arg) == 64);
33476 (*env)->GetByteArrayRegion(env, node_signature_arg, 0, 64, node_signature_arg_ref.compact_form);
33477 LDKSignature bitcoin_signature_arg_ref;
33478 CHECK((*env)->GetArrayLength(env, bitcoin_signature_arg) == 64);
33479 (*env)->GetByteArrayRegion(env, bitcoin_signature_arg, 0, 64, bitcoin_signature_arg_ref.compact_form);
33480 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
33481 int64_t ret_ref = 0;
33482 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33483 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33487 static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) {
33488 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg);
33489 int64_t ret_ref = 0;
33490 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33491 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33494 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33495 LDKAnnouncementSignatures arg_conv;
33496 arg_conv.inner = untag_ptr(arg);
33497 arg_conv.is_owned = ptr_is_owned(arg);
33498 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33499 arg_conv.is_owned = false;
33500 int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv);
33504 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33505 LDKAnnouncementSignatures orig_conv;
33506 orig_conv.inner = untag_ptr(orig);
33507 orig_conv.is_owned = ptr_is_owned(orig);
33508 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33509 orig_conv.is_owned = false;
33510 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
33511 int64_t ret_ref = 0;
33512 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33513 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33517 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
33518 if (!ptr_is_owned(this_ptr)) return;
33519 void* this_ptr_ptr = untag_ptr(this_ptr);
33520 CHECK_ACCESS(this_ptr_ptr);
33521 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
33522 FREE(untag_ptr(this_ptr));
33523 NetAddress_free(this_ptr_conv);
33526 static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) {
33527 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
33528 *ret_copy = NetAddress_clone(arg);
33529 int64_t ret_ref = tag_ptr(ret_copy, true);
33532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33533 LDKNetAddress* arg_conv = (LDKNetAddress*)untag_ptr(arg);
33534 int64_t ret_conv = NetAddress_clone_ptr(arg_conv);
33538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33539 LDKNetAddress* orig_conv = (LDKNetAddress*)untag_ptr(orig);
33540 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
33541 *ret_copy = NetAddress_clone(orig_conv);
33542 int64_t ret_ref = tag_ptr(ret_copy, true);
33546 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
33547 LDKFourBytes addr_ref;
33548 CHECK((*env)->GetArrayLength(env, addr) == 4);
33549 (*env)->GetByteArrayRegion(env, addr, 0, 4, addr_ref.data);
33550 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
33551 *ret_copy = NetAddress_ipv4(addr_ref, port);
33552 int64_t ret_ref = tag_ptr(ret_copy, true);
33556 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
33557 LDKSixteenBytes addr_ref;
33558 CHECK((*env)->GetArrayLength(env, addr) == 16);
33559 (*env)->GetByteArrayRegion(env, addr, 0, 16, addr_ref.data);
33560 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
33561 *ret_copy = NetAddress_ipv6(addr_ref, port);
33562 int64_t ret_ref = tag_ptr(ret_copy, true);
33566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray a) {
33567 LDKTwelveBytes a_ref;
33568 CHECK((*env)->GetArrayLength(env, a) == 12);
33569 (*env)->GetByteArrayRegion(env, a, 0, 12, a_ref.data);
33570 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
33571 *ret_copy = NetAddress_onion_v2(a_ref);
33572 int64_t ret_ref = tag_ptr(ret_copy, true);
33576 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) {
33577 LDKThirtyTwoBytes ed25519_pubkey_ref;
33578 CHECK((*env)->GetArrayLength(env, ed25519_pubkey) == 32);
33579 (*env)->GetByteArrayRegion(env, ed25519_pubkey, 0, 32, ed25519_pubkey_ref.data);
33580 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
33581 *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
33582 int64_t ret_ref = tag_ptr(ret_copy, true);
33586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1hostname(JNIEnv *env, jclass clz, int64_t hostname, int16_t port) {
33587 LDKHostname hostname_conv;
33588 hostname_conv.inner = untag_ptr(hostname);
33589 hostname_conv.is_owned = ptr_is_owned(hostname);
33590 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_conv);
33591 hostname_conv = Hostname_clone(&hostname_conv);
33592 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
33593 *ret_copy = NetAddress_hostname(hostname_conv, port);
33594 int64_t ret_ref = tag_ptr(ret_copy, true);
33598 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) {
33599 LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
33600 LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
33601 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
33602 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
33603 CVec_u8Z_free(ret_var);
33607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
33608 LDKu8slice ser_ref;
33609 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
33610 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
33611 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
33612 *ret_conv = NetAddress_read(ser_ref);
33613 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
33614 return tag_ptr(ret_conv, true);
33617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33618 LDKUnsignedNodeAnnouncement this_obj_conv;
33619 this_obj_conv.inner = untag_ptr(this_obj);
33620 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33622 UnsignedNodeAnnouncement_free(this_obj_conv);
33625 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
33626 LDKUnsignedNodeAnnouncement this_ptr_conv;
33627 this_ptr_conv.inner = untag_ptr(this_ptr);
33628 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33629 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33630 this_ptr_conv.is_owned = false;
33631 LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
33632 int64_t ret_ref = 0;
33633 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33634 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33638 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33639 LDKUnsignedNodeAnnouncement 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 LDKNodeFeatures val_conv;
33645 val_conv.inner = untag_ptr(val);
33646 val_conv.is_owned = ptr_is_owned(val);
33647 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
33648 val_conv = NodeFeatures_clone(&val_conv);
33649 UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv);
33652 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
33653 LDKUnsignedNodeAnnouncement this_ptr_conv;
33654 this_ptr_conv.inner = untag_ptr(this_ptr);
33655 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33657 this_ptr_conv.is_owned = false;
33658 int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
33662 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
33663 LDKUnsignedNodeAnnouncement this_ptr_conv;
33664 this_ptr_conv.inner = untag_ptr(this_ptr);
33665 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33667 this_ptr_conv.is_owned = false;
33668 UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
33671 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
33672 LDKUnsignedNodeAnnouncement this_ptr_conv;
33673 this_ptr_conv.inner = untag_ptr(this_ptr);
33674 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33676 this_ptr_conv.is_owned = false;
33677 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33678 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form);
33682 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33683 LDKUnsignedNodeAnnouncement this_ptr_conv;
33684 this_ptr_conv.inner = untag_ptr(this_ptr);
33685 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33687 this_ptr_conv.is_owned = false;
33688 LDKPublicKey val_ref;
33689 CHECK((*env)->GetArrayLength(env, val) == 33);
33690 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33691 UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref);
33694 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) {
33695 LDKUnsignedNodeAnnouncement this_ptr_conv;
33696 this_ptr_conv.inner = untag_ptr(this_ptr);
33697 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33699 this_ptr_conv.is_owned = false;
33700 int8_tArray ret_arr = (*env)->NewByteArray(env, 3);
33701 (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv));
33705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33706 LDKUnsignedNodeAnnouncement this_ptr_conv;
33707 this_ptr_conv.inner = untag_ptr(this_ptr);
33708 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33709 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33710 this_ptr_conv.is_owned = false;
33711 LDKThreeBytes val_ref;
33712 CHECK((*env)->GetArrayLength(env, val) == 3);
33713 (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data);
33714 UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref);
33717 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
33718 LDKUnsignedNodeAnnouncement this_ptr_conv;
33719 this_ptr_conv.inner = untag_ptr(this_ptr);
33720 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33722 this_ptr_conv.is_owned = false;
33723 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33724 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv));
33728 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33729 LDKUnsignedNodeAnnouncement this_ptr_conv;
33730 this_ptr_conv.inner = untag_ptr(this_ptr);
33731 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33732 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33733 this_ptr_conv.is_owned = false;
33734 LDKThirtyTwoBytes val_ref;
33735 CHECK((*env)->GetArrayLength(env, val) == 32);
33736 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33737 UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref);
33740 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) {
33741 LDKUnsignedNodeAnnouncement this_ptr_conv;
33742 this_ptr_conv.inner = untag_ptr(this_ptr);
33743 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33745 this_ptr_conv.is_owned = false;
33746 LDKCVec_NetAddressZ ret_var = UnsignedNodeAnnouncement_get_addresses(&this_ptr_conv);
33747 int64_tArray ret_arr = NULL;
33748 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
33749 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
33750 for (size_t m = 0; m < ret_var.datalen; m++) {
33751 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
33752 *ret_conv_12_copy = ret_var.data[m];
33753 int64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
33754 ret_arr_ptr[m] = ret_conv_12_ref;
33756 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
33757 FREE(ret_var.data);
33761 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
33762 LDKUnsignedNodeAnnouncement 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 LDKCVec_NetAddressZ val_constr;
33768 val_constr.datalen = (*env)->GetArrayLength(env, val);
33769 if (val_constr.datalen > 0)
33770 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
33772 val_constr.data = NULL;
33773 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
33774 for (size_t m = 0; m < val_constr.datalen; m++) {
33775 int64_t val_conv_12 = val_vals[m];
33776 void* val_conv_12_ptr = untag_ptr(val_conv_12);
33777 CHECK_ACCESS(val_conv_12_ptr);
33778 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
33779 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
33780 val_constr.data[m] = val_conv_12_conv;
33782 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
33783 UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
33786 static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) {
33787 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg);
33788 int64_t ret_ref = 0;
33789 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33790 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33793 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33794 LDKUnsignedNodeAnnouncement arg_conv;
33795 arg_conv.inner = untag_ptr(arg);
33796 arg_conv.is_owned = ptr_is_owned(arg);
33797 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33798 arg_conv.is_owned = false;
33799 int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv);
33803 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33804 LDKUnsignedNodeAnnouncement orig_conv;
33805 orig_conv.inner = untag_ptr(orig);
33806 orig_conv.is_owned = ptr_is_owned(orig);
33807 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33808 orig_conv.is_owned = false;
33809 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
33810 int64_t ret_ref = 0;
33811 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33812 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33817 LDKNodeAnnouncement this_obj_conv;
33818 this_obj_conv.inner = untag_ptr(this_obj);
33819 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33820 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33821 NodeAnnouncement_free(this_obj_conv);
33824 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
33825 LDKNodeAnnouncement this_ptr_conv;
33826 this_ptr_conv.inner = untag_ptr(this_ptr);
33827 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33829 this_ptr_conv.is_owned = false;
33830 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
33831 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form);
33835 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33836 LDKNodeAnnouncement this_ptr_conv;
33837 this_ptr_conv.inner = untag_ptr(this_ptr);
33838 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33840 this_ptr_conv.is_owned = false;
33841 LDKSignature val_ref;
33842 CHECK((*env)->GetArrayLength(env, val) == 64);
33843 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
33844 NodeAnnouncement_set_signature(&this_ptr_conv, val_ref);
33847 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
33848 LDKNodeAnnouncement this_ptr_conv;
33849 this_ptr_conv.inner = untag_ptr(this_ptr);
33850 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33851 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33852 this_ptr_conv.is_owned = false;
33853 LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
33854 int64_t ret_ref = 0;
33855 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33856 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33860 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33861 LDKNodeAnnouncement this_ptr_conv;
33862 this_ptr_conv.inner = untag_ptr(this_ptr);
33863 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33864 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33865 this_ptr_conv.is_owned = false;
33866 LDKUnsignedNodeAnnouncement val_conv;
33867 val_conv.inner = untag_ptr(val);
33868 val_conv.is_owned = ptr_is_owned(val);
33869 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
33870 val_conv = UnsignedNodeAnnouncement_clone(&val_conv);
33871 NodeAnnouncement_set_contents(&this_ptr_conv, val_conv);
33874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) {
33875 LDKSignature signature_arg_ref;
33876 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
33877 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
33878 LDKUnsignedNodeAnnouncement contents_arg_conv;
33879 contents_arg_conv.inner = untag_ptr(contents_arg);
33880 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
33881 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
33882 contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
33883 LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv);
33884 int64_t ret_ref = 0;
33885 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33886 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33890 static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) {
33891 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg);
33892 int64_t ret_ref = 0;
33893 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33894 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33897 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33898 LDKNodeAnnouncement arg_conv;
33899 arg_conv.inner = untag_ptr(arg);
33900 arg_conv.is_owned = ptr_is_owned(arg);
33901 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33902 arg_conv.is_owned = false;
33903 int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv);
33907 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33908 LDKNodeAnnouncement orig_conv;
33909 orig_conv.inner = untag_ptr(orig);
33910 orig_conv.is_owned = ptr_is_owned(orig);
33911 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33912 orig_conv.is_owned = false;
33913 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
33914 int64_t ret_ref = 0;
33915 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33916 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
33921 LDKUnsignedChannelAnnouncement this_obj_conv;
33922 this_obj_conv.inner = untag_ptr(this_obj);
33923 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33925 UnsignedChannelAnnouncement_free(this_obj_conv);
33928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
33929 LDKUnsignedChannelAnnouncement this_ptr_conv;
33930 this_ptr_conv.inner = untag_ptr(this_ptr);
33931 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33932 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33933 this_ptr_conv.is_owned = false;
33934 LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
33935 int64_t ret_ref = 0;
33936 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33937 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33941 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33942 LDKUnsignedChannelAnnouncement this_ptr_conv;
33943 this_ptr_conv.inner = untag_ptr(this_ptr);
33944 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33945 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33946 this_ptr_conv.is_owned = false;
33947 LDKChannelFeatures val_conv;
33948 val_conv.inner = untag_ptr(val);
33949 val_conv.is_owned = ptr_is_owned(val);
33950 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
33951 val_conv = ChannelFeatures_clone(&val_conv);
33952 UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv);
33955 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
33956 LDKUnsignedChannelAnnouncement this_ptr_conv;
33957 this_ptr_conv.inner = untag_ptr(this_ptr);
33958 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33960 this_ptr_conv.is_owned = false;
33961 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
33962 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv));
33966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33967 LDKUnsignedChannelAnnouncement this_ptr_conv;
33968 this_ptr_conv.inner = untag_ptr(this_ptr);
33969 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33971 this_ptr_conv.is_owned = false;
33972 LDKThirtyTwoBytes val_ref;
33973 CHECK((*env)->GetArrayLength(env, val) == 32);
33974 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
33975 UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref);
33978 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
33979 LDKUnsignedChannelAnnouncement 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 int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
33988 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33989 LDKUnsignedChannelAnnouncement 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 UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
33997 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
33998 LDKUnsignedChannelAnnouncement 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, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form);
34008 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34009 LDKUnsignedChannelAnnouncement 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 UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref);
34020 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
34021 LDKUnsignedChannelAnnouncement 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, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form);
34031 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34032 LDKUnsignedChannelAnnouncement 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 UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref);
34043 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
34044 LDKUnsignedChannelAnnouncement 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, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form);
34054 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34055 LDKUnsignedChannelAnnouncement 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 UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref);
34066 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
34067 LDKUnsignedChannelAnnouncement 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, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form);
34077 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34078 LDKUnsignedChannelAnnouncement 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 UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref);
34089 static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
34090 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg);
34091 int64_t ret_ref = 0;
34092 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34093 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34096 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34097 LDKUnsignedChannelAnnouncement arg_conv;
34098 arg_conv.inner = untag_ptr(arg);
34099 arg_conv.is_owned = ptr_is_owned(arg);
34100 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34101 arg_conv.is_owned = false;
34102 int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv);
34106 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34107 LDKUnsignedChannelAnnouncement orig_conv;
34108 orig_conv.inner = untag_ptr(orig);
34109 orig_conv.is_owned = ptr_is_owned(orig);
34110 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34111 orig_conv.is_owned = false;
34112 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv);
34113 int64_t ret_ref = 0;
34114 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34115 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34119 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34120 LDKChannelAnnouncement this_obj_conv;
34121 this_obj_conv.inner = untag_ptr(this_obj);
34122 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34124 ChannelAnnouncement_free(this_obj_conv);
34127 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
34128 LDKChannelAnnouncement this_ptr_conv;
34129 this_ptr_conv.inner = untag_ptr(this_ptr);
34130 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34131 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34132 this_ptr_conv.is_owned = false;
34133 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
34134 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form);
34138 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34139 LDKChannelAnnouncement this_ptr_conv;
34140 this_ptr_conv.inner = untag_ptr(this_ptr);
34141 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34143 this_ptr_conv.is_owned = false;
34144 LDKSignature val_ref;
34145 CHECK((*env)->GetArrayLength(env, val) == 64);
34146 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
34147 ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref);
34150 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
34151 LDKChannelAnnouncement this_ptr_conv;
34152 this_ptr_conv.inner = untag_ptr(this_ptr);
34153 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34154 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34155 this_ptr_conv.is_owned = false;
34156 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
34157 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form);
34161 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34162 LDKChannelAnnouncement this_ptr_conv;
34163 this_ptr_conv.inner = untag_ptr(this_ptr);
34164 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34166 this_ptr_conv.is_owned = false;
34167 LDKSignature val_ref;
34168 CHECK((*env)->GetArrayLength(env, val) == 64);
34169 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
34170 ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref);
34173 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
34174 LDKChannelAnnouncement this_ptr_conv;
34175 this_ptr_conv.inner = untag_ptr(this_ptr);
34176 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34178 this_ptr_conv.is_owned = false;
34179 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
34180 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form);
34184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34185 LDKChannelAnnouncement this_ptr_conv;
34186 this_ptr_conv.inner = untag_ptr(this_ptr);
34187 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34189 this_ptr_conv.is_owned = false;
34190 LDKSignature val_ref;
34191 CHECK((*env)->GetArrayLength(env, val) == 64);
34192 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
34193 ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref);
34196 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
34197 LDKChannelAnnouncement this_ptr_conv;
34198 this_ptr_conv.inner = untag_ptr(this_ptr);
34199 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34201 this_ptr_conv.is_owned = false;
34202 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
34203 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form);
34207 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34208 LDKChannelAnnouncement this_ptr_conv;
34209 this_ptr_conv.inner = untag_ptr(this_ptr);
34210 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34211 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34212 this_ptr_conv.is_owned = false;
34213 LDKSignature val_ref;
34214 CHECK((*env)->GetArrayLength(env, val) == 64);
34215 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
34216 ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref);
34219 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
34220 LDKChannelAnnouncement this_ptr_conv;
34221 this_ptr_conv.inner = untag_ptr(this_ptr);
34222 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34224 this_ptr_conv.is_owned = false;
34225 LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
34226 int64_t ret_ref = 0;
34227 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34228 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34232 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34233 LDKChannelAnnouncement this_ptr_conv;
34234 this_ptr_conv.inner = untag_ptr(this_ptr);
34235 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34237 this_ptr_conv.is_owned = false;
34238 LDKUnsignedChannelAnnouncement val_conv;
34239 val_conv.inner = untag_ptr(val);
34240 val_conv.is_owned = ptr_is_owned(val);
34241 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34242 val_conv = UnsignedChannelAnnouncement_clone(&val_conv);
34243 ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv);
34246 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) {
34247 LDKSignature node_signature_1_arg_ref;
34248 CHECK((*env)->GetArrayLength(env, node_signature_1_arg) == 64);
34249 (*env)->GetByteArrayRegion(env, node_signature_1_arg, 0, 64, node_signature_1_arg_ref.compact_form);
34250 LDKSignature node_signature_2_arg_ref;
34251 CHECK((*env)->GetArrayLength(env, node_signature_2_arg) == 64);
34252 (*env)->GetByteArrayRegion(env, node_signature_2_arg, 0, 64, node_signature_2_arg_ref.compact_form);
34253 LDKSignature bitcoin_signature_1_arg_ref;
34254 CHECK((*env)->GetArrayLength(env, bitcoin_signature_1_arg) == 64);
34255 (*env)->GetByteArrayRegion(env, bitcoin_signature_1_arg, 0, 64, bitcoin_signature_1_arg_ref.compact_form);
34256 LDKSignature bitcoin_signature_2_arg_ref;
34257 CHECK((*env)->GetArrayLength(env, bitcoin_signature_2_arg) == 64);
34258 (*env)->GetByteArrayRegion(env, bitcoin_signature_2_arg, 0, 64, bitcoin_signature_2_arg_ref.compact_form);
34259 LDKUnsignedChannelAnnouncement contents_arg_conv;
34260 contents_arg_conv.inner = untag_ptr(contents_arg);
34261 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
34262 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
34263 contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
34264 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);
34265 int64_t ret_ref = 0;
34266 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34267 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34271 static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) {
34272 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg);
34273 int64_t ret_ref = 0;
34274 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34275 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34278 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34279 LDKChannelAnnouncement arg_conv;
34280 arg_conv.inner = untag_ptr(arg);
34281 arg_conv.is_owned = ptr_is_owned(arg);
34282 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34283 arg_conv.is_owned = false;
34284 int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv);
34288 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34289 LDKChannelAnnouncement orig_conv;
34290 orig_conv.inner = untag_ptr(orig);
34291 orig_conv.is_owned = ptr_is_owned(orig);
34292 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34293 orig_conv.is_owned = false;
34294 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
34295 int64_t ret_ref = 0;
34296 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34297 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34301 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34302 LDKUnsignedChannelUpdate this_obj_conv;
34303 this_obj_conv.inner = untag_ptr(this_obj);
34304 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34306 UnsignedChannelUpdate_free(this_obj_conv);
34309 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
34310 LDKUnsignedChannelUpdate this_ptr_conv;
34311 this_ptr_conv.inner = untag_ptr(this_ptr);
34312 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34314 this_ptr_conv.is_owned = false;
34315 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34316 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv));
34320 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34321 LDKUnsignedChannelUpdate this_ptr_conv;
34322 this_ptr_conv.inner = untag_ptr(this_ptr);
34323 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34325 this_ptr_conv.is_owned = false;
34326 LDKThirtyTwoBytes val_ref;
34327 CHECK((*env)->GetArrayLength(env, val) == 32);
34328 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34329 UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref);
34332 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
34333 LDKUnsignedChannelUpdate this_ptr_conv;
34334 this_ptr_conv.inner = untag_ptr(this_ptr);
34335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34337 this_ptr_conv.is_owned = false;
34338 int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
34342 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34343 LDKUnsignedChannelUpdate this_ptr_conv;
34344 this_ptr_conv.inner = untag_ptr(this_ptr);
34345 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34346 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34347 this_ptr_conv.is_owned = false;
34348 UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
34351 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
34352 LDKUnsignedChannelUpdate this_ptr_conv;
34353 this_ptr_conv.inner = untag_ptr(this_ptr);
34354 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34355 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34356 this_ptr_conv.is_owned = false;
34357 int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
34361 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
34362 LDKUnsignedChannelUpdate this_ptr_conv;
34363 this_ptr_conv.inner = untag_ptr(this_ptr);
34364 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34365 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34366 this_ptr_conv.is_owned = false;
34367 UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
34370 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) {
34371 LDKUnsignedChannelUpdate this_ptr_conv;
34372 this_ptr_conv.inner = untag_ptr(this_ptr);
34373 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34375 this_ptr_conv.is_owned = false;
34376 int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
34380 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
34381 LDKUnsignedChannelUpdate this_ptr_conv;
34382 this_ptr_conv.inner = untag_ptr(this_ptr);
34383 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34384 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34385 this_ptr_conv.is_owned = false;
34386 UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
34389 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
34390 LDKUnsignedChannelUpdate this_ptr_conv;
34391 this_ptr_conv.inner = untag_ptr(this_ptr);
34392 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34394 this_ptr_conv.is_owned = false;
34395 int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
34399 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
34400 LDKUnsignedChannelUpdate this_ptr_conv;
34401 this_ptr_conv.inner = untag_ptr(this_ptr);
34402 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34403 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34404 this_ptr_conv.is_owned = false;
34405 UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
34408 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
34409 LDKUnsignedChannelUpdate this_ptr_conv;
34410 this_ptr_conv.inner = untag_ptr(this_ptr);
34411 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34412 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34413 this_ptr_conv.is_owned = false;
34414 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
34418 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34419 LDKUnsignedChannelUpdate this_ptr_conv;
34420 this_ptr_conv.inner = untag_ptr(this_ptr);
34421 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34423 this_ptr_conv.is_owned = false;
34424 UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
34427 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
34428 LDKUnsignedChannelUpdate this_ptr_conv;
34429 this_ptr_conv.inner = untag_ptr(this_ptr);
34430 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34431 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34432 this_ptr_conv.is_owned = false;
34433 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv);
34437 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34438 LDKUnsignedChannelUpdate this_ptr_conv;
34439 this_ptr_conv.inner = untag_ptr(this_ptr);
34440 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34442 this_ptr_conv.is_owned = false;
34443 UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val);
34446 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
34447 LDKUnsignedChannelUpdate this_ptr_conv;
34448 this_ptr_conv.inner = untag_ptr(this_ptr);
34449 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34450 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34451 this_ptr_conv.is_owned = false;
34452 int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
34456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
34457 LDKUnsignedChannelUpdate this_ptr_conv;
34458 this_ptr_conv.inner = untag_ptr(this_ptr);
34459 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34461 this_ptr_conv.is_owned = false;
34462 UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
34465 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
34466 LDKUnsignedChannelUpdate this_ptr_conv;
34467 this_ptr_conv.inner = untag_ptr(this_ptr);
34468 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34469 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34470 this_ptr_conv.is_owned = false;
34471 int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
34475 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
34476 LDKUnsignedChannelUpdate this_ptr_conv;
34477 this_ptr_conv.inner = untag_ptr(this_ptr);
34478 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34479 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34480 this_ptr_conv.is_owned = false;
34481 UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
34484 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1excess_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
34485 LDKUnsignedChannelUpdate this_ptr_conv;
34486 this_ptr_conv.inner = untag_ptr(this_ptr);
34487 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34488 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34489 this_ptr_conv.is_owned = false;
34490 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_conv);
34491 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34492 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34493 CVec_u8Z_free(ret_var);
34497 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1excess_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34498 LDKUnsignedChannelUpdate 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 LDKCVec_u8Z val_ref;
34504 val_ref.datalen = (*env)->GetArrayLength(env, val);
34505 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
34506 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
34507 UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref);
34510 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) {
34511 LDKThirtyTwoBytes chain_hash_arg_ref;
34512 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
34513 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
34514 LDKCVec_u8Z excess_data_arg_ref;
34515 excess_data_arg_ref.datalen = (*env)->GetArrayLength(env, excess_data_arg);
34516 excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes");
34517 (*env)->GetByteArrayRegion(env, excess_data_arg, 0, excess_data_arg_ref.datalen, excess_data_arg_ref.data);
34518 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);
34519 int64_t ret_ref = 0;
34520 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34521 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34525 static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) {
34526 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg);
34527 int64_t ret_ref = 0;
34528 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34529 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34533 LDKUnsignedChannelUpdate arg_conv;
34534 arg_conv.inner = untag_ptr(arg);
34535 arg_conv.is_owned = ptr_is_owned(arg);
34536 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34537 arg_conv.is_owned = false;
34538 int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv);
34542 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34543 LDKUnsignedChannelUpdate orig_conv;
34544 orig_conv.inner = untag_ptr(orig);
34545 orig_conv.is_owned = ptr_is_owned(orig);
34546 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34547 orig_conv.is_owned = false;
34548 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
34549 int64_t ret_ref = 0;
34550 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34551 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34555 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34556 LDKChannelUpdate this_obj_conv;
34557 this_obj_conv.inner = untag_ptr(this_obj);
34558 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34560 ChannelUpdate_free(this_obj_conv);
34563 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
34564 LDKChannelUpdate this_ptr_conv;
34565 this_ptr_conv.inner = untag_ptr(this_ptr);
34566 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34567 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34568 this_ptr_conv.is_owned = false;
34569 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
34570 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form);
34574 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34575 LDKChannelUpdate this_ptr_conv;
34576 this_ptr_conv.inner = untag_ptr(this_ptr);
34577 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34579 this_ptr_conv.is_owned = false;
34580 LDKSignature val_ref;
34581 CHECK((*env)->GetArrayLength(env, val) == 64);
34582 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
34583 ChannelUpdate_set_signature(&this_ptr_conv, val_ref);
34586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
34587 LDKChannelUpdate this_ptr_conv;
34588 this_ptr_conv.inner = untag_ptr(this_ptr);
34589 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34590 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34591 this_ptr_conv.is_owned = false;
34592 LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
34593 int64_t ret_ref = 0;
34594 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34595 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34599 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34600 LDKChannelUpdate this_ptr_conv;
34601 this_ptr_conv.inner = untag_ptr(this_ptr);
34602 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34604 this_ptr_conv.is_owned = false;
34605 LDKUnsignedChannelUpdate val_conv;
34606 val_conv.inner = untag_ptr(val);
34607 val_conv.is_owned = ptr_is_owned(val);
34608 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34609 val_conv = UnsignedChannelUpdate_clone(&val_conv);
34610 ChannelUpdate_set_contents(&this_ptr_conv, val_conv);
34613 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) {
34614 LDKSignature signature_arg_ref;
34615 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
34616 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
34617 LDKUnsignedChannelUpdate contents_arg_conv;
34618 contents_arg_conv.inner = untag_ptr(contents_arg);
34619 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
34620 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
34621 contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
34622 LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv);
34623 int64_t ret_ref = 0;
34624 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34625 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34629 static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) {
34630 LDKChannelUpdate ret_var = ChannelUpdate_clone(arg);
34631 int64_t ret_ref = 0;
34632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34636 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34637 LDKChannelUpdate arg_conv;
34638 arg_conv.inner = untag_ptr(arg);
34639 arg_conv.is_owned = ptr_is_owned(arg);
34640 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34641 arg_conv.is_owned = false;
34642 int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv);
34646 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34647 LDKChannelUpdate orig_conv;
34648 orig_conv.inner = untag_ptr(orig);
34649 orig_conv.is_owned = ptr_is_owned(orig);
34650 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34651 orig_conv.is_owned = false;
34652 LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
34653 int64_t ret_ref = 0;
34654 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34655 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34659 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34660 LDKQueryChannelRange this_obj_conv;
34661 this_obj_conv.inner = untag_ptr(this_obj);
34662 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34664 QueryChannelRange_free(this_obj_conv);
34667 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
34668 LDKQueryChannelRange this_ptr_conv;
34669 this_ptr_conv.inner = untag_ptr(this_ptr);
34670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34672 this_ptr_conv.is_owned = false;
34673 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34674 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv));
34678 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34679 LDKQueryChannelRange this_ptr_conv;
34680 this_ptr_conv.inner = untag_ptr(this_ptr);
34681 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34683 this_ptr_conv.is_owned = false;
34684 LDKThirtyTwoBytes val_ref;
34685 CHECK((*env)->GetArrayLength(env, val) == 32);
34686 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34687 QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
34690 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) {
34691 LDKQueryChannelRange this_ptr_conv;
34692 this_ptr_conv.inner = untag_ptr(this_ptr);
34693 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34695 this_ptr_conv.is_owned = false;
34696 int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
34700 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
34701 LDKQueryChannelRange this_ptr_conv;
34702 this_ptr_conv.inner = untag_ptr(this_ptr);
34703 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34704 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34705 this_ptr_conv.is_owned = false;
34706 QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
34709 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) {
34710 LDKQueryChannelRange this_ptr_conv;
34711 this_ptr_conv.inner = untag_ptr(this_ptr);
34712 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34713 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34714 this_ptr_conv.is_owned = false;
34715 int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
34719 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
34720 LDKQueryChannelRange this_ptr_conv;
34721 this_ptr_conv.inner = untag_ptr(this_ptr);
34722 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34724 this_ptr_conv.is_owned = false;
34725 QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
34728 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) {
34729 LDKThirtyTwoBytes chain_hash_arg_ref;
34730 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
34731 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
34732 LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
34733 int64_t ret_ref = 0;
34734 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34735 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34739 static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) {
34740 LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg);
34741 int64_t ret_ref = 0;
34742 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34743 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34746 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34747 LDKQueryChannelRange arg_conv;
34748 arg_conv.inner = untag_ptr(arg);
34749 arg_conv.is_owned = ptr_is_owned(arg);
34750 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34751 arg_conv.is_owned = false;
34752 int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv);
34756 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34757 LDKQueryChannelRange orig_conv;
34758 orig_conv.inner = untag_ptr(orig);
34759 orig_conv.is_owned = ptr_is_owned(orig);
34760 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34761 orig_conv.is_owned = false;
34762 LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
34763 int64_t ret_ref = 0;
34764 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34765 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34769 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34770 LDKReplyChannelRange this_obj_conv;
34771 this_obj_conv.inner = untag_ptr(this_obj);
34772 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34774 ReplyChannelRange_free(this_obj_conv);
34777 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
34778 LDKReplyChannelRange this_ptr_conv;
34779 this_ptr_conv.inner = untag_ptr(this_ptr);
34780 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34782 this_ptr_conv.is_owned = false;
34783 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34784 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv));
34788 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34789 LDKReplyChannelRange this_ptr_conv;
34790 this_ptr_conv.inner = untag_ptr(this_ptr);
34791 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34792 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34793 this_ptr_conv.is_owned = false;
34794 LDKThirtyTwoBytes val_ref;
34795 CHECK((*env)->GetArrayLength(env, val) == 32);
34796 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34797 ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
34800 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) {
34801 LDKReplyChannelRange this_ptr_conv;
34802 this_ptr_conv.inner = untag_ptr(this_ptr);
34803 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34805 this_ptr_conv.is_owned = false;
34806 int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
34810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
34811 LDKReplyChannelRange this_ptr_conv;
34812 this_ptr_conv.inner = untag_ptr(this_ptr);
34813 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34815 this_ptr_conv.is_owned = false;
34816 ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
34819 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) {
34820 LDKReplyChannelRange this_ptr_conv;
34821 this_ptr_conv.inner = untag_ptr(this_ptr);
34822 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34823 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34824 this_ptr_conv.is_owned = false;
34825 int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
34829 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
34830 LDKReplyChannelRange this_ptr_conv;
34831 this_ptr_conv.inner = untag_ptr(this_ptr);
34832 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34833 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34834 this_ptr_conv.is_owned = false;
34835 ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
34838 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr) {
34839 LDKReplyChannelRange this_ptr_conv;
34840 this_ptr_conv.inner = untag_ptr(this_ptr);
34841 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34842 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34843 this_ptr_conv.is_owned = false;
34844 jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv);
34848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
34849 LDKReplyChannelRange this_ptr_conv;
34850 this_ptr_conv.inner = untag_ptr(this_ptr);
34851 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34852 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34853 this_ptr_conv.is_owned = false;
34854 ReplyChannelRange_set_sync_complete(&this_ptr_conv, val);
34857 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr) {
34858 LDKReplyChannelRange this_ptr_conv;
34859 this_ptr_conv.inner = untag_ptr(this_ptr);
34860 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34861 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34862 this_ptr_conv.is_owned = false;
34863 LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv);
34864 int64_tArray ret_arr = NULL;
34865 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
34866 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
34867 for (size_t g = 0; g < ret_var.datalen; g++) {
34868 int64_t ret_conv_6_conv = ret_var.data[g];
34869 ret_arr_ptr[g] = ret_conv_6_conv;
34871 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
34872 FREE(ret_var.data);
34876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
34877 LDKReplyChannelRange 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 LDKCVec_u64Z val_constr;
34883 val_constr.datalen = (*env)->GetArrayLength(env, val);
34884 if (val_constr.datalen > 0)
34885 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
34887 val_constr.data = NULL;
34888 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
34889 for (size_t g = 0; g < val_constr.datalen; g++) {
34890 int64_t val_conv_6 = val_vals[g];
34891 val_constr.data[g] = val_conv_6;
34893 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
34894 ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
34897 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) {
34898 LDKThirtyTwoBytes chain_hash_arg_ref;
34899 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
34900 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
34901 LDKCVec_u64Z short_channel_ids_arg_constr;
34902 short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg);
34903 if (short_channel_ids_arg_constr.datalen > 0)
34904 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
34906 short_channel_ids_arg_constr.data = NULL;
34907 int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL);
34908 for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) {
34909 int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g];
34910 short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6;
34912 (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
34913 LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
34914 int64_t ret_ref = 0;
34915 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34916 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34920 static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) {
34921 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg);
34922 int64_t ret_ref = 0;
34923 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34924 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34927 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34928 LDKReplyChannelRange arg_conv;
34929 arg_conv.inner = untag_ptr(arg);
34930 arg_conv.is_owned = ptr_is_owned(arg);
34931 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34932 arg_conv.is_owned = false;
34933 int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv);
34937 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34938 LDKReplyChannelRange orig_conv;
34939 orig_conv.inner = untag_ptr(orig);
34940 orig_conv.is_owned = ptr_is_owned(orig);
34941 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34942 orig_conv.is_owned = false;
34943 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
34944 int64_t ret_ref = 0;
34945 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34946 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34950 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34951 LDKQueryShortChannelIds this_obj_conv;
34952 this_obj_conv.inner = untag_ptr(this_obj);
34953 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34955 QueryShortChannelIds_free(this_obj_conv);
34958 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
34959 LDKQueryShortChannelIds this_ptr_conv;
34960 this_ptr_conv.inner = untag_ptr(this_ptr);
34961 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34963 this_ptr_conv.is_owned = false;
34964 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34965 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv));
34969 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34970 LDKQueryShortChannelIds this_ptr_conv;
34971 this_ptr_conv.inner = untag_ptr(this_ptr);
34972 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34974 this_ptr_conv.is_owned = false;
34975 LDKThirtyTwoBytes val_ref;
34976 CHECK((*env)->GetArrayLength(env, val) == 32);
34977 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34978 QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref);
34981 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr) {
34982 LDKQueryShortChannelIds this_ptr_conv;
34983 this_ptr_conv.inner = untag_ptr(this_ptr);
34984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34986 this_ptr_conv.is_owned = false;
34987 LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv);
34988 int64_tArray ret_arr = NULL;
34989 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
34990 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
34991 for (size_t g = 0; g < ret_var.datalen; g++) {
34992 int64_t ret_conv_6_conv = ret_var.data[g];
34993 ret_arr_ptr[g] = ret_conv_6_conv;
34995 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
34996 FREE(ret_var.data);
35000 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
35001 LDKQueryShortChannelIds this_ptr_conv;
35002 this_ptr_conv.inner = untag_ptr(this_ptr);
35003 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35005 this_ptr_conv.is_owned = false;
35006 LDKCVec_u64Z val_constr;
35007 val_constr.datalen = (*env)->GetArrayLength(env, val);
35008 if (val_constr.datalen > 0)
35009 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
35011 val_constr.data = NULL;
35012 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
35013 for (size_t g = 0; g < val_constr.datalen; g++) {
35014 int64_t val_conv_6 = val_vals[g];
35015 val_constr.data[g] = val_conv_6;
35017 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
35018 QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
35021 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) {
35022 LDKThirtyTwoBytes chain_hash_arg_ref;
35023 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
35024 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
35025 LDKCVec_u64Z short_channel_ids_arg_constr;
35026 short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg);
35027 if (short_channel_ids_arg_constr.datalen > 0)
35028 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
35030 short_channel_ids_arg_constr.data = NULL;
35031 int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL);
35032 for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) {
35033 int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g];
35034 short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6;
35036 (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
35037 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
35038 int64_t ret_ref = 0;
35039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35044 static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) {
35045 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg);
35046 int64_t ret_ref = 0;
35047 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35048 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35051 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35052 LDKQueryShortChannelIds arg_conv;
35053 arg_conv.inner = untag_ptr(arg);
35054 arg_conv.is_owned = ptr_is_owned(arg);
35055 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35056 arg_conv.is_owned = false;
35057 int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv);
35061 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35062 LDKQueryShortChannelIds orig_conv;
35063 orig_conv.inner = untag_ptr(orig);
35064 orig_conv.is_owned = ptr_is_owned(orig);
35065 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35066 orig_conv.is_owned = false;
35067 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
35068 int64_t ret_ref = 0;
35069 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35070 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35074 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35075 LDKReplyShortChannelIdsEnd this_obj_conv;
35076 this_obj_conv.inner = untag_ptr(this_obj);
35077 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35078 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35079 ReplyShortChannelIdsEnd_free(this_obj_conv);
35082 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
35083 LDKReplyShortChannelIdsEnd this_ptr_conv;
35084 this_ptr_conv.inner = untag_ptr(this_ptr);
35085 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35087 this_ptr_conv.is_owned = false;
35088 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35089 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv));
35093 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35094 LDKReplyShortChannelIdsEnd this_ptr_conv;
35095 this_ptr_conv.inner = untag_ptr(this_ptr);
35096 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35098 this_ptr_conv.is_owned = false;
35099 LDKThirtyTwoBytes val_ref;
35100 CHECK((*env)->GetArrayLength(env, val) == 32);
35101 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35102 ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref);
35105 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr) {
35106 LDKReplyShortChannelIdsEnd this_ptr_conv;
35107 this_ptr_conv.inner = untag_ptr(this_ptr);
35108 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35110 this_ptr_conv.is_owned = false;
35111 jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
35115 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
35116 LDKReplyShortChannelIdsEnd this_ptr_conv;
35117 this_ptr_conv.inner = untag_ptr(this_ptr);
35118 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35120 this_ptr_conv.is_owned = false;
35121 ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
35124 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, jboolean full_information_arg) {
35125 LDKThirtyTwoBytes chain_hash_arg_ref;
35126 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
35127 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
35128 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
35129 int64_t ret_ref = 0;
35130 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35131 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35135 static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) {
35136 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg);
35137 int64_t ret_ref = 0;
35138 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35139 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35142 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35143 LDKReplyShortChannelIdsEnd arg_conv;
35144 arg_conv.inner = untag_ptr(arg);
35145 arg_conv.is_owned = ptr_is_owned(arg);
35146 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35147 arg_conv.is_owned = false;
35148 int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv);
35152 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35153 LDKReplyShortChannelIdsEnd orig_conv;
35154 orig_conv.inner = untag_ptr(orig);
35155 orig_conv.is_owned = ptr_is_owned(orig);
35156 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35157 orig_conv.is_owned = false;
35158 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
35159 int64_t ret_ref = 0;
35160 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35161 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35165 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35166 LDKGossipTimestampFilter this_obj_conv;
35167 this_obj_conv.inner = untag_ptr(this_obj);
35168 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35170 GossipTimestampFilter_free(this_obj_conv);
35173 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
35174 LDKGossipTimestampFilter this_ptr_conv;
35175 this_ptr_conv.inner = untag_ptr(this_ptr);
35176 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35178 this_ptr_conv.is_owned = false;
35179 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35180 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv));
35184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35185 LDKGossipTimestampFilter this_ptr_conv;
35186 this_ptr_conv.inner = untag_ptr(this_ptr);
35187 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35189 this_ptr_conv.is_owned = false;
35190 LDKThirtyTwoBytes val_ref;
35191 CHECK((*env)->GetArrayLength(env, val) == 32);
35192 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35193 GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref);
35196 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
35197 LDKGossipTimestampFilter this_ptr_conv;
35198 this_ptr_conv.inner = untag_ptr(this_ptr);
35199 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35201 this_ptr_conv.is_owned = false;
35202 int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
35206 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
35207 LDKGossipTimestampFilter this_ptr_conv;
35208 this_ptr_conv.inner = untag_ptr(this_ptr);
35209 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35211 this_ptr_conv.is_owned = false;
35212 GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
35215 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr) {
35216 LDKGossipTimestampFilter this_ptr_conv;
35217 this_ptr_conv.inner = untag_ptr(this_ptr);
35218 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35220 this_ptr_conv.is_owned = false;
35221 int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
35225 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
35226 LDKGossipTimestampFilter this_ptr_conv;
35227 this_ptr_conv.inner = untag_ptr(this_ptr);
35228 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35229 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35230 this_ptr_conv.is_owned = false;
35231 GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
35234 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) {
35235 LDKThirtyTwoBytes chain_hash_arg_ref;
35236 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
35237 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
35238 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
35239 int64_t ret_ref = 0;
35240 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35241 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35245 static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) {
35246 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg);
35247 int64_t ret_ref = 0;
35248 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35249 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35252 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35253 LDKGossipTimestampFilter arg_conv;
35254 arg_conv.inner = untag_ptr(arg);
35255 arg_conv.is_owned = ptr_is_owned(arg);
35256 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35257 arg_conv.is_owned = false;
35258 int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv);
35262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35263 LDKGossipTimestampFilter orig_conv;
35264 orig_conv.inner = untag_ptr(orig);
35265 orig_conv.is_owned = ptr_is_owned(orig);
35266 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35267 orig_conv.is_owned = false;
35268 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv);
35269 int64_t ret_ref = 0;
35270 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35271 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35275 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
35276 if (!ptr_is_owned(this_ptr)) return;
35277 void* this_ptr_ptr = untag_ptr(this_ptr);
35278 CHECK_ACCESS(this_ptr_ptr);
35279 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
35280 FREE(untag_ptr(this_ptr));
35281 ErrorAction_free(this_ptr_conv);
35284 static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) {
35285 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
35286 *ret_copy = ErrorAction_clone(arg);
35287 int64_t ret_ref = tag_ptr(ret_copy, true);
35290 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35291 LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg);
35292 int64_t ret_conv = ErrorAction_clone_ptr(arg_conv);
35296 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35297 LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig);
35298 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
35299 *ret_copy = ErrorAction_clone(orig_conv);
35300 int64_t ret_ref = tag_ptr(ret_copy, true);
35304 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1peer(JNIEnv *env, jclass clz, int64_t msg) {
35305 LDKErrorMessage msg_conv;
35306 msg_conv.inner = untag_ptr(msg);
35307 msg_conv.is_owned = ptr_is_owned(msg);
35308 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
35309 msg_conv = ErrorMessage_clone(&msg_conv);
35310 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
35311 *ret_copy = ErrorAction_disconnect_peer(msg_conv);
35312 int64_t ret_ref = tag_ptr(ret_copy, true);
35316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error(JNIEnv *env, jclass clz) {
35317 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
35318 *ret_copy = ErrorAction_ignore_error();
35319 int64_t ret_ref = tag_ptr(ret_copy, true);
35323 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1and_1log(JNIEnv *env, jclass clz, jclass a) {
35324 LDKLevel a_conv = LDKLevel_from_java(env, a);
35325 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
35326 *ret_copy = ErrorAction_ignore_and_log(a_conv);
35327 int64_t ret_ref = tag_ptr(ret_copy, true);
35331 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip(JNIEnv *env, jclass clz) {
35332 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
35333 *ret_copy = ErrorAction_ignore_duplicate_gossip();
35334 int64_t ret_ref = tag_ptr(ret_copy, true);
35338 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) {
35339 LDKErrorMessage msg_conv;
35340 msg_conv.inner = untag_ptr(msg);
35341 msg_conv.is_owned = ptr_is_owned(msg);
35342 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
35343 msg_conv = ErrorMessage_clone(&msg_conv);
35344 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
35345 *ret_copy = ErrorAction_send_error_message(msg_conv);
35346 int64_t ret_ref = tag_ptr(ret_copy, true);
35350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1warning_1message(JNIEnv *env, jclass clz, int64_t msg, jclass log_level) {
35351 LDKWarningMessage msg_conv;
35352 msg_conv.inner = untag_ptr(msg);
35353 msg_conv.is_owned = ptr_is_owned(msg);
35354 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
35355 msg_conv = WarningMessage_clone(&msg_conv);
35356 LDKLevel log_level_conv = LDKLevel_from_java(env, log_level);
35357 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
35358 *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv);
35359 int64_t ret_ref = tag_ptr(ret_copy, true);
35363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35364 LDKLightningError 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 LightningError_free(this_obj_conv);
35371 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv *env, jclass clz, int64_t this_ptr) {
35372 LDKLightningError 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 LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
35378 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
35383 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
35384 LDKLightningError this_ptr_conv;
35385 this_ptr_conv.inner = untag_ptr(this_ptr);
35386 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35388 this_ptr_conv.is_owned = false;
35389 LDKStr val_conv = java_to_owned_str(env, val);
35390 LightningError_set_err(&this_ptr_conv, val_conv);
35393 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv *env, jclass clz, int64_t this_ptr) {
35394 LDKLightningError this_ptr_conv;
35395 this_ptr_conv.inner = untag_ptr(this_ptr);
35396 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35398 this_ptr_conv.is_owned = false;
35399 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
35400 *ret_copy = LightningError_get_action(&this_ptr_conv);
35401 int64_t ret_ref = tag_ptr(ret_copy, true);
35405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35406 LDKLightningError this_ptr_conv;
35407 this_ptr_conv.inner = untag_ptr(this_ptr);
35408 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35410 this_ptr_conv.is_owned = false;
35411 void* val_ptr = untag_ptr(val);
35412 CHECK_ACCESS(val_ptr);
35413 LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
35414 val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val));
35415 LightningError_set_action(&this_ptr_conv, val_conv);
35418 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *env, jclass clz, jstring err_arg, int64_t action_arg) {
35419 LDKStr err_arg_conv = java_to_owned_str(env, err_arg);
35420 void* action_arg_ptr = untag_ptr(action_arg);
35421 CHECK_ACCESS(action_arg_ptr);
35422 LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
35423 action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg));
35424 LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
35425 int64_t ret_ref = 0;
35426 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35427 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35431 static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) {
35432 LDKLightningError ret_var = LightningError_clone(arg);
35433 int64_t ret_ref = 0;
35434 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35435 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35438 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35439 LDKLightningError arg_conv;
35440 arg_conv.inner = untag_ptr(arg);
35441 arg_conv.is_owned = ptr_is_owned(arg);
35442 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35443 arg_conv.is_owned = false;
35444 int64_t ret_conv = LightningError_clone_ptr(&arg_conv);
35448 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35449 LDKLightningError orig_conv;
35450 orig_conv.inner = untag_ptr(orig);
35451 orig_conv.is_owned = ptr_is_owned(orig);
35452 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35453 orig_conv.is_owned = false;
35454 LDKLightningError ret_var = LightningError_clone(&orig_conv);
35455 int64_t ret_ref = 0;
35456 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35457 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35461 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35462 LDKCommitmentUpdate this_obj_conv;
35463 this_obj_conv.inner = untag_ptr(this_obj);
35464 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35466 CommitmentUpdate_free(this_obj_conv);
35469 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
35470 LDKCommitmentUpdate this_ptr_conv;
35471 this_ptr_conv.inner = untag_ptr(this_ptr);
35472 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35473 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35474 this_ptr_conv.is_owned = false;
35475 LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
35476 int64_tArray ret_arr = NULL;
35477 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
35478 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
35479 for (size_t p = 0; p < ret_var.datalen; p++) {
35480 LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
35481 int64_t ret_conv_15_ref = 0;
35482 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var);
35483 ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned);
35484 ret_arr_ptr[p] = ret_conv_15_ref;
35486 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
35487 FREE(ret_var.data);
35491 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
35492 LDKCommitmentUpdate this_ptr_conv;
35493 this_ptr_conv.inner = untag_ptr(this_ptr);
35494 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35496 this_ptr_conv.is_owned = false;
35497 LDKCVec_UpdateAddHTLCZ val_constr;
35498 val_constr.datalen = (*env)->GetArrayLength(env, val);
35499 if (val_constr.datalen > 0)
35500 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
35502 val_constr.data = NULL;
35503 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
35504 for (size_t p = 0; p < val_constr.datalen; p++) {
35505 int64_t val_conv_15 = val_vals[p];
35506 LDKUpdateAddHTLC val_conv_15_conv;
35507 val_conv_15_conv.inner = untag_ptr(val_conv_15);
35508 val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15);
35509 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv);
35510 val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
35511 val_constr.data[p] = val_conv_15_conv;
35513 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
35514 CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
35517 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
35518 LDKCommitmentUpdate this_ptr_conv;
35519 this_ptr_conv.inner = untag_ptr(this_ptr);
35520 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35521 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35522 this_ptr_conv.is_owned = false;
35523 LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
35524 int64_tArray ret_arr = NULL;
35525 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
35526 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
35527 for (size_t t = 0; t < ret_var.datalen; t++) {
35528 LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
35529 int64_t ret_conv_19_ref = 0;
35530 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var);
35531 ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned);
35532 ret_arr_ptr[t] = ret_conv_19_ref;
35534 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
35535 FREE(ret_var.data);
35539 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
35540 LDKCommitmentUpdate this_ptr_conv;
35541 this_ptr_conv.inner = untag_ptr(this_ptr);
35542 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35543 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35544 this_ptr_conv.is_owned = false;
35545 LDKCVec_UpdateFulfillHTLCZ val_constr;
35546 val_constr.datalen = (*env)->GetArrayLength(env, val);
35547 if (val_constr.datalen > 0)
35548 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
35550 val_constr.data = NULL;
35551 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
35552 for (size_t t = 0; t < val_constr.datalen; t++) {
35553 int64_t val_conv_19 = val_vals[t];
35554 LDKUpdateFulfillHTLC val_conv_19_conv;
35555 val_conv_19_conv.inner = untag_ptr(val_conv_19);
35556 val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19);
35557 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv);
35558 val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
35559 val_constr.data[t] = val_conv_19_conv;
35561 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
35562 CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
35565 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
35566 LDKCommitmentUpdate this_ptr_conv;
35567 this_ptr_conv.inner = untag_ptr(this_ptr);
35568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35570 this_ptr_conv.is_owned = false;
35571 LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
35572 int64_tArray ret_arr = NULL;
35573 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
35574 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
35575 for (size_t q = 0; q < ret_var.datalen; q++) {
35576 LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
35577 int64_t ret_conv_16_ref = 0;
35578 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
35579 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
35580 ret_arr_ptr[q] = ret_conv_16_ref;
35582 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
35583 FREE(ret_var.data);
35587 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
35588 LDKCommitmentUpdate this_ptr_conv;
35589 this_ptr_conv.inner = untag_ptr(this_ptr);
35590 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35591 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35592 this_ptr_conv.is_owned = false;
35593 LDKCVec_UpdateFailHTLCZ val_constr;
35594 val_constr.datalen = (*env)->GetArrayLength(env, val);
35595 if (val_constr.datalen > 0)
35596 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
35598 val_constr.data = NULL;
35599 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
35600 for (size_t q = 0; q < val_constr.datalen; q++) {
35601 int64_t val_conv_16 = val_vals[q];
35602 LDKUpdateFailHTLC val_conv_16_conv;
35603 val_conv_16_conv.inner = untag_ptr(val_conv_16);
35604 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
35605 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
35606 val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
35607 val_constr.data[q] = val_conv_16_conv;
35609 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
35610 CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
35613 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
35614 LDKCommitmentUpdate this_ptr_conv;
35615 this_ptr_conv.inner = untag_ptr(this_ptr);
35616 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35618 this_ptr_conv.is_owned = false;
35619 LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
35620 int64_tArray ret_arr = NULL;
35621 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
35622 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
35623 for (size_t z = 0; z < ret_var.datalen; z++) {
35624 LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
35625 int64_t ret_conv_25_ref = 0;
35626 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var);
35627 ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned);
35628 ret_arr_ptr[z] = ret_conv_25_ref;
35630 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
35631 FREE(ret_var.data);
35635 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) {
35636 LDKCommitmentUpdate this_ptr_conv;
35637 this_ptr_conv.inner = untag_ptr(this_ptr);
35638 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35639 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35640 this_ptr_conv.is_owned = false;
35641 LDKCVec_UpdateFailMalformedHTLCZ val_constr;
35642 val_constr.datalen = (*env)->GetArrayLength(env, val);
35643 if (val_constr.datalen > 0)
35644 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
35646 val_constr.data = NULL;
35647 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
35648 for (size_t z = 0; z < val_constr.datalen; z++) {
35649 int64_t val_conv_25 = val_vals[z];
35650 LDKUpdateFailMalformedHTLC val_conv_25_conv;
35651 val_conv_25_conv.inner = untag_ptr(val_conv_25);
35652 val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25);
35653 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv);
35654 val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
35655 val_constr.data[z] = val_conv_25_conv;
35657 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
35658 CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
35661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr) {
35662 LDKCommitmentUpdate this_ptr_conv;
35663 this_ptr_conv.inner = untag_ptr(this_ptr);
35664 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35666 this_ptr_conv.is_owned = false;
35667 LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
35668 int64_t ret_ref = 0;
35669 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35670 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35674 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35675 LDKCommitmentUpdate this_ptr_conv;
35676 this_ptr_conv.inner = untag_ptr(this_ptr);
35677 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35679 this_ptr_conv.is_owned = false;
35680 LDKUpdateFee val_conv;
35681 val_conv.inner = untag_ptr(val);
35682 val_conv.is_owned = ptr_is_owned(val);
35683 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
35684 val_conv = UpdateFee_clone(&val_conv);
35685 CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv);
35688 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr) {
35689 LDKCommitmentUpdate this_ptr_conv;
35690 this_ptr_conv.inner = untag_ptr(this_ptr);
35691 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35692 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35693 this_ptr_conv.is_owned = false;
35694 LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
35695 int64_t ret_ref = 0;
35696 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35697 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35701 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35702 LDKCommitmentUpdate this_ptr_conv;
35703 this_ptr_conv.inner = untag_ptr(this_ptr);
35704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35706 this_ptr_conv.is_owned = false;
35707 LDKCommitmentSigned val_conv;
35708 val_conv.inner = untag_ptr(val);
35709 val_conv.is_owned = ptr_is_owned(val);
35710 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
35711 val_conv = CommitmentSigned_clone(&val_conv);
35712 CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv);
35715 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) {
35716 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr;
35717 update_add_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_add_htlcs_arg);
35718 if (update_add_htlcs_arg_constr.datalen > 0)
35719 update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
35721 update_add_htlcs_arg_constr.data = NULL;
35722 int64_t* update_add_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_add_htlcs_arg, NULL);
35723 for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
35724 int64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
35725 LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
35726 update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15);
35727 update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15);
35728 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv);
35729 update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
35730 update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
35732 (*env)->ReleaseLongArrayElements(env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0);
35733 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
35734 update_fulfill_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fulfill_htlcs_arg);
35735 if (update_fulfill_htlcs_arg_constr.datalen > 0)
35736 update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
35738 update_fulfill_htlcs_arg_constr.data = NULL;
35739 int64_t* update_fulfill_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fulfill_htlcs_arg, NULL);
35740 for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
35741 int64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
35742 LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
35743 update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19);
35744 update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19);
35745 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv);
35746 update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
35747 update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
35749 (*env)->ReleaseLongArrayElements(env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0);
35750 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
35751 update_fail_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_htlcs_arg);
35752 if (update_fail_htlcs_arg_constr.datalen > 0)
35753 update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
35755 update_fail_htlcs_arg_constr.data = NULL;
35756 int64_t* update_fail_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_htlcs_arg, NULL);
35757 for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
35758 int64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
35759 LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
35760 update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16);
35761 update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16);
35762 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv);
35763 update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
35764 update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
35766 (*env)->ReleaseLongArrayElements(env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0);
35767 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
35768 update_fail_malformed_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_malformed_htlcs_arg);
35769 if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
35770 update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
35772 update_fail_malformed_htlcs_arg_constr.data = NULL;
35773 int64_t* update_fail_malformed_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_malformed_htlcs_arg, NULL);
35774 for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
35775 int64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
35776 LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
35777 update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25);
35778 update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25);
35779 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv);
35780 update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
35781 update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
35783 (*env)->ReleaseLongArrayElements(env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0);
35784 LDKUpdateFee update_fee_arg_conv;
35785 update_fee_arg_conv.inner = untag_ptr(update_fee_arg);
35786 update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg);
35787 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv);
35788 update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv);
35789 LDKCommitmentSigned commitment_signed_arg_conv;
35790 commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg);
35791 commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg);
35792 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv);
35793 commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
35794 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);
35795 int64_t ret_ref = 0;
35796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35801 static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) {
35802 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg);
35803 int64_t ret_ref = 0;
35804 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35805 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35809 LDKCommitmentUpdate arg_conv;
35810 arg_conv.inner = untag_ptr(arg);
35811 arg_conv.is_owned = ptr_is_owned(arg);
35812 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35813 arg_conv.is_owned = false;
35814 int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv);
35818 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35819 LDKCommitmentUpdate orig_conv;
35820 orig_conv.inner = untag_ptr(orig);
35821 orig_conv.is_owned = ptr_is_owned(orig);
35822 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35823 orig_conv.is_owned = false;
35824 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
35825 int64_t ret_ref = 0;
35826 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35827 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
35832 if (!ptr_is_owned(this_ptr)) return;
35833 void* this_ptr_ptr = untag_ptr(this_ptr);
35834 CHECK_ACCESS(this_ptr_ptr);
35835 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
35836 FREE(untag_ptr(this_ptr));
35837 ChannelMessageHandler_free(this_ptr_conv);
35840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
35841 if (!ptr_is_owned(this_ptr)) return;
35842 void* this_ptr_ptr = untag_ptr(this_ptr);
35843 CHECK_ACCESS(this_ptr_ptr);
35844 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
35845 FREE(untag_ptr(this_ptr));
35846 RoutingMessageHandler_free(this_ptr_conv);
35849 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv *env, jclass clz, int64_t obj) {
35850 LDKAcceptChannel obj_conv;
35851 obj_conv.inner = untag_ptr(obj);
35852 obj_conv.is_owned = ptr_is_owned(obj);
35853 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35854 obj_conv.is_owned = false;
35855 LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
35856 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
35857 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
35858 CVec_u8Z_free(ret_var);
35862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
35863 LDKu8slice ser_ref;
35864 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
35865 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
35866 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
35867 *ret_conv = AcceptChannel_read(ser_ref);
35868 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
35869 return tag_ptr(ret_conv, true);
35872 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
35873 LDKAnnouncementSignatures obj_conv;
35874 obj_conv.inner = untag_ptr(obj);
35875 obj_conv.is_owned = ptr_is_owned(obj);
35876 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35877 obj_conv.is_owned = false;
35878 LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
35879 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
35880 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
35881 CVec_u8Z_free(ret_var);
35885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
35886 LDKu8slice ser_ref;
35887 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
35888 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
35889 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
35890 *ret_conv = AnnouncementSignatures_read(ser_ref);
35891 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
35892 return tag_ptr(ret_conv, true);
35895 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv *env, jclass clz, int64_t obj) {
35896 LDKChannelReestablish obj_conv;
35897 obj_conv.inner = untag_ptr(obj);
35898 obj_conv.is_owned = ptr_is_owned(obj);
35899 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35900 obj_conv.is_owned = false;
35901 LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
35902 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
35903 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
35904 CVec_u8Z_free(ret_var);
35908 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
35909 LDKu8slice ser_ref;
35910 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
35911 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
35912 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
35913 *ret_conv = ChannelReestablish_read(ser_ref);
35914 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
35915 return tag_ptr(ret_conv, true);
35918 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
35919 LDKClosingSigned obj_conv;
35920 obj_conv.inner = untag_ptr(obj);
35921 obj_conv.is_owned = ptr_is_owned(obj);
35922 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35923 obj_conv.is_owned = false;
35924 LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
35925 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
35926 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
35927 CVec_u8Z_free(ret_var);
35931 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
35932 LDKu8slice ser_ref;
35933 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
35934 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
35935 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
35936 *ret_conv = ClosingSigned_read(ser_ref);
35937 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
35938 return tag_ptr(ret_conv, true);
35941 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
35942 LDKClosingSignedFeeRange obj_conv;
35943 obj_conv.inner = untag_ptr(obj);
35944 obj_conv.is_owned = ptr_is_owned(obj);
35945 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35946 obj_conv.is_owned = false;
35947 LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
35948 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
35949 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
35950 CVec_u8Z_free(ret_var);
35954 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
35955 LDKu8slice ser_ref;
35956 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
35957 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
35958 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
35959 *ret_conv = ClosingSignedFeeRange_read(ser_ref);
35960 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
35961 return tag_ptr(ret_conv, true);
35964 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
35965 LDKCommitmentSigned obj_conv;
35966 obj_conv.inner = untag_ptr(obj);
35967 obj_conv.is_owned = ptr_is_owned(obj);
35968 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35969 obj_conv.is_owned = false;
35970 LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
35971 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
35972 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
35973 CVec_u8Z_free(ret_var);
35977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
35978 LDKu8slice ser_ref;
35979 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
35980 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
35981 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
35982 *ret_conv = CommitmentSigned_read(ser_ref);
35983 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
35984 return tag_ptr(ret_conv, true);
35987 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv *env, jclass clz, int64_t obj) {
35988 LDKFundingCreated obj_conv;
35989 obj_conv.inner = untag_ptr(obj);
35990 obj_conv.is_owned = ptr_is_owned(obj);
35991 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35992 obj_conv.is_owned = false;
35993 LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
35994 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
35995 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
35996 CVec_u8Z_free(ret_var);
36000 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36001 LDKu8slice ser_ref;
36002 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36003 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36004 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
36005 *ret_conv = FundingCreated_read(ser_ref);
36006 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36007 return tag_ptr(ret_conv, true);
36010 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
36011 LDKFundingSigned obj_conv;
36012 obj_conv.inner = untag_ptr(obj);
36013 obj_conv.is_owned = ptr_is_owned(obj);
36014 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36015 obj_conv.is_owned = false;
36016 LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
36017 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36018 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36019 CVec_u8Z_free(ret_var);
36023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36024 LDKu8slice ser_ref;
36025 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36026 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36027 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
36028 *ret_conv = FundingSigned_read(ser_ref);
36029 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36030 return tag_ptr(ret_conv, true);
36033 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1write(JNIEnv *env, jclass clz, int64_t obj) {
36034 LDKChannelReady obj_conv;
36035 obj_conv.inner = untag_ptr(obj);
36036 obj_conv.is_owned = ptr_is_owned(obj);
36037 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36038 obj_conv.is_owned = false;
36039 LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv);
36040 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36041 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36042 CVec_u8Z_free(ret_var);
36046 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36047 LDKu8slice ser_ref;
36048 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36049 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36050 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
36051 *ret_conv = ChannelReady_read(ser_ref);
36052 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36053 return tag_ptr(ret_conv, true);
36056 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env, jclass clz, int64_t obj) {
36058 obj_conv.inner = untag_ptr(obj);
36059 obj_conv.is_owned = ptr_is_owned(obj);
36060 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36061 obj_conv.is_owned = false;
36062 LDKCVec_u8Z ret_var = Init_write(&obj_conv);
36063 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36064 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36065 CVec_u8Z_free(ret_var);
36069 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36070 LDKu8slice ser_ref;
36071 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36072 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36073 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
36074 *ret_conv = Init_read(ser_ref);
36075 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36076 return tag_ptr(ret_conv, true);
36079 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv *env, jclass clz, int64_t obj) {
36080 LDKOpenChannel obj_conv;
36081 obj_conv.inner = untag_ptr(obj);
36082 obj_conv.is_owned = ptr_is_owned(obj);
36083 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36084 obj_conv.is_owned = false;
36085 LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
36086 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36087 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36088 CVec_u8Z_free(ret_var);
36092 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36093 LDKu8slice ser_ref;
36094 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36095 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36096 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
36097 *ret_conv = OpenChannel_read(ser_ref);
36098 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36099 return tag_ptr(ret_conv, true);
36102 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv *env, jclass clz, int64_t obj) {
36103 LDKRevokeAndACK obj_conv;
36104 obj_conv.inner = untag_ptr(obj);
36105 obj_conv.is_owned = ptr_is_owned(obj);
36106 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36107 obj_conv.is_owned = false;
36108 LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
36109 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36110 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36111 CVec_u8Z_free(ret_var);
36115 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36116 LDKu8slice ser_ref;
36117 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36118 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36119 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
36120 *ret_conv = RevokeAndACK_read(ser_ref);
36121 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36122 return tag_ptr(ret_conv, true);
36125 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv *env, jclass clz, int64_t obj) {
36126 LDKShutdown obj_conv;
36127 obj_conv.inner = untag_ptr(obj);
36128 obj_conv.is_owned = ptr_is_owned(obj);
36129 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36130 obj_conv.is_owned = false;
36131 LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
36132 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36133 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36134 CVec_u8Z_free(ret_var);
36138 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36139 LDKu8slice ser_ref;
36140 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36141 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36142 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
36143 *ret_conv = Shutdown_read(ser_ref);
36144 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36145 return tag_ptr(ret_conv, true);
36148 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
36149 LDKUpdateFailHTLC obj_conv;
36150 obj_conv.inner = untag_ptr(obj);
36151 obj_conv.is_owned = ptr_is_owned(obj);
36152 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36153 obj_conv.is_owned = false;
36154 LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
36155 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36156 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36157 CVec_u8Z_free(ret_var);
36161 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36162 LDKu8slice ser_ref;
36163 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36164 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36165 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
36166 *ret_conv = UpdateFailHTLC_read(ser_ref);
36167 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36168 return tag_ptr(ret_conv, true);
36171 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
36172 LDKUpdateFailMalformedHTLC obj_conv;
36173 obj_conv.inner = untag_ptr(obj);
36174 obj_conv.is_owned = ptr_is_owned(obj);
36175 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36176 obj_conv.is_owned = false;
36177 LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
36178 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36179 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36180 CVec_u8Z_free(ret_var);
36184 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36185 LDKu8slice ser_ref;
36186 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36187 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36188 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
36189 *ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
36190 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36191 return tag_ptr(ret_conv, true);
36194 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv *env, jclass clz, int64_t obj) {
36195 LDKUpdateFee obj_conv;
36196 obj_conv.inner = untag_ptr(obj);
36197 obj_conv.is_owned = ptr_is_owned(obj);
36198 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36199 obj_conv.is_owned = false;
36200 LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
36201 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36202 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36203 CVec_u8Z_free(ret_var);
36207 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36208 LDKu8slice ser_ref;
36209 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36210 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36211 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
36212 *ret_conv = UpdateFee_read(ser_ref);
36213 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36214 return tag_ptr(ret_conv, true);
36217 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
36218 LDKUpdateFulfillHTLC obj_conv;
36219 obj_conv.inner = untag_ptr(obj);
36220 obj_conv.is_owned = ptr_is_owned(obj);
36221 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36222 obj_conv.is_owned = false;
36223 LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
36224 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36225 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36226 CVec_u8Z_free(ret_var);
36230 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36231 LDKu8slice ser_ref;
36232 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36233 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36234 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
36235 *ret_conv = UpdateFulfillHTLC_read(ser_ref);
36236 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36237 return tag_ptr(ret_conv, true);
36240 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
36241 LDKUpdateAddHTLC obj_conv;
36242 obj_conv.inner = untag_ptr(obj);
36243 obj_conv.is_owned = ptr_is_owned(obj);
36244 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36245 obj_conv.is_owned = false;
36246 LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
36247 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36248 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36249 CVec_u8Z_free(ret_var);
36253 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36254 LDKu8slice ser_ref;
36255 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36256 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36257 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
36258 *ret_conv = UpdateAddHTLC_read(ser_ref);
36259 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36260 return tag_ptr(ret_conv, true);
36263 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env, jclass clz, int64_t obj) {
36265 obj_conv.inner = untag_ptr(obj);
36266 obj_conv.is_owned = ptr_is_owned(obj);
36267 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36268 obj_conv.is_owned = false;
36269 LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
36270 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36271 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36272 CVec_u8Z_free(ret_var);
36276 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36277 LDKu8slice ser_ref;
36278 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36279 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36280 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
36281 *ret_conv = Ping_read(ser_ref);
36282 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36283 return tag_ptr(ret_conv, true);
36286 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env, jclass clz, int64_t obj) {
36288 obj_conv.inner = untag_ptr(obj);
36289 obj_conv.is_owned = ptr_is_owned(obj);
36290 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36291 obj_conv.is_owned = false;
36292 LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
36293 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36294 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36295 CVec_u8Z_free(ret_var);
36299 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36300 LDKu8slice ser_ref;
36301 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36302 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36303 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
36304 *ret_conv = Pong_read(ser_ref);
36305 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36306 return tag_ptr(ret_conv, true);
36309 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
36310 LDKUnsignedChannelAnnouncement obj_conv;
36311 obj_conv.inner = untag_ptr(obj);
36312 obj_conv.is_owned = ptr_is_owned(obj);
36313 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36314 obj_conv.is_owned = false;
36315 LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
36316 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36317 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36318 CVec_u8Z_free(ret_var);
36322 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36323 LDKu8slice ser_ref;
36324 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36325 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36326 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
36327 *ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
36328 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36329 return tag_ptr(ret_conv, true);
36332 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
36333 LDKChannelAnnouncement obj_conv;
36334 obj_conv.inner = untag_ptr(obj);
36335 obj_conv.is_owned = ptr_is_owned(obj);
36336 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36337 obj_conv.is_owned = false;
36338 LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
36339 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36340 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36341 CVec_u8Z_free(ret_var);
36345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36346 LDKu8slice ser_ref;
36347 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36348 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36349 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
36350 *ret_conv = ChannelAnnouncement_read(ser_ref);
36351 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36352 return tag_ptr(ret_conv, true);
36355 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
36356 LDKUnsignedChannelUpdate obj_conv;
36357 obj_conv.inner = untag_ptr(obj);
36358 obj_conv.is_owned = ptr_is_owned(obj);
36359 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36360 obj_conv.is_owned = false;
36361 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
36362 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36363 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36364 CVec_u8Z_free(ret_var);
36368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36369 LDKu8slice ser_ref;
36370 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36371 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36372 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
36373 *ret_conv = UnsignedChannelUpdate_read(ser_ref);
36374 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36375 return tag_ptr(ret_conv, true);
36378 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
36379 LDKChannelUpdate obj_conv;
36380 obj_conv.inner = untag_ptr(obj);
36381 obj_conv.is_owned = ptr_is_owned(obj);
36382 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36383 obj_conv.is_owned = false;
36384 LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
36385 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36386 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36387 CVec_u8Z_free(ret_var);
36391 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36392 LDKu8slice ser_ref;
36393 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36394 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36395 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
36396 *ret_conv = ChannelUpdate_read(ser_ref);
36397 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36398 return tag_ptr(ret_conv, true);
36401 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
36402 LDKErrorMessage obj_conv;
36403 obj_conv.inner = untag_ptr(obj);
36404 obj_conv.is_owned = ptr_is_owned(obj);
36405 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36406 obj_conv.is_owned = false;
36407 LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
36408 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36409 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36410 CVec_u8Z_free(ret_var);
36414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36415 LDKu8slice ser_ref;
36416 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36417 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36418 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
36419 *ret_conv = ErrorMessage_read(ser_ref);
36420 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36421 return tag_ptr(ret_conv, true);
36424 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
36425 LDKWarningMessage obj_conv;
36426 obj_conv.inner = untag_ptr(obj);
36427 obj_conv.is_owned = ptr_is_owned(obj);
36428 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36429 obj_conv.is_owned = false;
36430 LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv);
36431 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36432 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36433 CVec_u8Z_free(ret_var);
36437 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36438 LDKu8slice ser_ref;
36439 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36440 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36441 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
36442 *ret_conv = WarningMessage_read(ser_ref);
36443 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36444 return tag_ptr(ret_conv, true);
36447 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
36448 LDKUnsignedNodeAnnouncement obj_conv;
36449 obj_conv.inner = untag_ptr(obj);
36450 obj_conv.is_owned = ptr_is_owned(obj);
36451 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36452 obj_conv.is_owned = false;
36453 LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
36454 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36455 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36456 CVec_u8Z_free(ret_var);
36460 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36461 LDKu8slice ser_ref;
36462 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36463 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36464 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
36465 *ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
36466 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36467 return tag_ptr(ret_conv, true);
36470 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
36471 LDKNodeAnnouncement obj_conv;
36472 obj_conv.inner = untag_ptr(obj);
36473 obj_conv.is_owned = ptr_is_owned(obj);
36474 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36475 obj_conv.is_owned = false;
36476 LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
36477 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36478 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36479 CVec_u8Z_free(ret_var);
36483 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36484 LDKu8slice ser_ref;
36485 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36486 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36487 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
36488 *ret_conv = NodeAnnouncement_read(ser_ref);
36489 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36490 return tag_ptr(ret_conv, true);
36493 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36494 LDKu8slice ser_ref;
36495 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36496 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36497 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
36498 *ret_conv = QueryShortChannelIds_read(ser_ref);
36499 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36500 return tag_ptr(ret_conv, true);
36503 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv *env, jclass clz, int64_t obj) {
36504 LDKQueryShortChannelIds obj_conv;
36505 obj_conv.inner = untag_ptr(obj);
36506 obj_conv.is_owned = ptr_is_owned(obj);
36507 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36508 obj_conv.is_owned = false;
36509 LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
36510 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36511 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36512 CVec_u8Z_free(ret_var);
36516 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv *env, jclass clz, int64_t obj) {
36517 LDKReplyShortChannelIdsEnd obj_conv;
36518 obj_conv.inner = untag_ptr(obj);
36519 obj_conv.is_owned = ptr_is_owned(obj);
36520 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36521 obj_conv.is_owned = false;
36522 LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
36523 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36524 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36525 CVec_u8Z_free(ret_var);
36529 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36530 LDKu8slice ser_ref;
36531 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36532 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36533 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
36534 *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
36535 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36536 return tag_ptr(ret_conv, true);
36539 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blocknum(JNIEnv *env, jclass clz, int64_t this_arg) {
36540 LDKQueryChannelRange this_arg_conv;
36541 this_arg_conv.inner = untag_ptr(this_arg);
36542 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36543 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36544 this_arg_conv.is_owned = false;
36545 int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv);
36549 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
36550 LDKQueryChannelRange obj_conv;
36551 obj_conv.inner = untag_ptr(obj);
36552 obj_conv.is_owned = ptr_is_owned(obj);
36553 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36554 obj_conv.is_owned = false;
36555 LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
36556 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36557 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36558 CVec_u8Z_free(ret_var);
36562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36563 LDKu8slice ser_ref;
36564 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36565 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36566 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
36567 *ret_conv = QueryChannelRange_read(ser_ref);
36568 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36569 return tag_ptr(ret_conv, true);
36572 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36573 LDKu8slice ser_ref;
36574 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36575 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36576 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
36577 *ret_conv = ReplyChannelRange_read(ser_ref);
36578 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36579 return tag_ptr(ret_conv, true);
36582 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
36583 LDKReplyChannelRange obj_conv;
36584 obj_conv.inner = untag_ptr(obj);
36585 obj_conv.is_owned = ptr_is_owned(obj);
36586 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36587 obj_conv.is_owned = false;
36588 LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
36589 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36590 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36591 CVec_u8Z_free(ret_var);
36595 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv *env, jclass clz, int64_t obj) {
36596 LDKGossipTimestampFilter obj_conv;
36597 obj_conv.inner = untag_ptr(obj);
36598 obj_conv.is_owned = ptr_is_owned(obj);
36599 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36600 obj_conv.is_owned = false;
36601 LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
36602 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36603 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36604 CVec_u8Z_free(ret_var);
36608 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
36609 LDKu8slice ser_ref;
36610 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
36611 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
36612 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
36613 *ret_conv = GossipTimestampFilter_read(ser_ref);
36614 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
36615 return tag_ptr(ret_conv, true);
36618 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
36619 if (!ptr_is_owned(this_ptr)) return;
36620 void* this_ptr_ptr = untag_ptr(this_ptr);
36621 CHECK_ACCESS(this_ptr_ptr);
36622 LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
36623 FREE(untag_ptr(this_ptr));
36624 CustomMessageHandler_free(this_ptr_conv);
36627 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36628 LDKIgnoringMessageHandler this_obj_conv;
36629 this_obj_conv.inner = untag_ptr(this_obj);
36630 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36631 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36632 IgnoringMessageHandler_free(this_obj_conv);
36635 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) {
36636 LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
36637 int64_t ret_ref = 0;
36638 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36639 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36643 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
36644 LDKIgnoringMessageHandler this_arg_conv;
36645 this_arg_conv.inner = untag_ptr(this_arg);
36646 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36648 this_arg_conv.is_owned = false;
36649 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
36650 *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
36651 return tag_ptr(ret_ret, true);
36654 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
36655 LDKIgnoringMessageHandler this_arg_conv;
36656 this_arg_conv.inner = untag_ptr(this_arg);
36657 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36658 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36659 this_arg_conv.is_owned = false;
36660 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
36661 *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
36662 return tag_ptr(ret_ret, true);
36665 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t this_arg) {
36666 LDKIgnoringMessageHandler this_arg_conv;
36667 this_arg_conv.inner = untag_ptr(this_arg);
36668 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36670 this_arg_conv.is_owned = false;
36671 LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
36672 *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
36673 return tag_ptr(ret_ret, true);
36676 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
36677 LDKIgnoringMessageHandler this_arg_conv;
36678 this_arg_conv.inner = untag_ptr(this_arg);
36679 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36681 this_arg_conv.is_owned = false;
36682 LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
36683 *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
36684 return tag_ptr(ret_ret, true);
36687 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36688 LDKErroringMessageHandler this_obj_conv;
36689 this_obj_conv.inner = untag_ptr(this_obj);
36690 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36692 ErroringMessageHandler_free(this_obj_conv);
36695 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) {
36696 LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
36697 int64_t ret_ref = 0;
36698 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36699 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36703 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
36704 LDKErroringMessageHandler this_arg_conv;
36705 this_arg_conv.inner = untag_ptr(this_arg);
36706 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36708 this_arg_conv.is_owned = false;
36709 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
36710 *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
36711 return tag_ptr(ret_ret, true);
36714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
36715 LDKErroringMessageHandler this_arg_conv;
36716 this_arg_conv.inner = untag_ptr(this_arg);
36717 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36719 this_arg_conv.is_owned = false;
36720 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
36721 *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
36722 return tag_ptr(ret_ret, true);
36725 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36726 LDKMessageHandler this_obj_conv;
36727 this_obj_conv.inner = untag_ptr(this_obj);
36728 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36730 MessageHandler_free(this_obj_conv);
36733 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
36734 LDKMessageHandler this_ptr_conv;
36735 this_ptr_conv.inner = untag_ptr(this_ptr);
36736 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36738 this_ptr_conv.is_owned = false;
36739 // WARNING: This object doesn't live past this scope, needs clone!
36740 int64_t ret_ret = tag_ptr(MessageHandler_get_chan_handler(&this_ptr_conv), false);
36744 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36745 LDKMessageHandler this_ptr_conv;
36746 this_ptr_conv.inner = untag_ptr(this_ptr);
36747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36749 this_ptr_conv.is_owned = false;
36750 void* val_ptr = untag_ptr(val);
36751 CHECK_ACCESS(val_ptr);
36752 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
36753 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
36754 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
36755 LDKChannelMessageHandler_JCalls_cloned(&val_conv);
36757 MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
36760 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
36761 LDKMessageHandler this_ptr_conv;
36762 this_ptr_conv.inner = untag_ptr(this_ptr);
36763 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36765 this_ptr_conv.is_owned = false;
36766 // WARNING: This object doesn't live past this scope, needs clone!
36767 int64_t ret_ret = tag_ptr(MessageHandler_get_route_handler(&this_ptr_conv), false);
36771 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36772 LDKMessageHandler this_ptr_conv;
36773 this_ptr_conv.inner = untag_ptr(this_ptr);
36774 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36775 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36776 this_ptr_conv.is_owned = false;
36777 void* val_ptr = untag_ptr(val);
36778 CHECK_ACCESS(val_ptr);
36779 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
36780 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
36781 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
36782 LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
36784 MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
36787 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) {
36788 void* chan_handler_arg_ptr = untag_ptr(chan_handler_arg);
36789 CHECK_ACCESS(chan_handler_arg_ptr);
36790 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
36791 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
36792 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
36793 LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
36795 void* route_handler_arg_ptr = untag_ptr(route_handler_arg);
36796 CHECK_ACCESS(route_handler_arg_ptr);
36797 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
36798 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
36799 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
36800 LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
36802 LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
36803 int64_t ret_ref = 0;
36804 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36805 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36809 static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) {
36810 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
36811 *ret_ret = SocketDescriptor_clone(arg);
36812 return tag_ptr(ret_ret, true);
36814 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36815 void* arg_ptr = untag_ptr(arg);
36816 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
36817 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr;
36818 int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv);
36822 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36823 void* orig_ptr = untag_ptr(orig);
36824 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
36825 LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
36826 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
36827 *ret_ret = SocketDescriptor_clone(orig_conv);
36828 return tag_ptr(ret_ret, true);
36831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
36832 if (!ptr_is_owned(this_ptr)) return;
36833 void* this_ptr_ptr = untag_ptr(this_ptr);
36834 CHECK_ACCESS(this_ptr_ptr);
36835 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
36836 FREE(untag_ptr(this_ptr));
36837 SocketDescriptor_free(this_ptr_conv);
36840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36841 LDKPeerHandleError this_obj_conv;
36842 this_obj_conv.inner = untag_ptr(this_obj);
36843 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36845 PeerHandleError_free(this_obj_conv);
36848 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr) {
36849 LDKPeerHandleError this_ptr_conv;
36850 this_ptr_conv.inner = untag_ptr(this_ptr);
36851 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36852 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36853 this_ptr_conv.is_owned = false;
36854 jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv);
36858 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
36859 LDKPeerHandleError this_ptr_conv;
36860 this_ptr_conv.inner = untag_ptr(this_ptr);
36861 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36862 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36863 this_ptr_conv.is_owned = false;
36864 PeerHandleError_set_no_connection_possible(&this_ptr_conv, val);
36867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv *env, jclass clz, jboolean no_connection_possible_arg) {
36868 LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg);
36869 int64_t ret_ref = 0;
36870 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36871 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36875 static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) {
36876 LDKPeerHandleError ret_var = PeerHandleError_clone(arg);
36877 int64_t ret_ref = 0;
36878 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36879 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36882 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36883 LDKPeerHandleError arg_conv;
36884 arg_conv.inner = untag_ptr(arg);
36885 arg_conv.is_owned = ptr_is_owned(arg);
36886 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36887 arg_conv.is_owned = false;
36888 int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv);
36892 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36893 LDKPeerHandleError orig_conv;
36894 orig_conv.inner = untag_ptr(orig);
36895 orig_conv.is_owned = ptr_is_owned(orig);
36896 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36897 orig_conv.is_owned = false;
36898 LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv);
36899 int64_t ret_ref = 0;
36900 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36901 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36905 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36906 LDKPeerManager this_obj_conv;
36907 this_obj_conv.inner = untag_ptr(this_obj);
36908 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36910 PeerManager_free(this_obj_conv);
36913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler) {
36914 LDKMessageHandler message_handler_conv;
36915 message_handler_conv.inner = untag_ptr(message_handler);
36916 message_handler_conv.is_owned = ptr_is_owned(message_handler);
36917 CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
36918 // WARNING: we need a move here but no clone is available for LDKMessageHandler
36920 LDKSecretKey our_node_secret_ref;
36921 CHECK((*env)->GetArrayLength(env, our_node_secret) == 32);
36922 (*env)->GetByteArrayRegion(env, our_node_secret, 0, 32, our_node_secret_ref.bytes);
36923 unsigned char ephemeral_random_data_arr[32];
36924 CHECK((*env)->GetArrayLength(env, ephemeral_random_data) == 32);
36925 (*env)->GetByteArrayRegion(env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
36926 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
36927 void* logger_ptr = untag_ptr(logger);
36928 CHECK_ACCESS(logger_ptr);
36929 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
36930 if (logger_conv.free == LDKLogger_JCalls_free) {
36931 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
36932 LDKLogger_JCalls_cloned(&logger_conv);
36934 void* custom_message_handler_ptr = untag_ptr(custom_message_handler);
36935 CHECK_ACCESS(custom_message_handler_ptr);
36936 LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
36937 if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
36938 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
36939 LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
36941 LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv);
36942 int64_t ret_ref = 0;
36943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36948 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv *env, jclass clz, int64_t this_arg) {
36949 LDKPeerManager this_arg_conv;
36950 this_arg_conv.inner = untag_ptr(this_arg);
36951 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36953 this_arg_conv.is_owned = false;
36954 LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
36955 jobjectArray ret_arr = NULL;
36956 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
36958 for (size_t i = 0; i < ret_var.datalen; i++) {
36959 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33);
36960 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form);
36961 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
36964 FREE(ret_var.data);
36968 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) {
36969 LDKPeerManager this_arg_conv;
36970 this_arg_conv.inner = untag_ptr(this_arg);
36971 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36973 this_arg_conv.is_owned = false;
36974 LDKPublicKey their_node_id_ref;
36975 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
36976 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
36977 void* descriptor_ptr = untag_ptr(descriptor);
36978 CHECK_ACCESS(descriptor_ptr);
36979 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
36980 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
36981 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
36982 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
36984 void* remote_network_address_ptr = untag_ptr(remote_network_address);
36985 CHECK_ACCESS(remote_network_address_ptr);
36986 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
36987 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
36988 *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv);
36989 return tag_ptr(ret_conv, true);
36992 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) {
36993 LDKPeerManager this_arg_conv;
36994 this_arg_conv.inner = untag_ptr(this_arg);
36995 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36997 this_arg_conv.is_owned = false;
36998 void* descriptor_ptr = untag_ptr(descriptor);
36999 CHECK_ACCESS(descriptor_ptr);
37000 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
37001 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
37002 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
37003 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
37005 void* remote_network_address_ptr = untag_ptr(remote_network_address);
37006 CHECK_ACCESS(remote_network_address_ptr);
37007 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
37008 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
37009 *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv);
37010 return tag_ptr(ret_conv, true);
37013 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) {
37014 LDKPeerManager this_arg_conv;
37015 this_arg_conv.inner = untag_ptr(this_arg);
37016 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37017 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37018 this_arg_conv.is_owned = false;
37019 void* descriptor_ptr = untag_ptr(descriptor);
37020 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
37021 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
37022 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
37023 *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
37024 return tag_ptr(ret_conv, true);
37027 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) {
37028 LDKPeerManager this_arg_conv;
37029 this_arg_conv.inner = untag_ptr(this_arg);
37030 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37032 this_arg_conv.is_owned = false;
37033 void* peer_descriptor_ptr = untag_ptr(peer_descriptor);
37034 if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); }
37035 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
37036 LDKu8slice data_ref;
37037 data_ref.datalen = (*env)->GetArrayLength(env, data);
37038 data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
37039 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
37040 *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
37041 (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0);
37042 return tag_ptr(ret_conv, true);
37045 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
37046 LDKPeerManager this_arg_conv;
37047 this_arg_conv.inner = untag_ptr(this_arg);
37048 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37050 this_arg_conv.is_owned = false;
37051 PeerManager_process_events(&this_arg_conv);
37054 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) {
37055 LDKPeerManager this_arg_conv;
37056 this_arg_conv.inner = untag_ptr(this_arg);
37057 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37058 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37059 this_arg_conv.is_owned = false;
37060 void* descriptor_ptr = untag_ptr(descriptor);
37061 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
37062 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
37063 PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
37066 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) {
37067 LDKPeerManager this_arg_conv;
37068 this_arg_conv.inner = untag_ptr(this_arg);
37069 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37070 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37071 this_arg_conv.is_owned = false;
37072 LDKPublicKey node_id_ref;
37073 CHECK((*env)->GetArrayLength(env, node_id) == 33);
37074 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
37075 PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
37078 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers(JNIEnv *env, jclass clz, int64_t this_arg) {
37079 LDKPeerManager this_arg_conv;
37080 this_arg_conv.inner = untag_ptr(this_arg);
37081 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37083 this_arg_conv.is_owned = false;
37084 PeerManager_disconnect_all_peers(&this_arg_conv);
37087 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
37088 LDKPeerManager this_arg_conv;
37089 this_arg_conv.inner = untag_ptr(this_arg);
37090 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37092 this_arg_conv.is_owned = false;
37093 PeerManager_timer_tick_occurred(&this_arg_conv);
37096 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
37097 int64_t ret_conv = htlc_success_tx_weight(opt_anchors);
37101 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
37102 int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors);
37106 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) {
37107 unsigned char commitment_seed_arr[32];
37108 CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
37109 (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_arr);
37110 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
37111 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37112 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data);
37116 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) {
37117 LDKCVec_u8Z to_holder_script_ref;
37118 to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
37119 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
37120 (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data);
37121 LDKCVec_u8Z to_counterparty_script_ref;
37122 to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script);
37123 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
37124 (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data);
37125 LDKOutPoint funding_outpoint_conv;
37126 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
37127 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
37128 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
37129 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
37130 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);
37131 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37132 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37133 Transaction_free(ret_var);
37137 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37138 LDKCounterpartyCommitmentSecrets this_obj_conv;
37139 this_obj_conv.inner = untag_ptr(this_obj);
37140 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37141 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37142 CounterpartyCommitmentSecrets_free(this_obj_conv);
37145 static inline uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) {
37146 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg);
37147 int64_t ret_ref = 0;
37148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37149 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37152 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37153 LDKCounterpartyCommitmentSecrets arg_conv;
37154 arg_conv.inner = untag_ptr(arg);
37155 arg_conv.is_owned = ptr_is_owned(arg);
37156 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37157 arg_conv.is_owned = false;
37158 int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv);
37162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37163 LDKCounterpartyCommitmentSecrets orig_conv;
37164 orig_conv.inner = untag_ptr(orig);
37165 orig_conv.is_owned = ptr_is_owned(orig);
37166 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37167 orig_conv.is_owned = false;
37168 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv);
37169 int64_t ret_ref = 0;
37170 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37171 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37175 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1new(JNIEnv *env, jclass clz) {
37176 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new();
37177 int64_t ret_ref = 0;
37178 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37179 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37183 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1min_1seen_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
37184 LDKCounterpartyCommitmentSecrets this_arg_conv;
37185 this_arg_conv.inner = untag_ptr(this_arg);
37186 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37187 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37188 this_arg_conv.is_owned = false;
37189 int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv);
37193 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) {
37194 LDKCounterpartyCommitmentSecrets this_arg_conv;
37195 this_arg_conv.inner = untag_ptr(this_arg);
37196 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37198 this_arg_conv.is_owned = false;
37199 LDKThirtyTwoBytes secret_ref;
37200 CHECK((*env)->GetArrayLength(env, secret) == 32);
37201 (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_ref.data);
37202 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
37203 *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref);
37204 return tag_ptr(ret_conv, true);
37207 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
37208 LDKCounterpartyCommitmentSecrets this_arg_conv;
37209 this_arg_conv.inner = untag_ptr(this_arg);
37210 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37211 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37212 this_arg_conv.is_owned = false;
37213 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37214 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data);
37218 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1write(JNIEnv *env, jclass clz, int64_t obj) {
37219 LDKCounterpartyCommitmentSecrets obj_conv;
37220 obj_conv.inner = untag_ptr(obj);
37221 obj_conv.is_owned = ptr_is_owned(obj);
37222 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37223 obj_conv.is_owned = false;
37224 LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv);
37225 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37226 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37227 CVec_u8Z_free(ret_var);
37231 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
37232 LDKu8slice ser_ref;
37233 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
37234 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
37235 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
37236 *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
37237 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
37238 return tag_ptr(ret_conv, true);
37241 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) {
37242 LDKPublicKey per_commitment_point_ref;
37243 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
37244 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
37245 unsigned char base_secret_arr[32];
37246 CHECK((*env)->GetArrayLength(env, base_secret) == 32);
37247 (*env)->GetByteArrayRegion(env, base_secret, 0, 32, base_secret_arr);
37248 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
37249 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
37250 *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref);
37251 return tag_ptr(ret_conv, true);
37254 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) {
37255 LDKPublicKey per_commitment_point_ref;
37256 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
37257 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
37258 LDKPublicKey base_point_ref;
37259 CHECK((*env)->GetArrayLength(env, base_point) == 33);
37260 (*env)->GetByteArrayRegion(env, base_point, 0, 33, base_point_ref.compressed_form);
37261 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
37262 *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref);
37263 return tag_ptr(ret_conv, true);
37266 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) {
37267 unsigned char per_commitment_secret_arr[32];
37268 CHECK((*env)->GetArrayLength(env, per_commitment_secret) == 32);
37269 (*env)->GetByteArrayRegion(env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
37270 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
37271 unsigned char countersignatory_revocation_base_secret_arr[32];
37272 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_secret) == 32);
37273 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
37274 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
37275 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
37276 *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
37277 return tag_ptr(ret_conv, true);
37280 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) {
37281 LDKPublicKey per_commitment_point_ref;
37282 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
37283 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
37284 LDKPublicKey countersignatory_revocation_base_point_ref;
37285 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_point) == 33);
37286 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_point, 0, 33, countersignatory_revocation_base_point_ref.compressed_form);
37287 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
37288 *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref);
37289 return tag_ptr(ret_conv, true);
37292 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37293 LDKTxCreationKeys this_obj_conv;
37294 this_obj_conv.inner = untag_ptr(this_obj);
37295 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37296 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37297 TxCreationKeys_free(this_obj_conv);
37300 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
37301 LDKTxCreationKeys 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 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37307 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form);
37311 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37312 LDKTxCreationKeys this_ptr_conv;
37313 this_ptr_conv.inner = untag_ptr(this_ptr);
37314 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37316 this_ptr_conv.is_owned = false;
37317 LDKPublicKey val_ref;
37318 CHECK((*env)->GetArrayLength(env, val) == 33);
37319 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37320 TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref);
37323 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
37324 LDKTxCreationKeys this_ptr_conv;
37325 this_ptr_conv.inner = untag_ptr(this_ptr);
37326 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37327 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37328 this_ptr_conv.is_owned = false;
37329 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37330 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form);
37334 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37335 LDKTxCreationKeys this_ptr_conv;
37336 this_ptr_conv.inner = untag_ptr(this_ptr);
37337 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37339 this_ptr_conv.is_owned = false;
37340 LDKPublicKey val_ref;
37341 CHECK((*env)->GetArrayLength(env, val) == 33);
37342 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37343 TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref);
37346 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
37347 LDKTxCreationKeys this_ptr_conv;
37348 this_ptr_conv.inner = untag_ptr(this_ptr);
37349 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37351 this_ptr_conv.is_owned = false;
37352 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37353 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form);
37357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37358 LDKTxCreationKeys 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 LDKPublicKey val_ref;
37364 CHECK((*env)->GetArrayLength(env, val) == 33);
37365 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37366 TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref);
37369 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
37370 LDKTxCreationKeys this_ptr_conv;
37371 this_ptr_conv.inner = untag_ptr(this_ptr);
37372 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37373 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37374 this_ptr_conv.is_owned = false;
37375 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37376 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form);
37380 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37381 LDKTxCreationKeys this_ptr_conv;
37382 this_ptr_conv.inner = untag_ptr(this_ptr);
37383 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37384 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37385 this_ptr_conv.is_owned = false;
37386 LDKPublicKey val_ref;
37387 CHECK((*env)->GetArrayLength(env, val) == 33);
37388 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37389 TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref);
37392 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
37393 LDKTxCreationKeys this_ptr_conv;
37394 this_ptr_conv.inner = untag_ptr(this_ptr);
37395 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37396 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37397 this_ptr_conv.is_owned = false;
37398 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37399 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form);
37403 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) {
37404 LDKTxCreationKeys this_ptr_conv;
37405 this_ptr_conv.inner = untag_ptr(this_ptr);
37406 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37408 this_ptr_conv.is_owned = false;
37409 LDKPublicKey val_ref;
37410 CHECK((*env)->GetArrayLength(env, val) == 33);
37411 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37412 TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref);
37415 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) {
37416 LDKPublicKey per_commitment_point_arg_ref;
37417 CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
37418 (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
37419 LDKPublicKey revocation_key_arg_ref;
37420 CHECK((*env)->GetArrayLength(env, revocation_key_arg) == 33);
37421 (*env)->GetByteArrayRegion(env, revocation_key_arg, 0, 33, revocation_key_arg_ref.compressed_form);
37422 LDKPublicKey broadcaster_htlc_key_arg_ref;
37423 CHECK((*env)->GetArrayLength(env, broadcaster_htlc_key_arg) == 33);
37424 (*env)->GetByteArrayRegion(env, broadcaster_htlc_key_arg, 0, 33, broadcaster_htlc_key_arg_ref.compressed_form);
37425 LDKPublicKey countersignatory_htlc_key_arg_ref;
37426 CHECK((*env)->GetArrayLength(env, countersignatory_htlc_key_arg) == 33);
37427 (*env)->GetByteArrayRegion(env, countersignatory_htlc_key_arg, 0, 33, countersignatory_htlc_key_arg_ref.compressed_form);
37428 LDKPublicKey broadcaster_delayed_payment_key_arg_ref;
37429 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key_arg) == 33);
37430 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form);
37431 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);
37432 int64_t ret_ref = 0;
37433 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37434 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37438 static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
37439 LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
37440 int64_t ret_ref = 0;
37441 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37442 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37446 LDKTxCreationKeys arg_conv;
37447 arg_conv.inner = untag_ptr(arg);
37448 arg_conv.is_owned = ptr_is_owned(arg);
37449 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37450 arg_conv.is_owned = false;
37451 int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv);
37455 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37456 LDKTxCreationKeys orig_conv;
37457 orig_conv.inner = untag_ptr(orig);
37458 orig_conv.is_owned = ptr_is_owned(orig);
37459 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37460 orig_conv.is_owned = false;
37461 LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
37462 int64_t ret_ref = 0;
37463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37468 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
37469 LDKTxCreationKeys obj_conv;
37470 obj_conv.inner = untag_ptr(obj);
37471 obj_conv.is_owned = ptr_is_owned(obj);
37472 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37473 obj_conv.is_owned = false;
37474 LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
37475 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37476 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37477 CVec_u8Z_free(ret_var);
37481 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
37482 LDKu8slice ser_ref;
37483 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
37484 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
37485 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
37486 *ret_conv = TxCreationKeys_read(ser_ref);
37487 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
37488 return tag_ptr(ret_conv, true);
37491 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37492 LDKChannelPublicKeys this_obj_conv;
37493 this_obj_conv.inner = untag_ptr(this_obj);
37494 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37496 ChannelPublicKeys_free(this_obj_conv);
37499 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
37500 LDKChannelPublicKeys this_ptr_conv;
37501 this_ptr_conv.inner = untag_ptr(this_ptr);
37502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37504 this_ptr_conv.is_owned = false;
37505 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37506 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form);
37510 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37511 LDKChannelPublicKeys this_ptr_conv;
37512 this_ptr_conv.inner = untag_ptr(this_ptr);
37513 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37514 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37515 this_ptr_conv.is_owned = false;
37516 LDKPublicKey val_ref;
37517 CHECK((*env)->GetArrayLength(env, val) == 33);
37518 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37519 ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref);
37522 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
37523 LDKChannelPublicKeys this_ptr_conv;
37524 this_ptr_conv.inner = untag_ptr(this_ptr);
37525 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37526 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37527 this_ptr_conv.is_owned = false;
37528 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37529 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form);
37533 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37534 LDKChannelPublicKeys this_ptr_conv;
37535 this_ptr_conv.inner = untag_ptr(this_ptr);
37536 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37537 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37538 this_ptr_conv.is_owned = false;
37539 LDKPublicKey val_ref;
37540 CHECK((*env)->GetArrayLength(env, val) == 33);
37541 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37542 ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref);
37545 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
37546 LDKChannelPublicKeys this_ptr_conv;
37547 this_ptr_conv.inner = untag_ptr(this_ptr);
37548 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37549 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37550 this_ptr_conv.is_owned = false;
37551 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37552 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form);
37556 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37557 LDKChannelPublicKeys this_ptr_conv;
37558 this_ptr_conv.inner = untag_ptr(this_ptr);
37559 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37561 this_ptr_conv.is_owned = false;
37562 LDKPublicKey val_ref;
37563 CHECK((*env)->GetArrayLength(env, val) == 33);
37564 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37565 ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref);
37568 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
37569 LDKChannelPublicKeys this_ptr_conv;
37570 this_ptr_conv.inner = untag_ptr(this_ptr);
37571 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37573 this_ptr_conv.is_owned = false;
37574 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37575 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
37579 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37580 LDKChannelPublicKeys this_ptr_conv;
37581 this_ptr_conv.inner = untag_ptr(this_ptr);
37582 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37584 this_ptr_conv.is_owned = false;
37585 LDKPublicKey val_ref;
37586 CHECK((*env)->GetArrayLength(env, val) == 33);
37587 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37588 ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
37591 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
37592 LDKChannelPublicKeys this_ptr_conv;
37593 this_ptr_conv.inner = untag_ptr(this_ptr);
37594 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37595 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37596 this_ptr_conv.is_owned = false;
37597 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37598 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form);
37602 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37603 LDKChannelPublicKeys this_ptr_conv;
37604 this_ptr_conv.inner = untag_ptr(this_ptr);
37605 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37606 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37607 this_ptr_conv.is_owned = false;
37608 LDKPublicKey val_ref;
37609 CHECK((*env)->GetArrayLength(env, val) == 33);
37610 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37611 ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref);
37614 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) {
37615 LDKPublicKey funding_pubkey_arg_ref;
37616 CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33);
37617 (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form);
37618 LDKPublicKey revocation_basepoint_arg_ref;
37619 CHECK((*env)->GetArrayLength(env, revocation_basepoint_arg) == 33);
37620 (*env)->GetByteArrayRegion(env, revocation_basepoint_arg, 0, 33, revocation_basepoint_arg_ref.compressed_form);
37621 LDKPublicKey payment_point_arg_ref;
37622 CHECK((*env)->GetArrayLength(env, payment_point_arg) == 33);
37623 (*env)->GetByteArrayRegion(env, payment_point_arg, 0, 33, payment_point_arg_ref.compressed_form);
37624 LDKPublicKey delayed_payment_basepoint_arg_ref;
37625 CHECK((*env)->GetArrayLength(env, delayed_payment_basepoint_arg) == 33);
37626 (*env)->GetByteArrayRegion(env, delayed_payment_basepoint_arg, 0, 33, delayed_payment_basepoint_arg_ref.compressed_form);
37627 LDKPublicKey htlc_basepoint_arg_ref;
37628 CHECK((*env)->GetArrayLength(env, htlc_basepoint_arg) == 33);
37629 (*env)->GetByteArrayRegion(env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form);
37630 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);
37631 int64_t ret_ref = 0;
37632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37637 static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) {
37638 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg);
37639 int64_t ret_ref = 0;
37640 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37641 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37644 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37645 LDKChannelPublicKeys arg_conv;
37646 arg_conv.inner = untag_ptr(arg);
37647 arg_conv.is_owned = ptr_is_owned(arg);
37648 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37649 arg_conv.is_owned = false;
37650 int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv);
37654 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37655 LDKChannelPublicKeys orig_conv;
37656 orig_conv.inner = untag_ptr(orig);
37657 orig_conv.is_owned = ptr_is_owned(orig);
37658 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37659 orig_conv.is_owned = false;
37660 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
37661 int64_t ret_ref = 0;
37662 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37663 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37667 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
37668 LDKChannelPublicKeys obj_conv;
37669 obj_conv.inner = untag_ptr(obj);
37670 obj_conv.is_owned = ptr_is_owned(obj);
37671 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37672 obj_conv.is_owned = false;
37673 LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
37674 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37675 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37676 CVec_u8Z_free(ret_var);
37680 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
37681 LDKu8slice ser_ref;
37682 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
37683 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
37684 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
37685 *ret_conv = ChannelPublicKeys_read(ser_ref);
37686 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
37687 return tag_ptr(ret_conv, true);
37690 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) {
37691 LDKPublicKey per_commitment_point_ref;
37692 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
37693 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
37694 LDKPublicKey broadcaster_delayed_payment_base_ref;
37695 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_base) == 33);
37696 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_base, 0, 33, broadcaster_delayed_payment_base_ref.compressed_form);
37697 LDKPublicKey broadcaster_htlc_base_ref;
37698 CHECK((*env)->GetArrayLength(env, broadcaster_htlc_base) == 33);
37699 (*env)->GetByteArrayRegion(env, broadcaster_htlc_base, 0, 33, broadcaster_htlc_base_ref.compressed_form);
37700 LDKPublicKey countersignatory_revocation_base_ref;
37701 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base) == 33);
37702 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base, 0, 33, countersignatory_revocation_base_ref.compressed_form);
37703 LDKPublicKey countersignatory_htlc_base_ref;
37704 CHECK((*env)->GetArrayLength(env, countersignatory_htlc_base) == 33);
37705 (*env)->GetByteArrayRegion(env, countersignatory_htlc_base, 0, 33, countersignatory_htlc_base_ref.compressed_form);
37706 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
37707 *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);
37708 return tag_ptr(ret_conv, true);
37711 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) {
37712 LDKPublicKey per_commitment_point_ref;
37713 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
37714 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
37715 LDKChannelPublicKeys broadcaster_keys_conv;
37716 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
37717 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
37718 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
37719 broadcaster_keys_conv.is_owned = false;
37720 LDKChannelPublicKeys countersignatory_keys_conv;
37721 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
37722 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
37723 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
37724 countersignatory_keys_conv.is_owned = false;
37725 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
37726 *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
37727 return tag_ptr(ret_conv, true);
37730 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) {
37731 LDKPublicKey revocation_key_ref;
37732 CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
37733 (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
37734 LDKPublicKey broadcaster_delayed_payment_key_ref;
37735 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33);
37736 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
37737 LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
37738 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37739 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37740 CVec_u8Z_free(ret_var);
37744 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37745 LDKHTLCOutputInCommitment this_obj_conv;
37746 this_obj_conv.inner = untag_ptr(this_obj);
37747 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37749 HTLCOutputInCommitment_free(this_obj_conv);
37752 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv *env, jclass clz, int64_t this_ptr) {
37753 LDKHTLCOutputInCommitment this_ptr_conv;
37754 this_ptr_conv.inner = untag_ptr(this_ptr);
37755 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37756 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37757 this_ptr_conv.is_owned = false;
37758 jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
37762 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
37763 LDKHTLCOutputInCommitment this_ptr_conv;
37764 this_ptr_conv.inner = untag_ptr(this_ptr);
37765 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37766 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37767 this_ptr_conv.is_owned = false;
37768 HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
37771 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
37772 LDKHTLCOutputInCommitment this_ptr_conv;
37773 this_ptr_conv.inner = untag_ptr(this_ptr);
37774 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37775 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37776 this_ptr_conv.is_owned = false;
37777 int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
37781 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37782 LDKHTLCOutputInCommitment this_ptr_conv;
37783 this_ptr_conv.inner = untag_ptr(this_ptr);
37784 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37786 this_ptr_conv.is_owned = false;
37787 HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
37790 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) {
37791 LDKHTLCOutputInCommitment this_ptr_conv;
37792 this_ptr_conv.inner = untag_ptr(this_ptr);
37793 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37794 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37795 this_ptr_conv.is_owned = false;
37796 int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
37800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
37801 LDKHTLCOutputInCommitment this_ptr_conv;
37802 this_ptr_conv.inner = untag_ptr(this_ptr);
37803 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37805 this_ptr_conv.is_owned = false;
37806 HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
37809 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
37810 LDKHTLCOutputInCommitment this_ptr_conv;
37811 this_ptr_conv.inner = untag_ptr(this_ptr);
37812 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37814 this_ptr_conv.is_owned = false;
37815 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37816 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv));
37820 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37821 LDKHTLCOutputInCommitment this_ptr_conv;
37822 this_ptr_conv.inner = untag_ptr(this_ptr);
37823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37825 this_ptr_conv.is_owned = false;
37826 LDKThirtyTwoBytes val_ref;
37827 CHECK((*env)->GetArrayLength(env, val) == 32);
37828 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37829 HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref);
37832 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
37833 LDKHTLCOutputInCommitment this_ptr_conv;
37834 this_ptr_conv.inner = untag_ptr(this_ptr);
37835 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37837 this_ptr_conv.is_owned = false;
37838 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
37839 *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv);
37840 int64_t ret_ref = tag_ptr(ret_copy, true);
37844 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37845 LDKHTLCOutputInCommitment this_ptr_conv;
37846 this_ptr_conv.inner = untag_ptr(this_ptr);
37847 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37849 this_ptr_conv.is_owned = false;
37850 void* val_ptr = untag_ptr(val);
37851 CHECK_ACCESS(val_ptr);
37852 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
37853 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
37854 HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
37857 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) {
37858 LDKThirtyTwoBytes payment_hash_arg_ref;
37859 CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32);
37860 (*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data);
37861 void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg);
37862 CHECK_ACCESS(transaction_output_index_arg_ptr);
37863 LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
37864 transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg));
37865 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
37866 int64_t ret_ref = 0;
37867 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37868 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37872 static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) {
37873 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg);
37874 int64_t ret_ref = 0;
37875 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37876 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37880 LDKHTLCOutputInCommitment arg_conv;
37881 arg_conv.inner = untag_ptr(arg);
37882 arg_conv.is_owned = ptr_is_owned(arg);
37883 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37884 arg_conv.is_owned = false;
37885 int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv);
37889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37890 LDKHTLCOutputInCommitment orig_conv;
37891 orig_conv.inner = untag_ptr(orig);
37892 orig_conv.is_owned = ptr_is_owned(orig);
37893 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37894 orig_conv.is_owned = false;
37895 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
37896 int64_t ret_ref = 0;
37897 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37898 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37902 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) {
37903 LDKHTLCOutputInCommitment obj_conv;
37904 obj_conv.inner = untag_ptr(obj);
37905 obj_conv.is_owned = ptr_is_owned(obj);
37906 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37907 obj_conv.is_owned = false;
37908 LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
37909 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37910 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37911 CVec_u8Z_free(ret_var);
37915 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
37916 LDKu8slice ser_ref;
37917 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
37918 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
37919 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
37920 *ret_conv = HTLCOutputInCommitment_read(ser_ref);
37921 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
37922 return tag_ptr(ret_conv, true);
37925 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) {
37926 LDKHTLCOutputInCommitment htlc_conv;
37927 htlc_conv.inner = untag_ptr(htlc);
37928 htlc_conv.is_owned = ptr_is_owned(htlc);
37929 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
37930 htlc_conv.is_owned = false;
37931 LDKTxCreationKeys keys_conv;
37932 keys_conv.inner = untag_ptr(keys);
37933 keys_conv.is_owned = ptr_is_owned(keys);
37934 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
37935 keys_conv.is_owned = false;
37936 LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
37937 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37938 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37939 CVec_u8Z_free(ret_var);
37943 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv *env, jclass clz, int8_tArray broadcaster, int8_tArray countersignatory) {
37944 LDKPublicKey broadcaster_ref;
37945 CHECK((*env)->GetArrayLength(env, broadcaster) == 33);
37946 (*env)->GetByteArrayRegion(env, broadcaster, 0, 33, broadcaster_ref.compressed_form);
37947 LDKPublicKey countersignatory_ref;
37948 CHECK((*env)->GetArrayLength(env, countersignatory) == 33);
37949 (*env)->GetByteArrayRegion(env, countersignatory, 0, 33, countersignatory_ref.compressed_form);
37950 LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
37951 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37952 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37953 CVec_u8Z_free(ret_var);
37957 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) {
37958 unsigned char commitment_txid_arr[32];
37959 CHECK((*env)->GetArrayLength(env, commitment_txid) == 32);
37960 (*env)->GetByteArrayRegion(env, commitment_txid, 0, 32, commitment_txid_arr);
37961 unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr;
37962 LDKHTLCOutputInCommitment htlc_conv;
37963 htlc_conv.inner = untag_ptr(htlc);
37964 htlc_conv.is_owned = ptr_is_owned(htlc);
37965 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
37966 htlc_conv.is_owned = false;
37967 LDKPublicKey broadcaster_delayed_payment_key_ref;
37968 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33);
37969 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
37970 LDKPublicKey revocation_key_ref;
37971 CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
37972 (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
37973 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);
37974 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37975 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37976 Transaction_free(ret_var);
37980 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript(JNIEnv *env, jclass clz, int8_tArray funding_pubkey) {
37981 LDKPublicKey funding_pubkey_ref;
37982 CHECK((*env)->GetArrayLength(env, funding_pubkey) == 33);
37983 (*env)->GetByteArrayRegion(env, funding_pubkey, 0, 33, funding_pubkey_ref.compressed_form);
37984 LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
37985 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
37986 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
37987 CVec_u8Z_free(ret_var);
37991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37992 LDKChannelTransactionParameters this_obj_conv;
37993 this_obj_conv.inner = untag_ptr(this_obj);
37994 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37995 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37996 ChannelTransactionParameters_free(this_obj_conv);
37999 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) {
38000 LDKChannelTransactionParameters this_ptr_conv;
38001 this_ptr_conv.inner = untag_ptr(this_ptr);
38002 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38004 this_ptr_conv.is_owned = false;
38005 LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv);
38006 int64_t ret_ref = 0;
38007 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38008 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38012 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38013 LDKChannelTransactionParameters this_ptr_conv;
38014 this_ptr_conv.inner = untag_ptr(this_ptr);
38015 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38017 this_ptr_conv.is_owned = false;
38018 LDKChannelPublicKeys val_conv;
38019 val_conv.inner = untag_ptr(val);
38020 val_conv.is_owned = ptr_is_owned(val);
38021 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38022 val_conv = ChannelPublicKeys_clone(&val_conv);
38023 ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv);
38026 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
38027 LDKChannelTransactionParameters this_ptr_conv;
38028 this_ptr_conv.inner = untag_ptr(this_ptr);
38029 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38030 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38031 this_ptr_conv.is_owned = false;
38032 int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv);
38036 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) {
38037 LDKChannelTransactionParameters this_ptr_conv;
38038 this_ptr_conv.inner = untag_ptr(this_ptr);
38039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38041 this_ptr_conv.is_owned = false;
38042 ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val);
38045 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr) {
38046 LDKChannelTransactionParameters this_ptr_conv;
38047 this_ptr_conv.inner = untag_ptr(this_ptr);
38048 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38050 this_ptr_conv.is_owned = false;
38051 jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv);
38055 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
38056 LDKChannelTransactionParameters this_ptr_conv;
38057 this_ptr_conv.inner = untag_ptr(this_ptr);
38058 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38060 this_ptr_conv.is_owned = false;
38061 ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val);
38064 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) {
38065 LDKChannelTransactionParameters this_ptr_conv;
38066 this_ptr_conv.inner = untag_ptr(this_ptr);
38067 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38068 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38069 this_ptr_conv.is_owned = false;
38070 LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
38071 int64_t ret_ref = 0;
38072 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38073 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38077 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38078 LDKChannelTransactionParameters 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 LDKCounterpartyChannelTransactionParameters val_conv;
38084 val_conv.inner = untag_ptr(val);
38085 val_conv.is_owned = ptr_is_owned(val);
38086 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38087 val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv);
38088 ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv);
38091 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
38092 LDKChannelTransactionParameters this_ptr_conv;
38093 this_ptr_conv.inner = untag_ptr(this_ptr);
38094 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38096 this_ptr_conv.is_owned = false;
38097 LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
38098 int64_t ret_ref = 0;
38099 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38100 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38104 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38105 LDKChannelTransactionParameters this_ptr_conv;
38106 this_ptr_conv.inner = untag_ptr(this_ptr);
38107 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38108 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38109 this_ptr_conv.is_owned = false;
38110 LDKOutPoint val_conv;
38111 val_conv.inner = untag_ptr(val);
38112 val_conv.is_owned = ptr_is_owned(val);
38113 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38114 val_conv = OutPoint_clone(&val_conv);
38115 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
38118 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) {
38119 LDKChannelTransactionParameters this_ptr_conv;
38120 this_ptr_conv.inner = untag_ptr(this_ptr);
38121 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38122 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38123 this_ptr_conv.is_owned = false;
38124 jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
38128 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
38129 LDKChannelTransactionParameters this_ptr_conv;
38130 this_ptr_conv.inner = untag_ptr(this_ptr);
38131 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38133 this_ptr_conv.is_owned = false;
38134 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val);
38135 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
38138 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) {
38139 LDKChannelPublicKeys holder_pubkeys_arg_conv;
38140 holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg);
38141 holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg);
38142 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv);
38143 holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv);
38144 LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv;
38145 counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg);
38146 counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg);
38147 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv);
38148 counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv);
38149 LDKOutPoint funding_outpoint_arg_conv;
38150 funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg);
38151 funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_arg);
38152 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
38153 funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
38154 LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_anchors_arg);
38155 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);
38156 int64_t ret_ref = 0;
38157 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38158 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38162 static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) {
38163 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg);
38164 int64_t ret_ref = 0;
38165 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38166 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38169 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38170 LDKChannelTransactionParameters arg_conv;
38171 arg_conv.inner = untag_ptr(arg);
38172 arg_conv.is_owned = ptr_is_owned(arg);
38173 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38174 arg_conv.is_owned = false;
38175 int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv);
38179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38180 LDKChannelTransactionParameters orig_conv;
38181 orig_conv.inner = untag_ptr(orig);
38182 orig_conv.is_owned = ptr_is_owned(orig);
38183 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38184 orig_conv.is_owned = false;
38185 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv);
38186 int64_t ret_ref = 0;
38187 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38188 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38193 LDKCounterpartyChannelTransactionParameters this_obj_conv;
38194 this_obj_conv.inner = untag_ptr(this_obj);
38195 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38196 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38197 CounterpartyChannelTransactionParameters_free(this_obj_conv);
38200 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) {
38201 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
38202 this_ptr_conv.inner = untag_ptr(this_ptr);
38203 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38205 this_ptr_conv.is_owned = false;
38206 LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv);
38207 int64_t ret_ref = 0;
38208 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38209 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38213 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38214 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
38215 this_ptr_conv.inner = untag_ptr(this_ptr);
38216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38218 this_ptr_conv.is_owned = false;
38219 LDKChannelPublicKeys val_conv;
38220 val_conv.inner = untag_ptr(val);
38221 val_conv.is_owned = ptr_is_owned(val);
38222 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38223 val_conv = ChannelPublicKeys_clone(&val_conv);
38224 CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv);
38227 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
38228 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
38229 this_ptr_conv.inner = untag_ptr(this_ptr);
38230 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38232 this_ptr_conv.is_owned = false;
38233 int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv);
38237 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
38238 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
38239 this_ptr_conv.inner = untag_ptr(this_ptr);
38240 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38242 this_ptr_conv.is_owned = false;
38243 CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val);
38246 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) {
38247 LDKChannelPublicKeys pubkeys_arg_conv;
38248 pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg);
38249 pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg);
38250 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv);
38251 pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
38252 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg);
38253 int64_t ret_ref = 0;
38254 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38255 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38259 static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) {
38260 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg);
38261 int64_t ret_ref = 0;
38262 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38263 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38266 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38267 LDKCounterpartyChannelTransactionParameters arg_conv;
38268 arg_conv.inner = untag_ptr(arg);
38269 arg_conv.is_owned = ptr_is_owned(arg);
38270 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38271 arg_conv.is_owned = false;
38272 int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv);
38276 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38277 LDKCounterpartyChannelTransactionParameters orig_conv;
38278 orig_conv.inner = untag_ptr(orig);
38279 orig_conv.is_owned = ptr_is_owned(orig);
38280 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38281 orig_conv.is_owned = false;
38282 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv);
38283 int64_t ret_ref = 0;
38284 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38285 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38289 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1is_1populated(JNIEnv *env, jclass clz, int64_t this_arg) {
38290 LDKChannelTransactionParameters this_arg_conv;
38291 this_arg_conv.inner = untag_ptr(this_arg);
38292 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38293 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38294 this_arg_conv.is_owned = false;
38295 jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv);
38299 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1holder_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) {
38300 LDKChannelTransactionParameters this_arg_conv;
38301 this_arg_conv.inner = untag_ptr(this_arg);
38302 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38304 this_arg_conv.is_owned = false;
38305 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv);
38306 int64_t ret_ref = 0;
38307 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38308 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38312 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1counterparty_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) {
38313 LDKChannelTransactionParameters this_arg_conv;
38314 this_arg_conv.inner = untag_ptr(this_arg);
38315 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38317 this_arg_conv.is_owned = false;
38318 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv);
38319 int64_t ret_ref = 0;
38320 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38321 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38325 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
38326 LDKCounterpartyChannelTransactionParameters obj_conv;
38327 obj_conv.inner = untag_ptr(obj);
38328 obj_conv.is_owned = ptr_is_owned(obj);
38329 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38330 obj_conv.is_owned = false;
38331 LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
38332 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38333 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38334 CVec_u8Z_free(ret_var);
38338 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
38339 LDKu8slice ser_ref;
38340 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
38341 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
38342 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
38343 *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
38344 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
38345 return tag_ptr(ret_conv, true);
38348 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
38349 LDKChannelTransactionParameters obj_conv;
38350 obj_conv.inner = untag_ptr(obj);
38351 obj_conv.is_owned = ptr_is_owned(obj);
38352 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38353 obj_conv.is_owned = false;
38354 LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
38355 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38356 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38357 CVec_u8Z_free(ret_var);
38361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
38362 LDKu8slice ser_ref;
38363 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
38364 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
38365 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
38366 *ret_conv = ChannelTransactionParameters_read(ser_ref);
38367 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
38368 return tag_ptr(ret_conv, true);
38371 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38372 LDKDirectedChannelTransactionParameters this_obj_conv;
38373 this_obj_conv.inner = untag_ptr(this_obj);
38374 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38375 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38376 DirectedChannelTransactionParameters_free(this_obj_conv);
38379 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
38380 LDKDirectedChannelTransactionParameters this_arg_conv;
38381 this_arg_conv.inner = untag_ptr(this_arg);
38382 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38384 this_arg_conv.is_owned = false;
38385 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv);
38386 int64_t ret_ref = 0;
38387 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38388 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38392 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
38393 LDKDirectedChannelTransactionParameters this_arg_conv;
38394 this_arg_conv.inner = untag_ptr(this_arg);
38395 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38396 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38397 this_arg_conv.is_owned = false;
38398 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv);
38399 int64_t ret_ref = 0;
38400 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38401 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38405 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
38406 LDKDirectedChannelTransactionParameters this_arg_conv;
38407 this_arg_conv.inner = untag_ptr(this_arg);
38408 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38410 this_arg_conv.is_owned = false;
38411 int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv);
38415 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) {
38416 LDKDirectedChannelTransactionParameters this_arg_conv;
38417 this_arg_conv.inner = untag_ptr(this_arg);
38418 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38420 this_arg_conv.is_owned = false;
38421 jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv);
38425 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) {
38426 LDKDirectedChannelTransactionParameters this_arg_conv;
38427 this_arg_conv.inner = untag_ptr(this_arg);
38428 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38430 this_arg_conv.is_owned = false;
38431 LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv);
38432 int64_t ret_ref = 0;
38433 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38434 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38438 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
38439 LDKDirectedChannelTransactionParameters this_arg_conv;
38440 this_arg_conv.inner = untag_ptr(this_arg);
38441 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38442 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38443 this_arg_conv.is_owned = false;
38444 jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
38448 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38449 LDKHolderCommitmentTransaction this_obj_conv;
38450 this_obj_conv.inner = untag_ptr(this_obj);
38451 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38452 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38453 HolderCommitmentTransaction_free(this_obj_conv);
38456 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) {
38457 LDKHolderCommitmentTransaction this_ptr_conv;
38458 this_ptr_conv.inner = untag_ptr(this_ptr);
38459 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38461 this_ptr_conv.is_owned = false;
38462 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38463 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form);
38467 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38468 LDKHolderCommitmentTransaction this_ptr_conv;
38469 this_ptr_conv.inner = untag_ptr(this_ptr);
38470 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38471 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38472 this_ptr_conv.is_owned = false;
38473 LDKSignature val_ref;
38474 CHECK((*env)->GetArrayLength(env, val) == 64);
38475 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38476 HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref);
38479 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr) {
38480 LDKHolderCommitmentTransaction this_ptr_conv;
38481 this_ptr_conv.inner = untag_ptr(this_ptr);
38482 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38484 this_ptr_conv.is_owned = false;
38485 LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_conv);
38486 jobjectArray ret_arr = NULL;
38487 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
38489 for (size_t i = 0; i < ret_var.datalen; i++) {
38490 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
38491 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
38492 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
38495 FREE(ret_var.data);
38499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
38500 LDKHolderCommitmentTransaction this_ptr_conv;
38501 this_ptr_conv.inner = untag_ptr(this_ptr);
38502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38504 this_ptr_conv.is_owned = false;
38505 LDKCVec_SignatureZ val_constr;
38506 val_constr.datalen = (*env)->GetArrayLength(env, val);
38507 if (val_constr.datalen > 0)
38508 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
38510 val_constr.data = NULL;
38511 for (size_t i = 0; i < val_constr.datalen; i++) {
38512 int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
38513 LDKSignature val_conv_8_ref;
38514 CHECK((*env)->GetArrayLength(env, val_conv_8) == 64);
38515 (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form);
38516 val_constr.data[i] = val_conv_8_ref;
38518 HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
38521 static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) {
38522 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg);
38523 int64_t ret_ref = 0;
38524 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38525 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38528 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38529 LDKHolderCommitmentTransaction arg_conv;
38530 arg_conv.inner = untag_ptr(arg);
38531 arg_conv.is_owned = ptr_is_owned(arg);
38532 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38533 arg_conv.is_owned = false;
38534 int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv);
38538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38539 LDKHolderCommitmentTransaction orig_conv;
38540 orig_conv.inner = untag_ptr(orig);
38541 orig_conv.is_owned = ptr_is_owned(orig);
38542 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38543 orig_conv.is_owned = false;
38544 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
38545 int64_t ret_ref = 0;
38546 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38547 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38551 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
38552 LDKHolderCommitmentTransaction obj_conv;
38553 obj_conv.inner = untag_ptr(obj);
38554 obj_conv.is_owned = ptr_is_owned(obj);
38555 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38556 obj_conv.is_owned = false;
38557 LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
38558 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38559 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38560 CVec_u8Z_free(ret_var);
38564 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
38565 LDKu8slice ser_ref;
38566 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
38567 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
38568 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
38569 *ret_conv = HolderCommitmentTransaction_read(ser_ref);
38570 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
38571 return tag_ptr(ret_conv, true);
38574 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) {
38575 LDKCommitmentTransaction commitment_tx_conv;
38576 commitment_tx_conv.inner = untag_ptr(commitment_tx);
38577 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
38578 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
38579 commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv);
38580 LDKSignature counterparty_sig_ref;
38581 CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64);
38582 (*env)->GetByteArrayRegion(env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form);
38583 LDKCVec_SignatureZ counterparty_htlc_sigs_constr;
38584 counterparty_htlc_sigs_constr.datalen = (*env)->GetArrayLength(env, counterparty_htlc_sigs);
38585 if (counterparty_htlc_sigs_constr.datalen > 0)
38586 counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
38588 counterparty_htlc_sigs_constr.data = NULL;
38589 for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) {
38590 int8_tArray counterparty_htlc_sigs_conv_8 = (*env)->GetObjectArrayElement(env, counterparty_htlc_sigs, i);
38591 LDKSignature counterparty_htlc_sigs_conv_8_ref;
38592 CHECK((*env)->GetArrayLength(env, counterparty_htlc_sigs_conv_8) == 64);
38593 (*env)->GetByteArrayRegion(env, counterparty_htlc_sigs_conv_8, 0, 64, counterparty_htlc_sigs_conv_8_ref.compact_form);
38594 counterparty_htlc_sigs_constr.data[i] = counterparty_htlc_sigs_conv_8_ref;
38596 LDKPublicKey holder_funding_key_ref;
38597 CHECK((*env)->GetArrayLength(env, holder_funding_key) == 33);
38598 (*env)->GetByteArrayRegion(env, holder_funding_key, 0, 33, holder_funding_key_ref.compressed_form);
38599 LDKPublicKey counterparty_funding_key_ref;
38600 CHECK((*env)->GetArrayLength(env, counterparty_funding_key) == 33);
38601 (*env)->GetByteArrayRegion(env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form);
38602 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
38603 int64_t ret_ref = 0;
38604 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38605 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38609 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38610 LDKBuiltCommitmentTransaction this_obj_conv;
38611 this_obj_conv.inner = untag_ptr(this_obj);
38612 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38613 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38614 BuiltCommitmentTransaction_free(this_obj_conv);
38617 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr) {
38618 LDKBuiltCommitmentTransaction this_ptr_conv;
38619 this_ptr_conv.inner = untag_ptr(this_ptr);
38620 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38622 this_ptr_conv.is_owned = false;
38623 LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
38624 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38625 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38626 Transaction_free(ret_var);
38630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38631 LDKBuiltCommitmentTransaction this_ptr_conv;
38632 this_ptr_conv.inner = untag_ptr(this_ptr);
38633 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38635 this_ptr_conv.is_owned = false;
38636 LDKTransaction val_ref;
38637 val_ref.datalen = (*env)->GetArrayLength(env, val);
38638 val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
38639 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
38640 val_ref.data_is_owned = true;
38641 BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref);
38644 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
38645 LDKBuiltCommitmentTransaction this_ptr_conv;
38646 this_ptr_conv.inner = untag_ptr(this_ptr);
38647 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38649 this_ptr_conv.is_owned = false;
38650 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
38651 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv));
38655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38656 LDKBuiltCommitmentTransaction this_ptr_conv;
38657 this_ptr_conv.inner = untag_ptr(this_ptr);
38658 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38659 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38660 this_ptr_conv.is_owned = false;
38661 LDKThirtyTwoBytes val_ref;
38662 CHECK((*env)->GetArrayLength(env, val) == 32);
38663 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
38664 BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref);
38667 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new(JNIEnv *env, jclass clz, int8_tArray transaction_arg, int8_tArray txid_arg) {
38668 LDKTransaction transaction_arg_ref;
38669 transaction_arg_ref.datalen = (*env)->GetArrayLength(env, transaction_arg);
38670 transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes");
38671 (*env)->GetByteArrayRegion(env, transaction_arg, 0, transaction_arg_ref.datalen, transaction_arg_ref.data);
38672 transaction_arg_ref.data_is_owned = true;
38673 LDKThirtyTwoBytes txid_arg_ref;
38674 CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
38675 (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
38676 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
38677 int64_t ret_ref = 0;
38678 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38679 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38683 static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) {
38684 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg);
38685 int64_t ret_ref = 0;
38686 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38687 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38690 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38691 LDKBuiltCommitmentTransaction arg_conv;
38692 arg_conv.inner = untag_ptr(arg);
38693 arg_conv.is_owned = ptr_is_owned(arg);
38694 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38695 arg_conv.is_owned = false;
38696 int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv);
38700 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38701 LDKBuiltCommitmentTransaction orig_conv;
38702 orig_conv.inner = untag_ptr(orig);
38703 orig_conv.is_owned = ptr_is_owned(orig);
38704 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38705 orig_conv.is_owned = false;
38706 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv);
38707 int64_t ret_ref = 0;
38708 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38709 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38713 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
38714 LDKBuiltCommitmentTransaction obj_conv;
38715 obj_conv.inner = untag_ptr(obj);
38716 obj_conv.is_owned = ptr_is_owned(obj);
38717 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38718 obj_conv.is_owned = false;
38719 LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
38720 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38721 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38722 CVec_u8Z_free(ret_var);
38726 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
38727 LDKu8slice ser_ref;
38728 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
38729 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
38730 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
38731 *ret_conv = BuiltCommitmentTransaction_read(ser_ref);
38732 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
38733 return tag_ptr(ret_conv, true);
38736 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) {
38737 LDKBuiltCommitmentTransaction this_arg_conv;
38738 this_arg_conv.inner = untag_ptr(this_arg);
38739 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38741 this_arg_conv.is_owned = false;
38742 LDKu8slice funding_redeemscript_ref;
38743 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
38744 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
38745 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
38746 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data);
38747 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
38751 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) {
38752 LDKBuiltCommitmentTransaction this_arg_conv;
38753 this_arg_conv.inner = untag_ptr(this_arg);
38754 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38755 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38756 this_arg_conv.is_owned = false;
38757 unsigned char funding_key_arr[32];
38758 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
38759 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
38760 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
38761 LDKu8slice funding_redeemscript_ref;
38762 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
38763 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
38764 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38765 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
38766 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
38770 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38771 LDKClosingTransaction this_obj_conv;
38772 this_obj_conv.inner = untag_ptr(this_obj);
38773 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38775 ClosingTransaction_free(this_obj_conv);
38778 static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) {
38779 LDKClosingTransaction ret_var = ClosingTransaction_clone(arg);
38780 int64_t ret_ref = 0;
38781 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38782 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38785 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38786 LDKClosingTransaction arg_conv;
38787 arg_conv.inner = untag_ptr(arg);
38788 arg_conv.is_owned = ptr_is_owned(arg);
38789 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38790 arg_conv.is_owned = false;
38791 int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv);
38795 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38796 LDKClosingTransaction orig_conv;
38797 orig_conv.inner = untag_ptr(orig);
38798 orig_conv.is_owned = ptr_is_owned(orig);
38799 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38800 orig_conv.is_owned = false;
38801 LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
38802 int64_t ret_ref = 0;
38803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JNIEnv *env, jclass clz, int64_t o) {
38809 LDKClosingTransaction o_conv;
38810 o_conv.inner = untag_ptr(o);
38811 o_conv.is_owned = ptr_is_owned(o);
38812 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
38813 o_conv.is_owned = false;
38814 int64_t ret_conv = ClosingTransaction_hash(&o_conv);
38818 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) {
38819 LDKCVec_u8Z to_holder_script_ref;
38820 to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
38821 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
38822 (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data);
38823 LDKCVec_u8Z to_counterparty_script_ref;
38824 to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script);
38825 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
38826 (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data);
38827 LDKOutPoint funding_outpoint_conv;
38828 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
38829 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
38830 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
38831 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
38832 LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
38833 int64_t ret_ref = 0;
38834 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38835 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38839 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) {
38840 LDKClosingTransaction this_arg_conv;
38841 this_arg_conv.inner = untag_ptr(this_arg);
38842 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38843 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38844 this_arg_conv.is_owned = false;
38845 LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv);
38846 int64_t ret_ref = 0;
38847 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38848 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38852 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_outpoint) {
38853 LDKClosingTransaction this_arg_conv;
38854 this_arg_conv.inner = untag_ptr(this_arg);
38855 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38856 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38857 this_arg_conv.is_owned = false;
38858 LDKOutPoint funding_outpoint_conv;
38859 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
38860 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
38861 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
38862 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
38863 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
38864 *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv);
38865 return tag_ptr(ret_conv, true);
38868 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
38869 LDKClosingTransaction this_arg_conv;
38870 this_arg_conv.inner = untag_ptr(this_arg);
38871 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38873 this_arg_conv.is_owned = false;
38874 int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv);
38878 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
38879 LDKClosingTransaction this_arg_conv;
38880 this_arg_conv.inner = untag_ptr(this_arg);
38881 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38882 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38883 this_arg_conv.is_owned = false;
38884 int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv);
38888 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
38889 LDKClosingTransaction this_arg_conv;
38890 this_arg_conv.inner = untag_ptr(this_arg);
38891 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38893 this_arg_conv.is_owned = false;
38894 LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv);
38895 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38896 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38900 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
38901 LDKClosingTransaction this_arg_conv;
38902 this_arg_conv.inner = untag_ptr(this_arg);
38903 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38904 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38905 this_arg_conv.is_owned = false;
38906 LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv);
38907 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38908 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38912 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38913 LDKTrustedClosingTransaction this_obj_conv;
38914 this_obj_conv.inner = untag_ptr(this_obj);
38915 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38917 TrustedClosingTransaction_free(this_obj_conv);
38920 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) {
38921 LDKTrustedClosingTransaction this_arg_conv;
38922 this_arg_conv.inner = untag_ptr(this_arg);
38923 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38925 this_arg_conv.is_owned = false;
38926 LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv);
38927 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38928 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38929 Transaction_free(ret_var);
38933 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) {
38934 LDKTrustedClosingTransaction this_arg_conv;
38935 this_arg_conv.inner = untag_ptr(this_arg);
38936 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38938 this_arg_conv.is_owned = false;
38939 LDKu8slice funding_redeemscript_ref;
38940 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
38941 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
38942 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
38943 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data);
38944 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
38948 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) {
38949 LDKTrustedClosingTransaction this_arg_conv;
38950 this_arg_conv.inner = untag_ptr(this_arg);
38951 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38953 this_arg_conv.is_owned = false;
38954 unsigned char funding_key_arr[32];
38955 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
38956 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
38957 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
38958 LDKu8slice funding_redeemscript_ref;
38959 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
38960 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
38961 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38962 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
38963 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
38967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38968 LDKCommitmentTransaction this_obj_conv;
38969 this_obj_conv.inner = untag_ptr(this_obj);
38970 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38972 CommitmentTransaction_free(this_obj_conv);
38975 static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) {
38976 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg);
38977 int64_t ret_ref = 0;
38978 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38979 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38982 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38983 LDKCommitmentTransaction arg_conv;
38984 arg_conv.inner = untag_ptr(arg);
38985 arg_conv.is_owned = ptr_is_owned(arg);
38986 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38987 arg_conv.is_owned = false;
38988 int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv);
38992 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38993 LDKCommitmentTransaction orig_conv;
38994 orig_conv.inner = untag_ptr(orig);
38995 orig_conv.is_owned = ptr_is_owned(orig);
38996 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38997 orig_conv.is_owned = false;
38998 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv);
38999 int64_t ret_ref = 0;
39000 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39001 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39005 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
39006 LDKCommitmentTransaction obj_conv;
39007 obj_conv.inner = untag_ptr(obj);
39008 obj_conv.is_owned = ptr_is_owned(obj);
39009 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39010 obj_conv.is_owned = false;
39011 LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
39012 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39013 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39014 CVec_u8Z_free(ret_var);
39018 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39019 LDKu8slice ser_ref;
39020 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39021 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39022 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
39023 *ret_conv = CommitmentTransaction_read(ser_ref);
39024 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39025 return tag_ptr(ret_conv, true);
39028 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_arg) {
39029 LDKCommitmentTransaction this_arg_conv;
39030 this_arg_conv.inner = untag_ptr(this_arg);
39031 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39033 this_arg_conv.is_owned = false;
39034 int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv);
39038 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
39039 LDKCommitmentTransaction this_arg_conv;
39040 this_arg_conv.inner = untag_ptr(this_arg);
39041 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39043 this_arg_conv.is_owned = false;
39044 int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv);
39048 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
39049 LDKCommitmentTransaction this_arg_conv;
39050 this_arg_conv.inner = untag_ptr(this_arg);
39051 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39052 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39053 this_arg_conv.is_owned = false;
39054 int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv);
39058 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_arg) {
39059 LDKCommitmentTransaction this_arg_conv;
39060 this_arg_conv.inner = untag_ptr(this_arg);
39061 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39062 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39063 this_arg_conv.is_owned = false;
39064 int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv);
39068 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) {
39069 LDKCommitmentTransaction this_arg_conv;
39070 this_arg_conv.inner = untag_ptr(this_arg);
39071 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39073 this_arg_conv.is_owned = false;
39074 LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv);
39075 int64_t ret_ref = 0;
39076 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39077 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39081 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) {
39082 LDKCommitmentTransaction this_arg_conv;
39083 this_arg_conv.inner = untag_ptr(this_arg);
39084 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39086 this_arg_conv.is_owned = false;
39087 LDKDirectedChannelTransactionParameters channel_parameters_conv;
39088 channel_parameters_conv.inner = untag_ptr(channel_parameters);
39089 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
39090 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
39091 channel_parameters_conv.is_owned = false;
39092 LDKChannelPublicKeys broadcaster_keys_conv;
39093 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
39094 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
39095 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
39096 broadcaster_keys_conv.is_owned = false;
39097 LDKChannelPublicKeys countersignatory_keys_conv;
39098 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
39099 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
39100 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
39101 countersignatory_keys_conv.is_owned = false;
39102 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
39103 *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv);
39104 return tag_ptr(ret_conv, true);
39107 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39108 LDKTrustedCommitmentTransaction this_obj_conv;
39109 this_obj_conv.inner = untag_ptr(this_obj);
39110 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39112 TrustedCommitmentTransaction_free(this_obj_conv);
39115 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid(JNIEnv *env, jclass clz, int64_t this_arg) {
39116 LDKTrustedCommitmentTransaction this_arg_conv;
39117 this_arg_conv.inner = untag_ptr(this_arg);
39118 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39120 this_arg_conv.is_owned = false;
39121 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39122 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data);
39126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) {
39127 LDKTrustedCommitmentTransaction this_arg_conv;
39128 this_arg_conv.inner = untag_ptr(this_arg);
39129 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39130 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39131 this_arg_conv.is_owned = false;
39132 LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv);
39133 int64_t ret_ref = 0;
39134 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39135 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39139 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys(JNIEnv *env, jclass clz, int64_t this_arg) {
39140 LDKTrustedCommitmentTransaction this_arg_conv;
39141 this_arg_conv.inner = untag_ptr(this_arg);
39142 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39144 this_arg_conv.is_owned = false;
39145 LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv);
39146 int64_t ret_ref = 0;
39147 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39148 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39152 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
39153 LDKTrustedCommitmentTransaction this_arg_conv;
39154 this_arg_conv.inner = untag_ptr(this_arg);
39155 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39156 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39157 this_arg_conv.is_owned = false;
39158 jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
39162 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) {
39163 LDKTrustedCommitmentTransaction this_arg_conv;
39164 this_arg_conv.inner = untag_ptr(this_arg);
39165 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39166 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39167 this_arg_conv.is_owned = false;
39168 unsigned char htlc_base_key_arr[32];
39169 CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32);
39170 (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr);
39171 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
39172 LDKDirectedChannelTransactionParameters channel_parameters_conv;
39173 channel_parameters_conv.inner = untag_ptr(channel_parameters);
39174 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
39175 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
39176 channel_parameters_conv.is_owned = false;
39177 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
39178 *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv);
39179 return tag_ptr(ret_conv, true);
39182 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) {
39183 LDKPublicKey broadcaster_payment_basepoint_ref;
39184 CHECK((*env)->GetArrayLength(env, broadcaster_payment_basepoint) == 33);
39185 (*env)->GetByteArrayRegion(env, broadcaster_payment_basepoint, 0, 33, broadcaster_payment_basepoint_ref.compressed_form);
39186 LDKPublicKey countersignatory_payment_basepoint_ref;
39187 CHECK((*env)->GetArrayLength(env, countersignatory_payment_basepoint) == 33);
39188 (*env)->GetByteArrayRegion(env, countersignatory_payment_basepoint, 0, 33, countersignatory_payment_basepoint_ref.compressed_form);
39189 int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster);
39193 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39194 LDKInitFeatures a_conv;
39195 a_conv.inner = untag_ptr(a);
39196 a_conv.is_owned = ptr_is_owned(a);
39197 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39198 a_conv.is_owned = false;
39199 LDKInitFeatures b_conv;
39200 b_conv.inner = untag_ptr(b);
39201 b_conv.is_owned = ptr_is_owned(b);
39202 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39203 b_conv.is_owned = false;
39204 jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv);
39208 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39209 LDKNodeFeatures a_conv;
39210 a_conv.inner = untag_ptr(a);
39211 a_conv.is_owned = ptr_is_owned(a);
39212 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39213 a_conv.is_owned = false;
39214 LDKNodeFeatures b_conv;
39215 b_conv.inner = untag_ptr(b);
39216 b_conv.is_owned = ptr_is_owned(b);
39217 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39218 b_conv.is_owned = false;
39219 jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv);
39223 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39224 LDKChannelFeatures a_conv;
39225 a_conv.inner = untag_ptr(a);
39226 a_conv.is_owned = ptr_is_owned(a);
39227 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39228 a_conv.is_owned = false;
39229 LDKChannelFeatures b_conv;
39230 b_conv.inner = untag_ptr(b);
39231 b_conv.is_owned = ptr_is_owned(b);
39232 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39233 b_conv.is_owned = false;
39234 jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv);
39238 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39239 LDKInvoiceFeatures a_conv;
39240 a_conv.inner = untag_ptr(a);
39241 a_conv.is_owned = ptr_is_owned(a);
39242 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39243 a_conv.is_owned = false;
39244 LDKInvoiceFeatures b_conv;
39245 b_conv.inner = untag_ptr(b);
39246 b_conv.is_owned = ptr_is_owned(b);
39247 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39248 b_conv.is_owned = false;
39249 jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv);
39253 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39254 LDKChannelTypeFeatures a_conv;
39255 a_conv.inner = untag_ptr(a);
39256 a_conv.is_owned = ptr_is_owned(a);
39257 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39258 a_conv.is_owned = false;
39259 LDKChannelTypeFeatures b_conv;
39260 b_conv.inner = untag_ptr(b);
39261 b_conv.is_owned = ptr_is_owned(b);
39262 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39263 b_conv.is_owned = false;
39264 jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv);
39268 static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
39269 LDKInitFeatures ret_var = InitFeatures_clone(arg);
39270 int64_t ret_ref = 0;
39271 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39272 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39275 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39276 LDKInitFeatures arg_conv;
39277 arg_conv.inner = untag_ptr(arg);
39278 arg_conv.is_owned = ptr_is_owned(arg);
39279 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39280 arg_conv.is_owned = false;
39281 int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv);
39285 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39286 LDKInitFeatures orig_conv;
39287 orig_conv.inner = untag_ptr(orig);
39288 orig_conv.is_owned = ptr_is_owned(orig);
39289 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39290 orig_conv.is_owned = false;
39291 LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv);
39292 int64_t ret_ref = 0;
39293 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39294 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39298 static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) {
39299 LDKNodeFeatures ret_var = NodeFeatures_clone(arg);
39300 int64_t ret_ref = 0;
39301 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39302 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39305 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39306 LDKNodeFeatures arg_conv;
39307 arg_conv.inner = untag_ptr(arg);
39308 arg_conv.is_owned = ptr_is_owned(arg);
39309 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39310 arg_conv.is_owned = false;
39311 int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv);
39315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39316 LDKNodeFeatures orig_conv;
39317 orig_conv.inner = untag_ptr(orig);
39318 orig_conv.is_owned = ptr_is_owned(orig);
39319 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39320 orig_conv.is_owned = false;
39321 LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv);
39322 int64_t ret_ref = 0;
39323 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39324 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39328 static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) {
39329 LDKChannelFeatures ret_var = ChannelFeatures_clone(arg);
39330 int64_t ret_ref = 0;
39331 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39332 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39336 LDKChannelFeatures arg_conv;
39337 arg_conv.inner = untag_ptr(arg);
39338 arg_conv.is_owned = ptr_is_owned(arg);
39339 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39340 arg_conv.is_owned = false;
39341 int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv);
39345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39346 LDKChannelFeatures orig_conv;
39347 orig_conv.inner = untag_ptr(orig);
39348 orig_conv.is_owned = ptr_is_owned(orig);
39349 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39350 orig_conv.is_owned = false;
39351 LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv);
39352 int64_t ret_ref = 0;
39353 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39354 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39358 static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) {
39359 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg);
39360 int64_t ret_ref = 0;
39361 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39362 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39365 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39366 LDKInvoiceFeatures arg_conv;
39367 arg_conv.inner = untag_ptr(arg);
39368 arg_conv.is_owned = ptr_is_owned(arg);
39369 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39370 arg_conv.is_owned = false;
39371 int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv);
39375 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39376 LDKInvoiceFeatures orig_conv;
39377 orig_conv.inner = untag_ptr(orig);
39378 orig_conv.is_owned = ptr_is_owned(orig);
39379 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39380 orig_conv.is_owned = false;
39381 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
39382 int64_t ret_ref = 0;
39383 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39384 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39388 static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
39389 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
39390 int64_t ret_ref = 0;
39391 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39392 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39395 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39396 LDKChannelTypeFeatures arg_conv;
39397 arg_conv.inner = untag_ptr(arg);
39398 arg_conv.is_owned = ptr_is_owned(arg);
39399 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39400 arg_conv.is_owned = false;
39401 int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv);
39405 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39406 LDKChannelTypeFeatures orig_conv;
39407 orig_conv.inner = untag_ptr(orig);
39408 orig_conv.is_owned = ptr_is_owned(orig);
39409 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39410 orig_conv.is_owned = false;
39411 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
39412 int64_t ret_ref = 0;
39413 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39414 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39418 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39419 LDKInitFeatures this_obj_conv;
39420 this_obj_conv.inner = untag_ptr(this_obj);
39421 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39423 InitFeatures_free(this_obj_conv);
39426 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39427 LDKNodeFeatures this_obj_conv;
39428 this_obj_conv.inner = untag_ptr(this_obj);
39429 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39430 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39431 NodeFeatures_free(this_obj_conv);
39434 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39435 LDKChannelFeatures this_obj_conv;
39436 this_obj_conv.inner = untag_ptr(this_obj);
39437 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39438 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39439 ChannelFeatures_free(this_obj_conv);
39442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39443 LDKInvoiceFeatures this_obj_conv;
39444 this_obj_conv.inner = untag_ptr(this_obj);
39445 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39447 InvoiceFeatures_free(this_obj_conv);
39450 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39451 LDKChannelTypeFeatures this_obj_conv;
39452 this_obj_conv.inner = untag_ptr(this_obj);
39453 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39455 ChannelTypeFeatures_free(this_obj_conv);
39458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) {
39459 LDKInitFeatures ret_var = InitFeatures_empty();
39460 int64_t ret_ref = 0;
39461 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39462 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39466 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv *env, jclass clz) {
39467 LDKInitFeatures ret_var = InitFeatures_known();
39468 int64_t ret_ref = 0;
39469 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39470 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39474 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
39475 LDKInitFeatures this_arg_conv;
39476 this_arg_conv.inner = untag_ptr(this_arg);
39477 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39478 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39479 this_arg_conv.is_owned = false;
39480 jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv);
39484 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) {
39485 LDKNodeFeatures ret_var = NodeFeatures_empty();
39486 int64_t ret_ref = 0;
39487 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39488 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39492 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv *env, jclass clz) {
39493 LDKNodeFeatures ret_var = NodeFeatures_known();
39494 int64_t ret_ref = 0;
39495 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39496 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39500 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
39501 LDKNodeFeatures this_arg_conv;
39502 this_arg_conv.inner = untag_ptr(this_arg);
39503 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39505 this_arg_conv.is_owned = false;
39506 jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
39510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) {
39511 LDKChannelFeatures ret_var = ChannelFeatures_empty();
39512 int64_t ret_ref = 0;
39513 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39514 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39518 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIEnv *env, jclass clz) {
39519 LDKChannelFeatures ret_var = ChannelFeatures_known();
39520 int64_t ret_ref = 0;
39521 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39522 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39526 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
39527 LDKChannelFeatures this_arg_conv;
39528 this_arg_conv.inner = untag_ptr(this_arg);
39529 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39530 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39531 this_arg_conv.is_owned = false;
39532 jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
39536 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) {
39537 LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
39538 int64_t ret_ref = 0;
39539 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39540 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39544 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIEnv *env, jclass clz) {
39545 LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
39546 int64_t ret_ref = 0;
39547 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39548 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39552 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
39553 LDKInvoiceFeatures this_arg_conv;
39554 this_arg_conv.inner = untag_ptr(this_arg);
39555 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39556 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39557 this_arg_conv.is_owned = false;
39558 jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
39562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) {
39563 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
39564 int64_t ret_ref = 0;
39565 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39566 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39570 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known(JNIEnv *env, jclass clz) {
39571 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
39572 int64_t ret_ref = 0;
39573 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39574 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39578 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
39579 LDKChannelTypeFeatures this_arg_conv;
39580 this_arg_conv.inner = untag_ptr(this_arg);
39581 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39582 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39583 this_arg_conv.is_owned = false;
39584 jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
39588 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
39589 LDKInitFeatures 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 = InitFeatures_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_InitFeatures_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_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
39606 *ret_conv = InitFeatures_read(ser_ref);
39607 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39608 return tag_ptr(ret_conv, true);
39611 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
39612 LDKChannelFeatures obj_conv;
39613 obj_conv.inner = untag_ptr(obj);
39614 obj_conv.is_owned = ptr_is_owned(obj);
39615 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39616 obj_conv.is_owned = false;
39617 LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
39618 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39619 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39620 CVec_u8Z_free(ret_var);
39624 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39625 LDKu8slice ser_ref;
39626 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39627 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39628 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
39629 *ret_conv = ChannelFeatures_read(ser_ref);
39630 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39631 return tag_ptr(ret_conv, true);
39634 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
39635 LDKNodeFeatures obj_conv;
39636 obj_conv.inner = untag_ptr(obj);
39637 obj_conv.is_owned = ptr_is_owned(obj);
39638 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39639 obj_conv.is_owned = false;
39640 LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
39641 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39642 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39643 CVec_u8Z_free(ret_var);
39647 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39648 LDKu8slice ser_ref;
39649 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39650 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39651 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
39652 *ret_conv = NodeFeatures_read(ser_ref);
39653 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39654 return tag_ptr(ret_conv, true);
39657 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
39658 LDKInvoiceFeatures obj_conv;
39659 obj_conv.inner = untag_ptr(obj);
39660 obj_conv.is_owned = ptr_is_owned(obj);
39661 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39662 obj_conv.is_owned = false;
39663 LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
39664 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39665 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39666 CVec_u8Z_free(ret_var);
39670 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39671 LDKu8slice ser_ref;
39672 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39673 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39674 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
39675 *ret_conv = InvoiceFeatures_read(ser_ref);
39676 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39677 return tag_ptr(ret_conv, true);
39680 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
39681 LDKChannelTypeFeatures obj_conv;
39682 obj_conv.inner = untag_ptr(obj);
39683 obj_conv.is_owned = ptr_is_owned(obj);
39684 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39685 obj_conv.is_owned = false;
39686 LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
39687 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39688 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39689 CVec_u8Z_free(ret_var);
39693 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
39694 LDKu8slice ser_ref;
39695 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
39696 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
39697 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
39698 *ret_conv = ChannelTypeFeatures_read(ser_ref);
39699 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
39700 return tag_ptr(ret_conv, true);
39703 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
39704 LDKInitFeatures this_arg_conv;
39705 this_arg_conv.inner = untag_ptr(this_arg);
39706 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39708 this_arg_conv.is_owned = false;
39709 InitFeatures_set_data_loss_protect_optional(&this_arg_conv);
39712 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
39713 LDKInitFeatures this_arg_conv;
39714 this_arg_conv.inner = untag_ptr(this_arg);
39715 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39717 this_arg_conv.is_owned = false;
39718 InitFeatures_set_data_loss_protect_required(&this_arg_conv);
39721 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
39722 LDKInitFeatures this_arg_conv;
39723 this_arg_conv.inner = untag_ptr(this_arg);
39724 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39725 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39726 this_arg_conv.is_owned = false;
39727 jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv);
39731 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
39732 LDKNodeFeatures this_arg_conv;
39733 this_arg_conv.inner = untag_ptr(this_arg);
39734 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39735 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39736 this_arg_conv.is_owned = false;
39737 NodeFeatures_set_data_loss_protect_optional(&this_arg_conv);
39740 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
39741 LDKNodeFeatures this_arg_conv;
39742 this_arg_conv.inner = untag_ptr(this_arg);
39743 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39745 this_arg_conv.is_owned = false;
39746 NodeFeatures_set_data_loss_protect_required(&this_arg_conv);
39749 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
39750 LDKNodeFeatures this_arg_conv;
39751 this_arg_conv.inner = untag_ptr(this_arg);
39752 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39754 this_arg_conv.is_owned = false;
39755 jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv);
39759 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
39760 LDKInitFeatures 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 jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv);
39769 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
39770 LDKNodeFeatures this_arg_conv;
39771 this_arg_conv.inner = untag_ptr(this_arg);
39772 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39774 this_arg_conv.is_owned = false;
39775 jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv);
39779 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
39780 LDKInitFeatures this_arg_conv;
39781 this_arg_conv.inner = untag_ptr(this_arg);
39782 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39784 this_arg_conv.is_owned = false;
39785 InitFeatures_set_initial_routing_sync_optional(&this_arg_conv);
39788 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
39789 LDKInitFeatures this_arg_conv;
39790 this_arg_conv.inner = untag_ptr(this_arg);
39791 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39792 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39793 this_arg_conv.is_owned = false;
39794 InitFeatures_set_initial_routing_sync_required(&this_arg_conv);
39797 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync(JNIEnv *env, jclass clz, int64_t this_arg) {
39798 LDKInitFeatures this_arg_conv;
39799 this_arg_conv.inner = untag_ptr(this_arg);
39800 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39802 this_arg_conv.is_owned = false;
39803 jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv);
39807 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
39808 LDKInitFeatures this_arg_conv;
39809 this_arg_conv.inner = untag_ptr(this_arg);
39810 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39811 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39812 this_arg_conv.is_owned = false;
39813 InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
39816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
39817 LDKInitFeatures this_arg_conv;
39818 this_arg_conv.inner = untag_ptr(this_arg);
39819 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39820 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39821 this_arg_conv.is_owned = false;
39822 InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
39825 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
39826 LDKInitFeatures this_arg_conv;
39827 this_arg_conv.inner = untag_ptr(this_arg);
39828 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39829 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39830 this_arg_conv.is_owned = false;
39831 jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv);
39835 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
39836 LDKNodeFeatures this_arg_conv;
39837 this_arg_conv.inner = untag_ptr(this_arg);
39838 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39840 this_arg_conv.is_owned = false;
39841 NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
39844 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
39845 LDKNodeFeatures this_arg_conv;
39846 this_arg_conv.inner = untag_ptr(this_arg);
39847 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39849 this_arg_conv.is_owned = false;
39850 NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
39853 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
39854 LDKNodeFeatures this_arg_conv;
39855 this_arg_conv.inner = untag_ptr(this_arg);
39856 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39858 this_arg_conv.is_owned = false;
39859 jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv);
39863 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
39864 LDKInitFeatures this_arg_conv;
39865 this_arg_conv.inner = untag_ptr(this_arg);
39866 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39867 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39868 this_arg_conv.is_owned = false;
39869 jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv);
39873 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
39874 LDKNodeFeatures this_arg_conv;
39875 this_arg_conv.inner = untag_ptr(this_arg);
39876 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39877 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39878 this_arg_conv.is_owned = false;
39879 jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv);
39883 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
39884 LDKInitFeatures this_arg_conv;
39885 this_arg_conv.inner = untag_ptr(this_arg);
39886 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39888 this_arg_conv.is_owned = false;
39889 InitFeatures_set_gossip_queries_optional(&this_arg_conv);
39892 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
39893 LDKInitFeatures this_arg_conv;
39894 this_arg_conv.inner = untag_ptr(this_arg);
39895 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39897 this_arg_conv.is_owned = false;
39898 InitFeatures_set_gossip_queries_required(&this_arg_conv);
39901 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
39902 LDKInitFeatures this_arg_conv;
39903 this_arg_conv.inner = untag_ptr(this_arg);
39904 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39906 this_arg_conv.is_owned = false;
39907 jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv);
39911 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
39912 LDKNodeFeatures this_arg_conv;
39913 this_arg_conv.inner = untag_ptr(this_arg);
39914 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39916 this_arg_conv.is_owned = false;
39917 NodeFeatures_set_gossip_queries_optional(&this_arg_conv);
39920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
39921 LDKNodeFeatures this_arg_conv;
39922 this_arg_conv.inner = untag_ptr(this_arg);
39923 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39925 this_arg_conv.is_owned = false;
39926 NodeFeatures_set_gossip_queries_required(&this_arg_conv);
39929 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
39930 LDKNodeFeatures this_arg_conv;
39931 this_arg_conv.inner = untag_ptr(this_arg);
39932 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39934 this_arg_conv.is_owned = false;
39935 jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv);
39939 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
39940 LDKInitFeatures this_arg_conv;
39941 this_arg_conv.inner = untag_ptr(this_arg);
39942 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39943 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39944 this_arg_conv.is_owned = false;
39945 jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv);
39949 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
39950 LDKNodeFeatures this_arg_conv;
39951 this_arg_conv.inner = untag_ptr(this_arg);
39952 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39954 this_arg_conv.is_owned = false;
39955 jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv);
39959 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
39960 LDKInitFeatures this_arg_conv;
39961 this_arg_conv.inner = untag_ptr(this_arg);
39962 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39964 this_arg_conv.is_owned = false;
39965 InitFeatures_set_variable_length_onion_optional(&this_arg_conv);
39968 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
39969 LDKInitFeatures this_arg_conv;
39970 this_arg_conv.inner = untag_ptr(this_arg);
39971 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39973 this_arg_conv.is_owned = false;
39974 InitFeatures_set_variable_length_onion_required(&this_arg_conv);
39977 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
39978 LDKInitFeatures this_arg_conv;
39979 this_arg_conv.inner = untag_ptr(this_arg);
39980 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39982 this_arg_conv.is_owned = false;
39983 jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv);
39987 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
39988 LDKNodeFeatures this_arg_conv;
39989 this_arg_conv.inner = untag_ptr(this_arg);
39990 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39992 this_arg_conv.is_owned = false;
39993 NodeFeatures_set_variable_length_onion_optional(&this_arg_conv);
39996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
39997 LDKNodeFeatures this_arg_conv;
39998 this_arg_conv.inner = untag_ptr(this_arg);
39999 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40001 this_arg_conv.is_owned = false;
40002 NodeFeatures_set_variable_length_onion_required(&this_arg_conv);
40005 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
40006 LDKNodeFeatures this_arg_conv;
40007 this_arg_conv.inner = untag_ptr(this_arg);
40008 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40010 this_arg_conv.is_owned = false;
40011 jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv);
40015 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40016 LDKInvoiceFeatures this_arg_conv;
40017 this_arg_conv.inner = untag_ptr(this_arg);
40018 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40020 this_arg_conv.is_owned = false;
40021 InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv);
40024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40025 LDKInvoiceFeatures this_arg_conv;
40026 this_arg_conv.inner = untag_ptr(this_arg);
40027 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40029 this_arg_conv.is_owned = false;
40030 InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv);
40033 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
40034 LDKInvoiceFeatures this_arg_conv;
40035 this_arg_conv.inner = untag_ptr(this_arg);
40036 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40038 this_arg_conv.is_owned = false;
40039 jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv);
40043 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
40044 LDKInitFeatures this_arg_conv;
40045 this_arg_conv.inner = untag_ptr(this_arg);
40046 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40048 this_arg_conv.is_owned = false;
40049 jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv);
40053 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
40054 LDKNodeFeatures this_arg_conv;
40055 this_arg_conv.inner = untag_ptr(this_arg);
40056 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40058 this_arg_conv.is_owned = false;
40059 jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv);
40063 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
40064 LDKInvoiceFeatures this_arg_conv;
40065 this_arg_conv.inner = untag_ptr(this_arg);
40066 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40067 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40068 this_arg_conv.is_owned = false;
40069 jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv);
40073 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40074 LDKInitFeatures this_arg_conv;
40075 this_arg_conv.inner = untag_ptr(this_arg);
40076 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40077 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40078 this_arg_conv.is_owned = false;
40079 InitFeatures_set_static_remote_key_optional(&this_arg_conv);
40082 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40083 LDKInitFeatures this_arg_conv;
40084 this_arg_conv.inner = untag_ptr(this_arg);
40085 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40087 this_arg_conv.is_owned = false;
40088 InitFeatures_set_static_remote_key_required(&this_arg_conv);
40091 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
40092 LDKInitFeatures this_arg_conv;
40093 this_arg_conv.inner = untag_ptr(this_arg);
40094 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40096 this_arg_conv.is_owned = false;
40097 jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv);
40101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40102 LDKNodeFeatures this_arg_conv;
40103 this_arg_conv.inner = untag_ptr(this_arg);
40104 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40105 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40106 this_arg_conv.is_owned = false;
40107 NodeFeatures_set_static_remote_key_optional(&this_arg_conv);
40110 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40111 LDKNodeFeatures this_arg_conv;
40112 this_arg_conv.inner = untag_ptr(this_arg);
40113 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40114 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40115 this_arg_conv.is_owned = false;
40116 NodeFeatures_set_static_remote_key_required(&this_arg_conv);
40119 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
40120 LDKNodeFeatures this_arg_conv;
40121 this_arg_conv.inner = untag_ptr(this_arg);
40122 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40124 this_arg_conv.is_owned = false;
40125 jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv);
40129 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40130 LDKChannelTypeFeatures this_arg_conv;
40131 this_arg_conv.inner = untag_ptr(this_arg);
40132 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40134 this_arg_conv.is_owned = false;
40135 ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv);
40138 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40139 LDKChannelTypeFeatures this_arg_conv;
40140 this_arg_conv.inner = untag_ptr(this_arg);
40141 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40143 this_arg_conv.is_owned = false;
40144 ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv);
40147 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
40148 LDKChannelTypeFeatures this_arg_conv;
40149 this_arg_conv.inner = untag_ptr(this_arg);
40150 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40152 this_arg_conv.is_owned = false;
40153 jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv);
40157 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
40158 LDKInitFeatures this_arg_conv;
40159 this_arg_conv.inner = untag_ptr(this_arg);
40160 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40162 this_arg_conv.is_owned = false;
40163 jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv);
40167 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
40168 LDKNodeFeatures this_arg_conv;
40169 this_arg_conv.inner = untag_ptr(this_arg);
40170 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40171 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40172 this_arg_conv.is_owned = false;
40173 jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv);
40177 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
40178 LDKChannelTypeFeatures this_arg_conv;
40179 this_arg_conv.inner = untag_ptr(this_arg);
40180 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40181 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40182 this_arg_conv.is_owned = false;
40183 jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv);
40187 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40188 LDKInitFeatures this_arg_conv;
40189 this_arg_conv.inner = untag_ptr(this_arg);
40190 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40192 this_arg_conv.is_owned = false;
40193 InitFeatures_set_payment_secret_optional(&this_arg_conv);
40196 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40197 LDKInitFeatures this_arg_conv;
40198 this_arg_conv.inner = untag_ptr(this_arg);
40199 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40201 this_arg_conv.is_owned = false;
40202 InitFeatures_set_payment_secret_required(&this_arg_conv);
40205 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
40206 LDKInitFeatures 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 jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv);
40215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40216 LDKNodeFeatures this_arg_conv;
40217 this_arg_conv.inner = untag_ptr(this_arg);
40218 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40220 this_arg_conv.is_owned = false;
40221 NodeFeatures_set_payment_secret_optional(&this_arg_conv);
40224 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40225 LDKNodeFeatures this_arg_conv;
40226 this_arg_conv.inner = untag_ptr(this_arg);
40227 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40228 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40229 this_arg_conv.is_owned = false;
40230 NodeFeatures_set_payment_secret_required(&this_arg_conv);
40233 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
40234 LDKNodeFeatures this_arg_conv;
40235 this_arg_conv.inner = untag_ptr(this_arg);
40236 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40238 this_arg_conv.is_owned = false;
40239 jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv);
40243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40244 LDKInvoiceFeatures this_arg_conv;
40245 this_arg_conv.inner = untag_ptr(this_arg);
40246 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40248 this_arg_conv.is_owned = false;
40249 InvoiceFeatures_set_payment_secret_optional(&this_arg_conv);
40252 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40253 LDKInvoiceFeatures this_arg_conv;
40254 this_arg_conv.inner = untag_ptr(this_arg);
40255 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40257 this_arg_conv.is_owned = false;
40258 InvoiceFeatures_set_payment_secret_required(&this_arg_conv);
40261 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
40262 LDKInvoiceFeatures this_arg_conv;
40263 this_arg_conv.inner = untag_ptr(this_arg);
40264 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40266 this_arg_conv.is_owned = false;
40267 jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
40271 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
40272 LDKInitFeatures this_arg_conv;
40273 this_arg_conv.inner = untag_ptr(this_arg);
40274 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40276 this_arg_conv.is_owned = false;
40277 jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv);
40281 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
40282 LDKNodeFeatures this_arg_conv;
40283 this_arg_conv.inner = untag_ptr(this_arg);
40284 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40286 this_arg_conv.is_owned = false;
40287 jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv);
40291 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
40292 LDKInvoiceFeatures this_arg_conv;
40293 this_arg_conv.inner = untag_ptr(this_arg);
40294 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40296 this_arg_conv.is_owned = false;
40297 jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv);
40301 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40302 LDKInitFeatures this_arg_conv;
40303 this_arg_conv.inner = untag_ptr(this_arg);
40304 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40306 this_arg_conv.is_owned = false;
40307 InitFeatures_set_basic_mpp_optional(&this_arg_conv);
40310 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40311 LDKInitFeatures this_arg_conv;
40312 this_arg_conv.inner = untag_ptr(this_arg);
40313 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40314 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40315 this_arg_conv.is_owned = false;
40316 InitFeatures_set_basic_mpp_required(&this_arg_conv);
40319 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
40320 LDKInitFeatures this_arg_conv;
40321 this_arg_conv.inner = untag_ptr(this_arg);
40322 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40324 this_arg_conv.is_owned = false;
40325 jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv);
40329 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40330 LDKNodeFeatures this_arg_conv;
40331 this_arg_conv.inner = untag_ptr(this_arg);
40332 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40333 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40334 this_arg_conv.is_owned = false;
40335 NodeFeatures_set_basic_mpp_optional(&this_arg_conv);
40338 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40339 LDKNodeFeatures this_arg_conv;
40340 this_arg_conv.inner = untag_ptr(this_arg);
40341 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40342 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40343 this_arg_conv.is_owned = false;
40344 NodeFeatures_set_basic_mpp_required(&this_arg_conv);
40347 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
40348 LDKNodeFeatures this_arg_conv;
40349 this_arg_conv.inner = untag_ptr(this_arg);
40350 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40352 this_arg_conv.is_owned = false;
40353 jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv);
40357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40358 LDKInvoiceFeatures this_arg_conv;
40359 this_arg_conv.inner = untag_ptr(this_arg);
40360 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40362 this_arg_conv.is_owned = false;
40363 InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
40366 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40367 LDKInvoiceFeatures this_arg_conv;
40368 this_arg_conv.inner = untag_ptr(this_arg);
40369 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40371 this_arg_conv.is_owned = false;
40372 InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
40375 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
40376 LDKInvoiceFeatures this_arg_conv;
40377 this_arg_conv.inner = untag_ptr(this_arg);
40378 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40380 this_arg_conv.is_owned = false;
40381 jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
40385 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
40386 LDKInitFeatures this_arg_conv;
40387 this_arg_conv.inner = untag_ptr(this_arg);
40388 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40390 this_arg_conv.is_owned = false;
40391 jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv);
40395 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
40396 LDKNodeFeatures this_arg_conv;
40397 this_arg_conv.inner = untag_ptr(this_arg);
40398 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40400 this_arg_conv.is_owned = false;
40401 jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv);
40405 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
40406 LDKInvoiceFeatures this_arg_conv;
40407 this_arg_conv.inner = untag_ptr(this_arg);
40408 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40410 this_arg_conv.is_owned = false;
40411 jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
40415 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40416 LDKInitFeatures this_arg_conv;
40417 this_arg_conv.inner = untag_ptr(this_arg);
40418 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40420 this_arg_conv.is_owned = false;
40421 InitFeatures_set_wumbo_optional(&this_arg_conv);
40424 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40425 LDKInitFeatures this_arg_conv;
40426 this_arg_conv.inner = untag_ptr(this_arg);
40427 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40428 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40429 this_arg_conv.is_owned = false;
40430 InitFeatures_set_wumbo_required(&this_arg_conv);
40433 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
40434 LDKInitFeatures this_arg_conv;
40435 this_arg_conv.inner = untag_ptr(this_arg);
40436 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40438 this_arg_conv.is_owned = false;
40439 jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv);
40443 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40444 LDKNodeFeatures this_arg_conv;
40445 this_arg_conv.inner = untag_ptr(this_arg);
40446 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40448 this_arg_conv.is_owned = false;
40449 NodeFeatures_set_wumbo_optional(&this_arg_conv);
40452 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40453 LDKNodeFeatures this_arg_conv;
40454 this_arg_conv.inner = untag_ptr(this_arg);
40455 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40457 this_arg_conv.is_owned = false;
40458 NodeFeatures_set_wumbo_required(&this_arg_conv);
40461 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
40462 LDKNodeFeatures this_arg_conv;
40463 this_arg_conv.inner = untag_ptr(this_arg);
40464 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40466 this_arg_conv.is_owned = false;
40467 jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv);
40471 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
40472 LDKInitFeatures this_arg_conv;
40473 this_arg_conv.inner = untag_ptr(this_arg);
40474 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40476 this_arg_conv.is_owned = false;
40477 jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv);
40481 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
40482 LDKNodeFeatures this_arg_conv;
40483 this_arg_conv.inner = untag_ptr(this_arg);
40484 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40486 this_arg_conv.is_owned = false;
40487 jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv);
40491 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40492 LDKInitFeatures this_arg_conv;
40493 this_arg_conv.inner = untag_ptr(this_arg);
40494 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40496 this_arg_conv.is_owned = false;
40497 InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
40500 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40501 LDKInitFeatures this_arg_conv;
40502 this_arg_conv.inner = untag_ptr(this_arg);
40503 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40505 this_arg_conv.is_owned = false;
40506 InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
40509 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
40510 LDKInitFeatures this_arg_conv;
40511 this_arg_conv.inner = untag_ptr(this_arg);
40512 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40514 this_arg_conv.is_owned = false;
40515 jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv);
40519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40520 LDKNodeFeatures this_arg_conv;
40521 this_arg_conv.inner = untag_ptr(this_arg);
40522 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40524 this_arg_conv.is_owned = false;
40525 NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
40528 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40529 LDKNodeFeatures this_arg_conv;
40530 this_arg_conv.inner = untag_ptr(this_arg);
40531 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40533 this_arg_conv.is_owned = false;
40534 NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
40537 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
40538 LDKNodeFeatures this_arg_conv;
40539 this_arg_conv.inner = untag_ptr(this_arg);
40540 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40542 this_arg_conv.is_owned = false;
40543 jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv);
40547 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
40548 LDKInitFeatures this_arg_conv;
40549 this_arg_conv.inner = untag_ptr(this_arg);
40550 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40552 this_arg_conv.is_owned = false;
40553 jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv);
40557 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
40558 LDKNodeFeatures this_arg_conv;
40559 this_arg_conv.inner = untag_ptr(this_arg);
40560 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40562 this_arg_conv.is_owned = false;
40563 jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv);
40567 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40568 LDKInitFeatures this_arg_conv;
40569 this_arg_conv.inner = untag_ptr(this_arg);
40570 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40571 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40572 this_arg_conv.is_owned = false;
40573 InitFeatures_set_channel_type_optional(&this_arg_conv);
40576 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40577 LDKInitFeatures this_arg_conv;
40578 this_arg_conv.inner = untag_ptr(this_arg);
40579 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40580 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40581 this_arg_conv.is_owned = false;
40582 InitFeatures_set_channel_type_required(&this_arg_conv);
40585 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
40586 LDKInitFeatures this_arg_conv;
40587 this_arg_conv.inner = untag_ptr(this_arg);
40588 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40590 this_arg_conv.is_owned = false;
40591 jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv);
40595 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40596 LDKNodeFeatures this_arg_conv;
40597 this_arg_conv.inner = untag_ptr(this_arg);
40598 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40600 this_arg_conv.is_owned = false;
40601 NodeFeatures_set_channel_type_optional(&this_arg_conv);
40604 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40605 LDKNodeFeatures this_arg_conv;
40606 this_arg_conv.inner = untag_ptr(this_arg);
40607 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40608 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40609 this_arg_conv.is_owned = false;
40610 NodeFeatures_set_channel_type_required(&this_arg_conv);
40613 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
40614 LDKNodeFeatures this_arg_conv;
40615 this_arg_conv.inner = untag_ptr(this_arg);
40616 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40618 this_arg_conv.is_owned = false;
40619 jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv);
40623 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
40624 LDKInitFeatures this_arg_conv;
40625 this_arg_conv.inner = untag_ptr(this_arg);
40626 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40627 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40628 this_arg_conv.is_owned = false;
40629 jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv);
40633 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
40634 LDKNodeFeatures this_arg_conv;
40635 this_arg_conv.inner = untag_ptr(this_arg);
40636 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40638 this_arg_conv.is_owned = false;
40639 jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv);
40643 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40644 LDKInitFeatures this_arg_conv;
40645 this_arg_conv.inner = untag_ptr(this_arg);
40646 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40648 this_arg_conv.is_owned = false;
40649 InitFeatures_set_scid_privacy_optional(&this_arg_conv);
40652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40653 LDKInitFeatures this_arg_conv;
40654 this_arg_conv.inner = untag_ptr(this_arg);
40655 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40657 this_arg_conv.is_owned = false;
40658 InitFeatures_set_scid_privacy_required(&this_arg_conv);
40661 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
40662 LDKInitFeatures this_arg_conv;
40663 this_arg_conv.inner = untag_ptr(this_arg);
40664 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40666 this_arg_conv.is_owned = false;
40667 jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv);
40671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40672 LDKNodeFeatures this_arg_conv;
40673 this_arg_conv.inner = untag_ptr(this_arg);
40674 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40676 this_arg_conv.is_owned = false;
40677 NodeFeatures_set_scid_privacy_optional(&this_arg_conv);
40680 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40681 LDKNodeFeatures this_arg_conv;
40682 this_arg_conv.inner = untag_ptr(this_arg);
40683 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40685 this_arg_conv.is_owned = false;
40686 NodeFeatures_set_scid_privacy_required(&this_arg_conv);
40689 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
40690 LDKNodeFeatures this_arg_conv;
40691 this_arg_conv.inner = untag_ptr(this_arg);
40692 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40694 this_arg_conv.is_owned = false;
40695 jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv);
40699 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40700 LDKChannelTypeFeatures this_arg_conv;
40701 this_arg_conv.inner = untag_ptr(this_arg);
40702 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40704 this_arg_conv.is_owned = false;
40705 ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv);
40708 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40709 LDKChannelTypeFeatures this_arg_conv;
40710 this_arg_conv.inner = untag_ptr(this_arg);
40711 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40712 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40713 this_arg_conv.is_owned = false;
40714 ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv);
40717 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
40718 LDKChannelTypeFeatures this_arg_conv;
40719 this_arg_conv.inner = untag_ptr(this_arg);
40720 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40722 this_arg_conv.is_owned = false;
40723 jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv);
40727 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
40728 LDKInitFeatures this_arg_conv;
40729 this_arg_conv.inner = untag_ptr(this_arg);
40730 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40732 this_arg_conv.is_owned = false;
40733 jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv);
40737 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
40738 LDKNodeFeatures this_arg_conv;
40739 this_arg_conv.inner = untag_ptr(this_arg);
40740 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40742 this_arg_conv.is_owned = false;
40743 jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv);
40747 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
40748 LDKChannelTypeFeatures this_arg_conv;
40749 this_arg_conv.inner = untag_ptr(this_arg);
40750 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40752 this_arg_conv.is_owned = false;
40753 jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv);
40757 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40758 LDKInitFeatures this_arg_conv;
40759 this_arg_conv.inner = untag_ptr(this_arg);
40760 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40762 this_arg_conv.is_owned = false;
40763 InitFeatures_set_zero_conf_optional(&this_arg_conv);
40766 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40767 LDKInitFeatures this_arg_conv;
40768 this_arg_conv.inner = untag_ptr(this_arg);
40769 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40770 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40771 this_arg_conv.is_owned = false;
40772 InitFeatures_set_zero_conf_required(&this_arg_conv);
40775 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
40776 LDKInitFeatures this_arg_conv;
40777 this_arg_conv.inner = untag_ptr(this_arg);
40778 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40779 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40780 this_arg_conv.is_owned = false;
40781 jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv);
40785 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40786 LDKNodeFeatures this_arg_conv;
40787 this_arg_conv.inner = untag_ptr(this_arg);
40788 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40789 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40790 this_arg_conv.is_owned = false;
40791 NodeFeatures_set_zero_conf_optional(&this_arg_conv);
40794 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40795 LDKNodeFeatures this_arg_conv;
40796 this_arg_conv.inner = untag_ptr(this_arg);
40797 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40798 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40799 this_arg_conv.is_owned = false;
40800 NodeFeatures_set_zero_conf_required(&this_arg_conv);
40803 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
40804 LDKNodeFeatures this_arg_conv;
40805 this_arg_conv.inner = untag_ptr(this_arg);
40806 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40808 this_arg_conv.is_owned = false;
40809 jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv);
40813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40814 LDKChannelTypeFeatures this_arg_conv;
40815 this_arg_conv.inner = untag_ptr(this_arg);
40816 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40818 this_arg_conv.is_owned = false;
40819 ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv);
40822 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40823 LDKChannelTypeFeatures this_arg_conv;
40824 this_arg_conv.inner = untag_ptr(this_arg);
40825 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40827 this_arg_conv.is_owned = false;
40828 ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv);
40831 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
40832 LDKChannelTypeFeatures this_arg_conv;
40833 this_arg_conv.inner = untag_ptr(this_arg);
40834 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40836 this_arg_conv.is_owned = false;
40837 jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv);
40841 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
40842 LDKInitFeatures this_arg_conv;
40843 this_arg_conv.inner = untag_ptr(this_arg);
40844 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40845 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40846 this_arg_conv.is_owned = false;
40847 jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv);
40851 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
40852 LDKNodeFeatures this_arg_conv;
40853 this_arg_conv.inner = untag_ptr(this_arg);
40854 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40856 this_arg_conv.is_owned = false;
40857 jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv);
40861 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
40862 LDKChannelTypeFeatures this_arg_conv;
40863 this_arg_conv.inner = untag_ptr(this_arg);
40864 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40865 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40866 this_arg_conv.is_owned = false;
40867 jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv);
40871 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
40872 LDKNodeFeatures this_arg_conv;
40873 this_arg_conv.inner = untag_ptr(this_arg);
40874 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40875 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40876 this_arg_conv.is_owned = false;
40877 NodeFeatures_set_keysend_optional(&this_arg_conv);
40880 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
40881 LDKNodeFeatures this_arg_conv;
40882 this_arg_conv.inner = untag_ptr(this_arg);
40883 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40884 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40885 this_arg_conv.is_owned = false;
40886 NodeFeatures_set_keysend_required(&this_arg_conv);
40889 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) {
40890 LDKNodeFeatures this_arg_conv;
40891 this_arg_conv.inner = untag_ptr(this_arg);
40892 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40893 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40894 this_arg_conv.is_owned = false;
40895 jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv);
40899 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) {
40900 LDKNodeFeatures this_arg_conv;
40901 this_arg_conv.inner = untag_ptr(this_arg);
40902 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40904 this_arg_conv.is_owned = false;
40905 jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv);
40909 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40910 LDKShutdownScript this_obj_conv;
40911 this_obj_conv.inner = untag_ptr(this_obj);
40912 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40914 ShutdownScript_free(this_obj_conv);
40917 static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) {
40918 LDKShutdownScript ret_var = ShutdownScript_clone(arg);
40919 int64_t ret_ref = 0;
40920 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40921 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40924 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40925 LDKShutdownScript arg_conv;
40926 arg_conv.inner = untag_ptr(arg);
40927 arg_conv.is_owned = ptr_is_owned(arg);
40928 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40929 arg_conv.is_owned = false;
40930 int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv);
40934 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40935 LDKShutdownScript orig_conv;
40936 orig_conv.inner = untag_ptr(orig);
40937 orig_conv.is_owned = ptr_is_owned(orig);
40938 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40939 orig_conv.is_owned = false;
40940 LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
40941 int64_t ret_ref = 0;
40942 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40943 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40947 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40948 LDKInvalidShutdownScript this_obj_conv;
40949 this_obj_conv.inner = untag_ptr(this_obj);
40950 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40952 InvalidShutdownScript_free(this_obj_conv);
40955 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1get_1script(JNIEnv *env, jclass clz, int64_t this_ptr) {
40956 LDKInvalidShutdownScript this_ptr_conv;
40957 this_ptr_conv.inner = untag_ptr(this_ptr);
40958 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40960 this_ptr_conv.is_owned = false;
40961 LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
40962 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40963 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1script(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40968 LDKInvalidShutdownScript this_ptr_conv;
40969 this_ptr_conv.inner = untag_ptr(this_ptr);
40970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40972 this_ptr_conv.is_owned = false;
40973 LDKCVec_u8Z val_ref;
40974 val_ref.datalen = (*env)->GetArrayLength(env, val);
40975 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
40976 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
40977 InvalidShutdownScript_set_script(&this_ptr_conv, val_ref);
40980 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new(JNIEnv *env, jclass clz, int8_tArray script_arg) {
40981 LDKCVec_u8Z script_arg_ref;
40982 script_arg_ref.datalen = (*env)->GetArrayLength(env, script_arg);
40983 script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
40984 (*env)->GetByteArrayRegion(env, script_arg, 0, script_arg_ref.datalen, script_arg_ref.data);
40985 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
40986 int64_t ret_ref = 0;
40987 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40988 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40992 static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) {
40993 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg);
40994 int64_t ret_ref = 0;
40995 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40996 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40999 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41000 LDKInvalidShutdownScript arg_conv;
41001 arg_conv.inner = untag_ptr(arg);
41002 arg_conv.is_owned = ptr_is_owned(arg);
41003 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41004 arg_conv.is_owned = false;
41005 int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv);
41009 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41010 LDKInvalidShutdownScript orig_conv;
41011 orig_conv.inner = untag_ptr(orig);
41012 orig_conv.is_owned = ptr_is_owned(orig);
41013 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41014 orig_conv.is_owned = false;
41015 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
41016 int64_t ret_ref = 0;
41017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41018 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41022 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(JNIEnv *env, jclass clz, int64_t obj) {
41023 LDKShutdownScript obj_conv;
41024 obj_conv.inner = untag_ptr(obj);
41025 obj_conv.is_owned = ptr_is_owned(obj);
41026 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41027 obj_conv.is_owned = false;
41028 LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
41029 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41030 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41031 CVec_u8Z_free(ret_var);
41035 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41036 LDKu8slice ser_ref;
41037 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41038 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41039 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
41040 *ret_conv = ShutdownScript_read(ser_ref);
41041 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41042 return tag_ptr(ret_conv, true);
41045 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh(JNIEnv *env, jclass clz, int8_tArray pubkey_hash) {
41046 unsigned char pubkey_hash_arr[20];
41047 CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20);
41048 (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr);
41049 unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
41050 LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
41051 int64_t ret_ref = 0;
41052 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41053 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41057 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh(JNIEnv *env, jclass clz, int8_tArray script_hash) {
41058 unsigned char script_hash_arr[32];
41059 CHECK((*env)->GetArrayLength(env, script_hash) == 32);
41060 (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr);
41061 unsigned char (*script_hash_ref)[32] = &script_hash_arr;
41062 LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
41063 int64_t ret_ref = 0;
41064 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41065 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41069 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) {
41071 LDKu8slice program_ref;
41072 program_ref.datalen = (*env)->GetArrayLength(env, program);
41073 program_ref.data = (*env)->GetByteArrayElements (env, program, NULL);
41074 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
41075 *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
41076 (*env)->ReleaseByteArrayElements(env, program, (int8_t*)program_ref.data, 0);
41077 return tag_ptr(ret_conv, true);
41080 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
41081 LDKShutdownScript this_arg_conv;
41082 this_arg_conv.inner = untag_ptr(this_arg);
41083 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41085 this_arg_conv = ShutdownScript_clone(&this_arg_conv);
41086 LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
41087 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41088 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41089 CVec_u8Z_free(ret_var);
41093 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1legacy_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
41094 LDKShutdownScript this_arg_conv;
41095 this_arg_conv.inner = untag_ptr(this_arg);
41096 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41098 this_arg_conv.is_owned = false;
41099 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
41100 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form);
41104 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compatible(JNIEnv *env, jclass clz, int64_t this_arg, int64_t features) {
41105 LDKShutdownScript this_arg_conv;
41106 this_arg_conv.inner = untag_ptr(this_arg);
41107 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41108 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41109 this_arg_conv.is_owned = false;
41110 LDKInitFeatures features_conv;
41111 features_conv.inner = untag_ptr(features);
41112 features_conv.is_owned = ptr_is_owned(features);
41113 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
41114 features_conv.is_owned = false;
41115 jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
41119 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
41120 if (!ptr_is_owned(this_ptr)) return;
41121 void* this_ptr_ptr = untag_ptr(this_ptr);
41122 CHECK_ACCESS(this_ptr_ptr);
41123 LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
41124 FREE(untag_ptr(this_ptr));
41125 CustomMessageReader_free(this_ptr_conv);
41128 static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) {
41129 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
41130 *ret_ret = Type_clone(arg);
41131 return tag_ptr(ret_ret, true);
41133 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41134 void* arg_ptr = untag_ptr(arg);
41135 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
41136 LDKType* arg_conv = (LDKType*)arg_ptr;
41137 int64_t ret_conv = Type_clone_ptr(arg_conv);
41141 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41142 void* orig_ptr = untag_ptr(orig);
41143 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
41144 LDKType* orig_conv = (LDKType*)orig_ptr;
41145 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
41146 *ret_ret = Type_clone(orig_conv);
41147 return tag_ptr(ret_ret, true);
41150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
41151 if (!ptr_is_owned(this_ptr)) return;
41152 void* this_ptr_ptr = untag_ptr(this_ptr);
41153 CHECK_ACCESS(this_ptr_ptr);
41154 LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
41155 FREE(untag_ptr(this_ptr));
41156 Type_free(this_ptr_conv);
41159 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41160 LDKNodeId this_obj_conv;
41161 this_obj_conv.inner = untag_ptr(this_obj);
41162 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41163 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41164 NodeId_free(this_obj_conv);
41167 static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) {
41168 LDKNodeId ret_var = NodeId_clone(arg);
41169 int64_t ret_ref = 0;
41170 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41171 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41174 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41175 LDKNodeId arg_conv;
41176 arg_conv.inner = untag_ptr(arg);
41177 arg_conv.is_owned = ptr_is_owned(arg);
41178 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41179 arg_conv.is_owned = false;
41180 int64_t ret_conv = NodeId_clone_ptr(&arg_conv);
41184 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41185 LDKNodeId orig_conv;
41186 orig_conv.inner = untag_ptr(orig);
41187 orig_conv.is_owned = ptr_is_owned(orig);
41188 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41189 orig_conv.is_owned = false;
41190 LDKNodeId ret_var = NodeId_clone(&orig_conv);
41191 int64_t ret_ref = 0;
41192 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41193 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41197 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv *env, jclass clz, int8_tArray pubkey) {
41198 LDKPublicKey pubkey_ref;
41199 CHECK((*env)->GetArrayLength(env, pubkey) == 33);
41200 (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
41201 LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
41202 int64_t ret_ref = 0;
41203 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41204 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41208 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEnv *env, jclass clz, int64_t this_arg) {
41209 LDKNodeId this_arg_conv;
41210 this_arg_conv.inner = untag_ptr(this_arg);
41211 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41213 this_arg_conv.is_owned = false;
41214 LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv);
41215 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41216 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41220 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, jclass clz, int64_t o) {
41222 o_conv.inner = untag_ptr(o);
41223 o_conv.is_owned = ptr_is_owned(o);
41224 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
41225 o_conv.is_owned = false;
41226 int64_t ret_conv = NodeId_hash(&o_conv);
41230 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *env, jclass clz, int64_t obj) {
41231 LDKNodeId obj_conv;
41232 obj_conv.inner = untag_ptr(obj);
41233 obj_conv.is_owned = ptr_is_owned(obj);
41234 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41235 obj_conv.is_owned = false;
41236 LDKCVec_u8Z ret_var = NodeId_write(&obj_conv);
41237 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41238 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41239 CVec_u8Z_free(ret_var);
41243 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41244 LDKu8slice ser_ref;
41245 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41246 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41247 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
41248 *ret_conv = NodeId_read(ser_ref);
41249 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41250 return tag_ptr(ret_conv, true);
41253 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41254 LDKNetworkGraph this_obj_conv;
41255 this_obj_conv.inner = untag_ptr(this_obj);
41256 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41257 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41258 NetworkGraph_free(this_obj_conv);
41261 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41262 LDKReadOnlyNetworkGraph this_obj_conv;
41263 this_obj_conv.inner = untag_ptr(this_obj);
41264 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41266 ReadOnlyNetworkGraph_free(this_obj_conv);
41269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
41270 if (!ptr_is_owned(this_ptr)) return;
41271 void* this_ptr_ptr = untag_ptr(this_ptr);
41272 CHECK_ACCESS(this_ptr_ptr);
41273 LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
41274 FREE(untag_ptr(this_ptr));
41275 NetworkUpdate_free(this_ptr_conv);
41278 static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) {
41279 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
41280 *ret_copy = NetworkUpdate_clone(arg);
41281 int64_t ret_ref = tag_ptr(ret_copy, true);
41284 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41285 LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg);
41286 int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv);
41290 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41291 LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig);
41292 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
41293 *ret_copy = NetworkUpdate_clone(orig_conv);
41294 int64_t ret_ref = tag_ptr(ret_copy, true);
41298 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1update_1message(JNIEnv *env, jclass clz, int64_t msg) {
41299 LDKChannelUpdate msg_conv;
41300 msg_conv.inner = untag_ptr(msg);
41301 msg_conv.is_owned = ptr_is_owned(msg);
41302 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
41303 msg_conv = ChannelUpdate_clone(&msg_conv);
41304 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
41305 *ret_copy = NetworkUpdate_channel_update_message(msg_conv);
41306 int64_t ret_ref = tag_ptr(ret_copy, true);
41310 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) {
41311 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
41312 *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent);
41313 int64_t ret_ref = tag_ptr(ret_copy, true);
41317 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure(JNIEnv *env, jclass clz, int8_tArray node_id, jboolean is_permanent) {
41318 LDKPublicKey node_id_ref;
41319 CHECK((*env)->GetArrayLength(env, node_id) == 33);
41320 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
41321 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
41322 *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent);
41323 int64_t ret_ref = tag_ptr(ret_copy, true);
41327 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
41328 LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
41329 LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
41330 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41331 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41332 CVec_u8Z_free(ret_var);
41336 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41337 LDKu8slice ser_ref;
41338 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41339 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41340 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
41341 *ret_conv = NetworkUpdate_read(ser_ref);
41342 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41343 return tag_ptr(ret_conv, true);
41346 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41347 LDKP2PGossipSync this_obj_conv;
41348 this_obj_conv.inner = untag_ptr(this_obj);
41349 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41351 P2PGossipSync_free(this_obj_conv);
41354 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) {
41355 LDKNetworkGraph network_graph_conv;
41356 network_graph_conv.inner = untag_ptr(network_graph);
41357 network_graph_conv.is_owned = ptr_is_owned(network_graph);
41358 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
41359 network_graph_conv.is_owned = false;
41360 void* chain_access_ptr = untag_ptr(chain_access);
41361 CHECK_ACCESS(chain_access_ptr);
41362 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
41363 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
41364 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
41365 // Manually implement clone for Java trait instances
41366 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
41367 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41368 LDKAccess_JCalls_cloned(&chain_access_conv.some);
41371 void* logger_ptr = untag_ptr(logger);
41372 CHECK_ACCESS(logger_ptr);
41373 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41374 if (logger_conv.free == LDKLogger_JCalls_free) {
41375 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41376 LDKLogger_JCalls_cloned(&logger_conv);
41378 LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, chain_access_conv, logger_conv);
41379 int64_t ret_ref = 0;
41380 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41381 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41385 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1chain_1access(JNIEnv *env, jclass clz, int64_t this_arg, int64_t chain_access) {
41386 LDKP2PGossipSync this_arg_conv;
41387 this_arg_conv.inner = untag_ptr(this_arg);
41388 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41390 this_arg_conv.is_owned = false;
41391 void* chain_access_ptr = untag_ptr(chain_access);
41392 CHECK_ACCESS(chain_access_ptr);
41393 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
41394 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
41395 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
41396 // Manually implement clone for Java trait instances
41397 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
41398 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41399 LDKAccess_JCalls_cloned(&chain_access_conv.some);
41402 P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv);
41405 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41406 LDKNetworkGraph this_arg_conv;
41407 this_arg_conv.inner = untag_ptr(this_arg);
41408 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41410 this_arg_conv.is_owned = false;
41411 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
41412 *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv);
41413 return tag_ptr(ret_ret, true);
41416 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41417 LDKP2PGossipSync this_arg_conv;
41418 this_arg_conv.inner = untag_ptr(this_arg);
41419 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41421 this_arg_conv.is_owned = false;
41422 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
41423 *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv);
41424 return tag_ptr(ret_ret, true);
41427 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
41428 LDKP2PGossipSync this_arg_conv;
41429 this_arg_conv.inner = untag_ptr(this_arg);
41430 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41431 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41432 this_arg_conv.is_owned = false;
41433 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
41434 *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv);
41435 return tag_ptr(ret_ret, true);
41438 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41439 LDKChannelUpdateInfo this_obj_conv;
41440 this_obj_conv.inner = untag_ptr(this_obj);
41441 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41442 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41443 ChannelUpdateInfo_free(this_obj_conv);
41446 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) {
41447 LDKChannelUpdateInfo this_ptr_conv;
41448 this_ptr_conv.inner = untag_ptr(this_ptr);
41449 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41450 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41451 this_ptr_conv.is_owned = false;
41452 int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv);
41456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
41457 LDKChannelUpdateInfo this_ptr_conv;
41458 this_ptr_conv.inner = untag_ptr(this_ptr);
41459 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41461 this_ptr_conv.is_owned = false;
41462 ChannelUpdateInfo_set_last_update(&this_ptr_conv, val);
41465 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr) {
41466 LDKChannelUpdateInfo this_ptr_conv;
41467 this_ptr_conv.inner = untag_ptr(this_ptr);
41468 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41469 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41470 this_ptr_conv.is_owned = false;
41471 jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv);
41475 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
41476 LDKChannelUpdateInfo this_ptr_conv;
41477 this_ptr_conv.inner = untag_ptr(this_ptr);
41478 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41479 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41480 this_ptr_conv.is_owned = false;
41481 ChannelUpdateInfo_set_enabled(&this_ptr_conv, val);
41484 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
41485 LDKChannelUpdateInfo this_ptr_conv;
41486 this_ptr_conv.inner = untag_ptr(this_ptr);
41487 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41488 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41489 this_ptr_conv.is_owned = false;
41490 int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv);
41494 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
41495 LDKChannelUpdateInfo this_ptr_conv;
41496 this_ptr_conv.inner = untag_ptr(this_ptr);
41497 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41499 this_ptr_conv.is_owned = false;
41500 ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
41503 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
41504 LDKChannelUpdateInfo this_ptr_conv;
41505 this_ptr_conv.inner = untag_ptr(this_ptr);
41506 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41507 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41508 this_ptr_conv.is_owned = false;
41509 int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv);
41513 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41514 LDKChannelUpdateInfo this_ptr_conv;
41515 this_ptr_conv.inner = untag_ptr(this_ptr);
41516 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41518 this_ptr_conv.is_owned = false;
41519 ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
41522 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
41523 LDKChannelUpdateInfo this_ptr_conv;
41524 this_ptr_conv.inner = untag_ptr(this_ptr);
41525 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41526 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41527 this_ptr_conv.is_owned = false;
41528 int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv);
41532 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41533 LDKChannelUpdateInfo this_ptr_conv;
41534 this_ptr_conv.inner = untag_ptr(this_ptr);
41535 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41537 this_ptr_conv.is_owned = false;
41538 ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val);
41541 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) {
41542 LDKChannelUpdateInfo this_ptr_conv;
41543 this_ptr_conv.inner = untag_ptr(this_ptr);
41544 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41545 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41546 this_ptr_conv.is_owned = false;
41547 LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv);
41548 int64_t ret_ref = 0;
41549 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41550 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41554 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41555 LDKChannelUpdateInfo this_ptr_conv;
41556 this_ptr_conv.inner = untag_ptr(this_ptr);
41557 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41558 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41559 this_ptr_conv.is_owned = false;
41560 LDKRoutingFees val_conv;
41561 val_conv.inner = untag_ptr(val);
41562 val_conv.is_owned = ptr_is_owned(val);
41563 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41564 val_conv = RoutingFees_clone(&val_conv);
41565 ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv);
41568 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
41569 LDKChannelUpdateInfo this_ptr_conv;
41570 this_ptr_conv.inner = untag_ptr(this_ptr);
41571 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41573 this_ptr_conv.is_owned = false;
41574 LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv);
41575 int64_t ret_ref = 0;
41576 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41577 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41581 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41582 LDKChannelUpdateInfo this_ptr_conv;
41583 this_ptr_conv.inner = untag_ptr(this_ptr);
41584 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41586 this_ptr_conv.is_owned = false;
41587 LDKChannelUpdate val_conv;
41588 val_conv.inner = untag_ptr(val);
41589 val_conv.is_owned = ptr_is_owned(val);
41590 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41591 val_conv = ChannelUpdate_clone(&val_conv);
41592 ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv);
41595 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) {
41596 LDKRoutingFees fees_arg_conv;
41597 fees_arg_conv.inner = untag_ptr(fees_arg);
41598 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
41599 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
41600 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
41601 LDKChannelUpdate last_update_message_arg_conv;
41602 last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg);
41603 last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg);
41604 CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv);
41605 last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
41606 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);
41607 int64_t ret_ref = 0;
41608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41613 static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) {
41614 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg);
41615 int64_t ret_ref = 0;
41616 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41617 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41620 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41621 LDKChannelUpdateInfo arg_conv;
41622 arg_conv.inner = untag_ptr(arg);
41623 arg_conv.is_owned = ptr_is_owned(arg);
41624 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41625 arg_conv.is_owned = false;
41626 int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv);
41630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41631 LDKChannelUpdateInfo orig_conv;
41632 orig_conv.inner = untag_ptr(orig);
41633 orig_conv.is_owned = ptr_is_owned(orig);
41634 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41635 orig_conv.is_owned = false;
41636 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv);
41637 int64_t ret_ref = 0;
41638 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41639 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41643 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
41644 LDKChannelUpdateInfo obj_conv;
41645 obj_conv.inner = untag_ptr(obj);
41646 obj_conv.is_owned = ptr_is_owned(obj);
41647 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41648 obj_conv.is_owned = false;
41649 LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv);
41650 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41651 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41652 CVec_u8Z_free(ret_var);
41656 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41657 LDKu8slice ser_ref;
41658 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41659 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41660 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
41661 *ret_conv = ChannelUpdateInfo_read(ser_ref);
41662 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41663 return tag_ptr(ret_conv, true);
41666 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41667 LDKChannelInfo this_obj_conv;
41668 this_obj_conv.inner = untag_ptr(this_obj);
41669 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41670 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41671 ChannelInfo_free(this_obj_conv);
41674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
41675 LDKChannelInfo this_ptr_conv;
41676 this_ptr_conv.inner = untag_ptr(this_ptr);
41677 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41679 this_ptr_conv.is_owned = false;
41680 LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
41681 int64_t ret_ref = 0;
41682 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41683 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41687 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41688 LDKChannelInfo this_ptr_conv;
41689 this_ptr_conv.inner = untag_ptr(this_ptr);
41690 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41692 this_ptr_conv.is_owned = false;
41693 LDKChannelFeatures val_conv;
41694 val_conv.inner = untag_ptr(val);
41695 val_conv.is_owned = ptr_is_owned(val);
41696 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41697 val_conv = ChannelFeatures_clone(&val_conv);
41698 ChannelInfo_set_features(&this_ptr_conv, val_conv);
41701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr) {
41702 LDKChannelInfo this_ptr_conv;
41703 this_ptr_conv.inner = untag_ptr(this_ptr);
41704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41706 this_ptr_conv.is_owned = false;
41707 LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv);
41708 int64_t ret_ref = 0;
41709 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41710 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41714 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41715 LDKChannelInfo this_ptr_conv;
41716 this_ptr_conv.inner = untag_ptr(this_ptr);
41717 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41719 this_ptr_conv.is_owned = false;
41720 LDKNodeId val_conv;
41721 val_conv.inner = untag_ptr(val);
41722 val_conv.is_owned = ptr_is_owned(val);
41723 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41724 val_conv = NodeId_clone(&val_conv);
41725 ChannelInfo_set_node_one(&this_ptr_conv, val_conv);
41728 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr) {
41729 LDKChannelInfo this_ptr_conv;
41730 this_ptr_conv.inner = untag_ptr(this_ptr);
41731 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41732 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41733 this_ptr_conv.is_owned = false;
41734 LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
41735 int64_t ret_ref = 0;
41736 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41737 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41742 LDKChannelInfo this_ptr_conv;
41743 this_ptr_conv.inner = untag_ptr(this_ptr);
41744 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41746 this_ptr_conv.is_owned = false;
41747 LDKChannelUpdateInfo val_conv;
41748 val_conv.inner = untag_ptr(val);
41749 val_conv.is_owned = ptr_is_owned(val);
41750 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41751 val_conv = ChannelUpdateInfo_clone(&val_conv);
41752 ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv);
41755 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr) {
41756 LDKChannelInfo this_ptr_conv;
41757 this_ptr_conv.inner = untag_ptr(this_ptr);
41758 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41760 this_ptr_conv.is_owned = false;
41761 LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv);
41762 int64_t ret_ref = 0;
41763 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41764 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41768 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41769 LDKChannelInfo this_ptr_conv;
41770 this_ptr_conv.inner = untag_ptr(this_ptr);
41771 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41773 this_ptr_conv.is_owned = false;
41774 LDKNodeId val_conv;
41775 val_conv.inner = untag_ptr(val);
41776 val_conv.is_owned = ptr_is_owned(val);
41777 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41778 val_conv = NodeId_clone(&val_conv);
41779 ChannelInfo_set_node_two(&this_ptr_conv, val_conv);
41782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr) {
41783 LDKChannelInfo this_ptr_conv;
41784 this_ptr_conv.inner = untag_ptr(this_ptr);
41785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41787 this_ptr_conv.is_owned = false;
41788 LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
41789 int64_t ret_ref = 0;
41790 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41791 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41795 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41796 LDKChannelInfo this_ptr_conv;
41797 this_ptr_conv.inner = untag_ptr(this_ptr);
41798 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41800 this_ptr_conv.is_owned = false;
41801 LDKChannelUpdateInfo val_conv;
41802 val_conv.inner = untag_ptr(val);
41803 val_conv.is_owned = ptr_is_owned(val);
41804 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41805 val_conv = ChannelUpdateInfo_clone(&val_conv);
41806 ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv);
41809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr) {
41810 LDKChannelInfo this_ptr_conv;
41811 this_ptr_conv.inner = untag_ptr(this_ptr);
41812 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41814 this_ptr_conv.is_owned = false;
41815 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
41816 *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv);
41817 int64_t ret_ref = tag_ptr(ret_copy, true);
41821 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41822 LDKChannelInfo this_ptr_conv;
41823 this_ptr_conv.inner = untag_ptr(this_ptr);
41824 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41826 this_ptr_conv.is_owned = false;
41827 void* val_ptr = untag_ptr(val);
41828 CHECK_ACCESS(val_ptr);
41829 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
41830 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
41831 ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
41834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
41835 LDKChannelInfo this_ptr_conv;
41836 this_ptr_conv.inner = untag_ptr(this_ptr);
41837 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41839 this_ptr_conv.is_owned = false;
41840 LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
41841 int64_t ret_ref = 0;
41842 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41843 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41847 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41848 LDKChannelInfo this_ptr_conv;
41849 this_ptr_conv.inner = untag_ptr(this_ptr);
41850 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41851 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41852 this_ptr_conv.is_owned = false;
41853 LDKChannelAnnouncement val_conv;
41854 val_conv.inner = untag_ptr(val);
41855 val_conv.is_owned = ptr_is_owned(val);
41856 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41857 val_conv = ChannelAnnouncement_clone(&val_conv);
41858 ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
41861 static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
41862 LDKChannelInfo ret_var = ChannelInfo_clone(arg);
41863 int64_t ret_ref = 0;
41864 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41865 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41868 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41869 LDKChannelInfo arg_conv;
41870 arg_conv.inner = untag_ptr(arg);
41871 arg_conv.is_owned = ptr_is_owned(arg);
41872 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41873 arg_conv.is_owned = false;
41874 int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv);
41878 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41879 LDKChannelInfo orig_conv;
41880 orig_conv.inner = untag_ptr(orig);
41881 orig_conv.is_owned = ptr_is_owned(orig);
41882 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41883 orig_conv.is_owned = false;
41884 LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
41885 int64_t ret_ref = 0;
41886 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41887 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41891 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) {
41892 LDKChannelInfo this_arg_conv;
41893 this_arg_conv.inner = untag_ptr(this_arg);
41894 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41895 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41896 this_arg_conv.is_owned = false;
41897 LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags);
41898 int64_t ret_ref = 0;
41899 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41900 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41904 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
41905 LDKChannelInfo obj_conv;
41906 obj_conv.inner = untag_ptr(obj);
41907 obj_conv.is_owned = ptr_is_owned(obj);
41908 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41909 obj_conv.is_owned = false;
41910 LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
41911 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41912 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41913 CVec_u8Z_free(ret_var);
41917 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41918 LDKu8slice ser_ref;
41919 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41920 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41921 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
41922 *ret_conv = ChannelInfo_read(ser_ref);
41923 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41924 return tag_ptr(ret_conv, true);
41927 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41928 LDKDirectedChannelInfo this_obj_conv;
41929 this_obj_conv.inner = untag_ptr(this_obj);
41930 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41931 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41932 DirectedChannelInfo_free(this_obj_conv);
41935 static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) {
41936 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg);
41937 int64_t ret_ref = 0;
41938 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41939 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41942 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41943 LDKDirectedChannelInfo arg_conv;
41944 arg_conv.inner = untag_ptr(arg);
41945 arg_conv.is_owned = ptr_is_owned(arg);
41946 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41947 arg_conv.is_owned = false;
41948 int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv);
41952 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41953 LDKDirectedChannelInfo orig_conv;
41954 orig_conv.inner = untag_ptr(orig);
41955 orig_conv.is_owned = ptr_is_owned(orig);
41956 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41957 orig_conv.is_owned = false;
41958 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv);
41959 int64_t ret_ref = 0;
41960 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41961 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41965 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel(JNIEnv *env, jclass clz, int64_t this_arg) {
41966 LDKDirectedChannelInfo 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 LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv);
41972 int64_t ret_ref = 0;
41973 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41974 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41978 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1direction(JNIEnv *env, jclass clz, int64_t this_arg) {
41979 LDKDirectedChannelInfo this_arg_conv;
41980 this_arg_conv.inner = untag_ptr(this_arg);
41981 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41983 this_arg_conv.is_owned = false;
41984 LDKChannelUpdateInfo ret_var = DirectedChannelInfo_direction(&this_arg_conv);
41985 int64_t ret_ref = 0;
41986 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41987 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41991 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) {
41992 LDKDirectedChannelInfo this_arg_conv;
41993 this_arg_conv.inner = untag_ptr(this_arg);
41994 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41995 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41996 this_arg_conv.is_owned = false;
41997 int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv);
42001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_arg) {
42002 LDKDirectedChannelInfo this_arg_conv;
42003 this_arg_conv.inner = untag_ptr(this_arg);
42004 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42006 this_arg_conv.is_owned = false;
42007 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
42008 *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv);
42009 int64_t ret_ref = tag_ptr(ret_copy, true);
42013 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
42014 if (!ptr_is_owned(this_ptr)) return;
42015 void* this_ptr_ptr = untag_ptr(this_ptr);
42016 CHECK_ACCESS(this_ptr_ptr);
42017 LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr);
42018 FREE(untag_ptr(this_ptr));
42019 EffectiveCapacity_free(this_ptr_conv);
42022 static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) {
42023 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
42024 *ret_copy = EffectiveCapacity_clone(arg);
42025 int64_t ret_ref = tag_ptr(ret_copy, true);
42028 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42029 LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg);
42030 int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv);
42034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42035 LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig);
42036 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
42037 *ret_copy = EffectiveCapacity_clone(orig_conv);
42038 int64_t ret_ref = tag_ptr(ret_copy, true);
42042 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1exact_1liquidity(JNIEnv *env, jclass clz, int64_t liquidity_msat) {
42043 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
42044 *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat);
42045 int64_t ret_ref = tag_ptr(ret_copy, true);
42049 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1maximum_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) {
42050 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
42051 *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat);
42052 int64_t ret_ref = tag_ptr(ret_copy, true);
42056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total(JNIEnv *env, jclass clz, int64_t capacity_msat, int64_t htlc_maximum_msat) {
42057 void* htlc_maximum_msat_ptr = untag_ptr(htlc_maximum_msat);
42058 CHECK_ACCESS(htlc_maximum_msat_ptr);
42059 LDKCOption_u64Z htlc_maximum_msat_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_ptr);
42060 htlc_maximum_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat));
42061 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
42062 *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat_conv);
42063 int64_t ret_ref = tag_ptr(ret_copy, true);
42067 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1infinite(JNIEnv *env, jclass clz) {
42068 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
42069 *ret_copy = EffectiveCapacity_infinite();
42070 int64_t ret_ref = tag_ptr(ret_copy, true);
42074 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1unknown(JNIEnv *env, jclass clz) {
42075 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
42076 *ret_copy = EffectiveCapacity_unknown();
42077 int64_t ret_ref = tag_ptr(ret_copy, true);
42081 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1as_1msat(JNIEnv *env, jclass clz, int64_t this_arg) {
42082 LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg);
42083 int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv);
42087 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42088 LDKRoutingFees this_obj_conv;
42089 this_obj_conv.inner = untag_ptr(this_obj);
42090 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42092 RoutingFees_free(this_obj_conv);
42095 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
42096 LDKRoutingFees this_ptr_conv;
42097 this_ptr_conv.inner = untag_ptr(this_ptr);
42098 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42099 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42100 this_ptr_conv.is_owned = false;
42101 int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv);
42105 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
42106 LDKRoutingFees this_ptr_conv;
42107 this_ptr_conv.inner = untag_ptr(this_ptr);
42108 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42110 this_ptr_conv.is_owned = false;
42111 RoutingFees_set_base_msat(&this_ptr_conv, val);
42114 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
42115 LDKRoutingFees this_ptr_conv;
42116 this_ptr_conv.inner = untag_ptr(this_ptr);
42117 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42118 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42119 this_ptr_conv.is_owned = false;
42120 int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv);
42124 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
42125 LDKRoutingFees this_ptr_conv;
42126 this_ptr_conv.inner = untag_ptr(this_ptr);
42127 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42128 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42129 this_ptr_conv.is_owned = false;
42130 RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
42133 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) {
42134 LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
42135 int64_t ret_ref = 0;
42136 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42137 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42141 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42142 LDKRoutingFees a_conv;
42143 a_conv.inner = untag_ptr(a);
42144 a_conv.is_owned = ptr_is_owned(a);
42145 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42146 a_conv.is_owned = false;
42147 LDKRoutingFees b_conv;
42148 b_conv.inner = untag_ptr(b);
42149 b_conv.is_owned = ptr_is_owned(b);
42150 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42151 b_conv.is_owned = false;
42152 jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv);
42156 static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) {
42157 LDKRoutingFees ret_var = RoutingFees_clone(arg);
42158 int64_t ret_ref = 0;
42159 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42160 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42163 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42164 LDKRoutingFees arg_conv;
42165 arg_conv.inner = untag_ptr(arg);
42166 arg_conv.is_owned = ptr_is_owned(arg);
42167 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42168 arg_conv.is_owned = false;
42169 int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv);
42173 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42174 LDKRoutingFees orig_conv;
42175 orig_conv.inner = untag_ptr(orig);
42176 orig_conv.is_owned = ptr_is_owned(orig);
42177 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42178 orig_conv.is_owned = false;
42179 LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
42180 int64_t ret_ref = 0;
42181 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42182 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42186 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *env, jclass clz, int64_t o) {
42187 LDKRoutingFees o_conv;
42188 o_conv.inner = untag_ptr(o);
42189 o_conv.is_owned = ptr_is_owned(o);
42190 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42191 o_conv.is_owned = false;
42192 int64_t ret_conv = RoutingFees_hash(&o_conv);
42196 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv *env, jclass clz, int64_t obj) {
42197 LDKRoutingFees obj_conv;
42198 obj_conv.inner = untag_ptr(obj);
42199 obj_conv.is_owned = ptr_is_owned(obj);
42200 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42201 obj_conv.is_owned = false;
42202 LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
42203 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42204 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42205 CVec_u8Z_free(ret_var);
42209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42210 LDKu8slice ser_ref;
42211 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42212 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42213 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
42214 *ret_conv = RoutingFees_read(ser_ref);
42215 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42216 return tag_ptr(ret_conv, true);
42219 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42220 LDKNodeAnnouncementInfo this_obj_conv;
42221 this_obj_conv.inner = untag_ptr(this_obj);
42222 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42224 NodeAnnouncementInfo_free(this_obj_conv);
42227 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
42228 LDKNodeAnnouncementInfo this_ptr_conv;
42229 this_ptr_conv.inner = untag_ptr(this_ptr);
42230 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42232 this_ptr_conv.is_owned = false;
42233 LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
42234 int64_t ret_ref = 0;
42235 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42236 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42240 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
42241 LDKNodeAnnouncementInfo this_ptr_conv;
42242 this_ptr_conv.inner = untag_ptr(this_ptr);
42243 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42245 this_ptr_conv.is_owned = false;
42246 LDKNodeFeatures val_conv;
42247 val_conv.inner = untag_ptr(val);
42248 val_conv.is_owned = ptr_is_owned(val);
42249 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42250 val_conv = NodeFeatures_clone(&val_conv);
42251 NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv);
42254 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) {
42255 LDKNodeAnnouncementInfo this_ptr_conv;
42256 this_ptr_conv.inner = untag_ptr(this_ptr);
42257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42259 this_ptr_conv.is_owned = false;
42260 int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
42264 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
42265 LDKNodeAnnouncementInfo this_ptr_conv;
42266 this_ptr_conv.inner = untag_ptr(this_ptr);
42267 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42269 this_ptr_conv.is_owned = false;
42270 NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
42273 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) {
42274 LDKNodeAnnouncementInfo this_ptr_conv;
42275 this_ptr_conv.inner = untag_ptr(this_ptr);
42276 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42278 this_ptr_conv.is_owned = false;
42279 int8_tArray ret_arr = (*env)->NewByteArray(env, 3);
42280 (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv));
42284 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42285 LDKNodeAnnouncementInfo this_ptr_conv;
42286 this_ptr_conv.inner = untag_ptr(this_ptr);
42287 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42288 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42289 this_ptr_conv.is_owned = false;
42290 LDKThreeBytes val_ref;
42291 CHECK((*env)->GetArrayLength(env, val) == 3);
42292 (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data);
42293 NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref);
42296 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
42297 LDKNodeAnnouncementInfo this_ptr_conv;
42298 this_ptr_conv.inner = untag_ptr(this_ptr);
42299 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42301 this_ptr_conv.is_owned = false;
42302 LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv);
42303 int64_t ret_ref = 0;
42304 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42305 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42309 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
42310 LDKNodeAnnouncementInfo this_ptr_conv;
42311 this_ptr_conv.inner = untag_ptr(this_ptr);
42312 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42314 this_ptr_conv.is_owned = false;
42315 LDKNodeAlias val_conv;
42316 val_conv.inner = untag_ptr(val);
42317 val_conv.is_owned = ptr_is_owned(val);
42318 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42319 val_conv = NodeAlias_clone(&val_conv);
42320 NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv);
42323 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) {
42324 LDKNodeAnnouncementInfo this_ptr_conv;
42325 this_ptr_conv.inner = untag_ptr(this_ptr);
42326 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42327 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42328 this_ptr_conv.is_owned = false;
42329 LDKCVec_NetAddressZ ret_var = NodeAnnouncementInfo_get_addresses(&this_ptr_conv);
42330 int64_tArray ret_arr = NULL;
42331 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
42332 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
42333 for (size_t m = 0; m < ret_var.datalen; m++) {
42334 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
42335 *ret_conv_12_copy = ret_var.data[m];
42336 int64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
42337 ret_arr_ptr[m] = ret_conv_12_ref;
42339 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
42340 FREE(ret_var.data);
42344 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
42345 LDKNodeAnnouncementInfo this_ptr_conv;
42346 this_ptr_conv.inner = untag_ptr(this_ptr);
42347 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42349 this_ptr_conv.is_owned = false;
42350 LDKCVec_NetAddressZ val_constr;
42351 val_constr.datalen = (*env)->GetArrayLength(env, val);
42352 if (val_constr.datalen > 0)
42353 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
42355 val_constr.data = NULL;
42356 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
42357 for (size_t m = 0; m < val_constr.datalen; m++) {
42358 int64_t val_conv_12 = val_vals[m];
42359 void* val_conv_12_ptr = untag_ptr(val_conv_12);
42360 CHECK_ACCESS(val_conv_12_ptr);
42361 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
42362 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
42363 val_constr.data[m] = val_conv_12_conv;
42365 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
42366 NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
42369 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
42370 LDKNodeAnnouncementInfo this_ptr_conv;
42371 this_ptr_conv.inner = untag_ptr(this_ptr);
42372 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42373 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42374 this_ptr_conv.is_owned = false;
42375 LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
42376 int64_t ret_ref = 0;
42377 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42378 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
42383 LDKNodeAnnouncementInfo this_ptr_conv;
42384 this_ptr_conv.inner = untag_ptr(this_ptr);
42385 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42386 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42387 this_ptr_conv.is_owned = false;
42388 LDKNodeAnnouncement val_conv;
42389 val_conv.inner = untag_ptr(val);
42390 val_conv.is_owned = ptr_is_owned(val);
42391 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42392 val_conv = NodeAnnouncement_clone(&val_conv);
42393 NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv);
42396 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) {
42397 LDKNodeFeatures features_arg_conv;
42398 features_arg_conv.inner = untag_ptr(features_arg);
42399 features_arg_conv.is_owned = ptr_is_owned(features_arg);
42400 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
42401 features_arg_conv = NodeFeatures_clone(&features_arg_conv);
42402 LDKThreeBytes rgb_arg_ref;
42403 CHECK((*env)->GetArrayLength(env, rgb_arg) == 3);
42404 (*env)->GetByteArrayRegion(env, rgb_arg, 0, 3, rgb_arg_ref.data);
42405 LDKNodeAlias alias_arg_conv;
42406 alias_arg_conv.inner = untag_ptr(alias_arg);
42407 alias_arg_conv.is_owned = ptr_is_owned(alias_arg);
42408 CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv);
42409 alias_arg_conv = NodeAlias_clone(&alias_arg_conv);
42410 LDKCVec_NetAddressZ addresses_arg_constr;
42411 addresses_arg_constr.datalen = (*env)->GetArrayLength(env, addresses_arg);
42412 if (addresses_arg_constr.datalen > 0)
42413 addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
42415 addresses_arg_constr.data = NULL;
42416 int64_t* addresses_arg_vals = (*env)->GetLongArrayElements (env, addresses_arg, NULL);
42417 for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
42418 int64_t addresses_arg_conv_12 = addresses_arg_vals[m];
42419 void* addresses_arg_conv_12_ptr = untag_ptr(addresses_arg_conv_12);
42420 CHECK_ACCESS(addresses_arg_conv_12_ptr);
42421 LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
42422 addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
42424 (*env)->ReleaseLongArrayElements(env, addresses_arg, addresses_arg_vals, 0);
42425 LDKNodeAnnouncement announcement_message_arg_conv;
42426 announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg);
42427 announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg);
42428 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
42429 announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
42430 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, announcement_message_arg_conv);
42431 int64_t ret_ref = 0;
42432 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42433 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42437 static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) {
42438 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg);
42439 int64_t ret_ref = 0;
42440 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42441 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42444 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42445 LDKNodeAnnouncementInfo arg_conv;
42446 arg_conv.inner = untag_ptr(arg);
42447 arg_conv.is_owned = ptr_is_owned(arg);
42448 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42449 arg_conv.is_owned = false;
42450 int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv);
42454 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42455 LDKNodeAnnouncementInfo orig_conv;
42456 orig_conv.inner = untag_ptr(orig);
42457 orig_conv.is_owned = ptr_is_owned(orig);
42458 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42459 orig_conv.is_owned = false;
42460 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv);
42461 int64_t ret_ref = 0;
42462 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42463 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42467 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
42468 LDKNodeAnnouncementInfo obj_conv;
42469 obj_conv.inner = untag_ptr(obj);
42470 obj_conv.is_owned = ptr_is_owned(obj);
42471 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42472 obj_conv.is_owned = false;
42473 LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
42474 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42475 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42476 CVec_u8Z_free(ret_var);
42480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42481 LDKu8slice ser_ref;
42482 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42483 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42484 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
42485 *ret_conv = NodeAnnouncementInfo_read(ser_ref);
42486 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42487 return tag_ptr(ret_conv, true);
42490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42491 LDKNodeAlias this_obj_conv;
42492 this_obj_conv.inner = untag_ptr(this_obj);
42493 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42495 NodeAlias_free(this_obj_conv);
42498 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
42499 LDKNodeAlias this_ptr_conv;
42500 this_ptr_conv.inner = untag_ptr(this_ptr);
42501 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42503 this_ptr_conv.is_owned = false;
42504 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42505 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAlias_get_a(&this_ptr_conv));
42509 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42510 LDKNodeAlias this_ptr_conv;
42511 this_ptr_conv.inner = untag_ptr(this_ptr);
42512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42514 this_ptr_conv.is_owned = false;
42515 LDKThirtyTwoBytes val_ref;
42516 CHECK((*env)->GetArrayLength(env, val) == 32);
42517 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
42518 NodeAlias_set_a(&this_ptr_conv, val_ref);
42521 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) {
42522 LDKThirtyTwoBytes a_arg_ref;
42523 CHECK((*env)->GetArrayLength(env, a_arg) == 32);
42524 (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data);
42525 LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref);
42526 int64_t ret_ref = 0;
42527 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42528 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42532 static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) {
42533 LDKNodeAlias ret_var = NodeAlias_clone(arg);
42534 int64_t ret_ref = 0;
42535 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42536 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42539 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42540 LDKNodeAlias arg_conv;
42541 arg_conv.inner = untag_ptr(arg);
42542 arg_conv.is_owned = ptr_is_owned(arg);
42543 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42544 arg_conv.is_owned = false;
42545 int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv);
42549 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42550 LDKNodeAlias orig_conv;
42551 orig_conv.inner = untag_ptr(orig);
42552 orig_conv.is_owned = ptr_is_owned(orig);
42553 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42554 orig_conv.is_owned = false;
42555 LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv);
42556 int64_t ret_ref = 0;
42557 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42558 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42562 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write(JNIEnv *env, jclass clz, int64_t obj) {
42563 LDKNodeAlias obj_conv;
42564 obj_conv.inner = untag_ptr(obj);
42565 obj_conv.is_owned = ptr_is_owned(obj);
42566 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42567 obj_conv.is_owned = false;
42568 LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv);
42569 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42570 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42571 CVec_u8Z_free(ret_var);
42575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42576 LDKu8slice ser_ref;
42577 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42578 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42579 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
42580 *ret_conv = NodeAlias_read(ser_ref);
42581 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42582 return tag_ptr(ret_conv, true);
42585 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42586 LDKNodeInfo this_obj_conv;
42587 this_obj_conv.inner = untag_ptr(this_obj);
42588 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42590 NodeInfo_free(this_obj_conv);
42593 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
42594 LDKNodeInfo this_ptr_conv;
42595 this_ptr_conv.inner = untag_ptr(this_ptr);
42596 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42598 this_ptr_conv.is_owned = false;
42599 LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv);
42600 int64_tArray ret_arr = NULL;
42601 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
42602 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
42603 for (size_t g = 0; g < ret_var.datalen; g++) {
42604 int64_t ret_conv_6_conv = ret_var.data[g];
42605 ret_arr_ptr[g] = ret_conv_6_conv;
42607 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
42608 FREE(ret_var.data);
42612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
42613 LDKNodeInfo this_ptr_conv;
42614 this_ptr_conv.inner = untag_ptr(this_ptr);
42615 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42616 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42617 this_ptr_conv.is_owned = false;
42618 LDKCVec_u64Z val_constr;
42619 val_constr.datalen = (*env)->GetArrayLength(env, val);
42620 if (val_constr.datalen > 0)
42621 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
42623 val_constr.data = NULL;
42624 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
42625 for (size_t g = 0; g < val_constr.datalen; g++) {
42626 int64_t val_conv_6 = val_vals[g];
42627 val_constr.data[g] = val_conv_6;
42629 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
42630 NodeInfo_set_channels(&this_ptr_conv, val_constr);
42633 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) {
42634 LDKNodeInfo this_ptr_conv;
42635 this_ptr_conv.inner = untag_ptr(this_ptr);
42636 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42638 this_ptr_conv.is_owned = false;
42639 LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
42640 int64_t ret_ref = 0;
42641 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42642 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42646 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) {
42647 LDKNodeInfo this_ptr_conv;
42648 this_ptr_conv.inner = untag_ptr(this_ptr);
42649 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42650 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42651 this_ptr_conv.is_owned = false;
42652 LDKRoutingFees val_conv;
42653 val_conv.inner = untag_ptr(val);
42654 val_conv.is_owned = ptr_is_owned(val);
42655 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42656 val_conv = RoutingFees_clone(&val_conv);
42657 NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv);
42660 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr) {
42661 LDKNodeInfo this_ptr_conv;
42662 this_ptr_conv.inner = untag_ptr(this_ptr);
42663 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42665 this_ptr_conv.is_owned = false;
42666 LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
42667 int64_t ret_ref = 0;
42668 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42669 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42673 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
42674 LDKNodeInfo this_ptr_conv;
42675 this_ptr_conv.inner = untag_ptr(this_ptr);
42676 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42677 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42678 this_ptr_conv.is_owned = false;
42679 LDKNodeAnnouncementInfo val_conv;
42680 val_conv.inner = untag_ptr(val);
42681 val_conv.is_owned = ptr_is_owned(val);
42682 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42683 val_conv = NodeAnnouncementInfo_clone(&val_conv);
42684 NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
42687 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) {
42688 LDKCVec_u64Z channels_arg_constr;
42689 channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg);
42690 if (channels_arg_constr.datalen > 0)
42691 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
42693 channels_arg_constr.data = NULL;
42694 int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL);
42695 for (size_t g = 0; g < channels_arg_constr.datalen; g++) {
42696 int64_t channels_arg_conv_6 = channels_arg_vals[g];
42697 channels_arg_constr.data[g] = channels_arg_conv_6;
42699 (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0);
42700 LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
42701 lowest_inbound_channel_fees_arg_conv.inner = untag_ptr(lowest_inbound_channel_fees_arg);
42702 lowest_inbound_channel_fees_arg_conv.is_owned = ptr_is_owned(lowest_inbound_channel_fees_arg);
42703 CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv);
42704 lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv);
42705 LDKNodeAnnouncementInfo announcement_info_arg_conv;
42706 announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg);
42707 announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg);
42708 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
42709 announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
42710 LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
42711 int64_t ret_ref = 0;
42712 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42713 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42717 static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) {
42718 LDKNodeInfo ret_var = NodeInfo_clone(arg);
42719 int64_t ret_ref = 0;
42720 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42721 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42724 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42725 LDKNodeInfo arg_conv;
42726 arg_conv.inner = untag_ptr(arg);
42727 arg_conv.is_owned = ptr_is_owned(arg);
42728 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42729 arg_conv.is_owned = false;
42730 int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv);
42734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42735 LDKNodeInfo orig_conv;
42736 orig_conv.inner = untag_ptr(orig);
42737 orig_conv.is_owned = ptr_is_owned(orig);
42738 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42739 orig_conv.is_owned = false;
42740 LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv);
42741 int64_t ret_ref = 0;
42742 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42743 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42747 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
42748 LDKNodeInfo obj_conv;
42749 obj_conv.inner = untag_ptr(obj);
42750 obj_conv.is_owned = ptr_is_owned(obj);
42751 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42752 obj_conv.is_owned = false;
42753 LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
42754 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42755 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42756 CVec_u8Z_free(ret_var);
42760 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42761 LDKu8slice ser_ref;
42762 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42763 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42764 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
42765 *ret_conv = NodeInfo_read(ser_ref);
42766 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42767 return tag_ptr(ret_conv, true);
42770 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv *env, jclass clz, int64_t obj) {
42771 LDKNetworkGraph obj_conv;
42772 obj_conv.inner = untag_ptr(obj);
42773 obj_conv.is_owned = ptr_is_owned(obj);
42774 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42775 obj_conv.is_owned = false;
42776 LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
42777 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42778 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42779 CVec_u8Z_free(ret_var);
42783 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
42784 LDKu8slice ser_ref;
42785 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42786 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42787 void* arg_ptr = untag_ptr(arg);
42788 CHECK_ACCESS(arg_ptr);
42789 LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
42790 if (arg_conv.free == LDKLogger_JCalls_free) {
42791 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
42792 LDKLogger_JCalls_cloned(&arg_conv);
42794 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
42795 *ret_conv = NetworkGraph_read(ser_ref, arg_conv);
42796 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42797 return tag_ptr(ret_conv, true);
42800 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, int8_tArray genesis_hash, int64_t logger) {
42801 LDKThirtyTwoBytes genesis_hash_ref;
42802 CHECK((*env)->GetArrayLength(env, genesis_hash) == 32);
42803 (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_ref.data);
42804 void* logger_ptr = untag_ptr(logger);
42805 CHECK_ACCESS(logger_ptr);
42806 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
42807 if (logger_conv.free == LDKLogger_JCalls_free) {
42808 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
42809 LDKLogger_JCalls_cloned(&logger_conv);
42811 LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref, logger_conv);
42812 int64_t ret_ref = 0;
42813 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42814 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42818 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JNIEnv *env, jclass clz, int64_t this_arg) {
42819 LDKNetworkGraph this_arg_conv;
42820 this_arg_conv.inner = untag_ptr(this_arg);
42821 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42822 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42823 this_arg_conv.is_owned = false;
42824 LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv);
42825 int64_t ret_ref = 0;
42826 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42827 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42831 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
42832 LDKNetworkGraph this_arg_conv;
42833 this_arg_conv.inner = untag_ptr(this_arg);
42834 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42836 this_arg_conv.is_owned = false;
42837 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
42838 *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv);
42839 int64_t ret_ref = tag_ptr(ret_copy, true);
42843 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) {
42844 LDKNetworkGraph this_arg_conv;
42845 this_arg_conv.inner = untag_ptr(this_arg);
42846 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42848 this_arg_conv.is_owned = false;
42849 NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp);
42852 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) {
42853 LDKNetworkGraph this_arg_conv;
42854 this_arg_conv.inner = untag_ptr(this_arg);
42855 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42856 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42857 this_arg_conv.is_owned = false;
42858 LDKNodeAnnouncement msg_conv;
42859 msg_conv.inner = untag_ptr(msg);
42860 msg_conv.is_owned = ptr_is_owned(msg);
42861 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
42862 msg_conv.is_owned = false;
42863 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
42864 *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv);
42865 return tag_ptr(ret_conv, true);
42868 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) {
42869 LDKNetworkGraph this_arg_conv;
42870 this_arg_conv.inner = untag_ptr(this_arg);
42871 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42873 this_arg_conv.is_owned = false;
42874 LDKUnsignedNodeAnnouncement msg_conv;
42875 msg_conv.inner = untag_ptr(msg);
42876 msg_conv.is_owned = ptr_is_owned(msg);
42877 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
42878 msg_conv.is_owned = false;
42879 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
42880 *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv);
42881 return tag_ptr(ret_conv, true);
42884 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) {
42885 LDKNetworkGraph this_arg_conv;
42886 this_arg_conv.inner = untag_ptr(this_arg);
42887 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42888 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42889 this_arg_conv.is_owned = false;
42890 LDKChannelAnnouncement msg_conv;
42891 msg_conv.inner = untag_ptr(msg);
42892 msg_conv.is_owned = ptr_is_owned(msg);
42893 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
42894 msg_conv.is_owned = false;
42895 void* chain_access_ptr = untag_ptr(chain_access);
42896 CHECK_ACCESS(chain_access_ptr);
42897 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
42898 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
42899 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
42900 // Manually implement clone for Java trait instances
42901 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
42902 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
42903 LDKAccess_JCalls_cloned(&chain_access_conv.some);
42906 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
42907 *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
42908 return tag_ptr(ret_conv, true);
42911 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) {
42912 LDKNetworkGraph this_arg_conv;
42913 this_arg_conv.inner = untag_ptr(this_arg);
42914 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42916 this_arg_conv.is_owned = false;
42917 LDKUnsignedChannelAnnouncement msg_conv;
42918 msg_conv.inner = untag_ptr(msg);
42919 msg_conv.is_owned = ptr_is_owned(msg);
42920 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
42921 msg_conv.is_owned = false;
42922 void* chain_access_ptr = untag_ptr(chain_access);
42923 CHECK_ACCESS(chain_access_ptr);
42924 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
42925 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
42926 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
42927 // Manually implement clone for Java trait instances
42928 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
42929 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
42930 LDKAccess_JCalls_cloned(&chain_access_conv.some);
42933 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
42934 *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
42935 return tag_ptr(ret_conv, true);
42938 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) {
42939 LDKNetworkGraph 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 LDKChannelFeatures features_conv;
42945 features_conv.inner = untag_ptr(features);
42946 features_conv.is_owned = ptr_is_owned(features);
42947 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
42948 features_conv = ChannelFeatures_clone(&features_conv);
42949 LDKPublicKey node_id_1_ref;
42950 CHECK((*env)->GetArrayLength(env, node_id_1) == 33);
42951 (*env)->GetByteArrayRegion(env, node_id_1, 0, 33, node_id_1_ref.compressed_form);
42952 LDKPublicKey node_id_2_ref;
42953 CHECK((*env)->GetArrayLength(env, node_id_2) == 33);
42954 (*env)->GetByteArrayRegion(env, node_id_2, 0, 33, node_id_2_ref.compressed_form);
42955 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
42956 *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);
42957 return tag_ptr(ret_conv, true);
42960 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) {
42961 LDKNetworkGraph this_arg_conv;
42962 this_arg_conv.inner = untag_ptr(this_arg);
42963 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42964 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42965 this_arg_conv.is_owned = false;
42966 NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
42969 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray _node_id, jboolean is_permanent) {
42970 LDKNetworkGraph this_arg_conv;
42971 this_arg_conv.inner = untag_ptr(this_arg);
42972 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42974 this_arg_conv.is_owned = false;
42975 LDKPublicKey _node_id_ref;
42976 CHECK((*env)->GetArrayLength(env, _node_id) == 33);
42977 (*env)->GetByteArrayRegion(env, _node_id, 0, 33, _node_id_ref.compressed_form);
42978 NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent);
42981 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
42982 LDKNetworkGraph this_arg_conv;
42983 this_arg_conv.inner = untag_ptr(this_arg);
42984 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42986 this_arg_conv.is_owned = false;
42987 NetworkGraph_remove_stale_channels(&this_arg_conv);
42990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) {
42991 LDKNetworkGraph this_arg_conv;
42992 this_arg_conv.inner = untag_ptr(this_arg);
42993 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42994 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42995 this_arg_conv.is_owned = false;
42996 NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
42999 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
43000 LDKNetworkGraph this_arg_conv;
43001 this_arg_conv.inner = untag_ptr(this_arg);
43002 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43004 this_arg_conv.is_owned = false;
43005 LDKChannelUpdate msg_conv;
43006 msg_conv.inner = untag_ptr(msg);
43007 msg_conv.is_owned = ptr_is_owned(msg);
43008 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
43009 msg_conv.is_owned = false;
43010 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
43011 *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv);
43012 return tag_ptr(ret_conv, true);
43015 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
43016 LDKNetworkGraph this_arg_conv;
43017 this_arg_conv.inner = untag_ptr(this_arg);
43018 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43020 this_arg_conv.is_owned = false;
43021 LDKUnsignedChannelUpdate msg_conv;
43022 msg_conv.inner = untag_ptr(msg);
43023 msg_conv.is_owned = ptr_is_owned(msg);
43024 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
43025 msg_conv.is_owned = false;
43026 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
43027 *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv);
43028 return tag_ptr(ret_conv, true);
43031 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) {
43032 LDKReadOnlyNetworkGraph this_arg_conv;
43033 this_arg_conv.inner = untag_ptr(this_arg);
43034 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43036 this_arg_conv.is_owned = false;
43037 LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id);
43038 int64_t ret_ref = 0;
43039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43044 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
43045 LDKReadOnlyNetworkGraph this_arg_conv;
43046 this_arg_conv.inner = untag_ptr(this_arg);
43047 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43048 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43049 this_arg_conv.is_owned = false;
43050 LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv);
43051 int64_tArray ret_arr = NULL;
43052 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
43053 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
43054 for (size_t g = 0; g < ret_var.datalen; g++) {
43055 int64_t ret_conv_6_conv = ret_var.data[g];
43056 ret_arr_ptr[g] = ret_conv_6_conv;
43058 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
43059 FREE(ret_var.data);
43063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1node(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
43064 LDKReadOnlyNetworkGraph this_arg_conv;
43065 this_arg_conv.inner = untag_ptr(this_arg);
43066 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43067 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43068 this_arg_conv.is_owned = false;
43069 LDKNodeId node_id_conv;
43070 node_id_conv.inner = untag_ptr(node_id);
43071 node_id_conv.is_owned = ptr_is_owned(node_id);
43072 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
43073 node_id_conv.is_owned = false;
43074 LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv);
43075 int64_t ret_ref = 0;
43076 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43077 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43081 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1nodes(JNIEnv *env, jclass clz, int64_t this_arg) {
43082 LDKReadOnlyNetworkGraph 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 LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv);
43088 int64_tArray ret_arr = NULL;
43089 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
43090 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
43091 for (size_t i = 0; i < ret_var.datalen; i++) {
43092 LDKNodeId ret_conv_8_var = ret_var.data[i];
43093 int64_t ret_conv_8_ref = 0;
43094 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var);
43095 ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned);
43096 ret_arr_ptr[i] = ret_conv_8_ref;
43098 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
43099 FREE(ret_var.data);
43103 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey) {
43104 LDKReadOnlyNetworkGraph this_arg_conv;
43105 this_arg_conv.inner = untag_ptr(this_arg);
43106 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43108 this_arg_conv.is_owned = false;
43109 LDKPublicKey pubkey_ref;
43110 CHECK((*env)->GetArrayLength(env, pubkey) == 33);
43111 (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
43112 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
43113 *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref);
43114 int64_t ret_ref = tag_ptr(ret_copy, true);
43118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43119 LDKRouteHop this_obj_conv;
43120 this_obj_conv.inner = untag_ptr(this_obj);
43121 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43122 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43123 RouteHop_free(this_obj_conv);
43126 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
43127 LDKRouteHop this_ptr_conv;
43128 this_ptr_conv.inner = untag_ptr(this_ptr);
43129 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43130 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43131 this_ptr_conv.is_owned = false;
43132 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
43133 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form);
43137 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
43138 LDKRouteHop this_ptr_conv;
43139 this_ptr_conv.inner = untag_ptr(this_ptr);
43140 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43141 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43142 this_ptr_conv.is_owned = false;
43143 LDKPublicKey val_ref;
43144 CHECK((*env)->GetArrayLength(env, val) == 33);
43145 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
43146 RouteHop_set_pubkey(&this_ptr_conv, val_ref);
43149 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
43150 LDKRouteHop this_ptr_conv;
43151 this_ptr_conv.inner = untag_ptr(this_ptr);
43152 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43153 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43154 this_ptr_conv.is_owned = false;
43155 LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
43156 int64_t ret_ref = 0;
43157 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43158 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43162 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43163 LDKRouteHop this_ptr_conv;
43164 this_ptr_conv.inner = untag_ptr(this_ptr);
43165 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43166 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43167 this_ptr_conv.is_owned = false;
43168 LDKNodeFeatures val_conv;
43169 val_conv.inner = untag_ptr(val);
43170 val_conv.is_owned = ptr_is_owned(val);
43171 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43172 val_conv = NodeFeatures_clone(&val_conv);
43173 RouteHop_set_node_features(&this_ptr_conv, val_conv);
43176 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
43177 LDKRouteHop this_ptr_conv;
43178 this_ptr_conv.inner = untag_ptr(this_ptr);
43179 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43181 this_ptr_conv.is_owned = false;
43182 int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv);
43186 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43187 LDKRouteHop this_ptr_conv;
43188 this_ptr_conv.inner = untag_ptr(this_ptr);
43189 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43191 this_ptr_conv.is_owned = false;
43192 RouteHop_set_short_channel_id(&this_ptr_conv, val);
43195 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
43196 LDKRouteHop this_ptr_conv;
43197 this_ptr_conv.inner = untag_ptr(this_ptr);
43198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43200 this_ptr_conv.is_owned = false;
43201 LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
43202 int64_t ret_ref = 0;
43203 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43204 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43208 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43209 LDKRouteHop this_ptr_conv;
43210 this_ptr_conv.inner = untag_ptr(this_ptr);
43211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43213 this_ptr_conv.is_owned = false;
43214 LDKChannelFeatures val_conv;
43215 val_conv.inner = untag_ptr(val);
43216 val_conv.is_owned = ptr_is_owned(val);
43217 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43218 val_conv = ChannelFeatures_clone(&val_conv);
43219 RouteHop_set_channel_features(&this_ptr_conv, val_conv);
43222 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
43223 LDKRouteHop this_ptr_conv;
43224 this_ptr_conv.inner = untag_ptr(this_ptr);
43225 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43227 this_ptr_conv.is_owned = false;
43228 int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv);
43232 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43233 LDKRouteHop this_ptr_conv;
43234 this_ptr_conv.inner = untag_ptr(this_ptr);
43235 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43237 this_ptr_conv.is_owned = false;
43238 RouteHop_set_fee_msat(&this_ptr_conv, val);
43241 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
43242 LDKRouteHop this_ptr_conv;
43243 this_ptr_conv.inner = untag_ptr(this_ptr);
43244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43246 this_ptr_conv.is_owned = false;
43247 int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
43251 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
43252 LDKRouteHop this_ptr_conv;
43253 this_ptr_conv.inner = untag_ptr(this_ptr);
43254 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43256 this_ptr_conv.is_owned = false;
43257 RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
43260 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) {
43261 LDKPublicKey pubkey_arg_ref;
43262 CHECK((*env)->GetArrayLength(env, pubkey_arg) == 33);
43263 (*env)->GetByteArrayRegion(env, pubkey_arg, 0, 33, pubkey_arg_ref.compressed_form);
43264 LDKNodeFeatures node_features_arg_conv;
43265 node_features_arg_conv.inner = untag_ptr(node_features_arg);
43266 node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg);
43267 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv);
43268 node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv);
43269 LDKChannelFeatures channel_features_arg_conv;
43270 channel_features_arg_conv.inner = untag_ptr(channel_features_arg);
43271 channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg);
43272 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv);
43273 channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
43274 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);
43275 int64_t ret_ref = 0;
43276 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43277 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43281 static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) {
43282 LDKRouteHop ret_var = RouteHop_clone(arg);
43283 int64_t ret_ref = 0;
43284 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43285 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43288 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43289 LDKRouteHop arg_conv;
43290 arg_conv.inner = untag_ptr(arg);
43291 arg_conv.is_owned = ptr_is_owned(arg);
43292 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43293 arg_conv.is_owned = false;
43294 int64_t ret_conv = RouteHop_clone_ptr(&arg_conv);
43298 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43299 LDKRouteHop orig_conv;
43300 orig_conv.inner = untag_ptr(orig);
43301 orig_conv.is_owned = ptr_is_owned(orig);
43302 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43303 orig_conv.is_owned = false;
43304 LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
43305 int64_t ret_ref = 0;
43306 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43307 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43311 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, jclass clz, int64_t o) {
43312 LDKRouteHop o_conv;
43313 o_conv.inner = untag_ptr(o);
43314 o_conv.is_owned = ptr_is_owned(o);
43315 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
43316 o_conv.is_owned = false;
43317 int64_t ret_conv = RouteHop_hash(&o_conv);
43321 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
43322 LDKRouteHop a_conv;
43323 a_conv.inner = untag_ptr(a);
43324 a_conv.is_owned = ptr_is_owned(a);
43325 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43326 a_conv.is_owned = false;
43327 LDKRouteHop b_conv;
43328 b_conv.inner = untag_ptr(b);
43329 b_conv.is_owned = ptr_is_owned(b);
43330 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43331 b_conv.is_owned = false;
43332 jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv);
43336 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
43337 LDKRouteHop obj_conv;
43338 obj_conv.inner = untag_ptr(obj);
43339 obj_conv.is_owned = ptr_is_owned(obj);
43340 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43341 obj_conv.is_owned = false;
43342 LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv);
43343 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43344 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43345 CVec_u8Z_free(ret_var);
43349 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43350 LDKu8slice ser_ref;
43351 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43352 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43353 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
43354 *ret_conv = RouteHop_read(ser_ref);
43355 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43356 return tag_ptr(ret_conv, true);
43359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43360 LDKRoute this_obj_conv;
43361 this_obj_conv.inner = untag_ptr(this_obj);
43362 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43363 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43364 Route_free(this_obj_conv);
43367 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIEnv *env, jclass clz, int64_t this_ptr) {
43368 LDKRoute this_ptr_conv;
43369 this_ptr_conv.inner = untag_ptr(this_ptr);
43370 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43371 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43372 this_ptr_conv.is_owned = false;
43373 LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
43374 jobjectArray ret_arr = NULL;
43375 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL);
43377 for (size_t m = 0; m < ret_var.datalen; m++) {
43378 LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
43379 int64_tArray ret_conv_12_arr = NULL;
43380 ret_conv_12_arr = (*env)->NewLongArray(env, ret_conv_12_var.datalen);
43381 int64_t *ret_conv_12_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_conv_12_arr, NULL);
43382 for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
43383 LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
43384 int64_t ret_conv_12_conv_10_ref = 0;
43385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var);
43386 ret_conv_12_conv_10_ref = tag_ptr(ret_conv_12_conv_10_var.inner, ret_conv_12_conv_10_var.is_owned);
43387 ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref;
43389 (*env)->ReleasePrimitiveArrayCritical(env, ret_conv_12_arr, ret_conv_12_arr_ptr, 0);
43390 FREE(ret_conv_12_var.data);
43391 (*env)->SetObjectArrayElement(env, ret_arr, m, ret_conv_12_arr);
43394 FREE(ret_var.data);
43398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
43399 LDKRoute this_ptr_conv;
43400 this_ptr_conv.inner = untag_ptr(this_ptr);
43401 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43402 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43403 this_ptr_conv.is_owned = false;
43404 LDKCVec_CVec_RouteHopZZ val_constr;
43405 val_constr.datalen = (*env)->GetArrayLength(env, val);
43406 if (val_constr.datalen > 0)
43407 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
43409 val_constr.data = NULL;
43410 for (size_t m = 0; m < val_constr.datalen; m++) {
43411 int64_tArray val_conv_12 = (*env)->GetObjectArrayElement(env, val, m);
43412 LDKCVec_RouteHopZ val_conv_12_constr;
43413 val_conv_12_constr.datalen = (*env)->GetArrayLength(env, val_conv_12);
43414 if (val_conv_12_constr.datalen > 0)
43415 val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
43417 val_conv_12_constr.data = NULL;
43418 int64_t* val_conv_12_vals = (*env)->GetLongArrayElements (env, val_conv_12, NULL);
43419 for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
43420 int64_t val_conv_12_conv_10 = val_conv_12_vals[k];
43421 LDKRouteHop val_conv_12_conv_10_conv;
43422 val_conv_12_conv_10_conv.inner = untag_ptr(val_conv_12_conv_10);
43423 val_conv_12_conv_10_conv.is_owned = ptr_is_owned(val_conv_12_conv_10);
43424 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv);
43425 val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
43426 val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
43428 (*env)->ReleaseLongArrayElements(env, val_conv_12, val_conv_12_vals, 0);
43429 val_constr.data[m] = val_conv_12_constr;
43431 Route_set_paths(&this_ptr_conv, val_constr);
43434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) {
43435 LDKRoute this_ptr_conv;
43436 this_ptr_conv.inner = untag_ptr(this_ptr);
43437 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43438 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43439 this_ptr_conv.is_owned = false;
43440 LDKPaymentParameters ret_var = Route_get_payment_params(&this_ptr_conv);
43441 int64_t ret_ref = 0;
43442 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43443 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43448 LDKRoute this_ptr_conv;
43449 this_ptr_conv.inner = untag_ptr(this_ptr);
43450 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43452 this_ptr_conv.is_owned = false;
43453 LDKPaymentParameters val_conv;
43454 val_conv.inner = untag_ptr(val);
43455 val_conv.is_owned = ptr_is_owned(val);
43456 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43457 val_conv = PaymentParameters_clone(&val_conv);
43458 Route_set_payment_params(&this_ptr_conv, val_conv);
43461 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, jobjectArray paths_arg, int64_t payment_params_arg) {
43462 LDKCVec_CVec_RouteHopZZ paths_arg_constr;
43463 paths_arg_constr.datalen = (*env)->GetArrayLength(env, paths_arg);
43464 if (paths_arg_constr.datalen > 0)
43465 paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
43467 paths_arg_constr.data = NULL;
43468 for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
43469 int64_tArray paths_arg_conv_12 = (*env)->GetObjectArrayElement(env, paths_arg, m);
43470 LDKCVec_RouteHopZ paths_arg_conv_12_constr;
43471 paths_arg_conv_12_constr.datalen = (*env)->GetArrayLength(env, paths_arg_conv_12);
43472 if (paths_arg_conv_12_constr.datalen > 0)
43473 paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
43475 paths_arg_conv_12_constr.data = NULL;
43476 int64_t* paths_arg_conv_12_vals = (*env)->GetLongArrayElements (env, paths_arg_conv_12, NULL);
43477 for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
43478 int64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
43479 LDKRouteHop paths_arg_conv_12_conv_10_conv;
43480 paths_arg_conv_12_conv_10_conv.inner = untag_ptr(paths_arg_conv_12_conv_10);
43481 paths_arg_conv_12_conv_10_conv.is_owned = ptr_is_owned(paths_arg_conv_12_conv_10);
43482 CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv);
43483 paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
43484 paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
43486 (*env)->ReleaseLongArrayElements(env, paths_arg_conv_12, paths_arg_conv_12_vals, 0);
43487 paths_arg_constr.data[m] = paths_arg_conv_12_constr;
43489 LDKPaymentParameters payment_params_arg_conv;
43490 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
43491 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
43492 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
43493 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
43494 LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_arg_conv);
43495 int64_t ret_ref = 0;
43496 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43497 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43501 static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) {
43502 LDKRoute ret_var = Route_clone(arg);
43503 int64_t ret_ref = 0;
43504 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43505 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43508 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43510 arg_conv.inner = untag_ptr(arg);
43511 arg_conv.is_owned = ptr_is_owned(arg);
43512 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43513 arg_conv.is_owned = false;
43514 int64_t ret_conv = Route_clone_ptr(&arg_conv);
43518 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43519 LDKRoute orig_conv;
43520 orig_conv.inner = untag_ptr(orig);
43521 orig_conv.is_owned = ptr_is_owned(orig);
43522 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43523 orig_conv.is_owned = false;
43524 LDKRoute ret_var = Route_clone(&orig_conv);
43525 int64_t ret_ref = 0;
43526 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43527 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43531 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jclass clz, int64_t o) {
43533 o_conv.inner = untag_ptr(o);
43534 o_conv.is_owned = ptr_is_owned(o);
43535 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
43536 o_conv.is_owned = false;
43537 int64_t ret_conv = Route_hash(&o_conv);
43541 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
43543 a_conv.inner = untag_ptr(a);
43544 a_conv.is_owned = ptr_is_owned(a);
43545 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43546 a_conv.is_owned = false;
43548 b_conv.inner = untag_ptr(b);
43549 b_conv.is_owned = ptr_is_owned(b);
43550 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43551 b_conv.is_owned = false;
43552 jboolean ret_conv = Route_eq(&a_conv, &b_conv);
43556 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) {
43557 LDKRoute this_arg_conv;
43558 this_arg_conv.inner = untag_ptr(this_arg);
43559 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43561 this_arg_conv.is_owned = false;
43562 int64_t ret_conv = Route_get_total_fees(&this_arg_conv);
43566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) {
43567 LDKRoute this_arg_conv;
43568 this_arg_conv.inner = untag_ptr(this_arg);
43569 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43570 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43571 this_arg_conv.is_owned = false;
43572 int64_t ret_conv = Route_get_total_amount(&this_arg_conv);
43576 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) {
43578 obj_conv.inner = untag_ptr(obj);
43579 obj_conv.is_owned = ptr_is_owned(obj);
43580 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43581 obj_conv.is_owned = false;
43582 LDKCVec_u8Z ret_var = Route_write(&obj_conv);
43583 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43584 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43585 CVec_u8Z_free(ret_var);
43589 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43590 LDKu8slice ser_ref;
43591 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43592 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43593 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
43594 *ret_conv = Route_read(ser_ref);
43595 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43596 return tag_ptr(ret_conv, true);
43599 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43600 LDKRouteParameters this_obj_conv;
43601 this_obj_conv.inner = untag_ptr(this_obj);
43602 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43604 RouteParameters_free(this_obj_conv);
43607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) {
43608 LDKRouteParameters this_ptr_conv;
43609 this_ptr_conv.inner = untag_ptr(this_ptr);
43610 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43612 this_ptr_conv.is_owned = false;
43613 LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv);
43614 int64_t ret_ref = 0;
43615 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43616 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43620 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43621 LDKRouteParameters this_ptr_conv;
43622 this_ptr_conv.inner = untag_ptr(this_ptr);
43623 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43625 this_ptr_conv.is_owned = false;
43626 LDKPaymentParameters val_conv;
43627 val_conv.inner = untag_ptr(val);
43628 val_conv.is_owned = ptr_is_owned(val);
43629 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43630 val_conv = PaymentParameters_clone(&val_conv);
43631 RouteParameters_set_payment_params(&this_ptr_conv, val_conv);
43634 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
43635 LDKRouteParameters this_ptr_conv;
43636 this_ptr_conv.inner = untag_ptr(this_ptr);
43637 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43638 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43639 this_ptr_conv.is_owned = false;
43640 int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv);
43644 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43645 LDKRouteParameters this_ptr_conv;
43646 this_ptr_conv.inner = untag_ptr(this_ptr);
43647 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43649 this_ptr_conv.is_owned = false;
43650 RouteParameters_set_final_value_msat(&this_ptr_conv, val);
43653 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
43654 LDKRouteParameters this_ptr_conv;
43655 this_ptr_conv.inner = untag_ptr(this_ptr);
43656 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43658 this_ptr_conv.is_owned = false;
43659 int32_t ret_conv = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
43663 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) {
43664 LDKRouteParameters this_ptr_conv;
43665 this_ptr_conv.inner = untag_ptr(this_ptr);
43666 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43668 this_ptr_conv.is_owned = false;
43669 RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
43672 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) {
43673 LDKPaymentParameters payment_params_arg_conv;
43674 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
43675 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
43676 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
43677 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
43678 LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg);
43679 int64_t ret_ref = 0;
43680 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43681 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43685 static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) {
43686 LDKRouteParameters ret_var = RouteParameters_clone(arg);
43687 int64_t ret_ref = 0;
43688 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43689 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43692 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43693 LDKRouteParameters arg_conv;
43694 arg_conv.inner = untag_ptr(arg);
43695 arg_conv.is_owned = ptr_is_owned(arg);
43696 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43697 arg_conv.is_owned = false;
43698 int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv);
43702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43703 LDKRouteParameters orig_conv;
43704 orig_conv.inner = untag_ptr(orig);
43705 orig_conv.is_owned = ptr_is_owned(orig);
43706 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43707 orig_conv.is_owned = false;
43708 LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv);
43709 int64_t ret_ref = 0;
43710 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43711 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43715 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
43716 LDKRouteParameters obj_conv;
43717 obj_conv.inner = untag_ptr(obj);
43718 obj_conv.is_owned = ptr_is_owned(obj);
43719 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43720 obj_conv.is_owned = false;
43721 LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv);
43722 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43723 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43724 CVec_u8Z_free(ret_var);
43728 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43729 LDKu8slice ser_ref;
43730 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43731 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43732 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
43733 *ret_conv = RouteParameters_read(ser_ref);
43734 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43735 return tag_ptr(ret_conv, true);
43738 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43739 LDKPaymentParameters this_obj_conv;
43740 this_obj_conv.inner = untag_ptr(this_obj);
43741 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43742 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43743 PaymentParameters_free(this_obj_conv);
43746 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1payee_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
43747 LDKPaymentParameters this_ptr_conv;
43748 this_ptr_conv.inner = untag_ptr(this_ptr);
43749 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43750 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43751 this_ptr_conv.is_owned = false;
43752 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
43753 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form);
43757 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1payee_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
43758 LDKPaymentParameters this_ptr_conv;
43759 this_ptr_conv.inner = untag_ptr(this_ptr);
43760 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43762 this_ptr_conv.is_owned = false;
43763 LDKPublicKey val_ref;
43764 CHECK((*env)->GetArrayLength(env, val) == 33);
43765 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
43766 PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref);
43769 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
43770 LDKPaymentParameters this_ptr_conv;
43771 this_ptr_conv.inner = untag_ptr(this_ptr);
43772 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43774 this_ptr_conv.is_owned = false;
43775 LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&this_ptr_conv);
43776 int64_t ret_ref = 0;
43777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43782 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43783 LDKPaymentParameters this_ptr_conv;
43784 this_ptr_conv.inner = untag_ptr(this_ptr);
43785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43787 this_ptr_conv.is_owned = false;
43788 LDKInvoiceFeatures val_conv;
43789 val_conv.inner = untag_ptr(val);
43790 val_conv.is_owned = ptr_is_owned(val);
43791 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43792 val_conv = InvoiceFeatures_clone(&val_conv);
43793 PaymentParameters_set_features(&this_ptr_conv, val_conv);
43796 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr) {
43797 LDKPaymentParameters this_ptr_conv;
43798 this_ptr_conv.inner = untag_ptr(this_ptr);
43799 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43800 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43801 this_ptr_conv.is_owned = false;
43802 LDKCVec_RouteHintZ ret_var = PaymentParameters_get_route_hints(&this_ptr_conv);
43803 int64_tArray ret_arr = NULL;
43804 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
43805 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
43806 for (size_t l = 0; l < ret_var.datalen; l++) {
43807 LDKRouteHint ret_conv_11_var = ret_var.data[l];
43808 int64_t ret_conv_11_ref = 0;
43809 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
43810 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
43811 ret_arr_ptr[l] = ret_conv_11_ref;
43813 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
43814 FREE(ret_var.data);
43818 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
43819 LDKPaymentParameters this_ptr_conv;
43820 this_ptr_conv.inner = untag_ptr(this_ptr);
43821 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43822 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43823 this_ptr_conv.is_owned = false;
43824 LDKCVec_RouteHintZ val_constr;
43825 val_constr.datalen = (*env)->GetArrayLength(env, val);
43826 if (val_constr.datalen > 0)
43827 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
43829 val_constr.data = NULL;
43830 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
43831 for (size_t l = 0; l < val_constr.datalen; l++) {
43832 int64_t val_conv_11 = val_vals[l];
43833 LDKRouteHint val_conv_11_conv;
43834 val_conv_11_conv.inner = untag_ptr(val_conv_11);
43835 val_conv_11_conv.is_owned = ptr_is_owned(val_conv_11);
43836 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv);
43837 val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
43838 val_constr.data[l] = val_conv_11_conv;
43840 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
43841 PaymentParameters_set_route_hints(&this_ptr_conv, val_constr);
43844 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr) {
43845 LDKPaymentParameters this_ptr_conv;
43846 this_ptr_conv.inner = untag_ptr(this_ptr);
43847 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43849 this_ptr_conv.is_owned = false;
43850 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
43851 *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv);
43852 int64_t ret_ref = tag_ptr(ret_copy, true);
43856 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43857 LDKPaymentParameters this_ptr_conv;
43858 this_ptr_conv.inner = untag_ptr(this_ptr);
43859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43861 this_ptr_conv.is_owned = false;
43862 void* val_ptr = untag_ptr(val);
43863 CHECK_ACCESS(val_ptr);
43864 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
43865 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
43866 PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv);
43869 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
43870 LDKPaymentParameters this_ptr_conv;
43871 this_ptr_conv.inner = untag_ptr(this_ptr);
43872 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43874 this_ptr_conv.is_owned = false;
43875 int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv);
43879 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) {
43880 LDKPaymentParameters this_ptr_conv;
43881 this_ptr_conv.inner = untag_ptr(this_ptr);
43882 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43884 this_ptr_conv.is_owned = false;
43885 PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val);
43888 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr) {
43889 LDKPaymentParameters this_ptr_conv;
43890 this_ptr_conv.inner = untag_ptr(this_ptr);
43891 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43893 this_ptr_conv.is_owned = false;
43894 int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv);
43898 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
43899 LDKPaymentParameters this_ptr_conv;
43900 this_ptr_conv.inner = untag_ptr(this_ptr);
43901 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43903 this_ptr_conv.is_owned = false;
43904 PaymentParameters_set_max_path_count(&this_ptr_conv, val);
43907 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) {
43908 LDKPaymentParameters this_ptr_conv;
43909 this_ptr_conv.inner = untag_ptr(this_ptr);
43910 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43911 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43912 this_ptr_conv.is_owned = false;
43913 int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv);
43917 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) {
43918 LDKPaymentParameters this_ptr_conv;
43919 this_ptr_conv.inner = untag_ptr(this_ptr);
43920 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43921 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43922 this_ptr_conv.is_owned = false;
43923 PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val);
43926 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
43927 LDKPaymentParameters this_ptr_conv;
43928 this_ptr_conv.inner = untag_ptr(this_ptr);
43929 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43931 this_ptr_conv.is_owned = false;
43932 LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv);
43933 int64_tArray ret_arr = NULL;
43934 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
43935 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
43936 for (size_t g = 0; g < ret_var.datalen; g++) {
43937 int64_t ret_conv_6_conv = ret_var.data[g];
43938 ret_arr_ptr[g] = ret_conv_6_conv;
43940 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
43941 FREE(ret_var.data);
43945 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
43946 LDKPaymentParameters this_ptr_conv;
43947 this_ptr_conv.inner = untag_ptr(this_ptr);
43948 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43950 this_ptr_conv.is_owned = false;
43951 LDKCVec_u64Z val_constr;
43952 val_constr.datalen = (*env)->GetArrayLength(env, val);
43953 if (val_constr.datalen > 0)
43954 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
43956 val_constr.data = NULL;
43957 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
43958 for (size_t g = 0; g < val_constr.datalen; g++) {
43959 int64_t val_conv_6 = val_vals[g];
43960 val_constr.data[g] = val_conv_6;
43962 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
43963 PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr);
43966 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) {
43967 LDKPublicKey payee_pubkey_arg_ref;
43968 CHECK((*env)->GetArrayLength(env, payee_pubkey_arg) == 33);
43969 (*env)->GetByteArrayRegion(env, payee_pubkey_arg, 0, 33, payee_pubkey_arg_ref.compressed_form);
43970 LDKInvoiceFeatures features_arg_conv;
43971 features_arg_conv.inner = untag_ptr(features_arg);
43972 features_arg_conv.is_owned = ptr_is_owned(features_arg);
43973 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
43974 features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
43975 LDKCVec_RouteHintZ route_hints_arg_constr;
43976 route_hints_arg_constr.datalen = (*env)->GetArrayLength(env, route_hints_arg);
43977 if (route_hints_arg_constr.datalen > 0)
43978 route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
43980 route_hints_arg_constr.data = NULL;
43981 int64_t* route_hints_arg_vals = (*env)->GetLongArrayElements (env, route_hints_arg, NULL);
43982 for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
43983 int64_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
43984 LDKRouteHint route_hints_arg_conv_11_conv;
43985 route_hints_arg_conv_11_conv.inner = untag_ptr(route_hints_arg_conv_11);
43986 route_hints_arg_conv_11_conv.is_owned = ptr_is_owned(route_hints_arg_conv_11);
43987 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv);
43988 route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
43989 route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
43991 (*env)->ReleaseLongArrayElements(env, route_hints_arg, route_hints_arg_vals, 0);
43992 void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg);
43993 CHECK_ACCESS(expiry_time_arg_ptr);
43994 LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
43995 expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg));
43996 LDKCVec_u64Z previously_failed_channels_arg_constr;
43997 previously_failed_channels_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_channels_arg);
43998 if (previously_failed_channels_arg_constr.datalen > 0)
43999 previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
44001 previously_failed_channels_arg_constr.data = NULL;
44002 int64_t* previously_failed_channels_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_channels_arg, NULL);
44003 for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) {
44004 int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g];
44005 previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6;
44007 (*env)->ReleaseLongArrayElements(env, previously_failed_channels_arg, previously_failed_channels_arg_vals, 0);
44008 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);
44009 int64_t ret_ref = 0;
44010 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44011 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44015 static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) {
44016 LDKPaymentParameters ret_var = PaymentParameters_clone(arg);
44017 int64_t ret_ref = 0;
44018 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44019 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44022 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44023 LDKPaymentParameters arg_conv;
44024 arg_conv.inner = untag_ptr(arg);
44025 arg_conv.is_owned = ptr_is_owned(arg);
44026 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44027 arg_conv.is_owned = false;
44028 int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv);
44032 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44033 LDKPaymentParameters orig_conv;
44034 orig_conv.inner = untag_ptr(orig);
44035 orig_conv.is_owned = ptr_is_owned(orig);
44036 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44037 orig_conv.is_owned = false;
44038 LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv);
44039 int64_t ret_ref = 0;
44040 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44041 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44045 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1hash(JNIEnv *env, jclass clz, int64_t o) {
44046 LDKPaymentParameters o_conv;
44047 o_conv.inner = untag_ptr(o);
44048 o_conv.is_owned = ptr_is_owned(o);
44049 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44050 o_conv.is_owned = false;
44051 int64_t ret_conv = PaymentParameters_hash(&o_conv);
44055 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44056 LDKPaymentParameters a_conv;
44057 a_conv.inner = untag_ptr(a);
44058 a_conv.is_owned = ptr_is_owned(a);
44059 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44060 a_conv.is_owned = false;
44061 LDKPaymentParameters b_conv;
44062 b_conv.inner = untag_ptr(b);
44063 b_conv.is_owned = ptr_is_owned(b);
44064 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44065 b_conv.is_owned = false;
44066 jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv);
44070 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
44071 LDKPaymentParameters obj_conv;
44072 obj_conv.inner = untag_ptr(obj);
44073 obj_conv.is_owned = ptr_is_owned(obj);
44074 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44075 obj_conv.is_owned = false;
44076 LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv);
44077 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44078 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44079 CVec_u8Z_free(ret_var);
44083 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
44084 LDKu8slice ser_ref;
44085 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
44086 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
44087 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
44088 *ret_conv = PaymentParameters_read(ser_ref);
44089 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
44090 return tag_ptr(ret_conv, true);
44093 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1node_1id(JNIEnv *env, jclass clz, int8_tArray payee_pubkey) {
44094 LDKPublicKey payee_pubkey_ref;
44095 CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33);
44096 (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form);
44097 LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref);
44098 int64_t ret_ref = 0;
44099 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44100 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44104 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1for_1keysend(JNIEnv *env, jclass clz, int8_tArray payee_pubkey) {
44105 LDKPublicKey payee_pubkey_ref;
44106 CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33);
44107 (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form);
44108 LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref);
44109 int64_t ret_ref = 0;
44110 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44111 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44115 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44116 LDKRouteHint this_obj_conv;
44117 this_obj_conv.inner = untag_ptr(this_obj);
44118 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44120 RouteHint_free(this_obj_conv);
44123 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
44124 LDKRouteHint this_ptr_conv;
44125 this_ptr_conv.inner = untag_ptr(this_ptr);
44126 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44127 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44128 this_ptr_conv.is_owned = false;
44129 LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
44130 int64_tArray ret_arr = NULL;
44131 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
44132 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
44133 for (size_t o = 0; o < ret_var.datalen; o++) {
44134 LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
44135 int64_t ret_conv_14_ref = 0;
44136 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
44137 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
44138 ret_arr_ptr[o] = ret_conv_14_ref;
44140 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
44141 FREE(ret_var.data);
44145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
44146 LDKRouteHint this_ptr_conv;
44147 this_ptr_conv.inner = untag_ptr(this_ptr);
44148 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44149 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44150 this_ptr_conv.is_owned = false;
44151 LDKCVec_RouteHintHopZ val_constr;
44152 val_constr.datalen = (*env)->GetArrayLength(env, val);
44153 if (val_constr.datalen > 0)
44154 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
44156 val_constr.data = NULL;
44157 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
44158 for (size_t o = 0; o < val_constr.datalen; o++) {
44159 int64_t val_conv_14 = val_vals[o];
44160 LDKRouteHintHop val_conv_14_conv;
44161 val_conv_14_conv.inner = untag_ptr(val_conv_14);
44162 val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14);
44163 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv);
44164 val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
44165 val_constr.data[o] = val_conv_14_conv;
44167 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
44168 RouteHint_set_a(&this_ptr_conv, val_constr);
44171 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int64_tArray a_arg) {
44172 LDKCVec_RouteHintHopZ a_arg_constr;
44173 a_arg_constr.datalen = (*env)->GetArrayLength(env, a_arg);
44174 if (a_arg_constr.datalen > 0)
44175 a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
44177 a_arg_constr.data = NULL;
44178 int64_t* a_arg_vals = (*env)->GetLongArrayElements (env, a_arg, NULL);
44179 for (size_t o = 0; o < a_arg_constr.datalen; o++) {
44180 int64_t a_arg_conv_14 = a_arg_vals[o];
44181 LDKRouteHintHop a_arg_conv_14_conv;
44182 a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14);
44183 a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14);
44184 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv);
44185 a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
44186 a_arg_constr.data[o] = a_arg_conv_14_conv;
44188 (*env)->ReleaseLongArrayElements(env, a_arg, a_arg_vals, 0);
44189 LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
44190 int64_t ret_ref = 0;
44191 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44192 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44196 static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) {
44197 LDKRouteHint ret_var = RouteHint_clone(arg);
44198 int64_t ret_ref = 0;
44199 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44200 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44203 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44204 LDKRouteHint arg_conv;
44205 arg_conv.inner = untag_ptr(arg);
44206 arg_conv.is_owned = ptr_is_owned(arg);
44207 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44208 arg_conv.is_owned = false;
44209 int64_t ret_conv = RouteHint_clone_ptr(&arg_conv);
44213 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44214 LDKRouteHint orig_conv;
44215 orig_conv.inner = untag_ptr(orig);
44216 orig_conv.is_owned = ptr_is_owned(orig);
44217 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44218 orig_conv.is_owned = false;
44219 LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
44220 int64_t ret_ref = 0;
44221 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44222 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44226 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env, jclass clz, int64_t o) {
44227 LDKRouteHint o_conv;
44228 o_conv.inner = untag_ptr(o);
44229 o_conv.is_owned = ptr_is_owned(o);
44230 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44231 o_conv.is_owned = false;
44232 int64_t ret_conv = RouteHint_hash(&o_conv);
44236 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44237 LDKRouteHint a_conv;
44238 a_conv.inner = untag_ptr(a);
44239 a_conv.is_owned = ptr_is_owned(a);
44240 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44241 a_conv.is_owned = false;
44242 LDKRouteHint b_conv;
44243 b_conv.inner = untag_ptr(b);
44244 b_conv.is_owned = ptr_is_owned(b);
44245 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44246 b_conv.is_owned = false;
44247 jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv);
44251 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv *env, jclass clz, int64_t obj) {
44252 LDKRouteHint obj_conv;
44253 obj_conv.inner = untag_ptr(obj);
44254 obj_conv.is_owned = ptr_is_owned(obj);
44255 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44256 obj_conv.is_owned = false;
44257 LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv);
44258 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44259 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44260 CVec_u8Z_free(ret_var);
44264 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
44265 LDKu8slice ser_ref;
44266 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
44267 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
44268 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
44269 *ret_conv = RouteHint_read(ser_ref);
44270 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
44271 return tag_ptr(ret_conv, true);
44274 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44275 LDKRouteHintHop this_obj_conv;
44276 this_obj_conv.inner = untag_ptr(this_obj);
44277 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44279 RouteHintHop_free(this_obj_conv);
44282 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
44283 LDKRouteHintHop this_ptr_conv;
44284 this_ptr_conv.inner = untag_ptr(this_ptr);
44285 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44287 this_ptr_conv.is_owned = false;
44288 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
44289 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form);
44293 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
44294 LDKRouteHintHop this_ptr_conv;
44295 this_ptr_conv.inner = untag_ptr(this_ptr);
44296 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44298 this_ptr_conv.is_owned = false;
44299 LDKPublicKey val_ref;
44300 CHECK((*env)->GetArrayLength(env, val) == 33);
44301 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
44302 RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref);
44305 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
44306 LDKRouteHintHop this_ptr_conv;
44307 this_ptr_conv.inner = untag_ptr(this_ptr);
44308 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44309 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44310 this_ptr_conv.is_owned = false;
44311 int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv);
44315 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44316 LDKRouteHintHop this_ptr_conv;
44317 this_ptr_conv.inner = untag_ptr(this_ptr);
44318 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44319 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44320 this_ptr_conv.is_owned = false;
44321 RouteHintHop_set_short_channel_id(&this_ptr_conv, val);
44324 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) {
44325 LDKRouteHintHop this_ptr_conv;
44326 this_ptr_conv.inner = untag_ptr(this_ptr);
44327 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44329 this_ptr_conv.is_owned = false;
44330 LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv);
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 void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44338 LDKRouteHintHop this_ptr_conv;
44339 this_ptr_conv.inner = untag_ptr(this_ptr);
44340 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44342 this_ptr_conv.is_owned = false;
44343 LDKRoutingFees val_conv;
44344 val_conv.inner = untag_ptr(val);
44345 val_conv.is_owned = ptr_is_owned(val);
44346 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
44347 val_conv = RoutingFees_clone(&val_conv);
44348 RouteHintHop_set_fees(&this_ptr_conv, val_conv);
44351 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
44352 LDKRouteHintHop this_ptr_conv;
44353 this_ptr_conv.inner = untag_ptr(this_ptr);
44354 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44355 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44356 this_ptr_conv.is_owned = false;
44357 int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv);
44361 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
44362 LDKRouteHintHop this_ptr_conv;
44363 this_ptr_conv.inner = untag_ptr(this_ptr);
44364 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44365 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44366 this_ptr_conv.is_owned = false;
44367 RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val);
44370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44371 LDKRouteHintHop this_ptr_conv;
44372 this_ptr_conv.inner = untag_ptr(this_ptr);
44373 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44375 this_ptr_conv.is_owned = false;
44376 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
44377 *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv);
44378 int64_t ret_ref = tag_ptr(ret_copy, true);
44382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44383 LDKRouteHintHop this_ptr_conv;
44384 this_ptr_conv.inner = untag_ptr(this_ptr);
44385 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44386 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44387 this_ptr_conv.is_owned = false;
44388 void* val_ptr = untag_ptr(val);
44389 CHECK_ACCESS(val_ptr);
44390 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
44391 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
44392 RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
44395 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44396 LDKRouteHintHop this_ptr_conv;
44397 this_ptr_conv.inner = untag_ptr(this_ptr);
44398 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44400 this_ptr_conv.is_owned = false;
44401 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
44402 *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv);
44403 int64_t ret_ref = tag_ptr(ret_copy, true);
44407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44408 LDKRouteHintHop this_ptr_conv;
44409 this_ptr_conv.inner = untag_ptr(this_ptr);
44410 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44412 this_ptr_conv.is_owned = false;
44413 void* val_ptr = untag_ptr(val);
44414 CHECK_ACCESS(val_ptr);
44415 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
44416 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
44417 RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
44420 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) {
44421 LDKPublicKey src_node_id_arg_ref;
44422 CHECK((*env)->GetArrayLength(env, src_node_id_arg) == 33);
44423 (*env)->GetByteArrayRegion(env, src_node_id_arg, 0, 33, src_node_id_arg_ref.compressed_form);
44424 LDKRoutingFees fees_arg_conv;
44425 fees_arg_conv.inner = untag_ptr(fees_arg);
44426 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
44427 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
44428 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
44429 void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg);
44430 CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
44431 LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
44432 htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg));
44433 void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg);
44434 CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
44435 LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
44436 htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg));
44437 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);
44438 int64_t ret_ref = 0;
44439 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44440 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44444 static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) {
44445 LDKRouteHintHop ret_var = RouteHintHop_clone(arg);
44446 int64_t ret_ref = 0;
44447 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44448 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44451 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44452 LDKRouteHintHop arg_conv;
44453 arg_conv.inner = untag_ptr(arg);
44454 arg_conv.is_owned = ptr_is_owned(arg);
44455 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44456 arg_conv.is_owned = false;
44457 int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv);
44461 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44462 LDKRouteHintHop orig_conv;
44463 orig_conv.inner = untag_ptr(orig);
44464 orig_conv.is_owned = ptr_is_owned(orig);
44465 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44466 orig_conv.is_owned = false;
44467 LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv);
44468 int64_t ret_ref = 0;
44469 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44470 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44474 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv *env, jclass clz, int64_t o) {
44475 LDKRouteHintHop o_conv;
44476 o_conv.inner = untag_ptr(o);
44477 o_conv.is_owned = ptr_is_owned(o);
44478 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44479 o_conv.is_owned = false;
44480 int64_t ret_conv = RouteHintHop_hash(&o_conv);
44484 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44485 LDKRouteHintHop a_conv;
44486 a_conv.inner = untag_ptr(a);
44487 a_conv.is_owned = ptr_is_owned(a);
44488 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44489 a_conv.is_owned = false;
44490 LDKRouteHintHop b_conv;
44491 b_conv.inner = untag_ptr(b);
44492 b_conv.is_owned = ptr_is_owned(b);
44493 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44494 b_conv.is_owned = false;
44495 jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv);
44499 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
44500 LDKRouteHintHop obj_conv;
44501 obj_conv.inner = untag_ptr(obj);
44502 obj_conv.is_owned = ptr_is_owned(obj);
44503 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44504 obj_conv.is_owned = false;
44505 LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv);
44506 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44507 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44508 CVec_u8Z_free(ret_var);
44512 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
44513 LDKu8slice ser_ref;
44514 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
44515 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
44516 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
44517 *ret_conv = RouteHintHop_read(ser_ref);
44518 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
44519 return tag_ptr(ret_conv, true);
44522 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) {
44523 LDKPublicKey our_node_pubkey_ref;
44524 CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
44525 (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
44526 LDKRouteParameters route_params_conv;
44527 route_params_conv.inner = untag_ptr(route_params);
44528 route_params_conv.is_owned = ptr_is_owned(route_params);
44529 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
44530 route_params_conv.is_owned = false;
44531 LDKNetworkGraph network_graph_conv;
44532 network_graph_conv.inner = untag_ptr(network_graph);
44533 network_graph_conv.is_owned = ptr_is_owned(network_graph);
44534 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
44535 network_graph_conv.is_owned = false;
44536 LDKCVec_ChannelDetailsZ first_hops_constr;
44537 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
44538 if (first_hops != NULL) {
44539 first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
44540 if (first_hops_constr.datalen > 0)
44541 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
44543 first_hops_constr.data = NULL;
44544 int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
44545 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
44546 int64_t first_hops_conv_16 = first_hops_vals[q];
44547 LDKChannelDetails first_hops_conv_16_conv;
44548 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
44549 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
44550 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
44551 first_hops_conv_16_conv.is_owned = false;
44552 first_hops_constr.data[q] = first_hops_conv_16_conv;
44554 (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
44555 first_hops_ptr = &first_hops_constr;
44557 void* logger_ptr = untag_ptr(logger);
44558 CHECK_ACCESS(logger_ptr);
44559 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
44560 if (logger_conv.free == LDKLogger_JCalls_free) {
44561 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44562 LDKLogger_JCalls_cloned(&logger_conv);
44564 void* scorer_ptr = untag_ptr(scorer);
44565 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
44566 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
44567 unsigned char random_seed_bytes_arr[32];
44568 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
44569 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr);
44570 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
44571 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
44572 *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);
44573 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
44574 return tag_ptr(ret_conv, true);
44577 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) {
44578 LDKPublicKey our_node_pubkey_ref;
44579 CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
44580 (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
44581 LDKCVec_PublicKeyZ hops_constr;
44582 hops_constr.datalen = (*env)->GetArrayLength(env, hops);
44583 if (hops_constr.datalen > 0)
44584 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
44586 hops_constr.data = NULL;
44587 for (size_t i = 0; i < hops_constr.datalen; i++) {
44588 int8_tArray hops_conv_8 = (*env)->GetObjectArrayElement(env, hops, i);
44589 LDKPublicKey hops_conv_8_ref;
44590 CHECK((*env)->GetArrayLength(env, hops_conv_8) == 33);
44591 (*env)->GetByteArrayRegion(env, hops_conv_8, 0, 33, hops_conv_8_ref.compressed_form);
44592 hops_constr.data[i] = hops_conv_8_ref;
44594 LDKRouteParameters route_params_conv;
44595 route_params_conv.inner = untag_ptr(route_params);
44596 route_params_conv.is_owned = ptr_is_owned(route_params);
44597 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
44598 route_params_conv.is_owned = false;
44599 LDKNetworkGraph network_graph_conv;
44600 network_graph_conv.inner = untag_ptr(network_graph);
44601 network_graph_conv.is_owned = ptr_is_owned(network_graph);
44602 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
44603 network_graph_conv.is_owned = false;
44604 void* logger_ptr = untag_ptr(logger);
44605 CHECK_ACCESS(logger_ptr);
44606 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
44607 if (logger_conv.free == LDKLogger_JCalls_free) {
44608 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44609 LDKLogger_JCalls_cloned(&logger_conv);
44611 unsigned char random_seed_bytes_arr[32];
44612 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
44613 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr);
44614 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
44615 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
44616 *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref);
44617 return tag_ptr(ret_conv, true);
44620 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
44621 if (!ptr_is_owned(this_ptr)) return;
44622 void* this_ptr_ptr = untag_ptr(this_ptr);
44623 CHECK_ACCESS(this_ptr_ptr);
44624 LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
44625 FREE(untag_ptr(this_ptr));
44626 Score_free(this_ptr_conv);
44629 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
44630 if (!ptr_is_owned(this_ptr)) return;
44631 void* this_ptr_ptr = untag_ptr(this_ptr);
44632 CHECK_ACCESS(this_ptr_ptr);
44633 LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
44634 FREE(untag_ptr(this_ptr));
44635 LockableScore_free(this_ptr_conv);
44638 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44639 LDKMultiThreadedLockableScore this_obj_conv;
44640 this_obj_conv.inner = untag_ptr(this_obj);
44641 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44643 MultiThreadedLockableScore_free(this_obj_conv);
44646 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) {
44647 LDKMultiThreadedLockableScore obj_conv;
44648 obj_conv.inner = untag_ptr(obj);
44649 obj_conv.is_owned = ptr_is_owned(obj);
44650 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44651 obj_conv.is_owned = false;
44652 LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv);
44653 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44654 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44655 CVec_u8Z_free(ret_var);
44659 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) {
44660 void* score_ptr = untag_ptr(score);
44661 CHECK_ACCESS(score_ptr);
44662 LDKScore score_conv = *(LDKScore*)(score_ptr);
44663 if (score_conv.free == LDKScore_JCalls_free) {
44664 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44665 LDKScore_JCalls_cloned(&score_conv);
44667 LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
44668 int64_t ret_ref = 0;
44669 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44670 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44674 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44675 LDKChannelUsage this_obj_conv;
44676 this_obj_conv.inner = untag_ptr(this_obj);
44677 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44679 ChannelUsage_free(this_obj_conv);
44682 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44683 LDKChannelUsage this_ptr_conv;
44684 this_ptr_conv.inner = untag_ptr(this_ptr);
44685 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44687 this_ptr_conv.is_owned = false;
44688 int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv);
44692 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44693 LDKChannelUsage this_ptr_conv;
44694 this_ptr_conv.inner = untag_ptr(this_ptr);
44695 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44697 this_ptr_conv.is_owned = false;
44698 ChannelUsage_set_amount_msat(&this_ptr_conv, val);
44701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44702 LDKChannelUsage this_ptr_conv;
44703 this_ptr_conv.inner = untag_ptr(this_ptr);
44704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44706 this_ptr_conv.is_owned = false;
44707 int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv);
44711 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44712 LDKChannelUsage this_ptr_conv;
44713 this_ptr_conv.inner = untag_ptr(this_ptr);
44714 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44716 this_ptr_conv.is_owned = false;
44717 ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val);
44720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr) {
44721 LDKChannelUsage this_ptr_conv;
44722 this_ptr_conv.inner = untag_ptr(this_ptr);
44723 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44724 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44725 this_ptr_conv.is_owned = false;
44726 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
44727 *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv);
44728 int64_t ret_ref = tag_ptr(ret_copy, true);
44732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44733 LDKChannelUsage this_ptr_conv;
44734 this_ptr_conv.inner = untag_ptr(this_ptr);
44735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44737 this_ptr_conv.is_owned = false;
44738 void* val_ptr = untag_ptr(val);
44739 CHECK_ACCESS(val_ptr);
44740 LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr);
44741 val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val));
44742 ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv);
44745 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) {
44746 void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg);
44747 CHECK_ACCESS(effective_capacity_arg_ptr);
44748 LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr);
44749 effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg));
44750 LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv);
44751 int64_t ret_ref = 0;
44752 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44753 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44757 static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) {
44758 LDKChannelUsage ret_var = ChannelUsage_clone(arg);
44759 int64_t ret_ref = 0;
44760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44764 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44765 LDKChannelUsage arg_conv;
44766 arg_conv.inner = untag_ptr(arg);
44767 arg_conv.is_owned = ptr_is_owned(arg);
44768 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44769 arg_conv.is_owned = false;
44770 int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv);
44774 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44775 LDKChannelUsage orig_conv;
44776 orig_conv.inner = untag_ptr(orig);
44777 orig_conv.is_owned = ptr_is_owned(orig);
44778 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44779 orig_conv.is_owned = false;
44780 LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv);
44781 int64_t ret_ref = 0;
44782 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44783 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44787 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44788 LDKFixedPenaltyScorer this_obj_conv;
44789 this_obj_conv.inner = untag_ptr(this_obj);
44790 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44791 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44792 FixedPenaltyScorer_free(this_obj_conv);
44795 static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) {
44796 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg);
44797 int64_t ret_ref = 0;
44798 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44799 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44803 LDKFixedPenaltyScorer arg_conv;
44804 arg_conv.inner = untag_ptr(arg);
44805 arg_conv.is_owned = ptr_is_owned(arg);
44806 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44807 arg_conv.is_owned = false;
44808 int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv);
44812 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44813 LDKFixedPenaltyScorer orig_conv;
44814 orig_conv.inner = untag_ptr(orig);
44815 orig_conv.is_owned = ptr_is_owned(orig);
44816 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44817 orig_conv.is_owned = false;
44818 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv);
44819 int64_t ret_ref = 0;
44820 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44821 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) {
44826 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat);
44827 int64_t ret_ref = 0;
44828 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44829 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44833 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
44834 LDKFixedPenaltyScorer this_arg_conv;
44835 this_arg_conv.inner = untag_ptr(this_arg);
44836 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44838 this_arg_conv.is_owned = false;
44839 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
44840 *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv);
44841 return tag_ptr(ret_ret, true);
44844 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) {
44845 LDKFixedPenaltyScorer obj_conv;
44846 obj_conv.inner = untag_ptr(obj);
44847 obj_conv.is_owned = ptr_is_owned(obj);
44848 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44849 obj_conv.is_owned = false;
44850 LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv);
44851 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44852 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44853 CVec_u8Z_free(ret_var);
44857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
44858 LDKu8slice ser_ref;
44859 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
44860 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
44861 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
44862 *ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
44863 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
44864 return tag_ptr(ret_conv, true);
44867 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44868 LDKProbabilisticScorer this_obj_conv;
44869 this_obj_conv.inner = untag_ptr(this_obj);
44870 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44872 ProbabilisticScorer_free(this_obj_conv);
44875 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44876 LDKProbabilisticScoringParameters this_obj_conv;
44877 this_obj_conv.inner = untag_ptr(this_obj);
44878 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44880 ProbabilisticScoringParameters_free(this_obj_conv);
44883 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44884 LDKProbabilisticScoringParameters this_ptr_conv;
44885 this_ptr_conv.inner = untag_ptr(this_ptr);
44886 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44888 this_ptr_conv.is_owned = false;
44889 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_msat(&this_ptr_conv);
44893 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
44894 LDKProbabilisticScoringParameters this_ptr_conv;
44895 this_ptr_conv.inner = untag_ptr(this_ptr);
44896 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44897 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44898 this_ptr_conv.is_owned = false;
44899 ProbabilisticScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
44902 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44903 LDKProbabilisticScoringParameters this_ptr_conv;
44904 this_ptr_conv.inner = untag_ptr(this_ptr);
44905 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44906 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44907 this_ptr_conv.is_owned = false;
44908 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv);
44912 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) {
44913 LDKProbabilisticScoringParameters this_ptr_conv;
44914 this_ptr_conv.inner = untag_ptr(this_ptr);
44915 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44917 this_ptr_conv.is_owned = false;
44918 ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val);
44921 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44922 LDKProbabilisticScoringParameters this_ptr_conv;
44923 this_ptr_conv.inner = untag_ptr(this_ptr);
44924 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44926 this_ptr_conv.is_owned = false;
44927 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv);
44931 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) {
44932 LDKProbabilisticScoringParameters this_ptr_conv;
44933 this_ptr_conv.inner = untag_ptr(this_ptr);
44934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44936 this_ptr_conv.is_owned = false;
44937 ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
44940 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
44941 LDKProbabilisticScoringParameters this_ptr_conv;
44942 this_ptr_conv.inner = untag_ptr(this_ptr);
44943 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44945 this_ptr_conv.is_owned = false;
44946 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_offset_half_life(&this_ptr_conv);
44950 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) {
44951 LDKProbabilisticScoringParameters this_ptr_conv;
44952 this_ptr_conv.inner = untag_ptr(this_ptr);
44953 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44955 this_ptr_conv.is_owned = false;
44956 ProbabilisticScoringParameters_set_liquidity_offset_half_life(&this_ptr_conv, val);
44959 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44960 LDKProbabilisticScoringParameters this_ptr_conv;
44961 this_ptr_conv.inner = untag_ptr(this_ptr);
44962 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44964 this_ptr_conv.is_owned = false;
44965 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
44969 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) {
44970 LDKProbabilisticScoringParameters this_ptr_conv;
44971 this_ptr_conv.inner = untag_ptr(this_ptr);
44972 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44974 this_ptr_conv.is_owned = false;
44975 ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
44978 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44979 LDKProbabilisticScoringParameters this_ptr_conv;
44980 this_ptr_conv.inner = untag_ptr(this_ptr);
44981 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44983 this_ptr_conv.is_owned = false;
44984 int64_t ret_conv = ProbabilisticScoringParameters_get_anti_probing_penalty_msat(&this_ptr_conv);
44988 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) {
44989 LDKProbabilisticScoringParameters this_ptr_conv;
44990 this_ptr_conv.inner = untag_ptr(this_ptr);
44991 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
44992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
44993 this_ptr_conv.is_owned = false;
44994 ProbabilisticScoringParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val);
44997 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
44998 LDKProbabilisticScoringParameters this_ptr_conv;
44999 this_ptr_conv.inner = untag_ptr(this_ptr);
45000 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45002 this_ptr_conv.is_owned = false;
45003 int64_t ret_conv = ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(&this_ptr_conv);
45007 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) {
45008 LDKProbabilisticScoringParameters this_ptr_conv;
45009 this_ptr_conv.inner = untag_ptr(this_ptr);
45010 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45012 this_ptr_conv.is_owned = false;
45013 ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val);
45016 static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) {
45017 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(arg);
45018 int64_t ret_ref = 0;
45019 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45020 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45024 LDKProbabilisticScoringParameters arg_conv;
45025 arg_conv.inner = untag_ptr(arg);
45026 arg_conv.is_owned = ptr_is_owned(arg);
45027 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45028 arg_conv.is_owned = false;
45029 int64_t ret_conv = ProbabilisticScoringParameters_clone_ptr(&arg_conv);
45033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45034 LDKProbabilisticScoringParameters orig_conv;
45035 orig_conv.inner = untag_ptr(orig);
45036 orig_conv.is_owned = ptr_is_owned(orig);
45037 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45038 orig_conv.is_owned = false;
45039 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(&orig_conv);
45040 int64_t ret_ref = 0;
45041 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45042 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45046 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) {
45047 LDKProbabilisticScoringParameters params_conv;
45048 params_conv.inner = untag_ptr(params);
45049 params_conv.is_owned = ptr_is_owned(params);
45050 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
45051 params_conv = ProbabilisticScoringParameters_clone(¶ms_conv);
45052 LDKNetworkGraph network_graph_conv;
45053 network_graph_conv.inner = untag_ptr(network_graph);
45054 network_graph_conv.is_owned = ptr_is_owned(network_graph);
45055 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
45056 network_graph_conv.is_owned = false;
45057 void* logger_ptr = untag_ptr(logger);
45058 CHECK_ACCESS(logger_ptr);
45059 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
45060 if (logger_conv.free == LDKLogger_JCalls_free) {
45061 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45062 LDKLogger_JCalls_cloned(&logger_conv);
45064 LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv);
45065 int64_t ret_ref = 0;
45066 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45067 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45071 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats(JNIEnv *env, jclass clz, int64_t this_arg) {
45072 LDKProbabilisticScorer this_arg_conv;
45073 this_arg_conv.inner = untag_ptr(this_arg);
45074 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45075 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45076 this_arg_conv.is_owned = false;
45077 ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv);
45080 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) {
45081 LDKProbabilisticScorer this_arg_conv;
45082 this_arg_conv.inner = untag_ptr(this_arg);
45083 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45085 this_arg_conv.is_owned = false;
45086 LDKNodeId target_conv;
45087 target_conv.inner = untag_ptr(target);
45088 target_conv.is_owned = ptr_is_owned(target);
45089 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
45090 target_conv.is_owned = false;
45091 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
45092 *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv);
45093 int64_t ret_ref = tag_ptr(ret_copy, true);
45097 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1add_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
45098 LDKProbabilisticScorer this_arg_conv;
45099 this_arg_conv.inner = untag_ptr(this_arg);
45100 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45101 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45102 this_arg_conv.is_owned = false;
45103 LDKNodeId node_id_conv;
45104 node_id_conv.inner = untag_ptr(node_id);
45105 node_id_conv.is_owned = ptr_is_owned(node_id);
45106 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
45107 node_id_conv.is_owned = false;
45108 ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv);
45111 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1remove_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
45112 LDKProbabilisticScorer this_arg_conv;
45113 this_arg_conv.inner = untag_ptr(this_arg);
45114 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45116 this_arg_conv.is_owned = false;
45117 LDKNodeId node_id_conv;
45118 node_id_conv.inner = untag_ptr(node_id);
45119 node_id_conv.is_owned = ptr_is_owned(node_id);
45120 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
45121 node_id_conv.is_owned = false;
45122 ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv);
45125 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) {
45126 LDKProbabilisticScorer this_arg_conv;
45127 this_arg_conv.inner = untag_ptr(this_arg);
45128 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45129 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45130 this_arg_conv.is_owned = false;
45131 LDKNodeId node_id_conv;
45132 node_id_conv.inner = untag_ptr(node_id);
45133 node_id_conv.is_owned = ptr_is_owned(node_id);
45134 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
45135 node_id_conv.is_owned = false;
45136 ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty);
45139 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1remove_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
45140 LDKProbabilisticScorer this_arg_conv;
45141 this_arg_conv.inner = untag_ptr(this_arg);
45142 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45144 this_arg_conv.is_owned = false;
45145 LDKNodeId node_id_conv;
45146 node_id_conv.inner = untag_ptr(node_id);
45147 node_id_conv.is_owned = ptr_is_owned(node_id);
45148 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
45149 node_id_conv.is_owned = false;
45150 ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv);
45153 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1clear_1manual_1penalties(JNIEnv *env, jclass clz, int64_t this_arg) {
45154 LDKProbabilisticScorer this_arg_conv;
45155 this_arg_conv.inner = untag_ptr(this_arg);
45156 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45157 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45158 this_arg_conv.is_owned = false;
45159 ProbabilisticScorer_clear_manual_penalties(&this_arg_conv);
45162 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) {
45163 LDKProbabilisticScoringParameters this_arg_conv;
45164 this_arg_conv.inner = untag_ptr(this_arg);
45165 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45166 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45167 this_arg_conv.is_owned = false;
45168 LDKCVec_NodeIdZ node_ids_constr;
45169 node_ids_constr.datalen = (*env)->GetArrayLength(env, node_ids);
45170 if (node_ids_constr.datalen > 0)
45171 node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
45173 node_ids_constr.data = NULL;
45174 int64_t* node_ids_vals = (*env)->GetLongArrayElements (env, node_ids, NULL);
45175 for (size_t i = 0; i < node_ids_constr.datalen; i++) {
45176 int64_t node_ids_conv_8 = node_ids_vals[i];
45177 LDKNodeId node_ids_conv_8_conv;
45178 node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8);
45179 node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8);
45180 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv);
45181 node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv);
45182 node_ids_constr.data[i] = node_ids_conv_8_conv;
45184 (*env)->ReleaseLongArrayElements(env, node_ids, node_ids_vals, 0);
45185 ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr);
45188 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1default(JNIEnv *env, jclass clz) {
45189 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default();
45190 int64_t ret_ref = 0;
45191 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45192 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45196 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
45197 LDKProbabilisticScorer this_arg_conv;
45198 this_arg_conv.inner = untag_ptr(this_arg);
45199 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45201 this_arg_conv.is_owned = false;
45202 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
45203 *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv);
45204 return tag_ptr(ret_ret, true);
45207 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1write(JNIEnv *env, jclass clz, int64_t obj) {
45208 LDKProbabilisticScorer obj_conv;
45209 obj_conv.inner = untag_ptr(obj);
45210 obj_conv.is_owned = ptr_is_owned(obj);
45211 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45212 obj_conv.is_owned = false;
45213 LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv);
45214 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45215 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45216 CVec_u8Z_free(ret_var);
45220 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) {
45221 LDKu8slice ser_ref;
45222 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45223 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45224 LDKProbabilisticScoringParameters arg_a_conv;
45225 arg_a_conv.inner = untag_ptr(arg_a);
45226 arg_a_conv.is_owned = ptr_is_owned(arg_a);
45227 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv);
45228 arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv);
45229 LDKNetworkGraph arg_b_conv;
45230 arg_b_conv.inner = untag_ptr(arg_b);
45231 arg_b_conv.is_owned = ptr_is_owned(arg_b);
45232 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv);
45233 arg_b_conv.is_owned = false;
45234 void* arg_c_ptr = untag_ptr(arg_c);
45235 CHECK_ACCESS(arg_c_ptr);
45236 LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr);
45237 if (arg_c_conv.free == LDKLogger_JCalls_free) {
45238 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45239 LDKLogger_JCalls_cloned(&arg_c_conv);
45241 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
45242 *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
45243 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45244 return tag_ptr(ret_conv, true);
45247 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45248 LDKFilesystemPersister this_obj_conv;
45249 this_obj_conv.inner = untag_ptr(this_obj);
45250 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45251 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45252 FilesystemPersister_free(this_obj_conv);
45255 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1new(JNIEnv *env, jclass clz, jstring path_to_channel_data) {
45256 LDKStr path_to_channel_data_conv = java_to_owned_str(env, path_to_channel_data);
45257 LDKFilesystemPersister ret_var = FilesystemPersister_new(path_to_channel_data_conv);
45258 int64_t ret_ref = 0;
45259 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45260 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45264 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1data_1dir(JNIEnv *env, jclass clz, int64_t this_arg) {
45265 LDKFilesystemPersister this_arg_conv;
45266 this_arg_conv.inner = untag_ptr(this_arg);
45267 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45269 this_arg_conv.is_owned = false;
45270 LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv);
45271 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
45276 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1channelmonitors(JNIEnv *env, jclass clz, int64_t this_arg, int64_t keys_manager) {
45277 LDKFilesystemPersister this_arg_conv;
45278 this_arg_conv.inner = untag_ptr(this_arg);
45279 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45280 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45281 this_arg_conv.is_owned = false;
45282 void* keys_manager_ptr = untag_ptr(keys_manager);
45283 CHECK_ACCESS(keys_manager_ptr);
45284 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
45285 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
45286 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45287 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
45289 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
45290 *ret_conv = FilesystemPersister_read_channelmonitors(&this_arg_conv, keys_manager_conv);
45291 return tag_ptr(ret_conv, true);
45294 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45295 LDKBackgroundProcessor this_obj_conv;
45296 this_obj_conv.inner = untag_ptr(this_obj);
45297 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45298 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45299 BackgroundProcessor_free(this_obj_conv);
45302 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipSync_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
45303 if (!ptr_is_owned(this_ptr)) return;
45304 void* this_ptr_ptr = untag_ptr(this_ptr);
45305 CHECK_ACCESS(this_ptr_ptr);
45306 LDKGossipSync this_ptr_conv = *(LDKGossipSync*)(this_ptr_ptr);
45307 FREE(untag_ptr(this_ptr));
45308 GossipSync_free(this_ptr_conv);
45311 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1p2_1p(JNIEnv *env, jclass clz, int64_t a) {
45312 LDKP2PGossipSync a_conv;
45313 a_conv.inner = untag_ptr(a);
45314 a_conv.is_owned = ptr_is_owned(a);
45315 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45316 a_conv.is_owned = false;
45317 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
45318 *ret_copy = GossipSync_p2_p(&a_conv);
45319 int64_t ret_ref = tag_ptr(ret_copy, true);
45323 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1rapid(JNIEnv *env, jclass clz, int64_t a) {
45324 LDKRapidGossipSync a_conv;
45325 a_conv.inner = untag_ptr(a);
45326 a_conv.is_owned = ptr_is_owned(a);
45327 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45328 a_conv.is_owned = false;
45329 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
45330 *ret_copy = GossipSync_rapid(&a_conv);
45331 int64_t ret_ref = tag_ptr(ret_copy, true);
45335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1none(JNIEnv *env, jclass clz) {
45336 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
45337 *ret_copy = GossipSync_none();
45338 int64_t ret_ref = tag_ptr(ret_copy, true);
45342 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) {
45343 void* persister_ptr = untag_ptr(persister);
45344 CHECK_ACCESS(persister_ptr);
45345 LDKPersister persister_conv = *(LDKPersister*)(persister_ptr);
45346 if (persister_conv.free == LDKPersister_JCalls_free) {
45347 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45348 LDKPersister_JCalls_cloned(&persister_conv);
45350 void* event_handler_ptr = untag_ptr(event_handler);
45351 CHECK_ACCESS(event_handler_ptr);
45352 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
45353 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
45354 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45355 LDKEventHandler_JCalls_cloned(&event_handler_conv);
45357 LDKChainMonitor chain_monitor_conv;
45358 chain_monitor_conv.inner = untag_ptr(chain_monitor);
45359 chain_monitor_conv.is_owned = ptr_is_owned(chain_monitor);
45360 CHECK_INNER_FIELD_ACCESS_OR_NULL(chain_monitor_conv);
45361 chain_monitor_conv.is_owned = false;
45362 LDKChannelManager channel_manager_conv;
45363 channel_manager_conv.inner = untag_ptr(channel_manager);
45364 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
45365 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
45366 channel_manager_conv.is_owned = false;
45367 void* gossip_sync_ptr = untag_ptr(gossip_sync);
45368 CHECK_ACCESS(gossip_sync_ptr);
45369 LDKGossipSync gossip_sync_conv = *(LDKGossipSync*)(gossip_sync_ptr);
45370 // WARNING: we may need a move here but no clone is available for LDKGossipSync
45371 LDKPeerManager peer_manager_conv;
45372 peer_manager_conv.inner = untag_ptr(peer_manager);
45373 peer_manager_conv.is_owned = ptr_is_owned(peer_manager);
45374 CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_manager_conv);
45375 peer_manager_conv.is_owned = false;
45376 void* logger_ptr = untag_ptr(logger);
45377 CHECK_ACCESS(logger_ptr);
45378 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
45379 if (logger_conv.free == LDKLogger_JCalls_free) {
45380 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
45381 LDKLogger_JCalls_cloned(&logger_conv);
45383 LDKMultiThreadedLockableScore scorer_conv;
45384 scorer_conv.inner = untag_ptr(scorer);
45385 scorer_conv.is_owned = ptr_is_owned(scorer);
45386 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
45387 scorer_conv.is_owned = false;
45388 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);
45389 int64_t ret_ref = 0;
45390 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45391 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45395 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1join(JNIEnv *env, jclass clz, int64_t this_arg) {
45396 LDKBackgroundProcessor this_arg_conv;
45397 this_arg_conv.inner = untag_ptr(this_arg);
45398 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45400 // WARNING: we need a move here but no clone is available for LDKBackgroundProcessor
45402 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
45403 *ret_conv = BackgroundProcessor_join(this_arg_conv);
45404 return tag_ptr(ret_conv, true);
45407 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1stop(JNIEnv *env, jclass clz, int64_t this_arg) {
45408 LDKBackgroundProcessor this_arg_conv;
45409 this_arg_conv.inner = untag_ptr(this_arg);
45410 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45412 // WARNING: we need a move here but no clone is available for LDKBackgroundProcessor
45414 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
45415 *ret_conv = BackgroundProcessor_stop(this_arg_conv);
45416 return tag_ptr(ret_conv, true);
45419 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
45420 if (!ptr_is_owned(this_ptr)) return;
45421 void* this_ptr_ptr = untag_ptr(this_ptr);
45422 CHECK_ACCESS(this_ptr_ptr);
45423 LDKParseError this_ptr_conv = *(LDKParseError*)(this_ptr_ptr);
45424 FREE(untag_ptr(this_ptr));
45425 ParseError_free(this_ptr_conv);
45428 static inline uint64_t ParseError_clone_ptr(LDKParseError *NONNULL_PTR arg) {
45429 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45430 *ret_copy = ParseError_clone(arg);
45431 int64_t ret_ref = tag_ptr(ret_copy, true);
45434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45435 LDKParseError* arg_conv = (LDKParseError*)untag_ptr(arg);
45436 int64_t ret_conv = ParseError_clone_ptr(arg_conv);
45440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45441 LDKParseError* orig_conv = (LDKParseError*)untag_ptr(orig);
45442 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45443 *ret_copy = ParseError_clone(orig_conv);
45444 int64_t ret_ref = tag_ptr(ret_copy, true);
45448 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1bech32_1error(JNIEnv *env, jclass clz, int64_t a) {
45449 void* a_ptr = untag_ptr(a);
45450 CHECK_ACCESS(a_ptr);
45451 LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr);
45452 a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a));
45453 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45454 *ret_copy = ParseError_bech32_error(a_conv);
45455 int64_t ret_ref = tag_ptr(ret_copy, true);
45459 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1parse_1amount_1error(JNIEnv *env, jclass clz, int32_t a) {
45461 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45462 *ret_copy = ParseError_parse_amount_error((LDKError){ ._dummy = 0 });
45463 int64_t ret_ref = tag_ptr(ret_copy, true);
45467 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1malformed_1signature(JNIEnv *env, jclass clz, jclass a) {
45468 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a);
45469 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45470 *ret_copy = ParseError_malformed_signature(a_conv);
45471 int64_t ret_ref = tag_ptr(ret_copy, true);
45475 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1bad_1prefix(JNIEnv *env, jclass clz) {
45476 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45477 *ret_copy = ParseError_bad_prefix();
45478 int64_t ret_ref = tag_ptr(ret_copy, true);
45482 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unknown_1currency(JNIEnv *env, jclass clz) {
45483 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45484 *ret_copy = ParseError_unknown_currency();
45485 int64_t ret_ref = tag_ptr(ret_copy, true);
45489 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unknown_1si_1prefix(JNIEnv *env, jclass clz) {
45490 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45491 *ret_copy = ParseError_unknown_si_prefix();
45492 int64_t ret_ref = tag_ptr(ret_copy, true);
45496 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1malformed_1hrp(JNIEnv *env, jclass clz) {
45497 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45498 *ret_copy = ParseError_malformed_hrp();
45499 int64_t ret_ref = tag_ptr(ret_copy, true);
45503 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1too_1short_1data_1part(JNIEnv *env, jclass clz) {
45504 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45505 *ret_copy = ParseError_too_short_data_part();
45506 int64_t ret_ref = tag_ptr(ret_copy, true);
45510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unexpected_1end_1of_1tagged_1fields(JNIEnv *env, jclass clz) {
45511 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45512 *ret_copy = ParseError_unexpected_end_of_tagged_fields();
45513 int64_t ret_ref = tag_ptr(ret_copy, true);
45517 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1description_1decode_1error(JNIEnv *env, jclass clz, int32_t a) {
45519 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45520 *ret_copy = ParseError_description_decode_error((LDKError){ ._dummy = 0 });
45521 int64_t ret_ref = tag_ptr(ret_copy, true);
45525 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1padding_1error(JNIEnv *env, jclass clz) {
45526 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45527 *ret_copy = ParseError_padding_error();
45528 int64_t ret_ref = tag_ptr(ret_copy, true);
45532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1integer_1overflow_1error(JNIEnv *env, jclass clz) {
45533 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45534 *ret_copy = ParseError_integer_overflow_error();
45535 int64_t ret_ref = tag_ptr(ret_copy, true);
45539 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1seg_1wit_1program_1length(JNIEnv *env, jclass clz) {
45540 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45541 *ret_copy = ParseError_invalid_seg_wit_program_length();
45542 int64_t ret_ref = tag_ptr(ret_copy, true);
45546 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1pub_1key_1hash_1length(JNIEnv *env, jclass clz) {
45547 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45548 *ret_copy = ParseError_invalid_pub_key_hash_length();
45549 int64_t ret_ref = tag_ptr(ret_copy, true);
45553 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1script_1hash_1length(JNIEnv *env, jclass clz) {
45554 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45555 *ret_copy = ParseError_invalid_script_hash_length();
45556 int64_t ret_ref = tag_ptr(ret_copy, true);
45560 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) {
45561 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45562 *ret_copy = ParseError_invalid_recovery_id();
45563 int64_t ret_ref = tag_ptr(ret_copy, true);
45567 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1slice_1length(JNIEnv *env, jclass clz, jstring a) {
45568 LDKStr a_conv = java_to_owned_str(env, a);
45569 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45570 *ret_copy = ParseError_invalid_slice_length(a_conv);
45571 int64_t ret_ref = tag_ptr(ret_copy, true);
45575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1skip(JNIEnv *env, jclass clz) {
45576 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
45577 *ret_copy = ParseError_skip();
45578 int64_t ret_ref = tag_ptr(ret_copy, true);
45582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
45583 if (!ptr_is_owned(this_ptr)) return;
45584 void* this_ptr_ptr = untag_ptr(this_ptr);
45585 CHECK_ACCESS(this_ptr_ptr);
45586 LDKParseOrSemanticError this_ptr_conv = *(LDKParseOrSemanticError*)(this_ptr_ptr);
45587 FREE(untag_ptr(this_ptr));
45588 ParseOrSemanticError_free(this_ptr_conv);
45591 static inline uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg) {
45592 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
45593 *ret_copy = ParseOrSemanticError_clone(arg);
45594 int64_t ret_ref = tag_ptr(ret_copy, true);
45597 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45598 LDKParseOrSemanticError* arg_conv = (LDKParseOrSemanticError*)untag_ptr(arg);
45599 int64_t ret_conv = ParseOrSemanticError_clone_ptr(arg_conv);
45603 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45604 LDKParseOrSemanticError* orig_conv = (LDKParseOrSemanticError*)untag_ptr(orig);
45605 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
45606 *ret_copy = ParseOrSemanticError_clone(orig_conv);
45607 int64_t ret_ref = tag_ptr(ret_copy, true);
45611 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1parse_1error(JNIEnv *env, jclass clz, int64_t a) {
45612 void* a_ptr = untag_ptr(a);
45613 CHECK_ACCESS(a_ptr);
45614 LDKParseError a_conv = *(LDKParseError*)(a_ptr);
45615 a_conv = ParseError_clone((LDKParseError*)untag_ptr(a));
45616 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
45617 *ret_copy = ParseOrSemanticError_parse_error(a_conv);
45618 int64_t ret_ref = tag_ptr(ret_copy, true);
45622 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1semantic_1error(JNIEnv *env, jclass clz, jclass a) {
45623 LDKSemanticError a_conv = LDKSemanticError_from_java(env, a);
45624 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
45625 *ret_copy = ParseOrSemanticError_semantic_error(a_conv);
45626 int64_t ret_ref = tag_ptr(ret_copy, true);
45630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45631 LDKInvoice this_obj_conv;
45632 this_obj_conv.inner = untag_ptr(this_obj);
45633 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45635 Invoice_free(this_obj_conv);
45638 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
45640 a_conv.inner = untag_ptr(a);
45641 a_conv.is_owned = ptr_is_owned(a);
45642 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45643 a_conv.is_owned = false;
45645 b_conv.inner = untag_ptr(b);
45646 b_conv.is_owned = ptr_is_owned(b);
45647 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45648 b_conv.is_owned = false;
45649 jboolean ret_conv = Invoice_eq(&a_conv, &b_conv);
45653 static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) {
45654 LDKInvoice ret_var = Invoice_clone(arg);
45655 int64_t ret_ref = 0;
45656 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45657 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45660 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45661 LDKInvoice arg_conv;
45662 arg_conv.inner = untag_ptr(arg);
45663 arg_conv.is_owned = ptr_is_owned(arg);
45664 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45665 arg_conv.is_owned = false;
45666 int64_t ret_conv = Invoice_clone_ptr(&arg_conv);
45670 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45671 LDKInvoice orig_conv;
45672 orig_conv.inner = untag_ptr(orig);
45673 orig_conv.is_owned = ptr_is_owned(orig);
45674 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45675 orig_conv.is_owned = false;
45676 LDKInvoice ret_var = Invoice_clone(&orig_conv);
45677 int64_t ret_ref = 0;
45678 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45679 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45683 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45684 LDKSignedRawInvoice this_obj_conv;
45685 this_obj_conv.inner = untag_ptr(this_obj);
45686 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45687 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45688 SignedRawInvoice_free(this_obj_conv);
45691 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
45692 LDKSignedRawInvoice a_conv;
45693 a_conv.inner = untag_ptr(a);
45694 a_conv.is_owned = ptr_is_owned(a);
45695 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45696 a_conv.is_owned = false;
45697 LDKSignedRawInvoice b_conv;
45698 b_conv.inner = untag_ptr(b);
45699 b_conv.is_owned = ptr_is_owned(b);
45700 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45701 b_conv.is_owned = false;
45702 jboolean ret_conv = SignedRawInvoice_eq(&a_conv, &b_conv);
45706 static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) {
45707 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg);
45708 int64_t ret_ref = 0;
45709 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45710 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45713 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45714 LDKSignedRawInvoice arg_conv;
45715 arg_conv.inner = untag_ptr(arg);
45716 arg_conv.is_owned = ptr_is_owned(arg);
45717 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45718 arg_conv.is_owned = false;
45719 int64_t ret_conv = SignedRawInvoice_clone_ptr(&arg_conv);
45723 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45724 LDKSignedRawInvoice orig_conv;
45725 orig_conv.inner = untag_ptr(orig);
45726 orig_conv.is_owned = ptr_is_owned(orig);
45727 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45728 orig_conv.is_owned = false;
45729 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv);
45730 int64_t ret_ref = 0;
45731 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45732 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45736 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45737 LDKRawInvoice this_obj_conv;
45738 this_obj_conv.inner = untag_ptr(this_obj);
45739 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45741 RawInvoice_free(this_obj_conv);
45744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
45745 LDKRawInvoice this_ptr_conv;
45746 this_ptr_conv.inner = untag_ptr(this_ptr);
45747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45749 this_ptr_conv.is_owned = false;
45750 LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv);
45751 int64_t ret_ref = 0;
45752 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45753 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45757 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45758 LDKRawInvoice this_ptr_conv;
45759 this_ptr_conv.inner = untag_ptr(this_ptr);
45760 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45762 this_ptr_conv.is_owned = false;
45763 LDKRawDataPart val_conv;
45764 val_conv.inner = untag_ptr(val);
45765 val_conv.is_owned = ptr_is_owned(val);
45766 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45767 val_conv = RawDataPart_clone(&val_conv);
45768 RawInvoice_set_data(&this_ptr_conv, val_conv);
45771 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawInvoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
45772 LDKRawInvoice a_conv;
45773 a_conv.inner = untag_ptr(a);
45774 a_conv.is_owned = ptr_is_owned(a);
45775 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45776 a_conv.is_owned = false;
45777 LDKRawInvoice b_conv;
45778 b_conv.inner = untag_ptr(b);
45779 b_conv.is_owned = ptr_is_owned(b);
45780 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45781 b_conv.is_owned = false;
45782 jboolean ret_conv = RawInvoice_eq(&a_conv, &b_conv);
45786 static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) {
45787 LDKRawInvoice ret_var = RawInvoice_clone(arg);
45788 int64_t ret_ref = 0;
45789 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45790 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45793 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45794 LDKRawInvoice arg_conv;
45795 arg_conv.inner = untag_ptr(arg);
45796 arg_conv.is_owned = ptr_is_owned(arg);
45797 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45798 arg_conv.is_owned = false;
45799 int64_t ret_conv = RawInvoice_clone_ptr(&arg_conv);
45803 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45804 LDKRawInvoice orig_conv;
45805 orig_conv.inner = untag_ptr(orig);
45806 orig_conv.is_owned = ptr_is_owned(orig);
45807 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45808 orig_conv.is_owned = false;
45809 LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv);
45810 int64_t ret_ref = 0;
45811 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45812 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45817 LDKRawDataPart this_obj_conv;
45818 this_obj_conv.inner = untag_ptr(this_obj);
45819 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45820 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45821 RawDataPart_free(this_obj_conv);
45824 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
45825 LDKRawDataPart this_ptr_conv;
45826 this_ptr_conv.inner = untag_ptr(this_ptr);
45827 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45829 this_ptr_conv.is_owned = false;
45830 LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv);
45831 int64_t ret_ref = 0;
45832 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45833 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45837 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
45838 LDKRawDataPart this_ptr_conv;
45839 this_ptr_conv.inner = untag_ptr(this_ptr);
45840 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
45841 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
45842 this_ptr_conv.is_owned = false;
45843 LDKPositiveTimestamp val_conv;
45844 val_conv.inner = untag_ptr(val);
45845 val_conv.is_owned = ptr_is_owned(val);
45846 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
45847 val_conv = PositiveTimestamp_clone(&val_conv);
45848 RawDataPart_set_timestamp(&this_ptr_conv, val_conv);
45851 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawDataPart_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
45852 LDKRawDataPart a_conv;
45853 a_conv.inner = untag_ptr(a);
45854 a_conv.is_owned = ptr_is_owned(a);
45855 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45856 a_conv.is_owned = false;
45857 LDKRawDataPart b_conv;
45858 b_conv.inner = untag_ptr(b);
45859 b_conv.is_owned = ptr_is_owned(b);
45860 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45861 b_conv.is_owned = false;
45862 jboolean ret_conv = RawDataPart_eq(&a_conv, &b_conv);
45866 static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) {
45867 LDKRawDataPart ret_var = RawDataPart_clone(arg);
45868 int64_t ret_ref = 0;
45869 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45870 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45873 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45874 LDKRawDataPart arg_conv;
45875 arg_conv.inner = untag_ptr(arg);
45876 arg_conv.is_owned = ptr_is_owned(arg);
45877 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45878 arg_conv.is_owned = false;
45879 int64_t ret_conv = RawDataPart_clone_ptr(&arg_conv);
45883 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45884 LDKRawDataPart orig_conv;
45885 orig_conv.inner = untag_ptr(orig);
45886 orig_conv.is_owned = ptr_is_owned(orig);
45887 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45888 orig_conv.is_owned = false;
45889 LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv);
45890 int64_t ret_ref = 0;
45891 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45892 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45896 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
45897 LDKPositiveTimestamp this_obj_conv;
45898 this_obj_conv.inner = untag_ptr(this_obj);
45899 this_obj_conv.is_owned = ptr_is_owned(this_obj);
45900 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
45901 PositiveTimestamp_free(this_obj_conv);
45904 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
45905 LDKPositiveTimestamp a_conv;
45906 a_conv.inner = untag_ptr(a);
45907 a_conv.is_owned = ptr_is_owned(a);
45908 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
45909 a_conv.is_owned = false;
45910 LDKPositiveTimestamp b_conv;
45911 b_conv.inner = untag_ptr(b);
45912 b_conv.is_owned = ptr_is_owned(b);
45913 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
45914 b_conv.is_owned = false;
45915 jboolean ret_conv = PositiveTimestamp_eq(&a_conv, &b_conv);
45919 static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) {
45920 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg);
45921 int64_t ret_ref = 0;
45922 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45923 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45926 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
45927 LDKPositiveTimestamp arg_conv;
45928 arg_conv.inner = untag_ptr(arg);
45929 arg_conv.is_owned = ptr_is_owned(arg);
45930 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
45931 arg_conv.is_owned = false;
45932 int64_t ret_conv = PositiveTimestamp_clone_ptr(&arg_conv);
45936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45937 LDKPositiveTimestamp orig_conv;
45938 orig_conv.inner = untag_ptr(orig);
45939 orig_conv.is_owned = ptr_is_owned(orig);
45940 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
45941 orig_conv.is_owned = false;
45942 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv);
45943 int64_t ret_ref = 0;
45944 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45945 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45949 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45950 LDKSiPrefix* orig_conv = (LDKSiPrefix*)untag_ptr(orig);
45951 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_clone(orig_conv));
45955 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1milli(JNIEnv *env, jclass clz) {
45956 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_milli());
45960 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1micro(JNIEnv *env, jclass clz) {
45961 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_micro());
45965 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1nano(JNIEnv *env, jclass clz) {
45966 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_nano());
45970 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1pico(JNIEnv *env, jclass clz) {
45971 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_pico());
45975 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SiPrefix_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
45976 LDKSiPrefix* a_conv = (LDKSiPrefix*)untag_ptr(a);
45977 LDKSiPrefix* b_conv = (LDKSiPrefix*)untag_ptr(b);
45978 jboolean ret_conv = SiPrefix_eq(a_conv, b_conv);
45982 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1multiplier(JNIEnv *env, jclass clz, int64_t this_arg) {
45983 LDKSiPrefix* this_arg_conv = (LDKSiPrefix*)untag_ptr(this_arg);
45984 int64_t ret_conv = SiPrefix_multiplier(this_arg_conv);
45988 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1clone(JNIEnv *env, jclass clz, int64_t orig) {
45989 LDKCurrency* orig_conv = (LDKCurrency*)untag_ptr(orig);
45990 jclass ret_conv = LDKCurrency_to_java(env, Currency_clone(orig_conv));
45994 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin(JNIEnv *env, jclass clz) {
45995 jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin());
45999 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin_1testnet(JNIEnv *env, jclass clz) {
46000 jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin_testnet());
46004 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1regtest(JNIEnv *env, jclass clz) {
46005 jclass ret_conv = LDKCurrency_to_java(env, Currency_regtest());
46009 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1simnet(JNIEnv *env, jclass clz) {
46010 jclass ret_conv = LDKCurrency_to_java(env, Currency_simnet());
46014 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1signet(JNIEnv *env, jclass clz) {
46015 jclass ret_conv = LDKCurrency_to_java(env, Currency_signet());
46019 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Currency_1hash(JNIEnv *env, jclass clz, int64_t o) {
46020 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
46021 int64_t ret_conv = Currency_hash(o_conv);
46025 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Currency_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46026 LDKCurrency* a_conv = (LDKCurrency*)untag_ptr(a);
46027 LDKCurrency* b_conv = (LDKCurrency*)untag_ptr(b);
46028 jboolean ret_conv = Currency_eq(a_conv, b_conv);
46032 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sha256_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46033 LDKSha256 this_obj_conv;
46034 this_obj_conv.inner = untag_ptr(this_obj);
46035 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46037 Sha256_free(this_obj_conv);
46040 static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) {
46041 LDKSha256 ret_var = Sha256_clone(arg);
46042 int64_t ret_ref = 0;
46043 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46044 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46048 LDKSha256 arg_conv;
46049 arg_conv.inner = untag_ptr(arg);
46050 arg_conv.is_owned = ptr_is_owned(arg);
46051 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46052 arg_conv.is_owned = false;
46053 int64_t ret_conv = Sha256_clone_ptr(&arg_conv);
46057 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46058 LDKSha256 orig_conv;
46059 orig_conv.inner = untag_ptr(orig);
46060 orig_conv.is_owned = ptr_is_owned(orig);
46061 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46062 orig_conv.is_owned = false;
46063 LDKSha256 ret_var = Sha256_clone(&orig_conv);
46064 int64_t ret_ref = 0;
46065 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46066 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46070 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1hash(JNIEnv *env, jclass clz, int64_t o) {
46072 o_conv.inner = untag_ptr(o);
46073 o_conv.is_owned = ptr_is_owned(o);
46074 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46075 o_conv.is_owned = false;
46076 int64_t ret_conv = Sha256_hash(&o_conv);
46080 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Sha256_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46082 a_conv.inner = untag_ptr(a);
46083 a_conv.is_owned = ptr_is_owned(a);
46084 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46085 a_conv.is_owned = false;
46087 b_conv.inner = untag_ptr(b);
46088 b_conv.is_owned = ptr_is_owned(b);
46089 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46090 b_conv.is_owned = false;
46091 jboolean ret_conv = Sha256_eq(&a_conv, &b_conv);
46095 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Description_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46096 LDKDescription this_obj_conv;
46097 this_obj_conv.inner = untag_ptr(this_obj);
46098 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46099 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46100 Description_free(this_obj_conv);
46103 static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) {
46104 LDKDescription ret_var = Description_clone(arg);
46105 int64_t ret_ref = 0;
46106 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46107 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46110 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46111 LDKDescription arg_conv;
46112 arg_conv.inner = untag_ptr(arg);
46113 arg_conv.is_owned = ptr_is_owned(arg);
46114 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46115 arg_conv.is_owned = false;
46116 int64_t ret_conv = Description_clone_ptr(&arg_conv);
46120 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46121 LDKDescription orig_conv;
46122 orig_conv.inner = untag_ptr(orig);
46123 orig_conv.is_owned = ptr_is_owned(orig);
46124 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46125 orig_conv.is_owned = false;
46126 LDKDescription ret_var = Description_clone(&orig_conv);
46127 int64_t ret_ref = 0;
46128 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46129 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46133 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1hash(JNIEnv *env, jclass clz, int64_t o) {
46134 LDKDescription o_conv;
46135 o_conv.inner = untag_ptr(o);
46136 o_conv.is_owned = ptr_is_owned(o);
46137 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46138 o_conv.is_owned = false;
46139 int64_t ret_conv = Description_hash(&o_conv);
46143 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Description_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46144 LDKDescription a_conv;
46145 a_conv.inner = untag_ptr(a);
46146 a_conv.is_owned = ptr_is_owned(a);
46147 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46148 a_conv.is_owned = false;
46149 LDKDescription b_conv;
46150 b_conv.inner = untag_ptr(b);
46151 b_conv.is_owned = ptr_is_owned(b);
46152 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46153 b_conv.is_owned = false;
46154 jboolean ret_conv = Description_eq(&a_conv, &b_conv);
46158 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46159 LDKPayeePubKey this_obj_conv;
46160 this_obj_conv.inner = untag_ptr(this_obj);
46161 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46162 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46163 PayeePubKey_free(this_obj_conv);
46166 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
46167 LDKPayeePubKey this_ptr_conv;
46168 this_ptr_conv.inner = untag_ptr(this_ptr);
46169 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46171 this_ptr_conv.is_owned = false;
46172 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
46173 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PayeePubKey_get_a(&this_ptr_conv).compressed_form);
46177 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
46178 LDKPayeePubKey this_ptr_conv;
46179 this_ptr_conv.inner = untag_ptr(this_ptr);
46180 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46181 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46182 this_ptr_conv.is_owned = false;
46183 LDKPublicKey val_ref;
46184 CHECK((*env)->GetArrayLength(env, val) == 33);
46185 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
46186 PayeePubKey_set_a(&this_ptr_conv, val_ref);
46189 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) {
46190 LDKPublicKey a_arg_ref;
46191 CHECK((*env)->GetArrayLength(env, a_arg) == 33);
46192 (*env)->GetByteArrayRegion(env, a_arg, 0, 33, a_arg_ref.compressed_form);
46193 LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
46194 int64_t ret_ref = 0;
46195 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46196 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46200 static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) {
46201 LDKPayeePubKey ret_var = PayeePubKey_clone(arg);
46202 int64_t ret_ref = 0;
46203 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46204 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46207 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46208 LDKPayeePubKey arg_conv;
46209 arg_conv.inner = untag_ptr(arg);
46210 arg_conv.is_owned = ptr_is_owned(arg);
46211 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46212 arg_conv.is_owned = false;
46213 int64_t ret_conv = PayeePubKey_clone_ptr(&arg_conv);
46217 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46218 LDKPayeePubKey orig_conv;
46219 orig_conv.inner = untag_ptr(orig);
46220 orig_conv.is_owned = ptr_is_owned(orig);
46221 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46222 orig_conv.is_owned = false;
46223 LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv);
46224 int64_t ret_ref = 0;
46225 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46226 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46230 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1hash(JNIEnv *env, jclass clz, int64_t o) {
46231 LDKPayeePubKey o_conv;
46232 o_conv.inner = untag_ptr(o);
46233 o_conv.is_owned = ptr_is_owned(o);
46234 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46235 o_conv.is_owned = false;
46236 int64_t ret_conv = PayeePubKey_hash(&o_conv);
46240 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46241 LDKPayeePubKey a_conv;
46242 a_conv.inner = untag_ptr(a);
46243 a_conv.is_owned = ptr_is_owned(a);
46244 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46245 a_conv.is_owned = false;
46246 LDKPayeePubKey b_conv;
46247 b_conv.inner = untag_ptr(b);
46248 b_conv.is_owned = ptr_is_owned(b);
46249 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46250 b_conv.is_owned = false;
46251 jboolean ret_conv = PayeePubKey_eq(&a_conv, &b_conv);
46255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46256 LDKExpiryTime this_obj_conv;
46257 this_obj_conv.inner = untag_ptr(this_obj);
46258 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46259 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46260 ExpiryTime_free(this_obj_conv);
46263 static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) {
46264 LDKExpiryTime ret_var = ExpiryTime_clone(arg);
46265 int64_t ret_ref = 0;
46266 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46267 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46270 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46271 LDKExpiryTime arg_conv;
46272 arg_conv.inner = untag_ptr(arg);
46273 arg_conv.is_owned = ptr_is_owned(arg);
46274 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46275 arg_conv.is_owned = false;
46276 int64_t ret_conv = ExpiryTime_clone_ptr(&arg_conv);
46280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46281 LDKExpiryTime orig_conv;
46282 orig_conv.inner = untag_ptr(orig);
46283 orig_conv.is_owned = ptr_is_owned(orig);
46284 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46285 orig_conv.is_owned = false;
46286 LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv);
46287 int64_t ret_ref = 0;
46288 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46289 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46293 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1hash(JNIEnv *env, jclass clz, int64_t o) {
46294 LDKExpiryTime o_conv;
46295 o_conv.inner = untag_ptr(o);
46296 o_conv.is_owned = ptr_is_owned(o);
46297 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46298 o_conv.is_owned = false;
46299 int64_t ret_conv = ExpiryTime_hash(&o_conv);
46303 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46304 LDKExpiryTime a_conv;
46305 a_conv.inner = untag_ptr(a);
46306 a_conv.is_owned = ptr_is_owned(a);
46307 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46308 a_conv.is_owned = false;
46309 LDKExpiryTime b_conv;
46310 b_conv.inner = untag_ptr(b);
46311 b_conv.is_owned = ptr_is_owned(b);
46312 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46313 b_conv.is_owned = false;
46314 jboolean ret_conv = ExpiryTime_eq(&a_conv, &b_conv);
46318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46319 LDKMinFinalCltvExpiry this_obj_conv;
46320 this_obj_conv.inner = untag_ptr(this_obj);
46321 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46323 MinFinalCltvExpiry_free(this_obj_conv);
46326 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
46327 LDKMinFinalCltvExpiry this_ptr_conv;
46328 this_ptr_conv.inner = untag_ptr(this_ptr);
46329 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46331 this_ptr_conv.is_owned = false;
46332 int64_t ret_conv = MinFinalCltvExpiry_get_a(&this_ptr_conv);
46336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
46337 LDKMinFinalCltvExpiry this_ptr_conv;
46338 this_ptr_conv.inner = untag_ptr(this_ptr);
46339 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46340 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46341 this_ptr_conv.is_owned = false;
46342 MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
46345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
46346 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_arg);
46347 int64_t ret_ref = 0;
46348 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46349 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46353 static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) {
46354 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg);
46355 int64_t ret_ref = 0;
46356 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46357 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46360 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46361 LDKMinFinalCltvExpiry arg_conv;
46362 arg_conv.inner = untag_ptr(arg);
46363 arg_conv.is_owned = ptr_is_owned(arg);
46364 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46365 arg_conv.is_owned = false;
46366 int64_t ret_conv = MinFinalCltvExpiry_clone_ptr(&arg_conv);
46370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46371 LDKMinFinalCltvExpiry orig_conv;
46372 orig_conv.inner = untag_ptr(orig);
46373 orig_conv.is_owned = ptr_is_owned(orig);
46374 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46375 orig_conv.is_owned = false;
46376 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv);
46377 int64_t ret_ref = 0;
46378 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46379 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1hash(JNIEnv *env, jclass clz, int64_t o) {
46384 LDKMinFinalCltvExpiry o_conv;
46385 o_conv.inner = untag_ptr(o);
46386 o_conv.is_owned = ptr_is_owned(o);
46387 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46388 o_conv.is_owned = false;
46389 int64_t ret_conv = MinFinalCltvExpiry_hash(&o_conv);
46393 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46394 LDKMinFinalCltvExpiry a_conv;
46395 a_conv.inner = untag_ptr(a);
46396 a_conv.is_owned = ptr_is_owned(a);
46397 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46398 a_conv.is_owned = false;
46399 LDKMinFinalCltvExpiry b_conv;
46400 b_conv.inner = untag_ptr(b);
46401 b_conv.is_owned = ptr_is_owned(b);
46402 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46403 b_conv.is_owned = false;
46404 jboolean ret_conv = MinFinalCltvExpiry_eq(&a_conv, &b_conv);
46408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
46409 if (!ptr_is_owned(this_ptr)) return;
46410 void* this_ptr_ptr = untag_ptr(this_ptr);
46411 CHECK_ACCESS(this_ptr_ptr);
46412 LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
46413 FREE(untag_ptr(this_ptr));
46414 Fallback_free(this_ptr_conv);
46417 static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) {
46418 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
46419 *ret_copy = Fallback_clone(arg);
46420 int64_t ret_ref = tag_ptr(ret_copy, true);
46423 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46424 LDKFallback* arg_conv = (LDKFallback*)untag_ptr(arg);
46425 int64_t ret_conv = Fallback_clone_ptr(arg_conv);
46429 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46430 LDKFallback* orig_conv = (LDKFallback*)untag_ptr(orig);
46431 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
46432 *ret_copy = Fallback_clone(orig_conv);
46433 int64_t ret_ref = tag_ptr(ret_copy, true);
46437 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1seg_1wit_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) {
46439 LDKCVec_u8Z program_ref;
46440 program_ref.datalen = (*env)->GetArrayLength(env, program);
46441 program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
46442 (*env)->GetByteArrayRegion(env, program, 0, program_ref.datalen, program_ref.data);
46443 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
46444 *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
46445 int64_t ret_ref = tag_ptr(ret_copy, true);
46449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1pub_1key_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
46450 LDKTwentyBytes a_ref;
46451 CHECK((*env)->GetArrayLength(env, a) == 20);
46452 (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
46453 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
46454 *ret_copy = Fallback_pub_key_hash(a_ref);
46455 int64_t ret_ref = tag_ptr(ret_copy, true);
46459 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1script_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
46460 LDKTwentyBytes a_ref;
46461 CHECK((*env)->GetArrayLength(env, a) == 20);
46462 (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
46463 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
46464 *ret_copy = Fallback_script_hash(a_ref);
46465 int64_t ret_ref = tag_ptr(ret_copy, true);
46469 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1hash(JNIEnv *env, jclass clz, int64_t o) {
46470 LDKFallback* o_conv = (LDKFallback*)untag_ptr(o);
46471 int64_t ret_conv = Fallback_hash(o_conv);
46475 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Fallback_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46476 LDKFallback* a_conv = (LDKFallback*)untag_ptr(a);
46477 LDKFallback* b_conv = (LDKFallback*)untag_ptr(b);
46478 jboolean ret_conv = Fallback_eq(a_conv, b_conv);
46482 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46483 LDKInvoiceSignature this_obj_conv;
46484 this_obj_conv.inner = untag_ptr(this_obj);
46485 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46486 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46487 InvoiceSignature_free(this_obj_conv);
46490 static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) {
46491 LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg);
46492 int64_t ret_ref = 0;
46493 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46494 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46497 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46498 LDKInvoiceSignature arg_conv;
46499 arg_conv.inner = untag_ptr(arg);
46500 arg_conv.is_owned = ptr_is_owned(arg);
46501 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46502 arg_conv.is_owned = false;
46503 int64_t ret_conv = InvoiceSignature_clone_ptr(&arg_conv);
46507 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46508 LDKInvoiceSignature orig_conv;
46509 orig_conv.inner = untag_ptr(orig);
46510 orig_conv.is_owned = ptr_is_owned(orig);
46511 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46512 orig_conv.is_owned = false;
46513 LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv);
46514 int64_t ret_ref = 0;
46515 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46516 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46520 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46521 LDKInvoiceSignature a_conv;
46522 a_conv.inner = untag_ptr(a);
46523 a_conv.is_owned = ptr_is_owned(a);
46524 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46525 a_conv.is_owned = false;
46526 LDKInvoiceSignature b_conv;
46527 b_conv.inner = untag_ptr(b);
46528 b_conv.is_owned = ptr_is_owned(b);
46529 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46530 b_conv.is_owned = false;
46531 jboolean ret_conv = InvoiceSignature_eq(&a_conv, &b_conv);
46535 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46536 LDKPrivateRoute this_obj_conv;
46537 this_obj_conv.inner = untag_ptr(this_obj);
46538 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46540 PrivateRoute_free(this_obj_conv);
46543 static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) {
46544 LDKPrivateRoute ret_var = PrivateRoute_clone(arg);
46545 int64_t ret_ref = 0;
46546 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46547 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46550 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46551 LDKPrivateRoute arg_conv;
46552 arg_conv.inner = untag_ptr(arg);
46553 arg_conv.is_owned = ptr_is_owned(arg);
46554 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46555 arg_conv.is_owned = false;
46556 int64_t ret_conv = PrivateRoute_clone_ptr(&arg_conv);
46560 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46561 LDKPrivateRoute orig_conv;
46562 orig_conv.inner = untag_ptr(orig);
46563 orig_conv.is_owned = ptr_is_owned(orig);
46564 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46565 orig_conv.is_owned = false;
46566 LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv);
46567 int64_t ret_ref = 0;
46568 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46569 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46573 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1hash(JNIEnv *env, jclass clz, int64_t o) {
46574 LDKPrivateRoute o_conv;
46575 o_conv.inner = untag_ptr(o);
46576 o_conv.is_owned = ptr_is_owned(o);
46577 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
46578 o_conv.is_owned = false;
46579 int64_t ret_conv = PrivateRoute_hash(&o_conv);
46583 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46584 LDKPrivateRoute a_conv;
46585 a_conv.inner = untag_ptr(a);
46586 a_conv.is_owned = ptr_is_owned(a);
46587 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46588 a_conv.is_owned = false;
46589 LDKPrivateRoute b_conv;
46590 b_conv.inner = untag_ptr(b);
46591 b_conv.is_owned = ptr_is_owned(b);
46592 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46593 b_conv.is_owned = false;
46594 jboolean ret_conv = PrivateRoute_eq(&a_conv, &b_conv);
46598 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1into_1parts(JNIEnv *env, jclass clz, int64_t this_arg) {
46599 LDKSignedRawInvoice this_arg_conv;
46600 this_arg_conv.inner = untag_ptr(this_arg);
46601 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46602 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46603 this_arg_conv = SignedRawInvoice_clone(&this_arg_conv);
46604 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
46605 *ret_conv = SignedRawInvoice_into_parts(this_arg_conv);
46606 return tag_ptr(ret_conv, true);
46609 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1raw_1invoice(JNIEnv *env, jclass clz, int64_t this_arg) {
46610 LDKSignedRawInvoice this_arg_conv;
46611 this_arg_conv.inner = untag_ptr(this_arg);
46612 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46613 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46614 this_arg_conv.is_owned = false;
46615 LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv);
46616 int64_t ret_ref = 0;
46617 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46618 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46622 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
46623 LDKSignedRawInvoice this_arg_conv;
46624 this_arg_conv.inner = untag_ptr(this_arg);
46625 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46626 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46627 this_arg_conv.is_owned = false;
46628 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
46629 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SignedRawInvoice_hash(&this_arg_conv));
46633 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
46634 LDKSignedRawInvoice this_arg_conv;
46635 this_arg_conv.inner = untag_ptr(this_arg);
46636 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46638 this_arg_conv.is_owned = false;
46639 LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv);
46640 int64_t ret_ref = 0;
46641 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46642 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46646 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1recover_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
46647 LDKSignedRawInvoice this_arg_conv;
46648 this_arg_conv.inner = untag_ptr(this_arg);
46649 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46650 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46651 this_arg_conv.is_owned = false;
46652 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
46653 *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv);
46654 return tag_ptr(ret_conv, true);
46657 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1check_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
46658 LDKSignedRawInvoice this_arg_conv;
46659 this_arg_conv.inner = untag_ptr(this_arg);
46660 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46662 this_arg_conv.is_owned = false;
46663 jboolean ret_conv = SignedRawInvoice_check_signature(&this_arg_conv);
46667 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
46668 LDKRawInvoice this_arg_conv;
46669 this_arg_conv.inner = untag_ptr(this_arg);
46670 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46672 this_arg_conv.is_owned = false;
46673 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
46674 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_hash(&this_arg_conv).data);
46678 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
46679 LDKRawInvoice this_arg_conv;
46680 this_arg_conv.inner = untag_ptr(this_arg);
46681 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46683 this_arg_conv.is_owned = false;
46684 LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
46685 int64_t ret_ref = 0;
46686 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46687 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46691 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) {
46692 LDKRawInvoice this_arg_conv;
46693 this_arg_conv.inner = untag_ptr(this_arg);
46694 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46696 this_arg_conv.is_owned = false;
46697 LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
46698 int64_t ret_ref = 0;
46699 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46700 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46704 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
46705 LDKRawInvoice this_arg_conv;
46706 this_arg_conv.inner = untag_ptr(this_arg);
46707 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46709 this_arg_conv.is_owned = false;
46710 LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
46711 int64_t ret_ref = 0;
46712 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46713 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46717 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
46718 LDKRawInvoice this_arg_conv;
46719 this_arg_conv.inner = untag_ptr(this_arg);
46720 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46722 this_arg_conv.is_owned = false;
46723 LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
46724 int64_t ret_ref = 0;
46725 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46726 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46730 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
46731 LDKRawInvoice this_arg_conv;
46732 this_arg_conv.inner = untag_ptr(this_arg);
46733 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46734 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46735 this_arg_conv.is_owned = false;
46736 LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
46737 int64_t ret_ref = 0;
46738 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46739 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46743 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1min_1final_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) {
46744 LDKRawInvoice this_arg_conv;
46745 this_arg_conv.inner = untag_ptr(this_arg);
46746 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46747 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46748 this_arg_conv.is_owned = false;
46749 LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
46750 int64_t ret_ref = 0;
46751 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46752 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46756 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
46757 LDKRawInvoice this_arg_conv;
46758 this_arg_conv.inner = untag_ptr(this_arg);
46759 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46760 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46761 this_arg_conv.is_owned = false;
46762 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
46763 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_payment_secret(&this_arg_conv).data);
46767 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
46768 LDKRawInvoice this_arg_conv;
46769 this_arg_conv.inner = untag_ptr(this_arg);
46770 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46772 this_arg_conv.is_owned = false;
46773 LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
46774 int64_t ret_ref = 0;
46775 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46776 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46780 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1routes(JNIEnv *env, jclass clz, int64_t this_arg) {
46781 LDKRawInvoice this_arg_conv;
46782 this_arg_conv.inner = untag_ptr(this_arg);
46783 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46785 this_arg_conv.is_owned = false;
46786 LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
46787 int64_tArray ret_arr = NULL;
46788 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
46789 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
46790 for (size_t o = 0; o < ret_var.datalen; o++) {
46791 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
46792 int64_t ret_conv_14_ref = 0;
46793 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
46794 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
46795 ret_arr_ptr[o] = ret_conv_14_ref;
46797 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
46798 FREE(ret_var.data);
46802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1amount_1pico_1btc(JNIEnv *env, jclass clz, int64_t this_arg) {
46803 LDKRawInvoice this_arg_conv;
46804 this_arg_conv.inner = untag_ptr(this_arg);
46805 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46807 this_arg_conv.is_owned = false;
46808 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
46809 *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv);
46810 int64_t ret_ref = tag_ptr(ret_copy, true);
46814 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RawInvoice_1currency(JNIEnv *env, jclass clz, int64_t this_arg) {
46815 LDKRawInvoice this_arg_conv;
46816 this_arg_conv.inner = untag_ptr(this_arg);
46817 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46818 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46819 this_arg_conv.is_owned = false;
46820 jclass ret_conv = LDKCurrency_to_java(env, RawInvoice_currency(&this_arg_conv));
46824 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1unix_1timestamp(JNIEnv *env, jclass clz, int64_t unix_seconds) {
46825 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
46826 *ret_conv = PositiveTimestamp_from_unix_timestamp(unix_seconds);
46827 return tag_ptr(ret_conv, true);
46830 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1system_1time(JNIEnv *env, jclass clz, int64_t time) {
46831 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
46832 *ret_conv = PositiveTimestamp_from_system_time(time);
46833 return tag_ptr(ret_conv, true);
46836 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t duration) {
46837 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
46838 *ret_conv = PositiveTimestamp_from_duration_since_epoch(duration);
46839 return tag_ptr(ret_conv, true);
46842 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1unix_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
46843 LDKPositiveTimestamp this_arg_conv;
46844 this_arg_conv.inner = untag_ptr(this_arg);
46845 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46846 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46847 this_arg_conv.is_owned = false;
46848 int64_t ret_conv = PositiveTimestamp_as_unix_timestamp(&this_arg_conv);
46852 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t this_arg) {
46853 LDKPositiveTimestamp this_arg_conv;
46854 this_arg_conv.inner = untag_ptr(this_arg);
46855 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46856 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46857 this_arg_conv.is_owned = false;
46858 int64_t ret_conv = PositiveTimestamp_as_duration_since_epoch(&this_arg_conv);
46862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
46863 LDKPositiveTimestamp this_arg_conv;
46864 this_arg_conv.inner = untag_ptr(this_arg);
46865 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46867 this_arg_conv.is_owned = false;
46868 int64_t ret_conv = PositiveTimestamp_as_time(&this_arg_conv);
46872 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1into_1signed_1raw(JNIEnv *env, jclass clz, int64_t this_arg) {
46873 LDKInvoice this_arg_conv;
46874 this_arg_conv.inner = untag_ptr(this_arg);
46875 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46876 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46877 this_arg_conv = Invoice_clone(&this_arg_conv);
46878 LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv);
46879 int64_t ret_ref = 0;
46880 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46881 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1check_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
46886 LDKInvoice this_arg_conv;
46887 this_arg_conv.inner = untag_ptr(this_arg);
46888 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46890 this_arg_conv.is_owned = false;
46891 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
46892 *ret_conv = Invoice_check_signature(&this_arg_conv);
46893 return tag_ptr(ret_conv, true);
46896 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1signed(JNIEnv *env, jclass clz, int64_t signed_invoice) {
46897 LDKSignedRawInvoice signed_invoice_conv;
46898 signed_invoice_conv.inner = untag_ptr(signed_invoice);
46899 signed_invoice_conv.is_owned = ptr_is_owned(signed_invoice);
46900 CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv);
46901 signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv);
46902 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
46903 *ret_conv = Invoice_from_signed(signed_invoice_conv);
46904 return tag_ptr(ret_conv, true);
46907 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
46908 LDKInvoice this_arg_conv;
46909 this_arg_conv.inner = untag_ptr(this_arg);
46910 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46911 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46912 this_arg_conv.is_owned = false;
46913 int64_t ret_conv = Invoice_timestamp(&this_arg_conv);
46917 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t this_arg) {
46918 LDKInvoice this_arg_conv;
46919 this_arg_conv.inner = untag_ptr(this_arg);
46920 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46921 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46922 this_arg_conv.is_owned = false;
46923 int64_t ret_conv = Invoice_duration_since_epoch(&this_arg_conv);
46927 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
46928 LDKInvoice this_arg_conv;
46929 this_arg_conv.inner = untag_ptr(this_arg);
46930 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46931 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46932 this_arg_conv.is_owned = false;
46933 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
46934 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_hash(&this_arg_conv));
46938 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
46939 LDKInvoice this_arg_conv;
46940 this_arg_conv.inner = untag_ptr(this_arg);
46941 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46943 this_arg_conv.is_owned = false;
46944 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
46945 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_payee_pub_key(&this_arg_conv).compressed_form);
46949 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
46950 LDKInvoice this_arg_conv;
46951 this_arg_conv.inner = untag_ptr(this_arg);
46952 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46954 this_arg_conv.is_owned = false;
46955 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
46956 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_secret(&this_arg_conv));
46960 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
46961 LDKInvoice this_arg_conv;
46962 this_arg_conv.inner = untag_ptr(this_arg);
46963 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46964 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46965 this_arg_conv.is_owned = false;
46966 LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
46967 int64_t ret_ref = 0;
46968 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46969 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46973 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1recover_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
46974 LDKInvoice this_arg_conv;
46975 this_arg_conv.inner = untag_ptr(this_arg);
46976 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46978 this_arg_conv.is_owned = false;
46979 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
46980 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form);
46984 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
46985 LDKInvoice this_arg_conv;
46986 this_arg_conv.inner = untag_ptr(this_arg);
46987 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46989 this_arg_conv.is_owned = false;
46990 int64_t ret_conv = Invoice_expiry_time(&this_arg_conv);
46994 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) {
46995 LDKInvoice this_arg_conv;
46996 this_arg_conv.inner = untag_ptr(this_arg);
46997 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46999 this_arg_conv.is_owned = false;
47000 jboolean ret_conv = Invoice_is_expired(&this_arg_conv);
47004 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1would_1expire(JNIEnv *env, jclass clz, int64_t this_arg, int64_t at_time) {
47005 LDKInvoice this_arg_conv;
47006 this_arg_conv.inner = untag_ptr(this_arg);
47007 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47009 this_arg_conv.is_owned = false;
47010 jboolean ret_conv = Invoice_would_expire(&this_arg_conv, at_time);
47014 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1min_1final_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) {
47015 LDKInvoice this_arg_conv;
47016 this_arg_conv.inner = untag_ptr(this_arg);
47017 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47019 this_arg_conv.is_owned = false;
47020 int64_t ret_conv = Invoice_min_final_cltv_expiry(&this_arg_conv);
47024 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1routes(JNIEnv *env, jclass clz, int64_t this_arg) {
47025 LDKInvoice this_arg_conv;
47026 this_arg_conv.inner = untag_ptr(this_arg);
47027 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47029 this_arg_conv.is_owned = false;
47030 LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
47031 int64_tArray ret_arr = NULL;
47032 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
47033 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
47034 for (size_t o = 0; o < ret_var.datalen; o++) {
47035 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
47036 int64_t ret_conv_14_ref = 0;
47037 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
47038 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
47039 ret_arr_ptr[o] = ret_conv_14_ref;
47041 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
47042 FREE(ret_var.data);
47046 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) {
47047 LDKInvoice this_arg_conv;
47048 this_arg_conv.inner = untag_ptr(this_arg);
47049 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47050 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47051 this_arg_conv.is_owned = false;
47052 LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
47053 int64_tArray ret_arr = NULL;
47054 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
47055 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
47056 for (size_t l = 0; l < ret_var.datalen; l++) {
47057 LDKRouteHint ret_conv_11_var = ret_var.data[l];
47058 int64_t ret_conv_11_ref = 0;
47059 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
47060 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
47061 ret_arr_ptr[l] = ret_conv_11_ref;
47063 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
47064 FREE(ret_var.data);
47068 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Invoice_1currency(JNIEnv *env, jclass clz, int64_t this_arg) {
47069 LDKInvoice this_arg_conv;
47070 this_arg_conv.inner = untag_ptr(this_arg);
47071 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47073 this_arg_conv.is_owned = false;
47074 jclass ret_conv = LDKCurrency_to_java(env, Invoice_currency(&this_arg_conv));
47078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1satoshis(JNIEnv *env, jclass clz, int64_t this_arg) {
47079 LDKInvoice this_arg_conv;
47080 this_arg_conv.inner = untag_ptr(this_arg);
47081 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47083 this_arg_conv.is_owned = false;
47084 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
47085 *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
47086 int64_t ret_ref = tag_ptr(ret_copy, true);
47090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1new(JNIEnv *env, jclass clz, jstring description) {
47091 LDKStr description_conv = java_to_owned_str(env, description);
47092 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
47093 *ret_conv = Description_new(description_conv);
47094 return tag_ptr(ret_conv, true);
47097 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
47098 LDKDescription this_arg_conv;
47099 this_arg_conv.inner = untag_ptr(this_arg);
47100 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47101 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47102 this_arg_conv = Description_clone(&this_arg_conv);
47103 LDKStr ret_str = Description_into_inner(this_arg_conv);
47104 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
47109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1from_1seconds(JNIEnv *env, jclass clz, int64_t seconds) {
47110 LDKExpiryTime ret_var = ExpiryTime_from_seconds(seconds);
47111 int64_t ret_ref = 0;
47112 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47113 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47117 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1from_1duration(JNIEnv *env, jclass clz, int64_t duration) {
47118 LDKExpiryTime ret_var = ExpiryTime_from_duration(duration);
47119 int64_t ret_ref = 0;
47120 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47121 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47125 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1seconds(JNIEnv *env, jclass clz, int64_t this_arg) {
47126 LDKExpiryTime this_arg_conv;
47127 this_arg_conv.inner = untag_ptr(this_arg);
47128 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47129 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47130 this_arg_conv.is_owned = false;
47131 int64_t ret_conv = ExpiryTime_as_seconds(&this_arg_conv);
47135 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1duration(JNIEnv *env, jclass clz, int64_t this_arg) {
47136 LDKExpiryTime this_arg_conv;
47137 this_arg_conv.inner = untag_ptr(this_arg);
47138 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47140 this_arg_conv.is_owned = false;
47141 int64_t ret_conv = ExpiryTime_as_duration(&this_arg_conv);
47145 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1new(JNIEnv *env, jclass clz, int64_t hops) {
47146 LDKRouteHint hops_conv;
47147 hops_conv.inner = untag_ptr(hops);
47148 hops_conv.is_owned = ptr_is_owned(hops);
47149 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv);
47150 hops_conv = RouteHint_clone(&hops_conv);
47151 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
47152 *ret_conv = PrivateRoute_new(hops_conv);
47153 return tag_ptr(ret_conv, true);
47156 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
47157 LDKPrivateRoute this_arg_conv;
47158 this_arg_conv.inner = untag_ptr(this_arg);
47159 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47160 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47161 this_arg_conv = PrivateRoute_clone(&this_arg_conv);
47162 LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv);
47163 int64_t ret_ref = 0;
47164 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47165 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47169 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47170 LDKCreationError* orig_conv = (LDKCreationError*)untag_ptr(orig);
47171 jclass ret_conv = LDKCreationError_to_java(env, CreationError_clone(orig_conv));
47175 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1description_1too_1long(JNIEnv *env, jclass clz) {
47176 jclass ret_conv = LDKCreationError_to_java(env, CreationError_description_too_long());
47180 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1route_1too_1long(JNIEnv *env, jclass clz) {
47181 jclass ret_conv = LDKCreationError_to_java(env, CreationError_route_too_long());
47185 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1timestamp_1out_1of_1bounds(JNIEnv *env, jclass clz) {
47186 jclass ret_conv = LDKCreationError_to_java(env, CreationError_timestamp_out_of_bounds());
47190 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1invalid_1amount(JNIEnv *env, jclass clz) {
47191 jclass ret_conv = LDKCreationError_to_java(env, CreationError_invalid_amount());
47195 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1missing_1route_1hints(JNIEnv *env, jclass clz) {
47196 jclass ret_conv = LDKCreationError_to_java(env, CreationError_missing_route_hints());
47200 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47201 LDKCreationError* a_conv = (LDKCreationError*)untag_ptr(a);
47202 LDKCreationError* b_conv = (LDKCreationError*)untag_ptr(b);
47203 jboolean ret_conv = CreationError_eq(a_conv, b_conv);
47207 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CreationError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
47208 LDKCreationError* o_conv = (LDKCreationError*)untag_ptr(o);
47209 LDKStr ret_str = CreationError_to_str(o_conv);
47210 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
47215 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47216 LDKSemanticError* orig_conv = (LDKSemanticError*)untag_ptr(orig);
47217 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_clone(orig_conv));
47221 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1hash(JNIEnv *env, jclass clz) {
47222 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_payment_hash());
47226 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1hashes(JNIEnv *env, jclass clz) {
47227 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_hashes());
47231 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1description(JNIEnv *env, jclass clz) {
47232 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_description());
47236 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1descriptions(JNIEnv *env, jclass clz) {
47237 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_descriptions());
47241 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1secret(JNIEnv *env, jclass clz) {
47242 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_payment_secret());
47246 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1secrets(JNIEnv *env, jclass clz) {
47247 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_secrets());
47251 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1features(JNIEnv *env, jclass clz) {
47252 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_features());
47256 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) {
47257 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_recovery_id());
47261 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1signature(JNIEnv *env, jclass clz) {
47262 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_signature());
47266 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1imprecise_1amount(JNIEnv *env, jclass clz) {
47267 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_imprecise_amount());
47271 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47272 LDKSemanticError* a_conv = (LDKSemanticError*)untag_ptr(a);
47273 LDKSemanticError* b_conv = (LDKSemanticError*)untag_ptr(b);
47274 jboolean ret_conv = SemanticError_eq(a_conv, b_conv);
47278 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SemanticError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
47279 LDKSemanticError* o_conv = (LDKSemanticError*)untag_ptr(o);
47280 LDKStr ret_str = SemanticError_to_str(o_conv);
47281 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
47286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47287 if (!ptr_is_owned(this_ptr)) return;
47288 void* this_ptr_ptr = untag_ptr(this_ptr);
47289 CHECK_ACCESS(this_ptr_ptr);
47290 LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
47291 FREE(untag_ptr(this_ptr));
47292 SignOrCreationError_free(this_ptr_conv);
47295 static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) {
47296 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
47297 *ret_copy = SignOrCreationError_clone(arg);
47298 int64_t ret_ref = tag_ptr(ret_copy, true);
47301 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47302 LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)untag_ptr(arg);
47303 int64_t ret_conv = SignOrCreationError_clone_ptr(arg_conv);
47307 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47308 LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)untag_ptr(orig);
47309 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
47310 *ret_copy = SignOrCreationError_clone(orig_conv);
47311 int64_t ret_ref = tag_ptr(ret_copy, true);
47315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1sign_1error(JNIEnv *env, jclass clz) {
47316 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
47317 *ret_copy = SignOrCreationError_sign_error();
47318 int64_t ret_ref = tag_ptr(ret_copy, true);
47322 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1creation_1error(JNIEnv *env, jclass clz, jclass a) {
47323 LDKCreationError a_conv = LDKCreationError_from_java(env, a);
47324 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
47325 *ret_copy = SignOrCreationError_creation_error(a_conv);
47326 int64_t ret_ref = tag_ptr(ret_copy, true);
47330 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47331 LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)untag_ptr(a);
47332 LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)untag_ptr(b);
47333 jboolean ret_conv = SignOrCreationError_eq(a_conv, b_conv);
47337 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
47338 LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)untag_ptr(o);
47339 LDKStr ret_str = SignOrCreationError_to_str(o_conv);
47340 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
47345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47346 LDKInvoicePayer this_obj_conv;
47347 this_obj_conv.inner = untag_ptr(this_obj);
47348 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47350 InvoicePayer_free(this_obj_conv);
47353 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47354 if (!ptr_is_owned(this_ptr)) return;
47355 void* this_ptr_ptr = untag_ptr(this_ptr);
47356 CHECK_ACCESS(this_ptr_ptr);
47357 LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
47358 FREE(untag_ptr(this_ptr));
47359 Payer_free(this_ptr_conv);
47362 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47363 if (!ptr_is_owned(this_ptr)) return;
47364 void* this_ptr_ptr = untag_ptr(this_ptr);
47365 CHECK_ACCESS(this_ptr_ptr);
47366 LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
47367 FREE(untag_ptr(this_ptr));
47368 Router_free(this_ptr_conv);
47371 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47372 if (!ptr_is_owned(this_ptr)) return;
47373 void* this_ptr_ptr = untag_ptr(this_ptr);
47374 CHECK_ACCESS(this_ptr_ptr);
47375 LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
47376 FREE(untag_ptr(this_ptr));
47377 Retry_free(this_ptr_conv);
47380 static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
47381 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
47382 *ret_copy = Retry_clone(arg);
47383 int64_t ret_ref = tag_ptr(ret_copy, true);
47386 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47387 LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
47388 int64_t ret_conv = Retry_clone_ptr(arg_conv);
47392 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47393 LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
47394 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
47395 *ret_copy = Retry_clone(orig_conv);
47396 int64_t ret_ref = tag_ptr(ret_copy, true);
47400 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1attempts(JNIEnv *env, jclass clz, int64_t a) {
47401 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
47402 *ret_copy = Retry_attempts(a);
47403 int64_t ret_ref = tag_ptr(ret_copy, true);
47407 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1timeout(JNIEnv *env, jclass clz, int64_t a) {
47408 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
47409 *ret_copy = Retry_timeout(a);
47410 int64_t ret_ref = tag_ptr(ret_copy, true);
47414 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47415 LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
47416 LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
47417 jboolean ret_conv = Retry_eq(a_conv, b_conv);
47421 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1hash(JNIEnv *env, jclass clz, int64_t o) {
47422 LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
47423 int64_t ret_conv = Retry_hash(o_conv);
47427 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47428 if (!ptr_is_owned(this_ptr)) return;
47429 void* this_ptr_ptr = untag_ptr(this_ptr);
47430 CHECK_ACCESS(this_ptr_ptr);
47431 LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
47432 FREE(untag_ptr(this_ptr));
47433 PaymentError_free(this_ptr_conv);
47436 static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) {
47437 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
47438 *ret_copy = PaymentError_clone(arg);
47439 int64_t ret_ref = tag_ptr(ret_copy, true);
47442 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47443 LDKPaymentError* arg_conv = (LDKPaymentError*)untag_ptr(arg);
47444 int64_t ret_conv = PaymentError_clone_ptr(arg_conv);
47448 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47449 LDKPaymentError* orig_conv = (LDKPaymentError*)untag_ptr(orig);
47450 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
47451 *ret_copy = PaymentError_clone(orig_conv);
47452 int64_t ret_ref = tag_ptr(ret_copy, true);
47456 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1invoice(JNIEnv *env, jclass clz, jstring a) {
47457 LDKStr a_conv = java_to_owned_str(env, a);
47458 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
47459 *ret_copy = PaymentError_invoice(a_conv);
47460 int64_t ret_ref = tag_ptr(ret_copy, true);
47464 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1routing(JNIEnv *env, jclass clz, int64_t a) {
47465 LDKLightningError a_conv;
47466 a_conv.inner = untag_ptr(a);
47467 a_conv.is_owned = ptr_is_owned(a);
47468 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
47469 a_conv = LightningError_clone(&a_conv);
47470 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
47471 *ret_copy = PaymentError_routing(a_conv);
47472 int64_t ret_ref = tag_ptr(ret_copy, true);
47476 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1sending(JNIEnv *env, jclass clz, int64_t a) {
47477 void* a_ptr = untag_ptr(a);
47478 CHECK_ACCESS(a_ptr);
47479 LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
47480 a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a));
47481 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
47482 *ret_copy = PaymentError_sending(a_conv);
47483 int64_t ret_ref = tag_ptr(ret_copy, true);
47487 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *env, jclass clz, int64_t payer, int64_t router, int64_t scorer, int64_t logger, int64_t event_handler, int64_t retry) {
47488 void* payer_ptr = untag_ptr(payer);
47489 CHECK_ACCESS(payer_ptr);
47490 LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
47491 if (payer_conv.free == LDKPayer_JCalls_free) {
47492 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47493 LDKPayer_JCalls_cloned(&payer_conv);
47495 void* router_ptr = untag_ptr(router);
47496 CHECK_ACCESS(router_ptr);
47497 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
47498 if (router_conv.free == LDKRouter_JCalls_free) {
47499 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47500 LDKRouter_JCalls_cloned(&router_conv);
47502 LDKMultiThreadedLockableScore scorer_conv;
47503 scorer_conv.inner = untag_ptr(scorer);
47504 scorer_conv.is_owned = ptr_is_owned(scorer);
47505 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
47506 scorer_conv.is_owned = false;
47507 void* logger_ptr = untag_ptr(logger);
47508 CHECK_ACCESS(logger_ptr);
47509 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
47510 if (logger_conv.free == LDKLogger_JCalls_free) {
47511 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47512 LDKLogger_JCalls_cloned(&logger_conv);
47514 void* event_handler_ptr = untag_ptr(event_handler);
47515 CHECK_ACCESS(event_handler_ptr);
47516 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
47517 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
47518 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47519 LDKEventHandler_JCalls_cloned(&event_handler_conv);
47521 void* retry_ptr = untag_ptr(retry);
47522 CHECK_ACCESS(retry_ptr);
47523 LDKRetry retry_conv = *(LDKRetry*)(retry_ptr);
47524 retry_conv = Retry_clone((LDKRetry*)untag_ptr(retry));
47525 LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_conv);
47526 int64_t ret_ref = 0;
47527 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47528 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice) {
47533 LDKInvoicePayer this_arg_conv;
47534 this_arg_conv.inner = untag_ptr(this_arg);
47535 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47537 this_arg_conv.is_owned = false;
47538 LDKInvoice invoice_conv;
47539 invoice_conv.inner = untag_ptr(invoice);
47540 invoice_conv.is_owned = ptr_is_owned(invoice);
47541 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
47542 invoice_conv.is_owned = false;
47543 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
47544 *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
47545 return tag_ptr(ret_conv, true);
47548 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) {
47549 LDKInvoicePayer this_arg_conv;
47550 this_arg_conv.inner = untag_ptr(this_arg);
47551 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47553 this_arg_conv.is_owned = false;
47554 LDKInvoice invoice_conv;
47555 invoice_conv.inner = untag_ptr(invoice);
47556 invoice_conv.is_owned = ptr_is_owned(invoice);
47557 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
47558 invoice_conv.is_owned = false;
47559 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
47560 *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
47561 return tag_ptr(ret_conv, true);
47564 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) {
47565 LDKInvoicePayer this_arg_conv;
47566 this_arg_conv.inner = untag_ptr(this_arg);
47567 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47568 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47569 this_arg_conv.is_owned = false;
47570 LDKPublicKey pubkey_ref;
47571 CHECK((*env)->GetArrayLength(env, pubkey) == 33);
47572 (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
47573 LDKThirtyTwoBytes payment_preimage_ref;
47574 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
47575 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
47576 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
47577 *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
47578 return tag_ptr(ret_conv, true);
47581 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) {
47582 LDKInvoicePayer this_arg_conv;
47583 this_arg_conv.inner = untag_ptr(this_arg);
47584 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47586 this_arg_conv.is_owned = false;
47587 unsigned char payment_hash_arr[32];
47588 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
47589 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
47590 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
47591 InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
47594 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
47595 LDKInvoicePayer this_arg_conv;
47596 this_arg_conv.inner = untag_ptr(this_arg);
47597 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47599 this_arg_conv.is_owned = false;
47600 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
47601 *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
47602 return tag_ptr(ret_ret, true);
47605 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, jclass network) {
47606 void* amt_msat_ptr = untag_ptr(amt_msat);
47607 CHECK_ACCESS(amt_msat_ptr);
47608 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
47609 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
47610 LDKThirtyTwoBytes payment_hash_ref;
47611 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
47612 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
47613 LDKStr description_conv = java_to_owned_str(env, description);
47614 LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr;
47615 phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints);
47616 if (phantom_route_hints_constr.datalen > 0)
47617 phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
47619 phantom_route_hints_constr.data = NULL;
47620 int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL);
47621 for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) {
47622 int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t];
47623 LDKPhantomRouteHints phantom_route_hints_conv_19_conv;
47624 phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19);
47625 phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19);
47626 CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv);
47627 phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv);
47628 phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv;
47630 (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0);
47631 void* keys_manager_ptr = untag_ptr(keys_manager);
47632 CHECK_ACCESS(keys_manager_ptr);
47633 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
47634 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
47635 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47636 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
47638 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
47639 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
47640 *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_ref, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, keys_manager_conv, network_conv);
47641 return tag_ptr(ret_conv, true);
47644 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, jclass network) {
47645 void* amt_msat_ptr = untag_ptr(amt_msat);
47646 CHECK_ACCESS(amt_msat_ptr);
47647 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
47648 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
47649 LDKThirtyTwoBytes payment_hash_ref;
47650 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
47651 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
47652 LDKSha256 description_hash_conv;
47653 description_hash_conv.inner = untag_ptr(description_hash);
47654 description_hash_conv.is_owned = ptr_is_owned(description_hash);
47655 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
47656 description_hash_conv = Sha256_clone(&description_hash_conv);
47657 LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr;
47658 phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints);
47659 if (phantom_route_hints_constr.datalen > 0)
47660 phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
47662 phantom_route_hints_constr.data = NULL;
47663 int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL);
47664 for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) {
47665 int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t];
47666 LDKPhantomRouteHints phantom_route_hints_conv_19_conv;
47667 phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19);
47668 phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19);
47669 CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv);
47670 phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv);
47671 phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv;
47673 (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0);
47674 void* keys_manager_ptr = untag_ptr(keys_manager);
47675 CHECK_ACCESS(keys_manager_ptr);
47676 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
47677 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
47678 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47679 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
47681 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
47682 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
47683 *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, network_conv);
47684 return tag_ptr(ret_conv, true);
47687 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs) {
47688 LDKChannelManager channelmanager_conv;
47689 channelmanager_conv.inner = untag_ptr(channelmanager);
47690 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
47691 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
47692 channelmanager_conv.is_owned = false;
47693 void* keys_manager_ptr = untag_ptr(keys_manager);
47694 CHECK_ACCESS(keys_manager_ptr);
47695 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
47696 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
47697 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47698 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
47700 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
47701 void* amt_msat_ptr = untag_ptr(amt_msat);
47702 CHECK_ACCESS(amt_msat_ptr);
47703 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
47704 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
47705 LDKStr description_conv = java_to_owned_str(env, description);
47706 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
47707 *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs);
47708 return tag_ptr(ret_conv, true);
47711 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, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs) {
47712 LDKChannelManager channelmanager_conv;
47713 channelmanager_conv.inner = untag_ptr(channelmanager);
47714 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
47715 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
47716 channelmanager_conv.is_owned = false;
47717 void* keys_manager_ptr = untag_ptr(keys_manager);
47718 CHECK_ACCESS(keys_manager_ptr);
47719 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
47720 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
47721 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47722 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
47724 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
47725 void* amt_msat_ptr = untag_ptr(amt_msat);
47726 CHECK_ACCESS(amt_msat_ptr);
47727 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
47728 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
47729 LDKSha256 description_hash_conv;
47730 description_hash_conv.inner = untag_ptr(description_hash);
47731 description_hash_conv.is_owned = ptr_is_owned(description_hash);
47732 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
47733 description_hash_conv = Sha256_clone(&description_hash_conv);
47734 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
47735 *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs);
47736 return tag_ptr(ret_conv, true);
47739 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, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
47740 LDKChannelManager channelmanager_conv;
47741 channelmanager_conv.inner = untag_ptr(channelmanager);
47742 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
47743 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
47744 channelmanager_conv.is_owned = false;
47745 void* keys_manager_ptr = untag_ptr(keys_manager);
47746 CHECK_ACCESS(keys_manager_ptr);
47747 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
47748 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
47749 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47750 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
47752 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
47753 void* amt_msat_ptr = untag_ptr(amt_msat);
47754 CHECK_ACCESS(amt_msat_ptr);
47755 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
47756 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
47757 LDKSha256 description_hash_conv;
47758 description_hash_conv.inner = untag_ptr(description_hash);
47759 description_hash_conv.is_owned = ptr_is_owned(description_hash);
47760 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
47761 description_hash_conv = Sha256_clone(&description_hash_conv);
47762 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
47763 *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs);
47764 return tag_ptr(ret_conv, true);
47767 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, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
47768 LDKChannelManager channelmanager_conv;
47769 channelmanager_conv.inner = untag_ptr(channelmanager);
47770 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
47771 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
47772 channelmanager_conv.is_owned = false;
47773 void* keys_manager_ptr = untag_ptr(keys_manager);
47774 CHECK_ACCESS(keys_manager_ptr);
47775 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
47776 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
47777 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47778 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
47780 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
47781 void* amt_msat_ptr = untag_ptr(amt_msat);
47782 CHECK_ACCESS(amt_msat_ptr);
47783 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
47784 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
47785 LDKStr description_conv = java_to_owned_str(env, description);
47786 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
47787 *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs);
47788 return tag_ptr(ret_conv, true);
47791 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47792 LDKDefaultRouter this_obj_conv;
47793 this_obj_conv.inner = untag_ptr(this_obj);
47794 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47796 DefaultRouter_free(this_obj_conv);
47799 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) {
47800 LDKNetworkGraph network_graph_conv;
47801 network_graph_conv.inner = untag_ptr(network_graph);
47802 network_graph_conv.is_owned = ptr_is_owned(network_graph);
47803 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
47804 network_graph_conv.is_owned = false;
47805 void* logger_ptr = untag_ptr(logger);
47806 CHECK_ACCESS(logger_ptr);
47807 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
47808 if (logger_conv.free == LDKLogger_JCalls_free) {
47809 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47810 LDKLogger_JCalls_cloned(&logger_conv);
47812 LDKThirtyTwoBytes random_seed_bytes_ref;
47813 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
47814 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_ref.data);
47815 LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref);
47816 int64_t ret_ref = 0;
47817 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47818 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47822 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) {
47823 LDKDefaultRouter this_arg_conv;
47824 this_arg_conv.inner = untag_ptr(this_arg);
47825 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47827 this_arg_conv.is_owned = false;
47828 LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
47829 *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
47830 return tag_ptr(ret_ret, true);
47833 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer(JNIEnv *env, jclass clz, int64_t this_arg) {
47834 LDKChannelManager this_arg_conv;
47835 this_arg_conv.inner = untag_ptr(this_arg);
47836 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47838 this_arg_conv.is_owned = false;
47839 LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
47840 *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
47841 return tag_ptr(ret_ret, true);
47844 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1from_1str(JNIEnv *env, jclass clz, jstring s) {
47845 LDKStr s_conv = java_to_owned_str(env, s);
47846 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
47847 *ret_conv = SiPrefix_from_str(s_conv);
47848 return tag_ptr(ret_conv, true);
47851 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1str(JNIEnv *env, jclass clz, jstring s) {
47852 LDKStr s_conv = java_to_owned_str(env, s);
47853 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
47854 *ret_conv = Invoice_from_str(s_conv);
47855 return tag_ptr(ret_conv, true);
47858 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1from_1str(JNIEnv *env, jclass clz, jstring s) {
47859 LDKStr s_conv = java_to_owned_str(env, s);
47860 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
47861 *ret_conv = SignedRawInvoice_from_str(s_conv);
47862 return tag_ptr(ret_conv, true);
47865 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ParseError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
47866 LDKParseError* o_conv = (LDKParseError*)untag_ptr(o);
47867 LDKStr ret_str = ParseError_to_str(o_conv);
47868 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
47873 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
47874 LDKParseOrSemanticError* o_conv = (LDKParseOrSemanticError*)untag_ptr(o);
47875 LDKStr ret_str = ParseOrSemanticError_to_str(o_conv);
47876 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
47881 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Invoice_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
47883 o_conv.inner = untag_ptr(o);
47884 o_conv.is_owned = ptr_is_owned(o);
47885 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
47886 o_conv.is_owned = false;
47887 LDKStr ret_str = Invoice_to_str(&o_conv);
47888 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
47893 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
47894 LDKSignedRawInvoice o_conv;
47895 o_conv.inner = untag_ptr(o);
47896 o_conv.is_owned = ptr_is_owned(o);
47897 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
47898 o_conv.is_owned = false;
47899 LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
47900 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
47905 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Currency_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
47906 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
47907 LDKStr ret_str = Currency_to_str(o_conv);
47908 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
47913 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SiPrefix_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
47914 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
47915 LDKStr ret_str = SiPrefix_to_str(o_conv);
47916 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
47921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47922 LDKRapidGossipSync this_obj_conv;
47923 this_obj_conv.inner = untag_ptr(this_obj);
47924 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47926 RapidGossipSync_free(this_obj_conv);
47929 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph) {
47930 LDKNetworkGraph network_graph_conv;
47931 network_graph_conv.inner = untag_ptr(network_graph);
47932 network_graph_conv.is_owned = ptr_is_owned(network_graph);
47933 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
47934 network_graph_conv.is_owned = false;
47935 LDKRapidGossipSync ret_var = RapidGossipSync_new(&network_graph_conv);
47936 int64_t ret_ref = 0;
47937 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47938 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47942 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1sync_1network_1graph_1with_1file_1path(JNIEnv *env, jclass clz, int64_t this_arg, jstring sync_path) {
47943 LDKRapidGossipSync this_arg_conv;
47944 this_arg_conv.inner = untag_ptr(this_arg);
47945 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47946 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47947 this_arg_conv.is_owned = false;
47948 LDKStr sync_path_conv = java_to_owned_str(env, sync_path);
47949 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
47950 *ret_conv = RapidGossipSync_sync_network_graph_with_file_path(&this_arg_conv, sync_path_conv);
47951 return tag_ptr(ret_conv, true);
47954 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1is_1initial_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_arg) {
47955 LDKRapidGossipSync this_arg_conv;
47956 this_arg_conv.inner = untag_ptr(this_arg);
47957 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47959 this_arg_conv.is_owned = false;
47960 jboolean ret_conv = RapidGossipSync_is_initial_sync_complete(&this_arg_conv);
47964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47965 if (!ptr_is_owned(this_ptr)) return;
47966 void* this_ptr_ptr = untag_ptr(this_ptr);
47967 CHECK_ACCESS(this_ptr_ptr);
47968 LDKGraphSyncError this_ptr_conv = *(LDKGraphSyncError*)(this_ptr_ptr);
47969 FREE(untag_ptr(this_ptr));
47970 GraphSyncError_free(this_ptr_conv);
47973 static inline uint64_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg) {
47974 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
47975 *ret_copy = GraphSyncError_clone(arg);
47976 int64_t ret_ref = tag_ptr(ret_copy, true);
47979 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47980 LDKGraphSyncError* arg_conv = (LDKGraphSyncError*)untag_ptr(arg);
47981 int64_t ret_conv = GraphSyncError_clone_ptr(arg_conv);
47985 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47986 LDKGraphSyncError* orig_conv = (LDKGraphSyncError*)untag_ptr(orig);
47987 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
47988 *ret_copy = GraphSyncError_clone(orig_conv);
47989 int64_t ret_ref = tag_ptr(ret_copy, true);
47993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1decode_1error(JNIEnv *env, jclass clz, int64_t a) {
47994 LDKDecodeError a_conv;
47995 a_conv.inner = untag_ptr(a);
47996 a_conv.is_owned = ptr_is_owned(a);
47997 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
47998 a_conv = DecodeError_clone(&a_conv);
47999 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
48000 *ret_copy = GraphSyncError_decode_error(a_conv);
48001 int64_t ret_ref = tag_ptr(ret_copy, true);
48005 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1lightning_1error(JNIEnv *env, jclass clz, int64_t a) {
48006 LDKLightningError a_conv;
48007 a_conv.inner = untag_ptr(a);
48008 a_conv.is_owned = ptr_is_owned(a);
48009 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
48010 a_conv = LightningError_clone(&a_conv);
48011 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
48012 *ret_copy = GraphSyncError_lightning_error(a_conv);
48013 int64_t ret_ref = tag_ptr(ret_copy, true);
48017 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) {
48018 LDKRapidGossipSync this_arg_conv;
48019 this_arg_conv.inner = untag_ptr(this_arg);
48020 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48022 this_arg_conv.is_owned = false;
48023 LDKu8slice update_data_ref;
48024 update_data_ref.datalen = (*env)->GetArrayLength(env, update_data);
48025 update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL);
48026 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
48027 *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref);
48028 (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0);
48029 return tag_ptr(ret_conv, true);