2 // On OSX jlong (ie long long) is not equivalent to int64_t, so we override here
4 #include "org_ldk_impl_bindings.h"
10 #define LIKELY(v) __builtin_expect(!!(v), 1)
11 #define UNLIKELY(v) __builtin_expect(!!(v), 0)
13 #define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
14 #define MALLOC(a, _) malloc(a)
15 #define FREE(p) if ((uint64_t)(p) > 4096) { free(p); }
16 #define CHECK_ACCESS(p)
17 #define CHECK_INNER_FIELD_ACCESS_OR_NULL(v)
18 #define DO_ASSERT(a) (void)(a)
21 static jmethodID ordinal_meth = NULL;
22 JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class) {
23 ordinal_meth = (*env)->GetMethodID(env, enum_class, "ordinal", "()I");
24 CHECK(ordinal_meth != NULL);
27 // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
28 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
29 _Static_assert(offsetof(LDKCVec_u8Z, data) == offsetof(LDKu8slice, data), "Vec<u8> and [u8] need to have been mapped identically");
30 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), "Vec<u8> and [u8] need to have been mapped identically");
32 _Static_assert(sizeof(jlong) == sizeof(int64_t), "We assume that j-types are the same as C types");
33 _Static_assert(sizeof(jbyte) == sizeof(char), "We assume that j-types are the same as C types");
34 _Static_assert(sizeof(void*) <= 8, "Pointers must fit into 64 bits");
36 typedef jlongArray int64_tArray;
37 typedef jbyteArray int8_tArray;
38 typedef jshortArray int16_tArray;
40 static inline jstring str_ref_to_java(JNIEnv *env, const char* chars, size_t len) {
41 // Sadly we need to create a temporary because Java can't accept a char* without a 0-terminator
42 char* conv_buf = MALLOC(len + 1, "str conv buf");
43 memcpy(conv_buf, chars, len);
45 jstring ret = (*env)->NewStringUTF(env, conv_buf);
49 static inline LDKStr java_to_owned_str(JNIEnv *env, jstring str) {
50 uint64_t str_len = (*env)->GetStringUTFLength(env, str);
51 char* newchars = MALLOC(str_len + 1, "String chars");
52 const char* jchars = (*env)->GetStringUTFChars(env, str, NULL);
53 memcpy(newchars, jchars, str_len);
54 newchars[str_len] = 0;
55 (*env)->ReleaseStringUTFChars(env, str, jchars);
59 .chars_is_owned = true
64 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1version(JNIEnv *env, jclass _c) {
65 return str_ref_to_java(env, check_get_ldk_bindings_version(), strlen(check_get_ldk_bindings_version()));
67 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1version(JNIEnv *env, jclass _c) {
68 return str_ref_to_java(env, check_get_ldk_version(), strlen(check_get_ldk_version()));
71 static jclass arr_of_B_clz = NULL;
72 static jclass arr_of_J_clz = NULL;
73 JNIEXPORT void Java_org_ldk_impl_bindings_init_1class_1cache(JNIEnv * env, jclass clz) {
74 arr_of_B_clz = (*env)->FindClass(env, "[B");
75 CHECK(arr_of_B_clz != NULL);
76 arr_of_B_clz = (*env)->NewGlobalRef(env, arr_of_B_clz);
77 arr_of_J_clz = (*env)->FindClass(env, "[J");
78 CHECK(arr_of_J_clz != NULL);
79 arr_of_J_clz = (*env)->NewGlobalRef(env, arr_of_J_clz);
81 static inline struct LDKThirtyTwoBytes ThirtyTwoBytes_clone(const struct LDKThirtyTwoBytes *orig) { struct LDKThirtyTwoBytes ret; memcpy(ret.data, orig->data, 32); return ret; }
83 static inline void* untag_ptr(uint64_t ptr) {
84 if (ptr < 4096) return (void*)ptr;
85 if (sizeof(void*) == 4) {
86 // For 32-bit systems, store pointers as 64-bit ints and use the 31st bit
87 return (void*)(uintptr_t)ptr;
89 // For 64-bit systems, assume the top byte is used for tagging, then
90 // use bit 9 ^ bit 10.
91 uint64_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
92 uintptr_t p = (ptr & ~(1ULL << 55)) | (tenth_bit << 55);
93 #ifdef LDK_DEBUG_BUILD
94 // On debug builds we also use the 11th bit as a debug flag
95 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
96 CHECK(tenth_bit != eleventh_bit);
102 static inline bool ptr_is_owned(uint64_t ptr) {
103 if(ptr < 4096) return true;
104 if (sizeof(void*) == 4) {
105 return ptr & (1ULL << 32);
107 uintptr_t ninth_bit = (((uintptr_t)ptr) & (1ULL << 55)) >> 55;
108 uintptr_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
109 #ifdef LDK_DEBUG_BUILD
110 // On debug builds we also use the 11th bit as a debug flag
111 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
112 CHECK(tenth_bit != eleventh_bit);
114 return (ninth_bit ^ tenth_bit) ? true : false;
117 static inline uint64_t tag_ptr(const void* ptr, bool is_owned) {
118 if ((uintptr_t)ptr < 4096) return (uint64_t)ptr;
119 if (sizeof(void*) == 4) {
120 return (((uint64_t)ptr) | ((is_owned ? 1ULL : 0) << 32));
122 CHECK(sizeof(uintptr_t) == 8);
123 uintptr_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
124 uintptr_t t = (((uintptr_t)ptr) | (((is_owned ? 1ULL : 0ULL) ^ tenth_bit) << 55));
125 #ifdef LDK_DEBUG_BUILD
126 uintptr_t ninth_bit = (((uintptr_t)ptr) & (1ULL << 55)) >> 55;
127 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
128 CHECK(ninth_bit == tenth_bit);
129 CHECK(ninth_bit == eleventh_bit);
132 CHECK(ptr_is_owned(t) == is_owned);
133 CHECK(untag_ptr(t) == ptr);
138 static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_java(JNIEnv *env, jclass clz) {
139 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
140 if (UNLIKELY((*env)->ExceptionCheck(env))) {
141 (*env)->ExceptionDescribe(env);
142 (*env)->FatalError(env, "A call to COption_NoneZ.ordinal() from rust threw an exception.");
145 case 0: return LDKCOption_NoneZ_Some;
146 case 1: return LDKCOption_NoneZ_None;
148 (*env)->FatalError(env, "A call to COption_NoneZ.ordinal() from rust returned an invalid value.");
149 abort(); // Unreachable, but will let the compiler know we don't return here
151 static jclass COption_NoneZ_class = NULL;
152 static jfieldID COption_NoneZ_LDKCOption_NoneZ_Some = NULL;
153 static jfieldID COption_NoneZ_LDKCOption_NoneZ_None = NULL;
154 JNIEXPORT void JNICALL Java_org_ldk_enums_COption_1NoneZ_init (JNIEnv *env, jclass clz) {
155 COption_NoneZ_class = (*env)->NewGlobalRef(env, clz);
156 CHECK(COption_NoneZ_class != NULL);
157 COption_NoneZ_LDKCOption_NoneZ_Some = (*env)->GetStaticFieldID(env, COption_NoneZ_class, "LDKCOption_NoneZ_Some", "Lorg/ldk/enums/COption_NoneZ;");
158 CHECK(COption_NoneZ_LDKCOption_NoneZ_Some != NULL);
159 COption_NoneZ_LDKCOption_NoneZ_None = (*env)->GetStaticFieldID(env, COption_NoneZ_class, "LDKCOption_NoneZ_None", "Lorg/ldk/enums/COption_NoneZ;");
160 CHECK(COption_NoneZ_LDKCOption_NoneZ_None != NULL);
162 static inline jclass LDKCOption_NoneZ_to_java(JNIEnv *env, LDKCOption_NoneZ val) {
164 case LDKCOption_NoneZ_Some:
165 return (*env)->GetStaticObjectField(env, COption_NoneZ_class, COption_NoneZ_LDKCOption_NoneZ_Some);
166 case LDKCOption_NoneZ_None:
167 return (*env)->GetStaticObjectField(env, COption_NoneZ_class, COption_NoneZ_LDKCOption_NoneZ_None);
172 static inline LDKChannelMonitorUpdateStatus LDKChannelMonitorUpdateStatus_from_java(JNIEnv *env, jclass clz) {
173 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
174 if (UNLIKELY((*env)->ExceptionCheck(env))) {
175 (*env)->ExceptionDescribe(env);
176 (*env)->FatalError(env, "A call to ChannelMonitorUpdateStatus.ordinal() from rust threw an exception.");
179 case 0: return LDKChannelMonitorUpdateStatus_Completed;
180 case 1: return LDKChannelMonitorUpdateStatus_InProgress;
181 case 2: return LDKChannelMonitorUpdateStatus_PermanentFailure;
183 (*env)->FatalError(env, "A call to ChannelMonitorUpdateStatus.ordinal() from rust returned an invalid value.");
184 abort(); // Unreachable, but will let the compiler know we don't return here
186 static jclass ChannelMonitorUpdateStatus_class = NULL;
187 static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed = NULL;
188 static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress = NULL;
189 static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure = NULL;
190 JNIEXPORT void JNICALL Java_org_ldk_enums_ChannelMonitorUpdateStatus_init (JNIEnv *env, jclass clz) {
191 ChannelMonitorUpdateStatus_class = (*env)->NewGlobalRef(env, clz);
192 CHECK(ChannelMonitorUpdateStatus_class != NULL);
193 ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_Completed", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
194 CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed != NULL);
195 ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_InProgress", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
196 CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress != NULL);
197 ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_PermanentFailure", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
198 CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure != NULL);
200 static inline jclass LDKChannelMonitorUpdateStatus_to_java(JNIEnv *env, LDKChannelMonitorUpdateStatus val) {
202 case LDKChannelMonitorUpdateStatus_Completed:
203 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed);
204 case LDKChannelMonitorUpdateStatus_InProgress:
205 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress);
206 case LDKChannelMonitorUpdateStatus_PermanentFailure:
207 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure);
212 static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass clz) {
213 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
214 if (UNLIKELY((*env)->ExceptionCheck(env))) {
215 (*env)->ExceptionDescribe(env);
216 (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust threw an exception.");
219 case 0: return LDKConfirmationTarget_Background;
220 case 1: return LDKConfirmationTarget_Normal;
221 case 2: return LDKConfirmationTarget_HighPriority;
223 (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust returned an invalid value.");
224 abort(); // Unreachable, but will let the compiler know we don't return here
226 static jclass ConfirmationTarget_class = NULL;
227 static jfieldID ConfirmationTarget_LDKConfirmationTarget_Background = NULL;
228 static jfieldID ConfirmationTarget_LDKConfirmationTarget_Normal = NULL;
229 static jfieldID ConfirmationTarget_LDKConfirmationTarget_HighPriority = NULL;
230 JNIEXPORT void JNICALL Java_org_ldk_enums_ConfirmationTarget_init (JNIEnv *env, jclass clz) {
231 ConfirmationTarget_class = (*env)->NewGlobalRef(env, clz);
232 CHECK(ConfirmationTarget_class != NULL);
233 ConfirmationTarget_LDKConfirmationTarget_Background = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_Background", "Lorg/ldk/enums/ConfirmationTarget;");
234 CHECK(ConfirmationTarget_LDKConfirmationTarget_Background != NULL);
235 ConfirmationTarget_LDKConfirmationTarget_Normal = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_Normal", "Lorg/ldk/enums/ConfirmationTarget;");
236 CHECK(ConfirmationTarget_LDKConfirmationTarget_Normal != NULL);
237 ConfirmationTarget_LDKConfirmationTarget_HighPriority = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_HighPriority", "Lorg/ldk/enums/ConfirmationTarget;");
238 CHECK(ConfirmationTarget_LDKConfirmationTarget_HighPriority != NULL);
240 static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) {
242 case LDKConfirmationTarget_Background:
243 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_Background);
244 case LDKConfirmationTarget_Normal:
245 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_Normal);
246 case LDKConfirmationTarget_HighPriority:
247 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_HighPriority);
252 static inline LDKCreationError LDKCreationError_from_java(JNIEnv *env, jclass clz) {
253 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
254 if (UNLIKELY((*env)->ExceptionCheck(env))) {
255 (*env)->ExceptionDescribe(env);
256 (*env)->FatalError(env, "A call to CreationError.ordinal() from rust threw an exception.");
259 case 0: return LDKCreationError_DescriptionTooLong;
260 case 1: return LDKCreationError_RouteTooLong;
261 case 2: return LDKCreationError_TimestampOutOfBounds;
262 case 3: return LDKCreationError_InvalidAmount;
263 case 4: return LDKCreationError_MissingRouteHints;
264 case 5: return LDKCreationError_MinFinalCltvExpiryDeltaTooShort;
266 (*env)->FatalError(env, "A call to CreationError.ordinal() from rust returned an invalid value.");
267 abort(); // Unreachable, but will let the compiler know we don't return here
269 static jclass CreationError_class = NULL;
270 static jfieldID CreationError_LDKCreationError_DescriptionTooLong = NULL;
271 static jfieldID CreationError_LDKCreationError_RouteTooLong = NULL;
272 static jfieldID CreationError_LDKCreationError_TimestampOutOfBounds = NULL;
273 static jfieldID CreationError_LDKCreationError_InvalidAmount = NULL;
274 static jfieldID CreationError_LDKCreationError_MissingRouteHints = NULL;
275 static jfieldID CreationError_LDKCreationError_MinFinalCltvExpiryDeltaTooShort = NULL;
276 JNIEXPORT void JNICALL Java_org_ldk_enums_CreationError_init (JNIEnv *env, jclass clz) {
277 CreationError_class = (*env)->NewGlobalRef(env, clz);
278 CHECK(CreationError_class != NULL);
279 CreationError_LDKCreationError_DescriptionTooLong = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_DescriptionTooLong", "Lorg/ldk/enums/CreationError;");
280 CHECK(CreationError_LDKCreationError_DescriptionTooLong != NULL);
281 CreationError_LDKCreationError_RouteTooLong = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_RouteTooLong", "Lorg/ldk/enums/CreationError;");
282 CHECK(CreationError_LDKCreationError_RouteTooLong != NULL);
283 CreationError_LDKCreationError_TimestampOutOfBounds = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_TimestampOutOfBounds", "Lorg/ldk/enums/CreationError;");
284 CHECK(CreationError_LDKCreationError_TimestampOutOfBounds != NULL);
285 CreationError_LDKCreationError_InvalidAmount = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_InvalidAmount", "Lorg/ldk/enums/CreationError;");
286 CHECK(CreationError_LDKCreationError_InvalidAmount != NULL);
287 CreationError_LDKCreationError_MissingRouteHints = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_MissingRouteHints", "Lorg/ldk/enums/CreationError;");
288 CHECK(CreationError_LDKCreationError_MissingRouteHints != NULL);
289 CreationError_LDKCreationError_MinFinalCltvExpiryDeltaTooShort = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_MinFinalCltvExpiryDeltaTooShort", "Lorg/ldk/enums/CreationError;");
290 CHECK(CreationError_LDKCreationError_MinFinalCltvExpiryDeltaTooShort != NULL);
292 static inline jclass LDKCreationError_to_java(JNIEnv *env, LDKCreationError val) {
294 case LDKCreationError_DescriptionTooLong:
295 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_DescriptionTooLong);
296 case LDKCreationError_RouteTooLong:
297 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_RouteTooLong);
298 case LDKCreationError_TimestampOutOfBounds:
299 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_TimestampOutOfBounds);
300 case LDKCreationError_InvalidAmount:
301 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_InvalidAmount);
302 case LDKCreationError_MissingRouteHints:
303 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_MissingRouteHints);
304 case LDKCreationError_MinFinalCltvExpiryDeltaTooShort:
305 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_MinFinalCltvExpiryDeltaTooShort);
310 static inline LDKCurrency LDKCurrency_from_java(JNIEnv *env, jclass clz) {
311 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
312 if (UNLIKELY((*env)->ExceptionCheck(env))) {
313 (*env)->ExceptionDescribe(env);
314 (*env)->FatalError(env, "A call to Currency.ordinal() from rust threw an exception.");
317 case 0: return LDKCurrency_Bitcoin;
318 case 1: return LDKCurrency_BitcoinTestnet;
319 case 2: return LDKCurrency_Regtest;
320 case 3: return LDKCurrency_Simnet;
321 case 4: return LDKCurrency_Signet;
323 (*env)->FatalError(env, "A call to Currency.ordinal() from rust returned an invalid value.");
324 abort(); // Unreachable, but will let the compiler know we don't return here
326 static jclass Currency_class = NULL;
327 static jfieldID Currency_LDKCurrency_Bitcoin = NULL;
328 static jfieldID Currency_LDKCurrency_BitcoinTestnet = NULL;
329 static jfieldID Currency_LDKCurrency_Regtest = NULL;
330 static jfieldID Currency_LDKCurrency_Simnet = NULL;
331 static jfieldID Currency_LDKCurrency_Signet = NULL;
332 JNIEXPORT void JNICALL Java_org_ldk_enums_Currency_init (JNIEnv *env, jclass clz) {
333 Currency_class = (*env)->NewGlobalRef(env, clz);
334 CHECK(Currency_class != NULL);
335 Currency_LDKCurrency_Bitcoin = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Bitcoin", "Lorg/ldk/enums/Currency;");
336 CHECK(Currency_LDKCurrency_Bitcoin != NULL);
337 Currency_LDKCurrency_BitcoinTestnet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_BitcoinTestnet", "Lorg/ldk/enums/Currency;");
338 CHECK(Currency_LDKCurrency_BitcoinTestnet != NULL);
339 Currency_LDKCurrency_Regtest = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Regtest", "Lorg/ldk/enums/Currency;");
340 CHECK(Currency_LDKCurrency_Regtest != NULL);
341 Currency_LDKCurrency_Simnet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Simnet", "Lorg/ldk/enums/Currency;");
342 CHECK(Currency_LDKCurrency_Simnet != NULL);
343 Currency_LDKCurrency_Signet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Signet", "Lorg/ldk/enums/Currency;");
344 CHECK(Currency_LDKCurrency_Signet != NULL);
346 static inline jclass LDKCurrency_to_java(JNIEnv *env, LDKCurrency val) {
348 case LDKCurrency_Bitcoin:
349 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Bitcoin);
350 case LDKCurrency_BitcoinTestnet:
351 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_BitcoinTestnet);
352 case LDKCurrency_Regtest:
353 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Regtest);
354 case LDKCurrency_Simnet:
355 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Simnet);
356 case LDKCurrency_Signet:
357 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Signet);
362 static inline LDKFailureCode LDKFailureCode_from_java(JNIEnv *env, jclass clz) {
363 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
364 if (UNLIKELY((*env)->ExceptionCheck(env))) {
365 (*env)->ExceptionDescribe(env);
366 (*env)->FatalError(env, "A call to FailureCode.ordinal() from rust threw an exception.");
369 case 0: return LDKFailureCode_TemporaryNodeFailure;
370 case 1: return LDKFailureCode_RequiredNodeFeatureMissing;
371 case 2: return LDKFailureCode_IncorrectOrUnknownPaymentDetails;
373 (*env)->FatalError(env, "A call to FailureCode.ordinal() from rust returned an invalid value.");
374 abort(); // Unreachable, but will let the compiler know we don't return here
376 static jclass FailureCode_class = NULL;
377 static jfieldID FailureCode_LDKFailureCode_TemporaryNodeFailure = NULL;
378 static jfieldID FailureCode_LDKFailureCode_RequiredNodeFeatureMissing = NULL;
379 static jfieldID FailureCode_LDKFailureCode_IncorrectOrUnknownPaymentDetails = NULL;
380 JNIEXPORT void JNICALL Java_org_ldk_enums_FailureCode_init (JNIEnv *env, jclass clz) {
381 FailureCode_class = (*env)->NewGlobalRef(env, clz);
382 CHECK(FailureCode_class != NULL);
383 FailureCode_LDKFailureCode_TemporaryNodeFailure = (*env)->GetStaticFieldID(env, FailureCode_class, "LDKFailureCode_TemporaryNodeFailure", "Lorg/ldk/enums/FailureCode;");
384 CHECK(FailureCode_LDKFailureCode_TemporaryNodeFailure != NULL);
385 FailureCode_LDKFailureCode_RequiredNodeFeatureMissing = (*env)->GetStaticFieldID(env, FailureCode_class, "LDKFailureCode_RequiredNodeFeatureMissing", "Lorg/ldk/enums/FailureCode;");
386 CHECK(FailureCode_LDKFailureCode_RequiredNodeFeatureMissing != NULL);
387 FailureCode_LDKFailureCode_IncorrectOrUnknownPaymentDetails = (*env)->GetStaticFieldID(env, FailureCode_class, "LDKFailureCode_IncorrectOrUnknownPaymentDetails", "Lorg/ldk/enums/FailureCode;");
388 CHECK(FailureCode_LDKFailureCode_IncorrectOrUnknownPaymentDetails != NULL);
390 static inline jclass LDKFailureCode_to_java(JNIEnv *env, LDKFailureCode val) {
392 case LDKFailureCode_TemporaryNodeFailure:
393 return (*env)->GetStaticObjectField(env, FailureCode_class, FailureCode_LDKFailureCode_TemporaryNodeFailure);
394 case LDKFailureCode_RequiredNodeFeatureMissing:
395 return (*env)->GetStaticObjectField(env, FailureCode_class, FailureCode_LDKFailureCode_RequiredNodeFeatureMissing);
396 case LDKFailureCode_IncorrectOrUnknownPaymentDetails:
397 return (*env)->GetStaticObjectField(env, FailureCode_class, FailureCode_LDKFailureCode_IncorrectOrUnknownPaymentDetails);
402 static inline LDKHTLCClaim LDKHTLCClaim_from_java(JNIEnv *env, jclass clz) {
403 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
404 if (UNLIKELY((*env)->ExceptionCheck(env))) {
405 (*env)->ExceptionDescribe(env);
406 (*env)->FatalError(env, "A call to HTLCClaim.ordinal() from rust threw an exception.");
409 case 0: return LDKHTLCClaim_OfferedTimeout;
410 case 1: return LDKHTLCClaim_OfferedPreimage;
411 case 2: return LDKHTLCClaim_AcceptedTimeout;
412 case 3: return LDKHTLCClaim_AcceptedPreimage;
413 case 4: return LDKHTLCClaim_Revocation;
415 (*env)->FatalError(env, "A call to HTLCClaim.ordinal() from rust returned an invalid value.");
416 abort(); // Unreachable, but will let the compiler know we don't return here
418 static jclass HTLCClaim_class = NULL;
419 static jfieldID HTLCClaim_LDKHTLCClaim_OfferedTimeout = NULL;
420 static jfieldID HTLCClaim_LDKHTLCClaim_OfferedPreimage = NULL;
421 static jfieldID HTLCClaim_LDKHTLCClaim_AcceptedTimeout = NULL;
422 static jfieldID HTLCClaim_LDKHTLCClaim_AcceptedPreimage = NULL;
423 static jfieldID HTLCClaim_LDKHTLCClaim_Revocation = NULL;
424 JNIEXPORT void JNICALL Java_org_ldk_enums_HTLCClaim_init (JNIEnv *env, jclass clz) {
425 HTLCClaim_class = (*env)->NewGlobalRef(env, clz);
426 CHECK(HTLCClaim_class != NULL);
427 HTLCClaim_LDKHTLCClaim_OfferedTimeout = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_OfferedTimeout", "Lorg/ldk/enums/HTLCClaim;");
428 CHECK(HTLCClaim_LDKHTLCClaim_OfferedTimeout != NULL);
429 HTLCClaim_LDKHTLCClaim_OfferedPreimage = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_OfferedPreimage", "Lorg/ldk/enums/HTLCClaim;");
430 CHECK(HTLCClaim_LDKHTLCClaim_OfferedPreimage != NULL);
431 HTLCClaim_LDKHTLCClaim_AcceptedTimeout = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_AcceptedTimeout", "Lorg/ldk/enums/HTLCClaim;");
432 CHECK(HTLCClaim_LDKHTLCClaim_AcceptedTimeout != NULL);
433 HTLCClaim_LDKHTLCClaim_AcceptedPreimage = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_AcceptedPreimage", "Lorg/ldk/enums/HTLCClaim;");
434 CHECK(HTLCClaim_LDKHTLCClaim_AcceptedPreimage != NULL);
435 HTLCClaim_LDKHTLCClaim_Revocation = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_Revocation", "Lorg/ldk/enums/HTLCClaim;");
436 CHECK(HTLCClaim_LDKHTLCClaim_Revocation != NULL);
438 static inline jclass LDKHTLCClaim_to_java(JNIEnv *env, LDKHTLCClaim val) {
440 case LDKHTLCClaim_OfferedTimeout:
441 return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_OfferedTimeout);
442 case LDKHTLCClaim_OfferedPreimage:
443 return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_OfferedPreimage);
444 case LDKHTLCClaim_AcceptedTimeout:
445 return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_AcceptedTimeout);
446 case LDKHTLCClaim_AcceptedPreimage:
447 return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_AcceptedPreimage);
448 case LDKHTLCClaim_Revocation:
449 return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_Revocation);
454 static inline LDKIOError LDKIOError_from_java(JNIEnv *env, jclass clz) {
455 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
456 if (UNLIKELY((*env)->ExceptionCheck(env))) {
457 (*env)->ExceptionDescribe(env);
458 (*env)->FatalError(env, "A call to IOError.ordinal() from rust threw an exception.");
461 case 0: return LDKIOError_NotFound;
462 case 1: return LDKIOError_PermissionDenied;
463 case 2: return LDKIOError_ConnectionRefused;
464 case 3: return LDKIOError_ConnectionReset;
465 case 4: return LDKIOError_ConnectionAborted;
466 case 5: return LDKIOError_NotConnected;
467 case 6: return LDKIOError_AddrInUse;
468 case 7: return LDKIOError_AddrNotAvailable;
469 case 8: return LDKIOError_BrokenPipe;
470 case 9: return LDKIOError_AlreadyExists;
471 case 10: return LDKIOError_WouldBlock;
472 case 11: return LDKIOError_InvalidInput;
473 case 12: return LDKIOError_InvalidData;
474 case 13: return LDKIOError_TimedOut;
475 case 14: return LDKIOError_WriteZero;
476 case 15: return LDKIOError_Interrupted;
477 case 16: return LDKIOError_Other;
478 case 17: return LDKIOError_UnexpectedEof;
480 (*env)->FatalError(env, "A call to IOError.ordinal() from rust returned an invalid value.");
481 abort(); // Unreachable, but will let the compiler know we don't return here
483 static jclass IOError_class = NULL;
484 static jfieldID IOError_LDKIOError_NotFound = NULL;
485 static jfieldID IOError_LDKIOError_PermissionDenied = NULL;
486 static jfieldID IOError_LDKIOError_ConnectionRefused = NULL;
487 static jfieldID IOError_LDKIOError_ConnectionReset = NULL;
488 static jfieldID IOError_LDKIOError_ConnectionAborted = NULL;
489 static jfieldID IOError_LDKIOError_NotConnected = NULL;
490 static jfieldID IOError_LDKIOError_AddrInUse = NULL;
491 static jfieldID IOError_LDKIOError_AddrNotAvailable = NULL;
492 static jfieldID IOError_LDKIOError_BrokenPipe = NULL;
493 static jfieldID IOError_LDKIOError_AlreadyExists = NULL;
494 static jfieldID IOError_LDKIOError_WouldBlock = NULL;
495 static jfieldID IOError_LDKIOError_InvalidInput = NULL;
496 static jfieldID IOError_LDKIOError_InvalidData = NULL;
497 static jfieldID IOError_LDKIOError_TimedOut = NULL;
498 static jfieldID IOError_LDKIOError_WriteZero = NULL;
499 static jfieldID IOError_LDKIOError_Interrupted = NULL;
500 static jfieldID IOError_LDKIOError_Other = NULL;
501 static jfieldID IOError_LDKIOError_UnexpectedEof = NULL;
502 JNIEXPORT void JNICALL Java_org_ldk_enums_IOError_init (JNIEnv *env, jclass clz) {
503 IOError_class = (*env)->NewGlobalRef(env, clz);
504 CHECK(IOError_class != NULL);
505 IOError_LDKIOError_NotFound = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_NotFound", "Lorg/ldk/enums/IOError;");
506 CHECK(IOError_LDKIOError_NotFound != NULL);
507 IOError_LDKIOError_PermissionDenied = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_PermissionDenied", "Lorg/ldk/enums/IOError;");
508 CHECK(IOError_LDKIOError_PermissionDenied != NULL);
509 IOError_LDKIOError_ConnectionRefused = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionRefused", "Lorg/ldk/enums/IOError;");
510 CHECK(IOError_LDKIOError_ConnectionRefused != NULL);
511 IOError_LDKIOError_ConnectionReset = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionReset", "Lorg/ldk/enums/IOError;");
512 CHECK(IOError_LDKIOError_ConnectionReset != NULL);
513 IOError_LDKIOError_ConnectionAborted = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionAborted", "Lorg/ldk/enums/IOError;");
514 CHECK(IOError_LDKIOError_ConnectionAborted != NULL);
515 IOError_LDKIOError_NotConnected = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_NotConnected", "Lorg/ldk/enums/IOError;");
516 CHECK(IOError_LDKIOError_NotConnected != NULL);
517 IOError_LDKIOError_AddrInUse = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AddrInUse", "Lorg/ldk/enums/IOError;");
518 CHECK(IOError_LDKIOError_AddrInUse != NULL);
519 IOError_LDKIOError_AddrNotAvailable = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AddrNotAvailable", "Lorg/ldk/enums/IOError;");
520 CHECK(IOError_LDKIOError_AddrNotAvailable != NULL);
521 IOError_LDKIOError_BrokenPipe = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_BrokenPipe", "Lorg/ldk/enums/IOError;");
522 CHECK(IOError_LDKIOError_BrokenPipe != NULL);
523 IOError_LDKIOError_AlreadyExists = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AlreadyExists", "Lorg/ldk/enums/IOError;");
524 CHECK(IOError_LDKIOError_AlreadyExists != NULL);
525 IOError_LDKIOError_WouldBlock = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_WouldBlock", "Lorg/ldk/enums/IOError;");
526 CHECK(IOError_LDKIOError_WouldBlock != NULL);
527 IOError_LDKIOError_InvalidInput = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_InvalidInput", "Lorg/ldk/enums/IOError;");
528 CHECK(IOError_LDKIOError_InvalidInput != NULL);
529 IOError_LDKIOError_InvalidData = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_InvalidData", "Lorg/ldk/enums/IOError;");
530 CHECK(IOError_LDKIOError_InvalidData != NULL);
531 IOError_LDKIOError_TimedOut = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_TimedOut", "Lorg/ldk/enums/IOError;");
532 CHECK(IOError_LDKIOError_TimedOut != NULL);
533 IOError_LDKIOError_WriteZero = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_WriteZero", "Lorg/ldk/enums/IOError;");
534 CHECK(IOError_LDKIOError_WriteZero != NULL);
535 IOError_LDKIOError_Interrupted = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_Interrupted", "Lorg/ldk/enums/IOError;");
536 CHECK(IOError_LDKIOError_Interrupted != NULL);
537 IOError_LDKIOError_Other = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_Other", "Lorg/ldk/enums/IOError;");
538 CHECK(IOError_LDKIOError_Other != NULL);
539 IOError_LDKIOError_UnexpectedEof = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_UnexpectedEof", "Lorg/ldk/enums/IOError;");
540 CHECK(IOError_LDKIOError_UnexpectedEof != NULL);
542 static inline jclass LDKIOError_to_java(JNIEnv *env, LDKIOError val) {
544 case LDKIOError_NotFound:
545 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_NotFound);
546 case LDKIOError_PermissionDenied:
547 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_PermissionDenied);
548 case LDKIOError_ConnectionRefused:
549 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionRefused);
550 case LDKIOError_ConnectionReset:
551 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionReset);
552 case LDKIOError_ConnectionAborted:
553 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionAborted);
554 case LDKIOError_NotConnected:
555 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_NotConnected);
556 case LDKIOError_AddrInUse:
557 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AddrInUse);
558 case LDKIOError_AddrNotAvailable:
559 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AddrNotAvailable);
560 case LDKIOError_BrokenPipe:
561 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_BrokenPipe);
562 case LDKIOError_AlreadyExists:
563 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AlreadyExists);
564 case LDKIOError_WouldBlock:
565 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_WouldBlock);
566 case LDKIOError_InvalidInput:
567 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_InvalidInput);
568 case LDKIOError_InvalidData:
569 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_InvalidData);
570 case LDKIOError_TimedOut:
571 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_TimedOut);
572 case LDKIOError_WriteZero:
573 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_WriteZero);
574 case LDKIOError_Interrupted:
575 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_Interrupted);
576 case LDKIOError_Other:
577 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_Other);
578 case LDKIOError_UnexpectedEof:
579 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_UnexpectedEof);
584 static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass clz) {
585 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
586 if (UNLIKELY((*env)->ExceptionCheck(env))) {
587 (*env)->ExceptionDescribe(env);
588 (*env)->FatalError(env, "A call to Level.ordinal() from rust threw an exception.");
591 case 0: return LDKLevel_Gossip;
592 case 1: return LDKLevel_Trace;
593 case 2: return LDKLevel_Debug;
594 case 3: return LDKLevel_Info;
595 case 4: return LDKLevel_Warn;
596 case 5: return LDKLevel_Error;
598 (*env)->FatalError(env, "A call to Level.ordinal() from rust returned an invalid value.");
599 abort(); // Unreachable, but will let the compiler know we don't return here
601 static jclass Level_class = NULL;
602 static jfieldID Level_LDKLevel_Gossip = NULL;
603 static jfieldID Level_LDKLevel_Trace = NULL;
604 static jfieldID Level_LDKLevel_Debug = NULL;
605 static jfieldID Level_LDKLevel_Info = NULL;
606 static jfieldID Level_LDKLevel_Warn = NULL;
607 static jfieldID Level_LDKLevel_Error = NULL;
608 JNIEXPORT void JNICALL Java_org_ldk_enums_Level_init (JNIEnv *env, jclass clz) {
609 Level_class = (*env)->NewGlobalRef(env, clz);
610 CHECK(Level_class != NULL);
611 Level_LDKLevel_Gossip = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Gossip", "Lorg/ldk/enums/Level;");
612 CHECK(Level_LDKLevel_Gossip != NULL);
613 Level_LDKLevel_Trace = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Trace", "Lorg/ldk/enums/Level;");
614 CHECK(Level_LDKLevel_Trace != NULL);
615 Level_LDKLevel_Debug = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Debug", "Lorg/ldk/enums/Level;");
616 CHECK(Level_LDKLevel_Debug != NULL);
617 Level_LDKLevel_Info = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Info", "Lorg/ldk/enums/Level;");
618 CHECK(Level_LDKLevel_Info != NULL);
619 Level_LDKLevel_Warn = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Warn", "Lorg/ldk/enums/Level;");
620 CHECK(Level_LDKLevel_Warn != NULL);
621 Level_LDKLevel_Error = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Error", "Lorg/ldk/enums/Level;");
622 CHECK(Level_LDKLevel_Error != NULL);
624 static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
626 case LDKLevel_Gossip:
627 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Gossip);
629 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Trace);
631 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Debug);
633 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Info);
635 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Warn);
637 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Error);
642 static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass clz) {
643 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
644 if (UNLIKELY((*env)->ExceptionCheck(env))) {
645 (*env)->ExceptionDescribe(env);
646 (*env)->FatalError(env, "A call to Network.ordinal() from rust threw an exception.");
649 case 0: return LDKNetwork_Bitcoin;
650 case 1: return LDKNetwork_Testnet;
651 case 2: return LDKNetwork_Regtest;
652 case 3: return LDKNetwork_Signet;
654 (*env)->FatalError(env, "A call to Network.ordinal() from rust returned an invalid value.");
655 abort(); // Unreachable, but will let the compiler know we don't return here
657 static jclass Network_class = NULL;
658 static jfieldID Network_LDKNetwork_Bitcoin = NULL;
659 static jfieldID Network_LDKNetwork_Testnet = NULL;
660 static jfieldID Network_LDKNetwork_Regtest = NULL;
661 static jfieldID Network_LDKNetwork_Signet = NULL;
662 JNIEXPORT void JNICALL Java_org_ldk_enums_Network_init (JNIEnv *env, jclass clz) {
663 Network_class = (*env)->NewGlobalRef(env, clz);
664 CHECK(Network_class != NULL);
665 Network_LDKNetwork_Bitcoin = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Bitcoin", "Lorg/ldk/enums/Network;");
666 CHECK(Network_LDKNetwork_Bitcoin != NULL);
667 Network_LDKNetwork_Testnet = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Testnet", "Lorg/ldk/enums/Network;");
668 CHECK(Network_LDKNetwork_Testnet != NULL);
669 Network_LDKNetwork_Regtest = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Regtest", "Lorg/ldk/enums/Network;");
670 CHECK(Network_LDKNetwork_Regtest != NULL);
671 Network_LDKNetwork_Signet = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Signet", "Lorg/ldk/enums/Network;");
672 CHECK(Network_LDKNetwork_Signet != NULL);
674 static inline jclass LDKNetwork_to_java(JNIEnv *env, LDKNetwork val) {
676 case LDKNetwork_Bitcoin:
677 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Bitcoin);
678 case LDKNetwork_Testnet:
679 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Testnet);
680 case LDKNetwork_Regtest:
681 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Regtest);
682 case LDKNetwork_Signet:
683 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Signet);
688 static inline LDKRecipient LDKRecipient_from_java(JNIEnv *env, jclass clz) {
689 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
690 if (UNLIKELY((*env)->ExceptionCheck(env))) {
691 (*env)->ExceptionDescribe(env);
692 (*env)->FatalError(env, "A call to Recipient.ordinal() from rust threw an exception.");
695 case 0: return LDKRecipient_Node;
696 case 1: return LDKRecipient_PhantomNode;
698 (*env)->FatalError(env, "A call to Recipient.ordinal() from rust returned an invalid value.");
699 abort(); // Unreachable, but will let the compiler know we don't return here
701 static jclass Recipient_class = NULL;
702 static jfieldID Recipient_LDKRecipient_Node = NULL;
703 static jfieldID Recipient_LDKRecipient_PhantomNode = NULL;
704 JNIEXPORT void JNICALL Java_org_ldk_enums_Recipient_init (JNIEnv *env, jclass clz) {
705 Recipient_class = (*env)->NewGlobalRef(env, clz);
706 CHECK(Recipient_class != NULL);
707 Recipient_LDKRecipient_Node = (*env)->GetStaticFieldID(env, Recipient_class, "LDKRecipient_Node", "Lorg/ldk/enums/Recipient;");
708 CHECK(Recipient_LDKRecipient_Node != NULL);
709 Recipient_LDKRecipient_PhantomNode = (*env)->GetStaticFieldID(env, Recipient_class, "LDKRecipient_PhantomNode", "Lorg/ldk/enums/Recipient;");
710 CHECK(Recipient_LDKRecipient_PhantomNode != NULL);
712 static inline jclass LDKRecipient_to_java(JNIEnv *env, LDKRecipient val) {
714 case LDKRecipient_Node:
715 return (*env)->GetStaticObjectField(env, Recipient_class, Recipient_LDKRecipient_Node);
716 case LDKRecipient_PhantomNode:
717 return (*env)->GetStaticObjectField(env, Recipient_class, Recipient_LDKRecipient_PhantomNode);
722 static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_java(JNIEnv *env, jclass clz) {
723 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
724 if (UNLIKELY((*env)->ExceptionCheck(env))) {
725 (*env)->ExceptionDescribe(env);
726 (*env)->FatalError(env, "A call to RetryableSendFailure.ordinal() from rust threw an exception.");
729 case 0: return LDKRetryableSendFailure_PaymentExpired;
730 case 1: return LDKRetryableSendFailure_RouteNotFound;
731 case 2: return LDKRetryableSendFailure_DuplicatePayment;
733 (*env)->FatalError(env, "A call to RetryableSendFailure.ordinal() from rust returned an invalid value.");
734 abort(); // Unreachable, but will let the compiler know we don't return here
736 static jclass RetryableSendFailure_class = NULL;
737 static jfieldID RetryableSendFailure_LDKRetryableSendFailure_PaymentExpired = NULL;
738 static jfieldID RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound = NULL;
739 static jfieldID RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment = NULL;
740 JNIEXPORT void JNICALL Java_org_ldk_enums_RetryableSendFailure_init (JNIEnv *env, jclass clz) {
741 RetryableSendFailure_class = (*env)->NewGlobalRef(env, clz);
742 CHECK(RetryableSendFailure_class != NULL);
743 RetryableSendFailure_LDKRetryableSendFailure_PaymentExpired = (*env)->GetStaticFieldID(env, RetryableSendFailure_class, "LDKRetryableSendFailure_PaymentExpired", "Lorg/ldk/enums/RetryableSendFailure;");
744 CHECK(RetryableSendFailure_LDKRetryableSendFailure_PaymentExpired != NULL);
745 RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound = (*env)->GetStaticFieldID(env, RetryableSendFailure_class, "LDKRetryableSendFailure_RouteNotFound", "Lorg/ldk/enums/RetryableSendFailure;");
746 CHECK(RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound != NULL);
747 RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment = (*env)->GetStaticFieldID(env, RetryableSendFailure_class, "LDKRetryableSendFailure_DuplicatePayment", "Lorg/ldk/enums/RetryableSendFailure;");
748 CHECK(RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment != NULL);
750 static inline jclass LDKRetryableSendFailure_to_java(JNIEnv *env, LDKRetryableSendFailure val) {
752 case LDKRetryableSendFailure_PaymentExpired:
753 return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_PaymentExpired);
754 case LDKRetryableSendFailure_RouteNotFound:
755 return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound);
756 case LDKRetryableSendFailure_DuplicatePayment:
757 return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment);
762 static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass clz) {
763 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
764 if (UNLIKELY((*env)->ExceptionCheck(env))) {
765 (*env)->ExceptionDescribe(env);
766 (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust threw an exception.");
769 case 0: return LDKSecp256k1Error_IncorrectSignature;
770 case 1: return LDKSecp256k1Error_InvalidMessage;
771 case 2: return LDKSecp256k1Error_InvalidPublicKey;
772 case 3: return LDKSecp256k1Error_InvalidSignature;
773 case 4: return LDKSecp256k1Error_InvalidSecretKey;
774 case 5: return LDKSecp256k1Error_InvalidSharedSecret;
775 case 6: return LDKSecp256k1Error_InvalidRecoveryId;
776 case 7: return LDKSecp256k1Error_InvalidTweak;
777 case 8: return LDKSecp256k1Error_NotEnoughMemory;
778 case 9: return LDKSecp256k1Error_InvalidPublicKeySum;
779 case 10: return LDKSecp256k1Error_InvalidParityValue;
781 (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust returned an invalid value.");
782 abort(); // Unreachable, but will let the compiler know we don't return here
784 static jclass Secp256k1Error_class = NULL;
785 static jfieldID Secp256k1Error_LDKSecp256k1Error_IncorrectSignature = NULL;
786 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidMessage = NULL;
787 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey = NULL;
788 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSignature = NULL;
789 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = NULL;
790 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = NULL;
791 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = NULL;
792 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL;
793 static jfieldID Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL;
794 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = NULL;
795 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = NULL;
796 JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jclass clz) {
797 Secp256k1Error_class = (*env)->NewGlobalRef(env, clz);
798 CHECK(Secp256k1Error_class != NULL);
799 Secp256k1Error_LDKSecp256k1Error_IncorrectSignature = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_IncorrectSignature", "Lorg/ldk/enums/Secp256k1Error;");
800 CHECK(Secp256k1Error_LDKSecp256k1Error_IncorrectSignature != NULL);
801 Secp256k1Error_LDKSecp256k1Error_InvalidMessage = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidMessage", "Lorg/ldk/enums/Secp256k1Error;");
802 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidMessage != NULL);
803 Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKey", "Lorg/ldk/enums/Secp256k1Error;");
804 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey != NULL);
805 Secp256k1Error_LDKSecp256k1Error_InvalidSignature = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSignature", "Lorg/ldk/enums/Secp256k1Error;");
806 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSignature != NULL);
807 Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/enums/Secp256k1Error;");
808 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey != NULL);
809 Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSharedSecret", "Lorg/ldk/enums/Secp256k1Error;");
810 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret != NULL);
811 Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/enums/Secp256k1Error;");
812 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId != NULL);
813 Secp256k1Error_LDKSecp256k1Error_InvalidTweak = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/enums/Secp256k1Error;");
814 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidTweak != NULL);
815 Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/enums/Secp256k1Error;");
816 CHECK(Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory != NULL);
817 Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKeySum", "Lorg/ldk/enums/Secp256k1Error;");
818 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum != NULL);
819 Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidParityValue", "Lorg/ldk/enums/Secp256k1Error;");
820 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidParityValue != NULL);
822 static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) {
824 case LDKSecp256k1Error_IncorrectSignature:
825 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_IncorrectSignature);
826 case LDKSecp256k1Error_InvalidMessage:
827 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidMessage);
828 case LDKSecp256k1Error_InvalidPublicKey:
829 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey);
830 case LDKSecp256k1Error_InvalidSignature:
831 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSignature);
832 case LDKSecp256k1Error_InvalidSecretKey:
833 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey);
834 case LDKSecp256k1Error_InvalidSharedSecret:
835 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret);
836 case LDKSecp256k1Error_InvalidRecoveryId:
837 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId);
838 case LDKSecp256k1Error_InvalidTweak:
839 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidTweak);
840 case LDKSecp256k1Error_NotEnoughMemory:
841 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory);
842 case LDKSecp256k1Error_InvalidPublicKeySum:
843 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum);
844 case LDKSecp256k1Error_InvalidParityValue:
845 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidParityValue);
850 static inline LDKSemanticError LDKSemanticError_from_java(JNIEnv *env, jclass clz) {
851 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
852 if (UNLIKELY((*env)->ExceptionCheck(env))) {
853 (*env)->ExceptionDescribe(env);
854 (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust threw an exception.");
857 case 0: return LDKSemanticError_NoPaymentHash;
858 case 1: return LDKSemanticError_MultiplePaymentHashes;
859 case 2: return LDKSemanticError_NoDescription;
860 case 3: return LDKSemanticError_MultipleDescriptions;
861 case 4: return LDKSemanticError_NoPaymentSecret;
862 case 5: return LDKSemanticError_MultiplePaymentSecrets;
863 case 6: return LDKSemanticError_InvalidFeatures;
864 case 7: return LDKSemanticError_InvalidRecoveryId;
865 case 8: return LDKSemanticError_InvalidSignature;
866 case 9: return LDKSemanticError_ImpreciseAmount;
868 (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust returned an invalid value.");
869 abort(); // Unreachable, but will let the compiler know we don't return here
871 static jclass SemanticError_class = NULL;
872 static jfieldID SemanticError_LDKSemanticError_NoPaymentHash = NULL;
873 static jfieldID SemanticError_LDKSemanticError_MultiplePaymentHashes = NULL;
874 static jfieldID SemanticError_LDKSemanticError_NoDescription = NULL;
875 static jfieldID SemanticError_LDKSemanticError_MultipleDescriptions = NULL;
876 static jfieldID SemanticError_LDKSemanticError_NoPaymentSecret = NULL;
877 static jfieldID SemanticError_LDKSemanticError_MultiplePaymentSecrets = NULL;
878 static jfieldID SemanticError_LDKSemanticError_InvalidFeatures = NULL;
879 static jfieldID SemanticError_LDKSemanticError_InvalidRecoveryId = NULL;
880 static jfieldID SemanticError_LDKSemanticError_InvalidSignature = NULL;
881 static jfieldID SemanticError_LDKSemanticError_ImpreciseAmount = NULL;
882 JNIEXPORT void JNICALL Java_org_ldk_enums_SemanticError_init (JNIEnv *env, jclass clz) {
883 SemanticError_class = (*env)->NewGlobalRef(env, clz);
884 CHECK(SemanticError_class != NULL);
885 SemanticError_LDKSemanticError_NoPaymentHash = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoPaymentHash", "Lorg/ldk/enums/SemanticError;");
886 CHECK(SemanticError_LDKSemanticError_NoPaymentHash != NULL);
887 SemanticError_LDKSemanticError_MultiplePaymentHashes = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultiplePaymentHashes", "Lorg/ldk/enums/SemanticError;");
888 CHECK(SemanticError_LDKSemanticError_MultiplePaymentHashes != NULL);
889 SemanticError_LDKSemanticError_NoDescription = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoDescription", "Lorg/ldk/enums/SemanticError;");
890 CHECK(SemanticError_LDKSemanticError_NoDescription != NULL);
891 SemanticError_LDKSemanticError_MultipleDescriptions = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultipleDescriptions", "Lorg/ldk/enums/SemanticError;");
892 CHECK(SemanticError_LDKSemanticError_MultipleDescriptions != NULL);
893 SemanticError_LDKSemanticError_NoPaymentSecret = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoPaymentSecret", "Lorg/ldk/enums/SemanticError;");
894 CHECK(SemanticError_LDKSemanticError_NoPaymentSecret != NULL);
895 SemanticError_LDKSemanticError_MultiplePaymentSecrets = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultiplePaymentSecrets", "Lorg/ldk/enums/SemanticError;");
896 CHECK(SemanticError_LDKSemanticError_MultiplePaymentSecrets != NULL);
897 SemanticError_LDKSemanticError_InvalidFeatures = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidFeatures", "Lorg/ldk/enums/SemanticError;");
898 CHECK(SemanticError_LDKSemanticError_InvalidFeatures != NULL);
899 SemanticError_LDKSemanticError_InvalidRecoveryId = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidRecoveryId", "Lorg/ldk/enums/SemanticError;");
900 CHECK(SemanticError_LDKSemanticError_InvalidRecoveryId != NULL);
901 SemanticError_LDKSemanticError_InvalidSignature = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidSignature", "Lorg/ldk/enums/SemanticError;");
902 CHECK(SemanticError_LDKSemanticError_InvalidSignature != NULL);
903 SemanticError_LDKSemanticError_ImpreciseAmount = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_ImpreciseAmount", "Lorg/ldk/enums/SemanticError;");
904 CHECK(SemanticError_LDKSemanticError_ImpreciseAmount != NULL);
906 static inline jclass LDKSemanticError_to_java(JNIEnv *env, LDKSemanticError val) {
908 case LDKSemanticError_NoPaymentHash:
909 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoPaymentHash);
910 case LDKSemanticError_MultiplePaymentHashes:
911 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultiplePaymentHashes);
912 case LDKSemanticError_NoDescription:
913 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoDescription);
914 case LDKSemanticError_MultipleDescriptions:
915 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultipleDescriptions);
916 case LDKSemanticError_NoPaymentSecret:
917 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoPaymentSecret);
918 case LDKSemanticError_MultiplePaymentSecrets:
919 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultiplePaymentSecrets);
920 case LDKSemanticError_InvalidFeatures:
921 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidFeatures);
922 case LDKSemanticError_InvalidRecoveryId:
923 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidRecoveryId);
924 case LDKSemanticError_InvalidSignature:
925 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidSignature);
926 case LDKSemanticError_ImpreciseAmount:
927 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_ImpreciseAmount);
932 static inline LDKSiPrefix LDKSiPrefix_from_java(JNIEnv *env, jclass clz) {
933 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
934 if (UNLIKELY((*env)->ExceptionCheck(env))) {
935 (*env)->ExceptionDescribe(env);
936 (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust threw an exception.");
939 case 0: return LDKSiPrefix_Milli;
940 case 1: return LDKSiPrefix_Micro;
941 case 2: return LDKSiPrefix_Nano;
942 case 3: return LDKSiPrefix_Pico;
944 (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust returned an invalid value.");
945 abort(); // Unreachable, but will let the compiler know we don't return here
947 static jclass SiPrefix_class = NULL;
948 static jfieldID SiPrefix_LDKSiPrefix_Milli = NULL;
949 static jfieldID SiPrefix_LDKSiPrefix_Micro = NULL;
950 static jfieldID SiPrefix_LDKSiPrefix_Nano = NULL;
951 static jfieldID SiPrefix_LDKSiPrefix_Pico = NULL;
952 JNIEXPORT void JNICALL Java_org_ldk_enums_SiPrefix_init (JNIEnv *env, jclass clz) {
953 SiPrefix_class = (*env)->NewGlobalRef(env, clz);
954 CHECK(SiPrefix_class != NULL);
955 SiPrefix_LDKSiPrefix_Milli = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Milli", "Lorg/ldk/enums/SiPrefix;");
956 CHECK(SiPrefix_LDKSiPrefix_Milli != NULL);
957 SiPrefix_LDKSiPrefix_Micro = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Micro", "Lorg/ldk/enums/SiPrefix;");
958 CHECK(SiPrefix_LDKSiPrefix_Micro != NULL);
959 SiPrefix_LDKSiPrefix_Nano = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Nano", "Lorg/ldk/enums/SiPrefix;");
960 CHECK(SiPrefix_LDKSiPrefix_Nano != NULL);
961 SiPrefix_LDKSiPrefix_Pico = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Pico", "Lorg/ldk/enums/SiPrefix;");
962 CHECK(SiPrefix_LDKSiPrefix_Pico != NULL);
964 static inline jclass LDKSiPrefix_to_java(JNIEnv *env, LDKSiPrefix val) {
966 case LDKSiPrefix_Milli:
967 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Milli);
968 case LDKSiPrefix_Micro:
969 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Micro);
970 case LDKSiPrefix_Nano:
971 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Nano);
972 case LDKSiPrefix_Pico:
973 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Pico);
978 static inline LDKUtxoLookupError LDKUtxoLookupError_from_java(JNIEnv *env, jclass clz) {
979 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
980 if (UNLIKELY((*env)->ExceptionCheck(env))) {
981 (*env)->ExceptionDescribe(env);
982 (*env)->FatalError(env, "A call to UtxoLookupError.ordinal() from rust threw an exception.");
985 case 0: return LDKUtxoLookupError_UnknownChain;
986 case 1: return LDKUtxoLookupError_UnknownTx;
988 (*env)->FatalError(env, "A call to UtxoLookupError.ordinal() from rust returned an invalid value.");
989 abort(); // Unreachable, but will let the compiler know we don't return here
991 static jclass UtxoLookupError_class = NULL;
992 static jfieldID UtxoLookupError_LDKUtxoLookupError_UnknownChain = NULL;
993 static jfieldID UtxoLookupError_LDKUtxoLookupError_UnknownTx = NULL;
994 JNIEXPORT void JNICALL Java_org_ldk_enums_UtxoLookupError_init (JNIEnv *env, jclass clz) {
995 UtxoLookupError_class = (*env)->NewGlobalRef(env, clz);
996 CHECK(UtxoLookupError_class != NULL);
997 UtxoLookupError_LDKUtxoLookupError_UnknownChain = (*env)->GetStaticFieldID(env, UtxoLookupError_class, "LDKUtxoLookupError_UnknownChain", "Lorg/ldk/enums/UtxoLookupError;");
998 CHECK(UtxoLookupError_LDKUtxoLookupError_UnknownChain != NULL);
999 UtxoLookupError_LDKUtxoLookupError_UnknownTx = (*env)->GetStaticFieldID(env, UtxoLookupError_class, "LDKUtxoLookupError_UnknownTx", "Lorg/ldk/enums/UtxoLookupError;");
1000 CHECK(UtxoLookupError_LDKUtxoLookupError_UnknownTx != NULL);
1002 static inline jclass LDKUtxoLookupError_to_java(JNIEnv *env, LDKUtxoLookupError val) {
1004 case LDKUtxoLookupError_UnknownChain:
1005 return (*env)->GetStaticObjectField(env, UtxoLookupError_class, UtxoLookupError_LDKUtxoLookupError_UnknownChain);
1006 case LDKUtxoLookupError_UnknownTx:
1007 return (*env)->GetStaticObjectField(env, UtxoLookupError_class, UtxoLookupError_LDKUtxoLookupError_UnknownTx);
1012 struct LDKThirtyTwoBytes BigEndianScalar_get_bytes (struct LDKBigEndianScalar* thing) {
1013 LDKThirtyTwoBytes ret = { .data = *thing->big_endian_bytes };
1016 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1get_1bytes(JNIEnv *env, jclass clz, int64_t thing) {
1017 LDKBigEndianScalar* thing_conv = (LDKBigEndianScalar*)untag_ptr(thing);
1018 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
1019 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BigEndianScalar_get_bytes(thing_conv).data);
1023 static void BigEndianScalar_free (struct LDKBigEndianScalar thing) {}
1024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1free(JNIEnv *env, jclass clz, int64_t thing) {
1025 if (!ptr_is_owned(thing)) return;
1026 void* thing_ptr = untag_ptr(thing);
1027 CHECK_ACCESS(thing_ptr);
1028 LDKBigEndianScalar thing_conv = *(LDKBigEndianScalar*)(thing_ptr);
1029 FREE(untag_ptr(thing));
1030 BigEndianScalar_free(thing_conv);
1033 static jclass LDKBech32Error_MissingSeparator_class = NULL;
1034 static jmethodID LDKBech32Error_MissingSeparator_meth = NULL;
1035 static jclass LDKBech32Error_InvalidChecksum_class = NULL;
1036 static jmethodID LDKBech32Error_InvalidChecksum_meth = NULL;
1037 static jclass LDKBech32Error_InvalidLength_class = NULL;
1038 static jmethodID LDKBech32Error_InvalidLength_meth = NULL;
1039 static jclass LDKBech32Error_InvalidChar_class = NULL;
1040 static jmethodID LDKBech32Error_InvalidChar_meth = NULL;
1041 static jclass LDKBech32Error_InvalidData_class = NULL;
1042 static jmethodID LDKBech32Error_InvalidData_meth = NULL;
1043 static jclass LDKBech32Error_InvalidPadding_class = NULL;
1044 static jmethodID LDKBech32Error_InvalidPadding_meth = NULL;
1045 static jclass LDKBech32Error_MixedCase_class = NULL;
1046 static jmethodID LDKBech32Error_MixedCase_meth = NULL;
1047 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBech32Error_init (JNIEnv *env, jclass clz) {
1048 LDKBech32Error_MissingSeparator_class =
1049 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$MissingSeparator"));
1050 CHECK(LDKBech32Error_MissingSeparator_class != NULL);
1051 LDKBech32Error_MissingSeparator_meth = (*env)->GetMethodID(env, LDKBech32Error_MissingSeparator_class, "<init>", "()V");
1052 CHECK(LDKBech32Error_MissingSeparator_meth != NULL);
1053 LDKBech32Error_InvalidChecksum_class =
1054 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidChecksum"));
1055 CHECK(LDKBech32Error_InvalidChecksum_class != NULL);
1056 LDKBech32Error_InvalidChecksum_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidChecksum_class, "<init>", "()V");
1057 CHECK(LDKBech32Error_InvalidChecksum_meth != NULL);
1058 LDKBech32Error_InvalidLength_class =
1059 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidLength"));
1060 CHECK(LDKBech32Error_InvalidLength_class != NULL);
1061 LDKBech32Error_InvalidLength_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidLength_class, "<init>", "()V");
1062 CHECK(LDKBech32Error_InvalidLength_meth != NULL);
1063 LDKBech32Error_InvalidChar_class =
1064 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidChar"));
1065 CHECK(LDKBech32Error_InvalidChar_class != NULL);
1066 LDKBech32Error_InvalidChar_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidChar_class, "<init>", "(I)V");
1067 CHECK(LDKBech32Error_InvalidChar_meth != NULL);
1068 LDKBech32Error_InvalidData_class =
1069 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidData"));
1070 CHECK(LDKBech32Error_InvalidData_class != NULL);
1071 LDKBech32Error_InvalidData_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidData_class, "<init>", "(B)V");
1072 CHECK(LDKBech32Error_InvalidData_meth != NULL);
1073 LDKBech32Error_InvalidPadding_class =
1074 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidPadding"));
1075 CHECK(LDKBech32Error_InvalidPadding_class != NULL);
1076 LDKBech32Error_InvalidPadding_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidPadding_class, "<init>", "()V");
1077 CHECK(LDKBech32Error_InvalidPadding_meth != NULL);
1078 LDKBech32Error_MixedCase_class =
1079 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$MixedCase"));
1080 CHECK(LDKBech32Error_MixedCase_class != NULL);
1081 LDKBech32Error_MixedCase_meth = (*env)->GetMethodID(env, LDKBech32Error_MixedCase_class, "<init>", "()V");
1082 CHECK(LDKBech32Error_MixedCase_meth != NULL);
1084 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBech32Error_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1085 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
1087 case LDKBech32Error_MissingSeparator: {
1088 return (*env)->NewObject(env, LDKBech32Error_MissingSeparator_class, LDKBech32Error_MissingSeparator_meth);
1090 case LDKBech32Error_InvalidChecksum: {
1091 return (*env)->NewObject(env, LDKBech32Error_InvalidChecksum_class, LDKBech32Error_InvalidChecksum_meth);
1093 case LDKBech32Error_InvalidLength: {
1094 return (*env)->NewObject(env, LDKBech32Error_InvalidLength_class, LDKBech32Error_InvalidLength_meth);
1096 case LDKBech32Error_InvalidChar: {
1097 int32_t invalid_char_conv = obj->invalid_char;
1098 return (*env)->NewObject(env, LDKBech32Error_InvalidChar_class, LDKBech32Error_InvalidChar_meth, invalid_char_conv);
1100 case LDKBech32Error_InvalidData: {
1101 int8_t invalid_data_conv = obj->invalid_data;
1102 return (*env)->NewObject(env, LDKBech32Error_InvalidData_class, LDKBech32Error_InvalidData_meth, invalid_data_conv);
1104 case LDKBech32Error_InvalidPadding: {
1105 return (*env)->NewObject(env, LDKBech32Error_InvalidPadding_class, LDKBech32Error_InvalidPadding_meth);
1107 case LDKBech32Error_MixedCase: {
1108 return (*env)->NewObject(env, LDKBech32Error_MixedCase_class, LDKBech32Error_MixedCase_meth);
1113 static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
1114 LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen };
1115 memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
1118 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) {
1119 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
1120 LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
1121 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
1122 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
1123 CVec_u8Z_free(ret_var);
1127 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) {
1128 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
1129 int64_t ret_conv = TxOut_get_value(thing_conv);
1133 static jclass LDKAPIError_APIMisuseError_class = NULL;
1134 static jmethodID LDKAPIError_APIMisuseError_meth = NULL;
1135 static jclass LDKAPIError_FeeRateTooHigh_class = NULL;
1136 static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL;
1137 static jclass LDKAPIError_InvalidRoute_class = NULL;
1138 static jmethodID LDKAPIError_InvalidRoute_meth = NULL;
1139 static jclass LDKAPIError_ChannelUnavailable_class = NULL;
1140 static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL;
1141 static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL;
1142 static jmethodID LDKAPIError_MonitorUpdateInProgress_meth = NULL;
1143 static jclass LDKAPIError_IncompatibleShutdownScript_class = NULL;
1144 static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL;
1145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) {
1146 LDKAPIError_APIMisuseError_class =
1147 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$APIMisuseError"));
1148 CHECK(LDKAPIError_APIMisuseError_class != NULL);
1149 LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "<init>", "(Ljava/lang/String;)V");
1150 CHECK(LDKAPIError_APIMisuseError_meth != NULL);
1151 LDKAPIError_FeeRateTooHigh_class =
1152 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh"));
1153 CHECK(LDKAPIError_FeeRateTooHigh_class != NULL);
1154 LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "<init>", "(Ljava/lang/String;I)V");
1155 CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL);
1156 LDKAPIError_InvalidRoute_class =
1157 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$InvalidRoute"));
1158 CHECK(LDKAPIError_InvalidRoute_class != NULL);
1159 LDKAPIError_InvalidRoute_meth = (*env)->GetMethodID(env, LDKAPIError_InvalidRoute_class, "<init>", "(Ljava/lang/String;)V");
1160 CHECK(LDKAPIError_InvalidRoute_meth != NULL);
1161 LDKAPIError_ChannelUnavailable_class =
1162 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable"));
1163 CHECK(LDKAPIError_ChannelUnavailable_class != NULL);
1164 LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "<init>", "(Ljava/lang/String;)V");
1165 CHECK(LDKAPIError_ChannelUnavailable_meth != NULL);
1166 LDKAPIError_MonitorUpdateInProgress_class =
1167 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateInProgress"));
1168 CHECK(LDKAPIError_MonitorUpdateInProgress_class != NULL);
1169 LDKAPIError_MonitorUpdateInProgress_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateInProgress_class, "<init>", "()V");
1170 CHECK(LDKAPIError_MonitorUpdateInProgress_meth != NULL);
1171 LDKAPIError_IncompatibleShutdownScript_class =
1172 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript"));
1173 CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL);
1174 LDKAPIError_IncompatibleShutdownScript_meth = (*env)->GetMethodID(env, LDKAPIError_IncompatibleShutdownScript_class, "<init>", "(J)V");
1175 CHECK(LDKAPIError_IncompatibleShutdownScript_meth != NULL);
1177 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1178 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
1180 case LDKAPIError_APIMisuseError: {
1181 LDKStr err_str = obj->api_misuse_error.err;
1182 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
1183 return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_conv);
1185 case LDKAPIError_FeeRateTooHigh: {
1186 LDKStr err_str = obj->fee_rate_too_high.err;
1187 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
1188 int32_t feerate_conv = obj->fee_rate_too_high.feerate;
1189 return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_conv, feerate_conv);
1191 case LDKAPIError_InvalidRoute: {
1192 LDKStr err_str = obj->invalid_route.err;
1193 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
1194 return (*env)->NewObject(env, LDKAPIError_InvalidRoute_class, LDKAPIError_InvalidRoute_meth, err_conv);
1196 case LDKAPIError_ChannelUnavailable: {
1197 LDKStr err_str = obj->channel_unavailable.err;
1198 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
1199 return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_conv);
1201 case LDKAPIError_MonitorUpdateInProgress: {
1202 return (*env)->NewObject(env, LDKAPIError_MonitorUpdateInProgress_class, LDKAPIError_MonitorUpdateInProgress_meth);
1204 case LDKAPIError_IncompatibleShutdownScript: {
1205 LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
1206 int64_t script_ref = 0;
1207 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
1208 script_ref = tag_ptr(script_var.inner, false);
1209 return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref);
1214 static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
1215 CHECK(owner->result_ok);
1216 return *owner->contents.result;
1218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1219 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
1220 CResult_NoneAPIErrorZ_get_ok(owner_conv);
1223 static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
1224 CHECK(!owner->result_ok);
1225 return APIError_clone(&*owner->contents.err);
1227 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1228 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
1229 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
1230 *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
1231 int64_t ret_ref = tag_ptr(ret_copy, true);
1235 static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
1236 LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
1237 for (size_t i = 0; i < ret.datalen; i++) {
1238 ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
1242 static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
1243 LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
1244 for (size_t i = 0; i < ret.datalen; i++) {
1245 ret.data[i] = APIError_clone(&orig->data[i]);
1249 static jclass LDKCOption_HTLCClaimZ_Some_class = NULL;
1250 static jmethodID LDKCOption_HTLCClaimZ_Some_meth = NULL;
1251 static jclass LDKCOption_HTLCClaimZ_None_class = NULL;
1252 static jmethodID LDKCOption_HTLCClaimZ_None_meth = NULL;
1253 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1HTLCClaimZ_init (JNIEnv *env, jclass clz) {
1254 LDKCOption_HTLCClaimZ_Some_class =
1255 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCClaimZ$Some"));
1256 CHECK(LDKCOption_HTLCClaimZ_Some_class != NULL);
1257 LDKCOption_HTLCClaimZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_HTLCClaimZ_Some_class, "<init>", "(Lorg/ldk/enums/HTLCClaim;)V");
1258 CHECK(LDKCOption_HTLCClaimZ_Some_meth != NULL);
1259 LDKCOption_HTLCClaimZ_None_class =
1260 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCClaimZ$None"));
1261 CHECK(LDKCOption_HTLCClaimZ_None_class != NULL);
1262 LDKCOption_HTLCClaimZ_None_meth = (*env)->GetMethodID(env, LDKCOption_HTLCClaimZ_None_class, "<init>", "()V");
1263 CHECK(LDKCOption_HTLCClaimZ_None_meth != NULL);
1265 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1HTLCClaimZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1266 LDKCOption_HTLCClaimZ *obj = (LDKCOption_HTLCClaimZ*)untag_ptr(ptr);
1268 case LDKCOption_HTLCClaimZ_Some: {
1269 jclass some_conv = LDKHTLCClaim_to_java(env, obj->some);
1270 return (*env)->NewObject(env, LDKCOption_HTLCClaimZ_Some_class, LDKCOption_HTLCClaimZ_Some_meth, some_conv);
1272 case LDKCOption_HTLCClaimZ_None: {
1273 return (*env)->NewObject(env, LDKCOption_HTLCClaimZ_None_class, LDKCOption_HTLCClaimZ_None_meth);
1278 static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
1279 CHECK(owner->result_ok);
1280 return *owner->contents.result;
1282 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1283 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
1284 CResult_NoneNoneZ_get_ok(owner_conv);
1287 static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
1288 CHECK(!owner->result_ok);
1289 return *owner->contents.err;
1291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1292 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
1293 CResult_NoneNoneZ_get_err(owner_conv);
1296 static jclass LDKDecodeError_UnknownVersion_class = NULL;
1297 static jmethodID LDKDecodeError_UnknownVersion_meth = NULL;
1298 static jclass LDKDecodeError_UnknownRequiredFeature_class = NULL;
1299 static jmethodID LDKDecodeError_UnknownRequiredFeature_meth = NULL;
1300 static jclass LDKDecodeError_InvalidValue_class = NULL;
1301 static jmethodID LDKDecodeError_InvalidValue_meth = NULL;
1302 static jclass LDKDecodeError_ShortRead_class = NULL;
1303 static jmethodID LDKDecodeError_ShortRead_meth = NULL;
1304 static jclass LDKDecodeError_BadLengthDescriptor_class = NULL;
1305 static jmethodID LDKDecodeError_BadLengthDescriptor_meth = NULL;
1306 static jclass LDKDecodeError_Io_class = NULL;
1307 static jmethodID LDKDecodeError_Io_meth = NULL;
1308 static jclass LDKDecodeError_UnsupportedCompression_class = NULL;
1309 static jmethodID LDKDecodeError_UnsupportedCompression_meth = NULL;
1310 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDecodeError_init (JNIEnv *env, jclass clz) {
1311 LDKDecodeError_UnknownVersion_class =
1312 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnknownVersion"));
1313 CHECK(LDKDecodeError_UnknownVersion_class != NULL);
1314 LDKDecodeError_UnknownVersion_meth = (*env)->GetMethodID(env, LDKDecodeError_UnknownVersion_class, "<init>", "()V");
1315 CHECK(LDKDecodeError_UnknownVersion_meth != NULL);
1316 LDKDecodeError_UnknownRequiredFeature_class =
1317 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnknownRequiredFeature"));
1318 CHECK(LDKDecodeError_UnknownRequiredFeature_class != NULL);
1319 LDKDecodeError_UnknownRequiredFeature_meth = (*env)->GetMethodID(env, LDKDecodeError_UnknownRequiredFeature_class, "<init>", "()V");
1320 CHECK(LDKDecodeError_UnknownRequiredFeature_meth != NULL);
1321 LDKDecodeError_InvalidValue_class =
1322 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$InvalidValue"));
1323 CHECK(LDKDecodeError_InvalidValue_class != NULL);
1324 LDKDecodeError_InvalidValue_meth = (*env)->GetMethodID(env, LDKDecodeError_InvalidValue_class, "<init>", "()V");
1325 CHECK(LDKDecodeError_InvalidValue_meth != NULL);
1326 LDKDecodeError_ShortRead_class =
1327 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$ShortRead"));
1328 CHECK(LDKDecodeError_ShortRead_class != NULL);
1329 LDKDecodeError_ShortRead_meth = (*env)->GetMethodID(env, LDKDecodeError_ShortRead_class, "<init>", "()V");
1330 CHECK(LDKDecodeError_ShortRead_meth != NULL);
1331 LDKDecodeError_BadLengthDescriptor_class =
1332 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$BadLengthDescriptor"));
1333 CHECK(LDKDecodeError_BadLengthDescriptor_class != NULL);
1334 LDKDecodeError_BadLengthDescriptor_meth = (*env)->GetMethodID(env, LDKDecodeError_BadLengthDescriptor_class, "<init>", "()V");
1335 CHECK(LDKDecodeError_BadLengthDescriptor_meth != NULL);
1336 LDKDecodeError_Io_class =
1337 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$Io"));
1338 CHECK(LDKDecodeError_Io_class != NULL);
1339 LDKDecodeError_Io_meth = (*env)->GetMethodID(env, LDKDecodeError_Io_class, "<init>", "(Lorg/ldk/enums/IOError;)V");
1340 CHECK(LDKDecodeError_Io_meth != NULL);
1341 LDKDecodeError_UnsupportedCompression_class =
1342 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnsupportedCompression"));
1343 CHECK(LDKDecodeError_UnsupportedCompression_class != NULL);
1344 LDKDecodeError_UnsupportedCompression_meth = (*env)->GetMethodID(env, LDKDecodeError_UnsupportedCompression_class, "<init>", "()V");
1345 CHECK(LDKDecodeError_UnsupportedCompression_meth != NULL);
1347 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1348 LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr);
1350 case LDKDecodeError_UnknownVersion: {
1351 return (*env)->NewObject(env, LDKDecodeError_UnknownVersion_class, LDKDecodeError_UnknownVersion_meth);
1353 case LDKDecodeError_UnknownRequiredFeature: {
1354 return (*env)->NewObject(env, LDKDecodeError_UnknownRequiredFeature_class, LDKDecodeError_UnknownRequiredFeature_meth);
1356 case LDKDecodeError_InvalidValue: {
1357 return (*env)->NewObject(env, LDKDecodeError_InvalidValue_class, LDKDecodeError_InvalidValue_meth);
1359 case LDKDecodeError_ShortRead: {
1360 return (*env)->NewObject(env, LDKDecodeError_ShortRead_class, LDKDecodeError_ShortRead_meth);
1362 case LDKDecodeError_BadLengthDescriptor: {
1363 return (*env)->NewObject(env, LDKDecodeError_BadLengthDescriptor_class, LDKDecodeError_BadLengthDescriptor_meth);
1365 case LDKDecodeError_Io: {
1366 jclass io_conv = LDKIOError_to_java(env, obj->io);
1367 return (*env)->NewObject(env, LDKDecodeError_Io_class, LDKDecodeError_Io_meth, io_conv);
1369 case LDKDecodeError_UnsupportedCompression: {
1370 return (*env)->NewObject(env, LDKDecodeError_UnsupportedCompression_class, LDKDecodeError_UnsupportedCompression_meth);
1375 static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
1376 LDKCounterpartyCommitmentSecrets ret = *owner->contents.result;
1377 ret.is_owned = false;
1380 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1381 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
1382 LDKCounterpartyCommitmentSecrets ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(owner_conv);
1383 int64_t ret_ref = 0;
1384 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1385 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1389 static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
1390 CHECK(!owner->result_ok);
1391 return DecodeError_clone(&*owner->contents.err);
1393 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1394 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
1395 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1396 *ret_copy = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
1397 int64_t ret_ref = tag_ptr(ret_copy, true);
1401 static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
1402 LDKTxCreationKeys ret = *owner->contents.result;
1403 ret.is_owned = false;
1406 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1407 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
1408 LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv);
1409 int64_t ret_ref = 0;
1410 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1411 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1415 static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
1416 CHECK(!owner->result_ok);
1417 return DecodeError_clone(&*owner->contents.err);
1419 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1420 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
1421 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1422 *ret_copy = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
1423 int64_t ret_ref = tag_ptr(ret_copy, true);
1427 static inline struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
1428 LDKChannelPublicKeys ret = *owner->contents.result;
1429 ret.is_owned = false;
1432 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1433 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
1434 LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv);
1435 int64_t ret_ref = 0;
1436 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1437 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1441 static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
1442 CHECK(!owner->result_ok);
1443 return DecodeError_clone(&*owner->contents.err);
1445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1446 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
1447 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1448 *ret_copy = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
1449 int64_t ret_ref = tag_ptr(ret_copy, true);
1453 static jclass LDKCOption_u32Z_Some_class = NULL;
1454 static jmethodID LDKCOption_u32Z_Some_meth = NULL;
1455 static jclass LDKCOption_u32Z_None_class = NULL;
1456 static jmethodID LDKCOption_u32Z_None_meth = NULL;
1457 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u32Z_init (JNIEnv *env, jclass clz) {
1458 LDKCOption_u32Z_Some_class =
1459 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$Some"));
1460 CHECK(LDKCOption_u32Z_Some_class != NULL);
1461 LDKCOption_u32Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_Some_class, "<init>", "(I)V");
1462 CHECK(LDKCOption_u32Z_Some_meth != NULL);
1463 LDKCOption_u32Z_None_class =
1464 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$None"));
1465 CHECK(LDKCOption_u32Z_None_class != NULL);
1466 LDKCOption_u32Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_None_class, "<init>", "()V");
1467 CHECK(LDKCOption_u32Z_None_meth != NULL);
1469 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1470 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
1472 case LDKCOption_u32Z_Some: {
1473 int32_t some_conv = obj->some;
1474 return (*env)->NewObject(env, LDKCOption_u32Z_Some_class, LDKCOption_u32Z_Some_meth, some_conv);
1476 case LDKCOption_u32Z_None: {
1477 return (*env)->NewObject(env, LDKCOption_u32Z_None_class, LDKCOption_u32Z_None_meth);
1482 static inline struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
1483 LDKHTLCOutputInCommitment ret = *owner->contents.result;
1484 ret.is_owned = false;
1487 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1488 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
1489 LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv);
1490 int64_t ret_ref = 0;
1491 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1492 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1496 static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
1497 CHECK(!owner->result_ok);
1498 return DecodeError_clone(&*owner->contents.err);
1500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1501 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
1502 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1503 *ret_copy = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
1504 int64_t ret_ref = tag_ptr(ret_copy, true);
1508 static inline struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1509 LDKCounterpartyChannelTransactionParameters ret = *owner->contents.result;
1510 ret.is_owned = false;
1513 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1514 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1515 LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
1516 int64_t ret_ref = 0;
1517 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1518 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1522 static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1523 CHECK(!owner->result_ok);
1524 return DecodeError_clone(&*owner->contents.err);
1526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1527 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1528 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1529 *ret_copy = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
1530 int64_t ret_ref = tag_ptr(ret_copy, true);
1534 static inline struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1535 LDKChannelTransactionParameters ret = *owner->contents.result;
1536 ret.is_owned = false;
1539 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1540 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1541 LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
1542 int64_t ret_ref = 0;
1543 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1544 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1548 static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1549 CHECK(!owner->result_ok);
1550 return DecodeError_clone(&*owner->contents.err);
1552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1553 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1554 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1555 *ret_copy = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
1556 int64_t ret_ref = tag_ptr(ret_copy, true);
1560 static inline struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1561 LDKHolderCommitmentTransaction ret = *owner->contents.result;
1562 ret.is_owned = false;
1565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1566 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1567 LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
1568 int64_t ret_ref = 0;
1569 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1570 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1574 static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1575 CHECK(!owner->result_ok);
1576 return DecodeError_clone(&*owner->contents.err);
1578 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1579 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1580 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1581 *ret_copy = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1582 int64_t ret_ref = tag_ptr(ret_copy, true);
1586 static inline struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1587 LDKBuiltCommitmentTransaction ret = *owner->contents.result;
1588 ret.is_owned = false;
1591 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1592 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1593 LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
1594 int64_t ret_ref = 0;
1595 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1596 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1600 static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1601 CHECK(!owner->result_ok);
1602 return DecodeError_clone(&*owner->contents.err);
1604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1605 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1606 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1607 *ret_copy = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1608 int64_t ret_ref = tag_ptr(ret_copy, true);
1612 static inline struct LDKTrustedClosingTransaction CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
1613 LDKTrustedClosingTransaction ret = *owner->contents.result;
1614 ret.is_owned = false;
1617 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1618 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
1619 LDKTrustedClosingTransaction ret_var = CResult_TrustedClosingTransactionNoneZ_get_ok(owner_conv);
1620 int64_t ret_ref = 0;
1621 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1622 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1626 static inline void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
1627 CHECK(!owner->result_ok);
1628 return *owner->contents.err;
1630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1631 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
1632 CResult_TrustedClosingTransactionNoneZ_get_err(owner_conv);
1635 static inline struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1636 LDKCommitmentTransaction ret = *owner->contents.result;
1637 ret.is_owned = false;
1640 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1641 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1642 LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
1643 int64_t ret_ref = 0;
1644 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1645 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1649 static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1650 CHECK(!owner->result_ok);
1651 return DecodeError_clone(&*owner->contents.err);
1653 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1654 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1655 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1656 *ret_copy = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1657 int64_t ret_ref = tag_ptr(ret_copy, true);
1661 static inline struct LDKTrustedCommitmentTransaction CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
1662 LDKTrustedCommitmentTransaction ret = *owner->contents.result;
1663 ret.is_owned = false;
1666 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1667 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
1668 LDKTrustedCommitmentTransaction ret_var = CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv);
1669 int64_t ret_ref = 0;
1670 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1671 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1675 static inline void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
1676 CHECK(!owner->result_ok);
1677 return *owner->contents.err;
1679 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1680 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
1681 CResult_TrustedCommitmentTransactionNoneZ_get_err(owner_conv);
1684 static inline struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
1685 CHECK(owner->result_ok);
1686 return *owner->contents.result;
1688 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1689 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
1690 LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv);
1691 jobjectArray ret_arr = NULL;
1692 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
1694 for (size_t i = 0; i < ret_var.datalen; i++) {
1695 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
1696 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
1697 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
1703 static inline void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
1704 CHECK(!owner->result_ok);
1705 return *owner->contents.err;
1707 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1708 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
1709 CResult_CVec_SignatureZNoneZ_get_err(owner_conv);
1712 static inline struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1713 LDKShutdownScript ret = *owner->contents.result;
1714 ret.is_owned = false;
1717 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1718 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1719 LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv);
1720 int64_t ret_ref = 0;
1721 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1722 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1726 static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1727 CHECK(!owner->result_ok);
1728 return DecodeError_clone(&*owner->contents.err);
1730 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1731 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1732 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1733 *ret_copy = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
1734 int64_t ret_ref = tag_ptr(ret_copy, true);
1738 static inline struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1739 LDKShutdownScript ret = *owner->contents.result;
1740 ret.is_owned = false;
1743 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1744 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1745 LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv);
1746 int64_t ret_ref = 0;
1747 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1748 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1752 static inline struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1753 LDKInvalidShutdownScript ret = *owner->contents.err;
1754 ret.is_owned = false;
1757 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1758 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1759 LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv);
1760 int64_t ret_ref = 0;
1761 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1762 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1766 static inline struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){
1767 LDKBlindedPath ret = *owner->contents.result;
1768 ret.is_owned = false;
1771 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1772 LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner);
1773 LDKBlindedPath ret_var = CResult_BlindedPathNoneZ_get_ok(owner_conv);
1774 int64_t ret_ref = 0;
1775 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1776 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1780 static inline void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){
1781 CHECK(!owner->result_ok);
1782 return *owner->contents.err;
1784 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1785 LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner);
1786 CResult_BlindedPathNoneZ_get_err(owner_conv);
1789 static inline struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){
1790 LDKBlindedPath ret = *owner->contents.result;
1791 ret.is_owned = false;
1794 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1795 LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner);
1796 LDKBlindedPath ret_var = CResult_BlindedPathDecodeErrorZ_get_ok(owner_conv);
1797 int64_t ret_ref = 0;
1798 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1799 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1803 static inline struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){
1804 CHECK(!owner->result_ok);
1805 return DecodeError_clone(&*owner->contents.err);
1807 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1808 LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner);
1809 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1810 *ret_copy = CResult_BlindedPathDecodeErrorZ_get_err(owner_conv);
1811 int64_t ret_ref = tag_ptr(ret_copy, true);
1815 static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
1816 LDKBlindedHop ret = *owner->contents.result;
1817 ret.is_owned = false;
1820 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1821 LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
1822 LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv);
1823 int64_t ret_ref = 0;
1824 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1825 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1829 static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
1830 CHECK(!owner->result_ok);
1831 return DecodeError_clone(&*owner->contents.err);
1833 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1834 LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
1835 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1836 *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv);
1837 int64_t ret_ref = tag_ptr(ret_copy, true);
1841 static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) {
1842 LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen };
1843 for (size_t i = 0; i < ret.datalen; i++) {
1844 ret.data[i] = RouteHop_clone(&orig->data[i]);
1848 typedef struct LDKScore_JCalls {
1849 atomic_size_t refcnt;
1852 jmethodID channel_penalty_msat_meth;
1853 jmethodID payment_path_failed_meth;
1854 jmethodID payment_path_successful_meth;
1855 jmethodID probe_failed_meth;
1856 jmethodID probe_successful_meth;
1857 jmethodID write_meth;
1859 static void LDKScore_JCalls_free(void* this_arg) {
1860 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1861 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1863 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1864 if (get_jenv_res == JNI_EDETACHED) {
1865 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1867 DO_ASSERT(get_jenv_res == JNI_OK);
1869 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
1870 if (get_jenv_res == JNI_EDETACHED) {
1871 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1876 uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) {
1877 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1879 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1880 if (get_jenv_res == JNI_EDETACHED) {
1881 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1883 DO_ASSERT(get_jenv_res == JNI_OK);
1885 int64_t short_channel_id_conv = short_channel_id;
1886 LDKNodeId source_var = *source;
1887 int64_t source_ref = 0;
1888 source_var = NodeId_clone(&source_var);
1889 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var);
1890 source_ref = tag_ptr(source_var.inner, source_var.is_owned);
1891 LDKNodeId target_var = *target;
1892 int64_t target_ref = 0;
1893 target_var = NodeId_clone(&target_var);
1894 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var);
1895 target_ref = tag_ptr(target_var.inner, target_var.is_owned);
1896 LDKChannelUsage usage_var = usage;
1897 int64_t usage_ref = 0;
1898 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var);
1899 usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned);
1900 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
1902 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id_conv, source_ref, target_ref, usage_ref);
1903 if (UNLIKELY((*env)->ExceptionCheck(env))) {
1904 (*env)->ExceptionDescribe(env);
1905 (*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception.");
1907 if (get_jenv_res == JNI_EDETACHED) {
1908 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1912 void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
1913 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1915 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1916 if (get_jenv_res == JNI_EDETACHED) {
1917 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1919 DO_ASSERT(get_jenv_res == JNI_OK);
1921 LDKCVec_RouteHopZ path_var = path;
1922 int64_tArray path_arr = NULL;
1923 path_arr = (*env)->NewLongArray(env, path_var.datalen);
1924 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
1925 for (size_t k = 0; k < path_var.datalen; k++) {
1926 LDKRouteHop path_conv_10_var = path_var.data[k];
1927 int64_t path_conv_10_ref = 0;
1928 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1929 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
1930 path_arr_ptr[k] = path_conv_10_ref;
1932 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
1933 FREE(path_var.data);
1934 int64_t short_channel_id_conv = short_channel_id;
1935 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
1937 (*env)->CallVoidMethod(env, obj, j_calls->payment_path_failed_meth, path_arr, short_channel_id_conv);
1938 if (UNLIKELY((*env)->ExceptionCheck(env))) {
1939 (*env)->ExceptionDescribe(env);
1940 (*env)->FatalError(env, "A call to payment_path_failed in LDKScore from rust threw an exception.");
1942 if (get_jenv_res == JNI_EDETACHED) {
1943 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1946 void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
1947 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1949 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1950 if (get_jenv_res == JNI_EDETACHED) {
1951 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1953 DO_ASSERT(get_jenv_res == JNI_OK);
1955 LDKCVec_RouteHopZ path_var = path;
1956 int64_tArray path_arr = NULL;
1957 path_arr = (*env)->NewLongArray(env, path_var.datalen);
1958 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
1959 for (size_t k = 0; k < path_var.datalen; k++) {
1960 LDKRouteHop path_conv_10_var = path_var.data[k];
1961 int64_t path_conv_10_ref = 0;
1962 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1963 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
1964 path_arr_ptr[k] = path_conv_10_ref;
1966 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
1967 FREE(path_var.data);
1968 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
1970 (*env)->CallVoidMethod(env, obj, j_calls->payment_path_successful_meth, path_arr);
1971 if (UNLIKELY((*env)->ExceptionCheck(env))) {
1972 (*env)->ExceptionDescribe(env);
1973 (*env)->FatalError(env, "A call to payment_path_successful in LDKScore from rust threw an exception.");
1975 if (get_jenv_res == JNI_EDETACHED) {
1976 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
1979 void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
1980 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1982 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1983 if (get_jenv_res == JNI_EDETACHED) {
1984 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1986 DO_ASSERT(get_jenv_res == JNI_OK);
1988 LDKCVec_RouteHopZ path_var = path;
1989 int64_tArray path_arr = NULL;
1990 path_arr = (*env)->NewLongArray(env, path_var.datalen);
1991 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
1992 for (size_t k = 0; k < path_var.datalen; k++) {
1993 LDKRouteHop path_conv_10_var = path_var.data[k];
1994 int64_t path_conv_10_ref = 0;
1995 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1996 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
1997 path_arr_ptr[k] = path_conv_10_ref;
1999 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
2000 FREE(path_var.data);
2001 int64_t short_channel_id_conv = short_channel_id;
2002 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2004 (*env)->CallVoidMethod(env, obj, j_calls->probe_failed_meth, path_arr, short_channel_id_conv);
2005 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2006 (*env)->ExceptionDescribe(env);
2007 (*env)->FatalError(env, "A call to probe_failed in LDKScore from rust threw an exception.");
2009 if (get_jenv_res == JNI_EDETACHED) {
2010 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2013 void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
2014 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
2016 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2017 if (get_jenv_res == JNI_EDETACHED) {
2018 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2020 DO_ASSERT(get_jenv_res == JNI_OK);
2022 LDKCVec_RouteHopZ path_var = path;
2023 int64_tArray path_arr = NULL;
2024 path_arr = (*env)->NewLongArray(env, path_var.datalen);
2025 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
2026 for (size_t k = 0; k < path_var.datalen; k++) {
2027 LDKRouteHop path_conv_10_var = path_var.data[k];
2028 int64_t path_conv_10_ref = 0;
2029 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
2030 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
2031 path_arr_ptr[k] = path_conv_10_ref;
2033 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
2034 FREE(path_var.data);
2035 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2037 (*env)->CallVoidMethod(env, obj, j_calls->probe_successful_meth, path_arr);
2038 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2039 (*env)->ExceptionDescribe(env);
2040 (*env)->FatalError(env, "A call to probe_successful in LDKScore from rust threw an exception.");
2042 if (get_jenv_res == JNI_EDETACHED) {
2043 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2046 LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
2047 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
2049 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2050 if (get_jenv_res == JNI_EDETACHED) {
2051 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2053 DO_ASSERT(get_jenv_res == JNI_OK);
2055 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2057 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
2058 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2059 (*env)->ExceptionDescribe(env);
2060 (*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception.");
2062 LDKCVec_u8Z ret_ref;
2063 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
2064 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
2065 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
2066 if (get_jenv_res == JNI_EDETACHED) {
2067 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2071 static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
2072 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
2073 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2075 static inline LDKScore LDKScore_init (JNIEnv *env, jclass clz, jobject o) {
2076 jclass c = (*env)->GetObjectClass(env, o);
2078 LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls");
2079 atomic_init(&calls->refcnt, 1);
2080 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2081 calls->o = (*env)->NewWeakGlobalRef(env, o);
2082 calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJJ)J");
2083 CHECK(calls->channel_penalty_msat_meth != NULL);
2084 calls->payment_path_failed_meth = (*env)->GetMethodID(env, c, "payment_path_failed", "([JJ)V");
2085 CHECK(calls->payment_path_failed_meth != NULL);
2086 calls->payment_path_successful_meth = (*env)->GetMethodID(env, c, "payment_path_successful", "([J)V");
2087 CHECK(calls->payment_path_successful_meth != NULL);
2088 calls->probe_failed_meth = (*env)->GetMethodID(env, c, "probe_failed", "([JJ)V");
2089 CHECK(calls->probe_failed_meth != NULL);
2090 calls->probe_successful_meth = (*env)->GetMethodID(env, c, "probe_successful", "([J)V");
2091 CHECK(calls->probe_successful_meth != NULL);
2092 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
2093 CHECK(calls->write_meth != NULL);
2096 .this_arg = (void*) calls,
2097 .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
2098 .payment_path_failed = payment_path_failed_LDKScore_jcall,
2099 .payment_path_successful = payment_path_successful_LDKScore_jcall,
2100 .probe_failed = probe_failed_LDKScore_jcall,
2101 .probe_successful = probe_successful_LDKScore_jcall,
2102 .write = write_LDKScore_jcall,
2103 .free = LDKScore_JCalls_free,
2107 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKScore_1new(JNIEnv *env, jclass clz, jobject o) {
2108 LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore");
2109 *res_ptr = LDKScore_init(env, clz, o);
2110 return tag_ptr(res_ptr, true);
2112 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) {
2113 void* this_arg_ptr = untag_ptr(this_arg);
2114 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2115 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2116 LDKNodeId source_conv;
2117 source_conv.inner = untag_ptr(source);
2118 source_conv.is_owned = ptr_is_owned(source);
2119 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
2120 source_conv.is_owned = false;
2121 LDKNodeId target_conv;
2122 target_conv.inner = untag_ptr(target);
2123 target_conv.is_owned = ptr_is_owned(target);
2124 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
2125 target_conv.is_owned = false;
2126 LDKChannelUsage usage_conv;
2127 usage_conv.inner = untag_ptr(usage);
2128 usage_conv.is_owned = ptr_is_owned(usage);
2129 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv);
2130 usage_conv = ChannelUsage_clone(&usage_conv);
2131 int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv);
2135 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) {
2136 void* this_arg_ptr = untag_ptr(this_arg);
2137 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2138 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2139 LDKCVec_RouteHopZ path_constr;
2140 path_constr.datalen = (*env)->GetArrayLength(env, path);
2141 if (path_constr.datalen > 0)
2142 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
2144 path_constr.data = NULL;
2145 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
2146 for (size_t k = 0; k < path_constr.datalen; k++) {
2147 int64_t path_conv_10 = path_vals[k];
2148 LDKRouteHop path_conv_10_conv;
2149 path_conv_10_conv.inner = untag_ptr(path_conv_10);
2150 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
2151 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
2152 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
2153 path_constr.data[k] = path_conv_10_conv;
2155 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
2156 (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
2159 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) {
2160 void* this_arg_ptr = untag_ptr(this_arg);
2161 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2162 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2163 LDKCVec_RouteHopZ path_constr;
2164 path_constr.datalen = (*env)->GetArrayLength(env, path);
2165 if (path_constr.datalen > 0)
2166 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
2168 path_constr.data = NULL;
2169 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
2170 for (size_t k = 0; k < path_constr.datalen; k++) {
2171 int64_t path_conv_10 = path_vals[k];
2172 LDKRouteHop path_conv_10_conv;
2173 path_conv_10_conv.inner = untag_ptr(path_conv_10);
2174 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
2175 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
2176 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
2177 path_constr.data[k] = path_conv_10_conv;
2179 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
2180 (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
2183 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) {
2184 void* this_arg_ptr = untag_ptr(this_arg);
2185 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2186 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2187 LDKCVec_RouteHopZ path_constr;
2188 path_constr.datalen = (*env)->GetArrayLength(env, path);
2189 if (path_constr.datalen > 0)
2190 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
2192 path_constr.data = NULL;
2193 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
2194 for (size_t k = 0; k < path_constr.datalen; k++) {
2195 int64_t path_conv_10 = path_vals[k];
2196 LDKRouteHop path_conv_10_conv;
2197 path_conv_10_conv.inner = untag_ptr(path_conv_10);
2198 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
2199 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
2200 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
2201 path_constr.data[k] = path_conv_10_conv;
2203 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
2204 (this_arg_conv->probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
2207 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1probe_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) {
2208 void* this_arg_ptr = untag_ptr(this_arg);
2209 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2210 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2211 LDKCVec_RouteHopZ path_constr;
2212 path_constr.datalen = (*env)->GetArrayLength(env, path);
2213 if (path_constr.datalen > 0)
2214 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
2216 path_constr.data = NULL;
2217 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
2218 for (size_t k = 0; k < path_constr.datalen; k++) {
2219 int64_t path_conv_10 = path_vals[k];
2220 LDKRouteHop path_conv_10_conv;
2221 path_conv_10_conv.inner = untag_ptr(path_conv_10);
2222 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
2223 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
2224 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
2225 path_constr.data[k] = path_conv_10_conv;
2227 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
2228 (this_arg_conv->probe_successful)(this_arg_conv->this_arg, path_constr);
2231 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Score_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
2232 void* this_arg_ptr = untag_ptr(this_arg);
2233 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2234 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2235 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
2236 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
2237 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
2238 CVec_u8Z_free(ret_var);
2242 typedef struct LDKLockableScore_JCalls {
2243 atomic_size_t refcnt;
2246 jmethodID lock_meth;
2247 } LDKLockableScore_JCalls;
2248 static void LDKLockableScore_JCalls_free(void* this_arg) {
2249 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
2250 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2252 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2253 if (get_jenv_res == JNI_EDETACHED) {
2254 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2256 DO_ASSERT(get_jenv_res == JNI_OK);
2258 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
2259 if (get_jenv_res == JNI_EDETACHED) {
2260 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2265 LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
2266 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
2268 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2269 if (get_jenv_res == JNI_EDETACHED) {
2270 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2272 DO_ASSERT(get_jenv_res == JNI_OK);
2274 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2276 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->lock_meth);
2277 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2278 (*env)->ExceptionDescribe(env);
2279 (*env)->FatalError(env, "A call to lock in LDKLockableScore from rust threw an exception.");
2281 void* ret_ptr = untag_ptr(ret);
2282 CHECK_ACCESS(ret_ptr);
2283 LDKScore ret_conv = *(LDKScore*)(ret_ptr);
2284 if (ret_conv.free == LDKScore_JCalls_free) {
2285 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2286 LDKScore_JCalls_cloned(&ret_conv);
2287 }// WARNING: we may need a move here but no clone is available for LDKScore
2289 if (get_jenv_res == JNI_EDETACHED) {
2290 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2294 static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
2295 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
2296 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2298 static inline LDKLockableScore LDKLockableScore_init (JNIEnv *env, jclass clz, jobject o) {
2299 jclass c = (*env)->GetObjectClass(env, o);
2301 LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
2302 atomic_init(&calls->refcnt, 1);
2303 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2304 calls->o = (*env)->NewWeakGlobalRef(env, o);
2305 calls->lock_meth = (*env)->GetMethodID(env, c, "lock", "()J");
2306 CHECK(calls->lock_meth != NULL);
2308 LDKLockableScore ret = {
2309 .this_arg = (void*) calls,
2310 .lock = lock_LDKLockableScore_jcall,
2311 .free = LDKLockableScore_JCalls_free,
2315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLockableScore_1new(JNIEnv *env, jclass clz, jobject o) {
2316 LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
2317 *res_ptr = LDKLockableScore_init(env, clz, o);
2318 return tag_ptr(res_ptr, true);
2320 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1lock(JNIEnv *env, jclass clz, int64_t this_arg) {
2321 void* this_arg_ptr = untag_ptr(this_arg);
2322 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2323 LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
2324 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
2325 *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
2326 return tag_ptr(ret_ret, true);
2329 typedef struct LDKWriteableScore_JCalls {
2330 atomic_size_t refcnt;
2333 LDKLockableScore_JCalls* LockableScore;
2334 jmethodID write_meth;
2335 } LDKWriteableScore_JCalls;
2336 static void LDKWriteableScore_JCalls_free(void* this_arg) {
2337 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
2338 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2340 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2341 if (get_jenv_res == JNI_EDETACHED) {
2342 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2344 DO_ASSERT(get_jenv_res == JNI_OK);
2346 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
2347 if (get_jenv_res == JNI_EDETACHED) {
2348 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2353 LDKCVec_u8Z write_LDKWriteableScore_jcall(const void* this_arg) {
2354 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
2356 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2357 if (get_jenv_res == JNI_EDETACHED) {
2358 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2360 DO_ASSERT(get_jenv_res == JNI_OK);
2362 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2364 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
2365 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2366 (*env)->ExceptionDescribe(env);
2367 (*env)->FatalError(env, "A call to write in LDKWriteableScore from rust threw an exception.");
2369 LDKCVec_u8Z ret_ref;
2370 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
2371 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
2372 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
2373 if (get_jenv_res == JNI_EDETACHED) {
2374 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2378 static void LDKWriteableScore_JCalls_cloned(LDKWriteableScore* new_obj) {
2379 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) new_obj->this_arg;
2380 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2381 atomic_fetch_add_explicit(&j_calls->LockableScore->refcnt, 1, memory_order_release);
2383 static inline LDKWriteableScore LDKWriteableScore_init (JNIEnv *env, jclass clz, jobject o, jobject LockableScore) {
2384 jclass c = (*env)->GetObjectClass(env, o);
2386 LDKWriteableScore_JCalls *calls = MALLOC(sizeof(LDKWriteableScore_JCalls), "LDKWriteableScore_JCalls");
2387 atomic_init(&calls->refcnt, 1);
2388 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2389 calls->o = (*env)->NewWeakGlobalRef(env, o);
2390 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
2391 CHECK(calls->write_meth != NULL);
2393 LDKWriteableScore ret = {
2394 .this_arg = (void*) calls,
2395 .write = write_LDKWriteableScore_jcall,
2396 .free = LDKWriteableScore_JCalls_free,
2397 .LockableScore = LDKLockableScore_init(env, clz, LockableScore),
2399 calls->LockableScore = ret.LockableScore.this_arg;
2402 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableScore_1new(JNIEnv *env, jclass clz, jobject o, jobject LockableScore) {
2403 LDKWriteableScore *res_ptr = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
2404 *res_ptr = LDKWriteableScore_init(env, clz, o, LockableScore);
2405 return tag_ptr(res_ptr, true);
2407 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableScore_1get_1LockableScore(JNIEnv *env, jclass clz, int64_t arg) {
2408 LDKWriteableScore *inp = (LDKWriteableScore *)untag_ptr(arg);
2409 return tag_ptr(&inp->LockableScore, false);
2411 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WriteableScore_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
2412 void* this_arg_ptr = untag_ptr(this_arg);
2413 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2414 LDKWriteableScore* this_arg_conv = (LDKWriteableScore*)this_arg_ptr;
2415 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
2416 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
2417 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
2418 CVec_u8Z_free(ret_var);
2422 static jclass LDKCOption_WriteableScoreZ_Some_class = NULL;
2423 static jmethodID LDKCOption_WriteableScoreZ_Some_meth = NULL;
2424 static jclass LDKCOption_WriteableScoreZ_None_class = NULL;
2425 static jmethodID LDKCOption_WriteableScoreZ_None_meth = NULL;
2426 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1WriteableScoreZ_init (JNIEnv *env, jclass clz) {
2427 LDKCOption_WriteableScoreZ_Some_class =
2428 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_WriteableScoreZ$Some"));
2429 CHECK(LDKCOption_WriteableScoreZ_Some_class != NULL);
2430 LDKCOption_WriteableScoreZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_WriteableScoreZ_Some_class, "<init>", "(J)V");
2431 CHECK(LDKCOption_WriteableScoreZ_Some_meth != NULL);
2432 LDKCOption_WriteableScoreZ_None_class =
2433 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_WriteableScoreZ$None"));
2434 CHECK(LDKCOption_WriteableScoreZ_None_class != NULL);
2435 LDKCOption_WriteableScoreZ_None_meth = (*env)->GetMethodID(env, LDKCOption_WriteableScoreZ_None_class, "<init>", "()V");
2436 CHECK(LDKCOption_WriteableScoreZ_None_meth != NULL);
2438 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1WriteableScoreZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2439 LDKCOption_WriteableScoreZ *obj = (LDKCOption_WriteableScoreZ*)untag_ptr(ptr);
2441 case LDKCOption_WriteableScoreZ_Some: {
2442 LDKWriteableScore* some_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
2443 *some_ret = obj->some;
2444 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
2445 if ((*some_ret).free == LDKWriteableScore_JCalls_free) {
2446 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2447 LDKWriteableScore_JCalls_cloned(&(*some_ret));
2449 return (*env)->NewObject(env, LDKCOption_WriteableScoreZ_Some_class, LDKCOption_WriteableScoreZ_Some_meth, tag_ptr(some_ret, true));
2451 case LDKCOption_WriteableScoreZ_None: {
2452 return (*env)->NewObject(env, LDKCOption_WriteableScoreZ_None_class, LDKCOption_WriteableScoreZ_None_meth);
2457 static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
2458 CHECK(owner->result_ok);
2459 return *owner->contents.result;
2461 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2462 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
2463 CResult_NoneErrorZ_get_ok(owner_conv);
2466 static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
2467 CHECK(!owner->result_ok);
2468 return *owner->contents.err;
2470 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2471 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
2472 jclass ret_conv = LDKIOError_to_java(env, CResult_NoneErrorZ_get_err(owner_conv));
2476 static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
2477 LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
2478 for (size_t i = 0; i < ret.datalen; i++) {
2479 ret.data[i] = ChannelDetails_clone(&orig->data[i]);
2483 static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
2484 LDKRoute ret = *owner->contents.result;
2485 ret.is_owned = false;
2488 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2489 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
2490 LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
2491 int64_t ret_ref = 0;
2492 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2493 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2497 static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
2498 LDKLightningError ret = *owner->contents.err;
2499 ret.is_owned = false;
2502 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2503 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
2504 LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
2505 int64_t ret_ref = 0;
2506 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2507 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2511 static jclass LDKCOption_u64Z_Some_class = NULL;
2512 static jmethodID LDKCOption_u64Z_Some_meth = NULL;
2513 static jclass LDKCOption_u64Z_None_class = NULL;
2514 static jmethodID LDKCOption_u64Z_None_meth = NULL;
2515 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u64Z_init (JNIEnv *env, jclass clz) {
2516 LDKCOption_u64Z_Some_class =
2517 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$Some"));
2518 CHECK(LDKCOption_u64Z_Some_class != NULL);
2519 LDKCOption_u64Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_Some_class, "<init>", "(J)V");
2520 CHECK(LDKCOption_u64Z_Some_meth != NULL);
2521 LDKCOption_u64Z_None_class =
2522 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$None"));
2523 CHECK(LDKCOption_u64Z_None_class != NULL);
2524 LDKCOption_u64Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_None_class, "<init>", "()V");
2525 CHECK(LDKCOption_u64Z_None_meth != NULL);
2527 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2528 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
2530 case LDKCOption_u64Z_Some: {
2531 int64_t some_conv = obj->some;
2532 return (*env)->NewObject(env, LDKCOption_u64Z_Some_class, LDKCOption_u64Z_Some_meth, some_conv);
2534 case LDKCOption_u64Z_None: {
2535 return (*env)->NewObject(env, LDKCOption_u64Z_None_class, LDKCOption_u64Z_None_meth);
2540 static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
2541 LDKInFlightHtlcs ret = *owner->contents.result;
2542 ret.is_owned = false;
2545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2546 LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
2547 LDKInFlightHtlcs ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_ok(owner_conv);
2548 int64_t ret_ref = 0;
2549 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2550 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2554 static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
2555 CHECK(!owner->result_ok);
2556 return DecodeError_clone(&*owner->contents.err);
2558 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2559 LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
2560 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2561 *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv);
2562 int64_t ret_ref = tag_ptr(ret_copy, true);
2566 static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
2567 LDKRouteHop ret = *owner->contents.result;
2568 ret.is_owned = false;
2571 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2572 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
2573 LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
2574 int64_t ret_ref = 0;
2575 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2576 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2580 static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
2581 CHECK(!owner->result_ok);
2582 return DecodeError_clone(&*owner->contents.err);
2584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2585 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
2586 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2587 *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
2588 int64_t ret_ref = tag_ptr(ret_copy, true);
2592 static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) {
2593 LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen };
2594 for (size_t i = 0; i < ret.datalen; i++) {
2595 ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]);
2599 static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
2600 LDKRoute ret = *owner->contents.result;
2601 ret.is_owned = false;
2604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2605 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
2606 LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv);
2607 int64_t ret_ref = 0;
2608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2613 static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
2614 CHECK(!owner->result_ok);
2615 return DecodeError_clone(&*owner->contents.err);
2617 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2618 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
2619 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2620 *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv);
2621 int64_t ret_ref = tag_ptr(ret_copy, true);
2625 static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
2626 LDKRouteParameters ret = *owner->contents.result;
2627 ret.is_owned = false;
2630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2631 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
2632 LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv);
2633 int64_t ret_ref = 0;
2634 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2635 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2639 static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
2640 CHECK(!owner->result_ok);
2641 return DecodeError_clone(&*owner->contents.err);
2643 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2644 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
2645 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2646 *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
2647 int64_t ret_ref = tag_ptr(ret_copy, true);
2651 static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
2652 LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
2653 for (size_t i = 0; i < ret.datalen; i++) {
2654 ret.data[i] = RouteHint_clone(&orig->data[i]);
2658 static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
2659 LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
2660 memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
2663 static inline struct LDKPaymentParameters CResult_PaymentParametersDecodeErrorZ_get_ok(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
2664 LDKPaymentParameters ret = *owner->contents.result;
2665 ret.is_owned = false;
2668 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2669 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
2670 LDKPaymentParameters ret_var = CResult_PaymentParametersDecodeErrorZ_get_ok(owner_conv);
2671 int64_t ret_ref = 0;
2672 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2673 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2677 static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
2678 CHECK(!owner->result_ok);
2679 return DecodeError_clone(&*owner->contents.err);
2681 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2682 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
2683 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2684 *ret_copy = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
2685 int64_t ret_ref = tag_ptr(ret_copy, true);
2689 static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
2690 LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
2691 for (size_t i = 0; i < ret.datalen; i++) {
2692 ret.data[i] = RouteHintHop_clone(&orig->data[i]);
2696 static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
2697 LDKRouteHint ret = *owner->contents.result;
2698 ret.is_owned = false;
2701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2702 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
2703 LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv);
2704 int64_t ret_ref = 0;
2705 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2706 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2710 static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
2711 CHECK(!owner->result_ok);
2712 return DecodeError_clone(&*owner->contents.err);
2714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2715 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
2716 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2717 *ret_copy = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
2718 int64_t ret_ref = tag_ptr(ret_copy, true);
2722 static inline struct LDKRouteHintHop CResult_RouteHintHopDecodeErrorZ_get_ok(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
2723 LDKRouteHintHop ret = *owner->contents.result;
2724 ret.is_owned = false;
2727 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2728 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
2729 LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv);
2730 int64_t ret_ref = 0;
2731 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2732 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2736 static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
2737 CHECK(!owner->result_ok);
2738 return DecodeError_clone(&*owner->contents.err);
2740 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2741 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
2742 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2743 *ret_copy = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
2744 int64_t ret_ref = tag_ptr(ret_copy, true);
2748 static jclass LDKPaymentPurpose_InvoicePayment_class = NULL;
2749 static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL;
2750 static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL;
2751 static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL;
2752 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) {
2753 LDKPaymentPurpose_InvoicePayment_class =
2754 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment"));
2755 CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL);
2756 LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[B)V");
2757 CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL);
2758 LDKPaymentPurpose_SpontaneousPayment_class =
2759 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment"));
2760 CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL);
2761 LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "<init>", "([B)V");
2762 CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL);
2764 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2765 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
2767 case LDKPaymentPurpose_InvoicePayment: {
2768 int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
2769 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data);
2770 int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
2771 (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data);
2772 return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr);
2774 case LDKPaymentPurpose_SpontaneousPayment: {
2775 int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32);
2776 (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data);
2777 return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr);
2782 static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
2783 CHECK(owner->result_ok);
2784 return PaymentPurpose_clone(&*owner->contents.result);
2786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2787 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
2788 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
2789 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv);
2790 int64_t ret_ref = tag_ptr(ret_copy, true);
2794 static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
2795 CHECK(!owner->result_ok);
2796 return DecodeError_clone(&*owner->contents.err);
2798 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2799 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
2800 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2801 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
2802 int64_t ret_ref = tag_ptr(ret_copy, true);
2806 static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL;
2807 static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL;
2808 static jclass LDKNetworkUpdate_ChannelFailure_class = NULL;
2809 static jmethodID LDKNetworkUpdate_ChannelFailure_meth = NULL;
2810 static jclass LDKNetworkUpdate_NodeFailure_class = NULL;
2811 static jmethodID LDKNetworkUpdate_NodeFailure_meth = NULL;
2812 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JNIEnv *env, jclass clz) {
2813 LDKNetworkUpdate_ChannelUpdateMessage_class =
2814 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelUpdateMessage"));
2815 CHECK(LDKNetworkUpdate_ChannelUpdateMessage_class != NULL);
2816 LDKNetworkUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelUpdateMessage_class, "<init>", "(J)V");
2817 CHECK(LDKNetworkUpdate_ChannelUpdateMessage_meth != NULL);
2818 LDKNetworkUpdate_ChannelFailure_class =
2819 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelFailure"));
2820 CHECK(LDKNetworkUpdate_ChannelFailure_class != NULL);
2821 LDKNetworkUpdate_ChannelFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelFailure_class, "<init>", "(JZ)V");
2822 CHECK(LDKNetworkUpdate_ChannelFailure_meth != NULL);
2823 LDKNetworkUpdate_NodeFailure_class =
2824 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$NodeFailure"));
2825 CHECK(LDKNetworkUpdate_NodeFailure_class != NULL);
2826 LDKNetworkUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_NodeFailure_class, "<init>", "([BZ)V");
2827 CHECK(LDKNetworkUpdate_NodeFailure_meth != NULL);
2829 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2830 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
2832 case LDKNetworkUpdate_ChannelUpdateMessage: {
2833 LDKChannelUpdate msg_var = obj->channel_update_message.msg;
2834 int64_t msg_ref = 0;
2835 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2836 msg_ref = tag_ptr(msg_var.inner, false);
2837 return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref);
2839 case LDKNetworkUpdate_ChannelFailure: {
2840 int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
2841 jboolean is_permanent_conv = obj->channel_failure.is_permanent;
2842 return (*env)->NewObject(env, LDKNetworkUpdate_ChannelFailure_class, LDKNetworkUpdate_ChannelFailure_meth, short_channel_id_conv, is_permanent_conv);
2844 case LDKNetworkUpdate_NodeFailure: {
2845 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
2846 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->node_failure.node_id.compressed_form);
2847 jboolean is_permanent_conv = obj->node_failure.is_permanent;
2848 return (*env)->NewObject(env, LDKNetworkUpdate_NodeFailure_class, LDKNetworkUpdate_NodeFailure_meth, node_id_arr, is_permanent_conv);
2853 static jclass LDKCOption_NetworkUpdateZ_Some_class = NULL;
2854 static jmethodID LDKCOption_NetworkUpdateZ_Some_meth = NULL;
2855 static jclass LDKCOption_NetworkUpdateZ_None_class = NULL;
2856 static jmethodID LDKCOption_NetworkUpdateZ_None_meth = NULL;
2857 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetworkUpdateZ_init (JNIEnv *env, jclass clz) {
2858 LDKCOption_NetworkUpdateZ_Some_class =
2859 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$Some"));
2860 CHECK(LDKCOption_NetworkUpdateZ_Some_class != NULL);
2861 LDKCOption_NetworkUpdateZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_Some_class, "<init>", "(J)V");
2862 CHECK(LDKCOption_NetworkUpdateZ_Some_meth != NULL);
2863 LDKCOption_NetworkUpdateZ_None_class =
2864 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$None"));
2865 CHECK(LDKCOption_NetworkUpdateZ_None_class != NULL);
2866 LDKCOption_NetworkUpdateZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_None_class, "<init>", "()V");
2867 CHECK(LDKCOption_NetworkUpdateZ_None_meth != NULL);
2869 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetworkUpdateZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2870 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
2872 case LDKCOption_NetworkUpdateZ_Some: {
2873 int64_t some_ref = tag_ptr(&obj->some, false);
2874 return (*env)->NewObject(env, LDKCOption_NetworkUpdateZ_Some_class, LDKCOption_NetworkUpdateZ_Some_meth, some_ref);
2876 case LDKCOption_NetworkUpdateZ_None: {
2877 return (*env)->NewObject(env, LDKCOption_NetworkUpdateZ_None_class, LDKCOption_NetworkUpdateZ_None_meth);
2882 static jclass LDKPathFailure_InitialSend_class = NULL;
2883 static jmethodID LDKPathFailure_InitialSend_meth = NULL;
2884 static jclass LDKPathFailure_OnPath_class = NULL;
2885 static jmethodID LDKPathFailure_OnPath_meth = NULL;
2886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPathFailure_init (JNIEnv *env, jclass clz) {
2887 LDKPathFailure_InitialSend_class =
2888 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPathFailure$InitialSend"));
2889 CHECK(LDKPathFailure_InitialSend_class != NULL);
2890 LDKPathFailure_InitialSend_meth = (*env)->GetMethodID(env, LDKPathFailure_InitialSend_class, "<init>", "(J)V");
2891 CHECK(LDKPathFailure_InitialSend_meth != NULL);
2892 LDKPathFailure_OnPath_class =
2893 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPathFailure$OnPath"));
2894 CHECK(LDKPathFailure_OnPath_class != NULL);
2895 LDKPathFailure_OnPath_meth = (*env)->GetMethodID(env, LDKPathFailure_OnPath_class, "<init>", "(J)V");
2896 CHECK(LDKPathFailure_OnPath_meth != NULL);
2898 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPathFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2899 LDKPathFailure *obj = (LDKPathFailure*)untag_ptr(ptr);
2901 case LDKPathFailure_InitialSend: {
2902 int64_t err_ref = tag_ptr(&obj->initial_send.err, false);
2903 return (*env)->NewObject(env, LDKPathFailure_InitialSend_class, LDKPathFailure_InitialSend_meth, err_ref);
2905 case LDKPathFailure_OnPath: {
2906 int64_t network_update_ref = tag_ptr(&obj->on_path.network_update, false);
2907 return (*env)->NewObject(env, LDKPathFailure_OnPath_class, LDKPathFailure_OnPath_meth, network_update_ref);
2912 static jclass LDKCOption_PathFailureZ_Some_class = NULL;
2913 static jmethodID LDKCOption_PathFailureZ_Some_meth = NULL;
2914 static jclass LDKCOption_PathFailureZ_None_class = NULL;
2915 static jmethodID LDKCOption_PathFailureZ_None_meth = NULL;
2916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1PathFailureZ_init (JNIEnv *env, jclass clz) {
2917 LDKCOption_PathFailureZ_Some_class =
2918 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PathFailureZ$Some"));
2919 CHECK(LDKCOption_PathFailureZ_Some_class != NULL);
2920 LDKCOption_PathFailureZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_PathFailureZ_Some_class, "<init>", "(J)V");
2921 CHECK(LDKCOption_PathFailureZ_Some_meth != NULL);
2922 LDKCOption_PathFailureZ_None_class =
2923 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PathFailureZ$None"));
2924 CHECK(LDKCOption_PathFailureZ_None_class != NULL);
2925 LDKCOption_PathFailureZ_None_meth = (*env)->GetMethodID(env, LDKCOption_PathFailureZ_None_class, "<init>", "()V");
2926 CHECK(LDKCOption_PathFailureZ_None_meth != NULL);
2928 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1PathFailureZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2929 LDKCOption_PathFailureZ *obj = (LDKCOption_PathFailureZ*)untag_ptr(ptr);
2931 case LDKCOption_PathFailureZ_Some: {
2932 int64_t some_ref = tag_ptr(&obj->some, false);
2933 return (*env)->NewObject(env, LDKCOption_PathFailureZ_Some_class, LDKCOption_PathFailureZ_Some_meth, some_ref);
2935 case LDKCOption_PathFailureZ_None: {
2936 return (*env)->NewObject(env, LDKCOption_PathFailureZ_None_class, LDKCOption_PathFailureZ_None_meth);
2941 static inline struct LDKCOption_PathFailureZ CResult_COption_PathFailureZDecodeErrorZ_get_ok(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR owner){
2942 CHECK(owner->result_ok);
2943 return COption_PathFailureZ_clone(&*owner->contents.result);
2945 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2946 LDKCResult_COption_PathFailureZDecodeErrorZ* owner_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(owner);
2947 LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
2948 *ret_copy = CResult_COption_PathFailureZDecodeErrorZ_get_ok(owner_conv);
2949 int64_t ret_ref = tag_ptr(ret_copy, true);
2953 static inline struct LDKDecodeError CResult_COption_PathFailureZDecodeErrorZ_get_err(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR owner){
2954 CHECK(!owner->result_ok);
2955 return DecodeError_clone(&*owner->contents.err);
2957 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2958 LDKCResult_COption_PathFailureZDecodeErrorZ* owner_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(owner);
2959 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2960 *ret_copy = CResult_COption_PathFailureZDecodeErrorZ_get_err(owner_conv);
2961 int64_t ret_ref = tag_ptr(ret_copy, true);
2965 static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL;
2966 static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL;
2967 static jclass LDKClosureReason_HolderForceClosed_class = NULL;
2968 static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL;
2969 static jclass LDKClosureReason_CooperativeClosure_class = NULL;
2970 static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL;
2971 static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL;
2972 static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL;
2973 static jclass LDKClosureReason_FundingTimedOut_class = NULL;
2974 static jmethodID LDKClosureReason_FundingTimedOut_meth = NULL;
2975 static jclass LDKClosureReason_ProcessingError_class = NULL;
2976 static jmethodID LDKClosureReason_ProcessingError_meth = NULL;
2977 static jclass LDKClosureReason_DisconnectedPeer_class = NULL;
2978 static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL;
2979 static jclass LDKClosureReason_OutdatedChannelManager_class = NULL;
2980 static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL;
2981 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) {
2982 LDKClosureReason_CounterpartyForceClosed_class =
2983 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed"));
2984 CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL);
2985 LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "<init>", "(Ljava/lang/String;)V");
2986 CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL);
2987 LDKClosureReason_HolderForceClosed_class =
2988 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$HolderForceClosed"));
2989 CHECK(LDKClosureReason_HolderForceClosed_class != NULL);
2990 LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "<init>", "()V");
2991 CHECK(LDKClosureReason_HolderForceClosed_meth != NULL);
2992 LDKClosureReason_CooperativeClosure_class =
2993 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CooperativeClosure"));
2994 CHECK(LDKClosureReason_CooperativeClosure_class != NULL);
2995 LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "<init>", "()V");
2996 CHECK(LDKClosureReason_CooperativeClosure_meth != NULL);
2997 LDKClosureReason_CommitmentTxConfirmed_class =
2998 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed"));
2999 CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL);
3000 LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "<init>", "()V");
3001 CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL);
3002 LDKClosureReason_FundingTimedOut_class =
3003 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$FundingTimedOut"));
3004 CHECK(LDKClosureReason_FundingTimedOut_class != NULL);
3005 LDKClosureReason_FundingTimedOut_meth = (*env)->GetMethodID(env, LDKClosureReason_FundingTimedOut_class, "<init>", "()V");
3006 CHECK(LDKClosureReason_FundingTimedOut_meth != NULL);
3007 LDKClosureReason_ProcessingError_class =
3008 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$ProcessingError"));
3009 CHECK(LDKClosureReason_ProcessingError_class != NULL);
3010 LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "<init>", "(Ljava/lang/String;)V");
3011 CHECK(LDKClosureReason_ProcessingError_meth != NULL);
3012 LDKClosureReason_DisconnectedPeer_class =
3013 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer"));
3014 CHECK(LDKClosureReason_DisconnectedPeer_class != NULL);
3015 LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "<init>", "()V");
3016 CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL);
3017 LDKClosureReason_OutdatedChannelManager_class =
3018 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager"));
3019 CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL);
3020 LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "<init>", "()V");
3021 CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL);
3023 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3024 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
3026 case LDKClosureReason_CounterpartyForceClosed: {
3027 LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg;
3028 jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len);
3029 return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv);
3031 case LDKClosureReason_HolderForceClosed: {
3032 return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth);
3034 case LDKClosureReason_CooperativeClosure: {
3035 return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth);
3037 case LDKClosureReason_CommitmentTxConfirmed: {
3038 return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth);
3040 case LDKClosureReason_FundingTimedOut: {
3041 return (*env)->NewObject(env, LDKClosureReason_FundingTimedOut_class, LDKClosureReason_FundingTimedOut_meth);
3043 case LDKClosureReason_ProcessingError: {
3044 LDKStr err_str = obj->processing_error.err;
3045 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
3046 return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv);
3048 case LDKClosureReason_DisconnectedPeer: {
3049 return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth);
3051 case LDKClosureReason_OutdatedChannelManager: {
3052 return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth);
3057 static jclass LDKCOption_ClosureReasonZ_Some_class = NULL;
3058 static jmethodID LDKCOption_ClosureReasonZ_Some_meth = NULL;
3059 static jclass LDKCOption_ClosureReasonZ_None_class = NULL;
3060 static jmethodID LDKCOption_ClosureReasonZ_None_meth = NULL;
3061 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init (JNIEnv *env, jclass clz) {
3062 LDKCOption_ClosureReasonZ_Some_class =
3063 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some"));
3064 CHECK(LDKCOption_ClosureReasonZ_Some_class != NULL);
3065 LDKCOption_ClosureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_Some_class, "<init>", "(J)V");
3066 CHECK(LDKCOption_ClosureReasonZ_Some_meth != NULL);
3067 LDKCOption_ClosureReasonZ_None_class =
3068 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None"));
3069 CHECK(LDKCOption_ClosureReasonZ_None_class != NULL);
3070 LDKCOption_ClosureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_None_class, "<init>", "()V");
3071 CHECK(LDKCOption_ClosureReasonZ_None_meth != NULL);
3073 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ClosureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3074 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
3076 case LDKCOption_ClosureReasonZ_Some: {
3077 int64_t some_ref = tag_ptr(&obj->some, false);
3078 return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_Some_class, LDKCOption_ClosureReasonZ_Some_meth, some_ref);
3080 case LDKCOption_ClosureReasonZ_None: {
3081 return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_None_class, LDKCOption_ClosureReasonZ_None_meth);
3086 static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
3087 CHECK(owner->result_ok);
3088 return COption_ClosureReasonZ_clone(&*owner->contents.result);
3090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3091 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
3092 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
3093 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv);
3094 int64_t ret_ref = tag_ptr(ret_copy, true);
3098 static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
3099 CHECK(!owner->result_ok);
3100 return DecodeError_clone(&*owner->contents.err);
3102 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3103 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
3104 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3105 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
3106 int64_t ret_ref = tag_ptr(ret_copy, true);
3110 static jclass LDKHTLCDestination_NextHopChannel_class = NULL;
3111 static jmethodID LDKHTLCDestination_NextHopChannel_meth = NULL;
3112 static jclass LDKHTLCDestination_UnknownNextHop_class = NULL;
3113 static jmethodID LDKHTLCDestination_UnknownNextHop_meth = NULL;
3114 static jclass LDKHTLCDestination_InvalidForward_class = NULL;
3115 static jmethodID LDKHTLCDestination_InvalidForward_meth = NULL;
3116 static jclass LDKHTLCDestination_FailedPayment_class = NULL;
3117 static jmethodID LDKHTLCDestination_FailedPayment_meth = NULL;
3118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCDestination_init (JNIEnv *env, jclass clz) {
3119 LDKHTLCDestination_NextHopChannel_class =
3120 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$NextHopChannel"));
3121 CHECK(LDKHTLCDestination_NextHopChannel_class != NULL);
3122 LDKHTLCDestination_NextHopChannel_meth = (*env)->GetMethodID(env, LDKHTLCDestination_NextHopChannel_class, "<init>", "([B[B)V");
3123 CHECK(LDKHTLCDestination_NextHopChannel_meth != NULL);
3124 LDKHTLCDestination_UnknownNextHop_class =
3125 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$UnknownNextHop"));
3126 CHECK(LDKHTLCDestination_UnknownNextHop_class != NULL);
3127 LDKHTLCDestination_UnknownNextHop_meth = (*env)->GetMethodID(env, LDKHTLCDestination_UnknownNextHop_class, "<init>", "(J)V");
3128 CHECK(LDKHTLCDestination_UnknownNextHop_meth != NULL);
3129 LDKHTLCDestination_InvalidForward_class =
3130 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$InvalidForward"));
3131 CHECK(LDKHTLCDestination_InvalidForward_class != NULL);
3132 LDKHTLCDestination_InvalidForward_meth = (*env)->GetMethodID(env, LDKHTLCDestination_InvalidForward_class, "<init>", "(J)V");
3133 CHECK(LDKHTLCDestination_InvalidForward_meth != NULL);
3134 LDKHTLCDestination_FailedPayment_class =
3135 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$FailedPayment"));
3136 CHECK(LDKHTLCDestination_FailedPayment_class != NULL);
3137 LDKHTLCDestination_FailedPayment_meth = (*env)->GetMethodID(env, LDKHTLCDestination_FailedPayment_class, "<init>", "([B)V");
3138 CHECK(LDKHTLCDestination_FailedPayment_meth != NULL);
3140 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3141 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
3143 case LDKHTLCDestination_NextHopChannel: {
3144 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3145 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->next_hop_channel.node_id.compressed_form);
3146 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
3147 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->next_hop_channel.channel_id.data);
3148 return (*env)->NewObject(env, LDKHTLCDestination_NextHopChannel_class, LDKHTLCDestination_NextHopChannel_meth, node_id_arr, channel_id_arr);
3150 case LDKHTLCDestination_UnknownNextHop: {
3151 int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid;
3152 return (*env)->NewObject(env, LDKHTLCDestination_UnknownNextHop_class, LDKHTLCDestination_UnknownNextHop_meth, requested_forward_scid_conv);
3154 case LDKHTLCDestination_InvalidForward: {
3155 int64_t requested_forward_scid_conv = obj->invalid_forward.requested_forward_scid;
3156 return (*env)->NewObject(env, LDKHTLCDestination_InvalidForward_class, LDKHTLCDestination_InvalidForward_meth, requested_forward_scid_conv);
3158 case LDKHTLCDestination_FailedPayment: {
3159 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3160 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->failed_payment.payment_hash.data);
3161 return (*env)->NewObject(env, LDKHTLCDestination_FailedPayment_class, LDKHTLCDestination_FailedPayment_meth, payment_hash_arr);
3166 static jclass LDKCOption_HTLCDestinationZ_Some_class = NULL;
3167 static jmethodID LDKCOption_HTLCDestinationZ_Some_meth = NULL;
3168 static jclass LDKCOption_HTLCDestinationZ_None_class = NULL;
3169 static jmethodID LDKCOption_HTLCDestinationZ_None_meth = NULL;
3170 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1HTLCDestinationZ_init (JNIEnv *env, jclass clz) {
3171 LDKCOption_HTLCDestinationZ_Some_class =
3172 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCDestinationZ$Some"));
3173 CHECK(LDKCOption_HTLCDestinationZ_Some_class != NULL);
3174 LDKCOption_HTLCDestinationZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_HTLCDestinationZ_Some_class, "<init>", "(J)V");
3175 CHECK(LDKCOption_HTLCDestinationZ_Some_meth != NULL);
3176 LDKCOption_HTLCDestinationZ_None_class =
3177 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCDestinationZ$None"));
3178 CHECK(LDKCOption_HTLCDestinationZ_None_class != NULL);
3179 LDKCOption_HTLCDestinationZ_None_meth = (*env)->GetMethodID(env, LDKCOption_HTLCDestinationZ_None_class, "<init>", "()V");
3180 CHECK(LDKCOption_HTLCDestinationZ_None_meth != NULL);
3182 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1HTLCDestinationZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3183 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
3185 case LDKCOption_HTLCDestinationZ_Some: {
3186 int64_t some_ref = tag_ptr(&obj->some, false);
3187 return (*env)->NewObject(env, LDKCOption_HTLCDestinationZ_Some_class, LDKCOption_HTLCDestinationZ_Some_meth, some_ref);
3189 case LDKCOption_HTLCDestinationZ_None: {
3190 return (*env)->NewObject(env, LDKCOption_HTLCDestinationZ_None_class, LDKCOption_HTLCDestinationZ_None_meth);
3195 static inline struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
3196 CHECK(owner->result_ok);
3197 return COption_HTLCDestinationZ_clone(&*owner->contents.result);
3199 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3200 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
3201 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
3202 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(owner_conv);
3203 int64_t ret_ref = tag_ptr(ret_copy, true);
3207 static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
3208 CHECK(!owner->result_ok);
3209 return DecodeError_clone(&*owner->contents.err);
3211 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3212 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
3213 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3214 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
3215 int64_t ret_ref = tag_ptr(ret_copy, true);
3219 static jclass LDKCOption_u128Z_Some_class = NULL;
3220 static jmethodID LDKCOption_u128Z_Some_meth = NULL;
3221 static jclass LDKCOption_u128Z_None_class = NULL;
3222 static jmethodID LDKCOption_u128Z_None_meth = NULL;
3223 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u128Z_init (JNIEnv *env, jclass clz) {
3224 LDKCOption_u128Z_Some_class =
3225 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u128Z$Some"));
3226 CHECK(LDKCOption_u128Z_Some_class != NULL);
3227 LDKCOption_u128Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u128Z_Some_class, "<init>", "([B)V");
3228 CHECK(LDKCOption_u128Z_Some_meth != NULL);
3229 LDKCOption_u128Z_None_class =
3230 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u128Z$None"));
3231 CHECK(LDKCOption_u128Z_None_class != NULL);
3232 LDKCOption_u128Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u128Z_None_class, "<init>", "()V");
3233 CHECK(LDKCOption_u128Z_None_meth != NULL);
3235 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u128Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3236 LDKCOption_u128Z *obj = (LDKCOption_u128Z*)untag_ptr(ptr);
3238 case LDKCOption_u128Z_Some: {
3239 int8_tArray some_arr = (*env)->NewByteArray(env, 16);
3240 (*env)->SetByteArrayRegion(env, some_arr, 0, 16, obj->some.le_bytes);
3241 return (*env)->NewObject(env, LDKCOption_u128Z_Some_class, LDKCOption_u128Z_Some_meth, some_arr);
3243 case LDKCOption_u128Z_None: {
3244 return (*env)->NewObject(env, LDKCOption_u128Z_None_class, LDKCOption_u128Z_None_meth);
3249 static jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL;
3250 static jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL;
3251 static jclass LDKSpendableOutputDescriptor_DelayedPaymentOutput_class = NULL;
3252 static jmethodID LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = NULL;
3253 static jclass LDKSpendableOutputDescriptor_StaticPaymentOutput_class = NULL;
3254 static jmethodID LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = NULL;
3255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv *env, jclass clz) {
3256 LDKSpendableOutputDescriptor_StaticOutput_class =
3257 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput"));
3258 CHECK(LDKSpendableOutputDescriptor_StaticOutput_class != NULL);
3259 LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "<init>", "(JJ)V");
3260 CHECK(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL);
3261 LDKSpendableOutputDescriptor_DelayedPaymentOutput_class =
3262 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$DelayedPaymentOutput"));
3263 CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_class != NULL);
3264 LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, "<init>", "(J)V");
3265 CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth != NULL);
3266 LDKSpendableOutputDescriptor_StaticPaymentOutput_class =
3267 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticPaymentOutput"));
3268 CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_class != NULL);
3269 LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, "<init>", "(J)V");
3270 CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_meth != NULL);
3272 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3273 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
3275 case LDKSpendableOutputDescriptor_StaticOutput: {
3276 LDKOutPoint outpoint_var = obj->static_output.outpoint;
3277 int64_t outpoint_ref = 0;
3278 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var);
3279 outpoint_ref = tag_ptr(outpoint_var.inner, false);
3280 LDKTxOut* output_ref = &obj->static_output.output;
3281 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, tag_ptr(output_ref, false));
3283 case LDKSpendableOutputDescriptor_DelayedPaymentOutput: {
3284 LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
3285 int64_t delayed_payment_output_ref = 0;
3286 CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var);
3287 delayed_payment_output_ref = tag_ptr(delayed_payment_output_var.inner, false);
3288 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref);
3290 case LDKSpendableOutputDescriptor_StaticPaymentOutput: {
3291 LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
3292 int64_t static_payment_output_ref = 0;
3293 CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var);
3294 static_payment_output_ref = tag_ptr(static_payment_output_var.inner, false);
3295 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref);
3300 static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) {
3301 LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen };
3302 for (size_t i = 0; i < ret.datalen; i++) {
3303 ret.data[i] = SpendableOutputDescriptor_clone(&orig->data[i]);
3307 static jclass LDKEvent_FundingGenerationReady_class = NULL;
3308 static jmethodID LDKEvent_FundingGenerationReady_meth = NULL;
3309 static jclass LDKEvent_PaymentClaimable_class = NULL;
3310 static jmethodID LDKEvent_PaymentClaimable_meth = NULL;
3311 static jclass LDKEvent_PaymentClaimed_class = NULL;
3312 static jmethodID LDKEvent_PaymentClaimed_meth = NULL;
3313 static jclass LDKEvent_PaymentSent_class = NULL;
3314 static jmethodID LDKEvent_PaymentSent_meth = NULL;
3315 static jclass LDKEvent_PaymentFailed_class = NULL;
3316 static jmethodID LDKEvent_PaymentFailed_meth = NULL;
3317 static jclass LDKEvent_PaymentPathSuccessful_class = NULL;
3318 static jmethodID LDKEvent_PaymentPathSuccessful_meth = NULL;
3319 static jclass LDKEvent_PaymentPathFailed_class = NULL;
3320 static jmethodID LDKEvent_PaymentPathFailed_meth = NULL;
3321 static jclass LDKEvent_ProbeSuccessful_class = NULL;
3322 static jmethodID LDKEvent_ProbeSuccessful_meth = NULL;
3323 static jclass LDKEvent_ProbeFailed_class = NULL;
3324 static jmethodID LDKEvent_ProbeFailed_meth = NULL;
3325 static jclass LDKEvent_PendingHTLCsForwardable_class = NULL;
3326 static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL;
3327 static jclass LDKEvent_HTLCIntercepted_class = NULL;
3328 static jmethodID LDKEvent_HTLCIntercepted_meth = NULL;
3329 static jclass LDKEvent_SpendableOutputs_class = NULL;
3330 static jmethodID LDKEvent_SpendableOutputs_meth = NULL;
3331 static jclass LDKEvent_PaymentForwarded_class = NULL;
3332 static jmethodID LDKEvent_PaymentForwarded_meth = NULL;
3333 static jclass LDKEvent_ChannelReady_class = NULL;
3334 static jmethodID LDKEvent_ChannelReady_meth = NULL;
3335 static jclass LDKEvent_ChannelClosed_class = NULL;
3336 static jmethodID LDKEvent_ChannelClosed_meth = NULL;
3337 static jclass LDKEvent_DiscardFunding_class = NULL;
3338 static jmethodID LDKEvent_DiscardFunding_meth = NULL;
3339 static jclass LDKEvent_OpenChannelRequest_class = NULL;
3340 static jmethodID LDKEvent_OpenChannelRequest_meth = NULL;
3341 static jclass LDKEvent_HTLCHandlingFailed_class = NULL;
3342 static jmethodID LDKEvent_HTLCHandlingFailed_meth = NULL;
3343 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) {
3344 LDKEvent_FundingGenerationReady_class =
3345 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingGenerationReady"));
3346 CHECK(LDKEvent_FundingGenerationReady_class != NULL);
3347 LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "<init>", "([B[BJ[B[B)V");
3348 CHECK(LDKEvent_FundingGenerationReady_meth != NULL);
3349 LDKEvent_PaymentClaimable_class =
3350 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimable"));
3351 CHECK(LDKEvent_PaymentClaimable_class != NULL);
3352 LDKEvent_PaymentClaimable_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimable_class, "<init>", "([B[BJJ[BJ)V");
3353 CHECK(LDKEvent_PaymentClaimable_meth != NULL);
3354 LDKEvent_PaymentClaimed_class =
3355 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimed"));
3356 CHECK(LDKEvent_PaymentClaimed_class != NULL);
3357 LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "<init>", "([B[BJJ)V");
3358 CHECK(LDKEvent_PaymentClaimed_meth != NULL);
3359 LDKEvent_PaymentSent_class =
3360 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent"));
3361 CHECK(LDKEvent_PaymentSent_class != NULL);
3362 LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B[B[BJ)V");
3363 CHECK(LDKEvent_PaymentSent_meth != NULL);
3364 LDKEvent_PaymentFailed_class =
3365 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentFailed"));
3366 CHECK(LDKEvent_PaymentFailed_class != NULL);
3367 LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "<init>", "([B[B)V");
3368 CHECK(LDKEvent_PaymentFailed_meth != NULL);
3369 LDKEvent_PaymentPathSuccessful_class =
3370 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful"));
3371 CHECK(LDKEvent_PaymentPathSuccessful_class != NULL);
3372 LDKEvent_PaymentPathSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathSuccessful_class, "<init>", "([B[B[J)V");
3373 CHECK(LDKEvent_PaymentPathSuccessful_meth != NULL);
3374 LDKEvent_PaymentPathFailed_class =
3375 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathFailed"));
3376 CHECK(LDKEvent_PaymentPathFailed_class != NULL);
3377 LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([B[BZJ[JJJ)V");
3378 CHECK(LDKEvent_PaymentPathFailed_meth != NULL);
3379 LDKEvent_ProbeSuccessful_class =
3380 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ProbeSuccessful"));
3381 CHECK(LDKEvent_ProbeSuccessful_class != NULL);
3382 LDKEvent_ProbeSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_ProbeSuccessful_class, "<init>", "([B[B[J)V");
3383 CHECK(LDKEvent_ProbeSuccessful_meth != NULL);
3384 LDKEvent_ProbeFailed_class =
3385 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ProbeFailed"));
3386 CHECK(LDKEvent_ProbeFailed_class != NULL);
3387 LDKEvent_ProbeFailed_meth = (*env)->GetMethodID(env, LDKEvent_ProbeFailed_class, "<init>", "([B[B[JJ)V");
3388 CHECK(LDKEvent_ProbeFailed_meth != NULL);
3389 LDKEvent_PendingHTLCsForwardable_class =
3390 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable"));
3391 CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL);
3392 LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "<init>", "(J)V");
3393 CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL);
3394 LDKEvent_HTLCIntercepted_class =
3395 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$HTLCIntercepted"));
3396 CHECK(LDKEvent_HTLCIntercepted_class != NULL);
3397 LDKEvent_HTLCIntercepted_meth = (*env)->GetMethodID(env, LDKEvent_HTLCIntercepted_class, "<init>", "([BJ[BJJ)V");
3398 CHECK(LDKEvent_HTLCIntercepted_meth != NULL);
3399 LDKEvent_SpendableOutputs_class =
3400 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$SpendableOutputs"));
3401 CHECK(LDKEvent_SpendableOutputs_class != NULL);
3402 LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "<init>", "([J)V");
3403 CHECK(LDKEvent_SpendableOutputs_meth != NULL);
3404 LDKEvent_PaymentForwarded_class =
3405 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentForwarded"));
3406 CHECK(LDKEvent_PaymentForwarded_class != NULL);
3407 LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "<init>", "([B[BJZ)V");
3408 CHECK(LDKEvent_PaymentForwarded_meth != NULL);
3409 LDKEvent_ChannelReady_class =
3410 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelReady"));
3411 CHECK(LDKEvent_ChannelReady_class != NULL);
3412 LDKEvent_ChannelReady_meth = (*env)->GetMethodID(env, LDKEvent_ChannelReady_class, "<init>", "([B[B[BJ)V");
3413 CHECK(LDKEvent_ChannelReady_meth != NULL);
3414 LDKEvent_ChannelClosed_class =
3415 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed"));
3416 CHECK(LDKEvent_ChannelClosed_class != NULL);
3417 LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "<init>", "([B[BJ)V");
3418 CHECK(LDKEvent_ChannelClosed_meth != NULL);
3419 LDKEvent_DiscardFunding_class =
3420 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding"));
3421 CHECK(LDKEvent_DiscardFunding_class != NULL);
3422 LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "<init>", "([B[B)V");
3423 CHECK(LDKEvent_DiscardFunding_meth != NULL);
3424 LDKEvent_OpenChannelRequest_class =
3425 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OpenChannelRequest"));
3426 CHECK(LDKEvent_OpenChannelRequest_class != NULL);
3427 LDKEvent_OpenChannelRequest_meth = (*env)->GetMethodID(env, LDKEvent_OpenChannelRequest_class, "<init>", "([B[BJJJ)V");
3428 CHECK(LDKEvent_OpenChannelRequest_meth != NULL);
3429 LDKEvent_HTLCHandlingFailed_class =
3430 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$HTLCHandlingFailed"));
3431 CHECK(LDKEvent_HTLCHandlingFailed_class != NULL);
3432 LDKEvent_HTLCHandlingFailed_meth = (*env)->GetMethodID(env, LDKEvent_HTLCHandlingFailed_class, "<init>", "([BJ)V");
3433 CHECK(LDKEvent_HTLCHandlingFailed_meth != NULL);
3435 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3436 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
3438 case LDKEvent_FundingGenerationReady: {
3439 int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
3440 (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data);
3441 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
3442 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->funding_generation_ready.counterparty_node_id.compressed_form);
3443 int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis;
3444 LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
3445 int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen);
3446 (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data);
3447 int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16);
3448 (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->funding_generation_ready.user_channel_id.le_bytes);
3449 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_arr);
3451 case LDKEvent_PaymentClaimable: {
3452 int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33);
3453 (*env)->SetByteArrayRegion(env, receiver_node_id_arr, 0, 33, obj->payment_claimable.receiver_node_id.compressed_form);
3454 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3455 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_claimable.payment_hash.data);
3456 int64_t amount_msat_conv = obj->payment_claimable.amount_msat;
3457 int64_t purpose_ref = tag_ptr(&obj->payment_claimable.purpose, false);
3458 int8_tArray via_channel_id_arr = (*env)->NewByteArray(env, 32);
3459 (*env)->SetByteArrayRegion(env, via_channel_id_arr, 0, 32, obj->payment_claimable.via_channel_id.data);
3460 int64_t via_user_channel_id_ref = tag_ptr(&obj->payment_claimable.via_user_channel_id, false);
3461 return (*env)->NewObject(env, LDKEvent_PaymentClaimable_class, LDKEvent_PaymentClaimable_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref, via_channel_id_arr, via_user_channel_id_ref);
3463 case LDKEvent_PaymentClaimed: {
3464 int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33);
3465 (*env)->SetByteArrayRegion(env, receiver_node_id_arr, 0, 33, obj->payment_claimed.receiver_node_id.compressed_form);
3466 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3467 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_claimed.payment_hash.data);
3468 int64_t amount_msat_conv = obj->payment_claimed.amount_msat;
3469 int64_t purpose_ref = tag_ptr(&obj->payment_claimed.purpose, false);
3470 return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref);
3472 case LDKEvent_PaymentSent: {
3473 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3474 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data);
3475 int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
3476 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data);
3477 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3478 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data);
3479 int64_t fee_paid_msat_ref = tag_ptr(&obj->payment_sent.fee_paid_msat, false);
3480 return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref);
3482 case LDKEvent_PaymentFailed: {
3483 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3484 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data);
3485 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3486 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data);
3487 return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr);
3489 case LDKEvent_PaymentPathSuccessful: {
3490 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3491 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_successful.payment_id.data);
3492 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3493 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_successful.payment_hash.data);
3494 LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
3495 int64_tArray path_arr = NULL;
3496 path_arr = (*env)->NewLongArray(env, path_var.datalen);
3497 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
3498 for (size_t k = 0; k < path_var.datalen; k++) {
3499 LDKRouteHop path_conv_10_var = path_var.data[k];
3500 int64_t path_conv_10_ref = 0;
3501 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
3502 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
3503 path_arr_ptr[k] = path_conv_10_ref;
3505 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
3506 return (*env)->NewObject(env, LDKEvent_PaymentPathSuccessful_class, LDKEvent_PaymentPathSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr);
3508 case LDKEvent_PaymentPathFailed: {
3509 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3510 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data);
3511 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3512 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data);
3513 jboolean payment_failed_permanently_conv = obj->payment_path_failed.payment_failed_permanently;
3514 int64_t failure_ref = tag_ptr(&obj->payment_path_failed.failure, false);
3515 LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
3516 int64_tArray path_arr = NULL;
3517 path_arr = (*env)->NewLongArray(env, path_var.datalen);
3518 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
3519 for (size_t k = 0; k < path_var.datalen; k++) {
3520 LDKRouteHop path_conv_10_var = path_var.data[k];
3521 int64_t path_conv_10_ref = 0;
3522 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
3523 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
3524 path_arr_ptr[k] = path_conv_10_ref;
3526 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
3527 int64_t short_channel_id_ref = tag_ptr(&obj->payment_path_failed.short_channel_id, false);
3528 LDKRouteParameters retry_var = obj->payment_path_failed.retry;
3529 int64_t retry_ref = 0;
3530 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var);
3531 retry_ref = tag_ptr(retry_var.inner, false);
3532 return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, payment_failed_permanently_conv, failure_ref, path_arr, short_channel_id_ref, retry_ref);
3534 case LDKEvent_ProbeSuccessful: {
3535 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3536 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->probe_successful.payment_id.data);
3537 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3538 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->probe_successful.payment_hash.data);
3539 LDKCVec_RouteHopZ path_var = obj->probe_successful.path;
3540 int64_tArray path_arr = NULL;
3541 path_arr = (*env)->NewLongArray(env, path_var.datalen);
3542 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
3543 for (size_t k = 0; k < path_var.datalen; k++) {
3544 LDKRouteHop path_conv_10_var = path_var.data[k];
3545 int64_t path_conv_10_ref = 0;
3546 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
3547 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
3548 path_arr_ptr[k] = path_conv_10_ref;
3550 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
3551 return (*env)->NewObject(env, LDKEvent_ProbeSuccessful_class, LDKEvent_ProbeSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr);
3553 case LDKEvent_ProbeFailed: {
3554 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
3555 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->probe_failed.payment_id.data);
3556 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3557 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->probe_failed.payment_hash.data);
3558 LDKCVec_RouteHopZ path_var = obj->probe_failed.path;
3559 int64_tArray path_arr = NULL;
3560 path_arr = (*env)->NewLongArray(env, path_var.datalen);
3561 int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
3562 for (size_t k = 0; k < path_var.datalen; k++) {
3563 LDKRouteHop path_conv_10_var = path_var.data[k];
3564 int64_t path_conv_10_ref = 0;
3565 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
3566 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
3567 path_arr_ptr[k] = path_conv_10_ref;
3569 (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
3570 int64_t short_channel_id_ref = tag_ptr(&obj->probe_failed.short_channel_id, false);
3571 return (*env)->NewObject(env, LDKEvent_ProbeFailed_class, LDKEvent_ProbeFailed_meth, payment_id_arr, payment_hash_arr, path_arr, short_channel_id_ref);
3573 case LDKEvent_PendingHTLCsForwardable: {
3574 int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable;
3575 return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, time_forwardable_conv);
3577 case LDKEvent_HTLCIntercepted: {
3578 int8_tArray intercept_id_arr = (*env)->NewByteArray(env, 32);
3579 (*env)->SetByteArrayRegion(env, intercept_id_arr, 0, 32, obj->htlc_intercepted.intercept_id.data);
3580 int64_t requested_next_hop_scid_conv = obj->htlc_intercepted.requested_next_hop_scid;
3581 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3582 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->htlc_intercepted.payment_hash.data);
3583 int64_t inbound_amount_msat_conv = obj->htlc_intercepted.inbound_amount_msat;
3584 int64_t expected_outbound_amount_msat_conv = obj->htlc_intercepted.expected_outbound_amount_msat;
3585 return (*env)->NewObject(env, LDKEvent_HTLCIntercepted_class, LDKEvent_HTLCIntercepted_meth, intercept_id_arr, requested_next_hop_scid_conv, payment_hash_arr, inbound_amount_msat_conv, expected_outbound_amount_msat_conv);
3587 case LDKEvent_SpendableOutputs: {
3588 LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
3589 int64_tArray outputs_arr = NULL;
3590 outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
3591 int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL);
3592 for (size_t b = 0; b < outputs_var.datalen; b++) {
3593 int64_t outputs_conv_27_ref = tag_ptr(&outputs_var.data[b], false);
3594 outputs_arr_ptr[b] = outputs_conv_27_ref;
3596 (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0);
3597 return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr);
3599 case LDKEvent_PaymentForwarded: {
3600 int8_tArray prev_channel_id_arr = (*env)->NewByteArray(env, 32);
3601 (*env)->SetByteArrayRegion(env, prev_channel_id_arr, 0, 32, obj->payment_forwarded.prev_channel_id.data);
3602 int8_tArray next_channel_id_arr = (*env)->NewByteArray(env, 32);
3603 (*env)->SetByteArrayRegion(env, next_channel_id_arr, 0, 32, obj->payment_forwarded.next_channel_id.data);
3604 int64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false);
3605 jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx;
3606 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);
3608 case LDKEvent_ChannelReady: {
3609 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
3610 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_ready.channel_id.data);
3611 int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16);
3612 (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->channel_ready.user_channel_id.le_bytes);
3613 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
3614 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->channel_ready.counterparty_node_id.compressed_form);
3615 LDKChannelTypeFeatures channel_type_var = obj->channel_ready.channel_type;
3616 int64_t channel_type_ref = 0;
3617 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
3618 channel_type_ref = tag_ptr(channel_type_var.inner, false);
3619 return (*env)->NewObject(env, LDKEvent_ChannelReady_class, LDKEvent_ChannelReady_meth, channel_id_arr, user_channel_id_arr, counterparty_node_id_arr, channel_type_ref);
3621 case LDKEvent_ChannelClosed: {
3622 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
3623 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data);
3624 int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16);
3625 (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->channel_closed.user_channel_id.le_bytes);
3626 int64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false);
3627 return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, user_channel_id_arr, reason_ref);
3629 case LDKEvent_DiscardFunding: {
3630 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
3631 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data);
3632 LDKTransaction transaction_var = obj->discard_funding.transaction;
3633 int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen);
3634 (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data);
3635 return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr);
3637 case LDKEvent_OpenChannelRequest: {
3638 int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
3639 (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->open_channel_request.temporary_channel_id.data);
3640 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
3641 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->open_channel_request.counterparty_node_id.compressed_form);
3642 int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis;
3643 int64_t push_msat_conv = obj->open_channel_request.push_msat;
3644 LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type;
3645 int64_t channel_type_ref = 0;
3646 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
3647 channel_type_ref = tag_ptr(channel_type_var.inner, false);
3648 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);
3650 case LDKEvent_HTLCHandlingFailed: {
3651 int8_tArray prev_channel_id_arr = (*env)->NewByteArray(env, 32);
3652 (*env)->SetByteArrayRegion(env, prev_channel_id_arr, 0, 32, obj->htlc_handling_failed.prev_channel_id.data);
3653 int64_t failed_next_destination_ref = tag_ptr(&obj->htlc_handling_failed.failed_next_destination, false);
3654 return (*env)->NewObject(env, LDKEvent_HTLCHandlingFailed_class, LDKEvent_HTLCHandlingFailed_meth, prev_channel_id_arr, failed_next_destination_ref);
3659 static jclass LDKCOption_EventZ_Some_class = NULL;
3660 static jmethodID LDKCOption_EventZ_Some_meth = NULL;
3661 static jclass LDKCOption_EventZ_None_class = NULL;
3662 static jmethodID LDKCOption_EventZ_None_meth = NULL;
3663 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init (JNIEnv *env, jclass clz) {
3664 LDKCOption_EventZ_Some_class =
3665 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$Some"));
3666 CHECK(LDKCOption_EventZ_Some_class != NULL);
3667 LDKCOption_EventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_Some_class, "<init>", "(J)V");
3668 CHECK(LDKCOption_EventZ_Some_meth != NULL);
3669 LDKCOption_EventZ_None_class =
3670 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$None"));
3671 CHECK(LDKCOption_EventZ_None_class != NULL);
3672 LDKCOption_EventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_None_class, "<init>", "()V");
3673 CHECK(LDKCOption_EventZ_None_meth != NULL);
3675 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1EventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3676 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
3678 case LDKCOption_EventZ_Some: {
3679 int64_t some_ref = tag_ptr(&obj->some, false);
3680 return (*env)->NewObject(env, LDKCOption_EventZ_Some_class, LDKCOption_EventZ_Some_meth, some_ref);
3682 case LDKCOption_EventZ_None: {
3683 return (*env)->NewObject(env, LDKCOption_EventZ_None_class, LDKCOption_EventZ_None_meth);
3688 static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
3689 CHECK(owner->result_ok);
3690 return COption_EventZ_clone(&*owner->contents.result);
3692 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3693 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
3694 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
3695 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv);
3696 int64_t ret_ref = tag_ptr(ret_copy, true);
3700 static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
3701 CHECK(!owner->result_ok);
3702 return DecodeError_clone(&*owner->contents.err);
3704 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3705 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
3706 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3707 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
3708 int64_t ret_ref = tag_ptr(ret_copy, true);
3712 static jclass LDKErrorAction_DisconnectPeer_class = NULL;
3713 static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL;
3714 static jclass LDKErrorAction_IgnoreError_class = NULL;
3715 static jmethodID LDKErrorAction_IgnoreError_meth = NULL;
3716 static jclass LDKErrorAction_IgnoreAndLog_class = NULL;
3717 static jmethodID LDKErrorAction_IgnoreAndLog_meth = NULL;
3718 static jclass LDKErrorAction_IgnoreDuplicateGossip_class = NULL;
3719 static jmethodID LDKErrorAction_IgnoreDuplicateGossip_meth = NULL;
3720 static jclass LDKErrorAction_SendErrorMessage_class = NULL;
3721 static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL;
3722 static jclass LDKErrorAction_SendWarningMessage_class = NULL;
3723 static jmethodID LDKErrorAction_SendWarningMessage_meth = NULL;
3724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv *env, jclass clz) {
3725 LDKErrorAction_DisconnectPeer_class =
3726 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$DisconnectPeer"));
3727 CHECK(LDKErrorAction_DisconnectPeer_class != NULL);
3728 LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "<init>", "(J)V");
3729 CHECK(LDKErrorAction_DisconnectPeer_meth != NULL);
3730 LDKErrorAction_IgnoreError_class =
3731 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreError"));
3732 CHECK(LDKErrorAction_IgnoreError_class != NULL);
3733 LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "<init>", "()V");
3734 CHECK(LDKErrorAction_IgnoreError_meth != NULL);
3735 LDKErrorAction_IgnoreAndLog_class =
3736 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreAndLog"));
3737 CHECK(LDKErrorAction_IgnoreAndLog_class != NULL);
3738 LDKErrorAction_IgnoreAndLog_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreAndLog_class, "<init>", "(Lorg/ldk/enums/Level;)V");
3739 CHECK(LDKErrorAction_IgnoreAndLog_meth != NULL);
3740 LDKErrorAction_IgnoreDuplicateGossip_class =
3741 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreDuplicateGossip"));
3742 CHECK(LDKErrorAction_IgnoreDuplicateGossip_class != NULL);
3743 LDKErrorAction_IgnoreDuplicateGossip_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreDuplicateGossip_class, "<init>", "()V");
3744 CHECK(LDKErrorAction_IgnoreDuplicateGossip_meth != NULL);
3745 LDKErrorAction_SendErrorMessage_class =
3746 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$SendErrorMessage"));
3747 CHECK(LDKErrorAction_SendErrorMessage_class != NULL);
3748 LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "<init>", "(J)V");
3749 CHECK(LDKErrorAction_SendErrorMessage_meth != NULL);
3750 LDKErrorAction_SendWarningMessage_class =
3751 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$SendWarningMessage"));
3752 CHECK(LDKErrorAction_SendWarningMessage_class != NULL);
3753 LDKErrorAction_SendWarningMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendWarningMessage_class, "<init>", "(JLorg/ldk/enums/Level;)V");
3754 CHECK(LDKErrorAction_SendWarningMessage_meth != NULL);
3756 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3757 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
3759 case LDKErrorAction_DisconnectPeer: {
3760 LDKErrorMessage msg_var = obj->disconnect_peer.msg;
3761 int64_t msg_ref = 0;
3762 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3763 msg_ref = tag_ptr(msg_var.inner, false);
3764 return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref);
3766 case LDKErrorAction_IgnoreError: {
3767 return (*env)->NewObject(env, LDKErrorAction_IgnoreError_class, LDKErrorAction_IgnoreError_meth);
3769 case LDKErrorAction_IgnoreAndLog: {
3770 jclass ignore_and_log_conv = LDKLevel_to_java(env, obj->ignore_and_log);
3771 return (*env)->NewObject(env, LDKErrorAction_IgnoreAndLog_class, LDKErrorAction_IgnoreAndLog_meth, ignore_and_log_conv);
3773 case LDKErrorAction_IgnoreDuplicateGossip: {
3774 return (*env)->NewObject(env, LDKErrorAction_IgnoreDuplicateGossip_class, LDKErrorAction_IgnoreDuplicateGossip_meth);
3776 case LDKErrorAction_SendErrorMessage: {
3777 LDKErrorMessage msg_var = obj->send_error_message.msg;
3778 int64_t msg_ref = 0;
3779 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3780 msg_ref = tag_ptr(msg_var.inner, false);
3781 return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref);
3783 case LDKErrorAction_SendWarningMessage: {
3784 LDKWarningMessage msg_var = obj->send_warning_message.msg;
3785 int64_t msg_ref = 0;
3786 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3787 msg_ref = tag_ptr(msg_var.inner, false);
3788 jclass log_level_conv = LDKLevel_to_java(env, obj->send_warning_message.log_level);
3789 return (*env)->NewObject(env, LDKErrorAction_SendWarningMessage_class, LDKErrorAction_SendWarningMessage_meth, msg_ref, log_level_conv);
3794 static jclass LDKMessageSendEvent_SendAcceptChannel_class = NULL;
3795 static jmethodID LDKMessageSendEvent_SendAcceptChannel_meth = NULL;
3796 static jclass LDKMessageSendEvent_SendOpenChannel_class = NULL;
3797 static jmethodID LDKMessageSendEvent_SendOpenChannel_meth = NULL;
3798 static jclass LDKMessageSendEvent_SendFundingCreated_class = NULL;
3799 static jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL;
3800 static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL;
3801 static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL;
3802 static jclass LDKMessageSendEvent_SendChannelReady_class = NULL;
3803 static jmethodID LDKMessageSendEvent_SendChannelReady_meth = NULL;
3804 static jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL;
3805 static jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL;
3806 static jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL;
3807 static jmethodID LDKMessageSendEvent_UpdateHTLCs_meth = NULL;
3808 static jclass LDKMessageSendEvent_SendRevokeAndACK_class = NULL;
3809 static jmethodID LDKMessageSendEvent_SendRevokeAndACK_meth = NULL;
3810 static jclass LDKMessageSendEvent_SendClosingSigned_class = NULL;
3811 static jmethodID LDKMessageSendEvent_SendClosingSigned_meth = NULL;
3812 static jclass LDKMessageSendEvent_SendShutdown_class = NULL;
3813 static jmethodID LDKMessageSendEvent_SendShutdown_meth = NULL;
3814 static jclass LDKMessageSendEvent_SendChannelReestablish_class = NULL;
3815 static jmethodID LDKMessageSendEvent_SendChannelReestablish_meth = NULL;
3816 static jclass LDKMessageSendEvent_SendChannelAnnouncement_class = NULL;
3817 static jmethodID LDKMessageSendEvent_SendChannelAnnouncement_meth = NULL;
3818 static jclass LDKMessageSendEvent_BroadcastChannelAnnouncement_class = NULL;
3819 static jmethodID LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = NULL;
3820 static jclass LDKMessageSendEvent_BroadcastChannelUpdate_class = NULL;
3821 static jmethodID LDKMessageSendEvent_BroadcastChannelUpdate_meth = NULL;
3822 static jclass LDKMessageSendEvent_BroadcastNodeAnnouncement_class = NULL;
3823 static jmethodID LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = NULL;
3824 static jclass LDKMessageSendEvent_SendChannelUpdate_class = NULL;
3825 static jmethodID LDKMessageSendEvent_SendChannelUpdate_meth = NULL;
3826 static jclass LDKMessageSendEvent_HandleError_class = NULL;
3827 static jmethodID LDKMessageSendEvent_HandleError_meth = NULL;
3828 static jclass LDKMessageSendEvent_SendChannelRangeQuery_class = NULL;
3829 static jmethodID LDKMessageSendEvent_SendChannelRangeQuery_meth = NULL;
3830 static jclass LDKMessageSendEvent_SendShortIdsQuery_class = NULL;
3831 static jmethodID LDKMessageSendEvent_SendShortIdsQuery_meth = NULL;
3832 static jclass LDKMessageSendEvent_SendReplyChannelRange_class = NULL;
3833 static jmethodID LDKMessageSendEvent_SendReplyChannelRange_meth = NULL;
3834 static jclass LDKMessageSendEvent_SendGossipTimestampFilter_class = NULL;
3835 static jmethodID LDKMessageSendEvent_SendGossipTimestampFilter_meth = NULL;
3836 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv *env, jclass clz) {
3837 LDKMessageSendEvent_SendAcceptChannel_class =
3838 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel"));
3839 CHECK(LDKMessageSendEvent_SendAcceptChannel_class != NULL);
3840 LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "<init>", "([BJ)V");
3841 CHECK(LDKMessageSendEvent_SendAcceptChannel_meth != NULL);
3842 LDKMessageSendEvent_SendOpenChannel_class =
3843 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel"));
3844 CHECK(LDKMessageSendEvent_SendOpenChannel_class != NULL);
3845 LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "<init>", "([BJ)V");
3846 CHECK(LDKMessageSendEvent_SendOpenChannel_meth != NULL);
3847 LDKMessageSendEvent_SendFundingCreated_class =
3848 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated"));
3849 CHECK(LDKMessageSendEvent_SendFundingCreated_class != NULL);
3850 LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "<init>", "([BJ)V");
3851 CHECK(LDKMessageSendEvent_SendFundingCreated_meth != NULL);
3852 LDKMessageSendEvent_SendFundingSigned_class =
3853 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned"));
3854 CHECK(LDKMessageSendEvent_SendFundingSigned_class != NULL);
3855 LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "<init>", "([BJ)V");
3856 CHECK(LDKMessageSendEvent_SendFundingSigned_meth != NULL);
3857 LDKMessageSendEvent_SendChannelReady_class =
3858 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReady"));
3859 CHECK(LDKMessageSendEvent_SendChannelReady_class != NULL);
3860 LDKMessageSendEvent_SendChannelReady_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReady_class, "<init>", "([BJ)V");
3861 CHECK(LDKMessageSendEvent_SendChannelReady_meth != NULL);
3862 LDKMessageSendEvent_SendAnnouncementSignatures_class =
3863 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures"));
3864 CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL);
3865 LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "<init>", "([BJ)V");
3866 CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL);
3867 LDKMessageSendEvent_UpdateHTLCs_class =
3868 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs"));
3869 CHECK(LDKMessageSendEvent_UpdateHTLCs_class != NULL);
3870 LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "<init>", "([BJ)V");
3871 CHECK(LDKMessageSendEvent_UpdateHTLCs_meth != NULL);
3872 LDKMessageSendEvent_SendRevokeAndACK_class =
3873 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK"));
3874 CHECK(LDKMessageSendEvent_SendRevokeAndACK_class != NULL);
3875 LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "<init>", "([BJ)V");
3876 CHECK(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL);
3877 LDKMessageSendEvent_SendClosingSigned_class =
3878 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned"));
3879 CHECK(LDKMessageSendEvent_SendClosingSigned_class != NULL);
3880 LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "<init>", "([BJ)V");
3881 CHECK(LDKMessageSendEvent_SendClosingSigned_meth != NULL);
3882 LDKMessageSendEvent_SendShutdown_class =
3883 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown"));
3884 CHECK(LDKMessageSendEvent_SendShutdown_class != NULL);
3885 LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "<init>", "([BJ)V");
3886 CHECK(LDKMessageSendEvent_SendShutdown_meth != NULL);
3887 LDKMessageSendEvent_SendChannelReestablish_class =
3888 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish"));
3889 CHECK(LDKMessageSendEvent_SendChannelReestablish_class != NULL);
3890 LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "<init>", "([BJ)V");
3891 CHECK(LDKMessageSendEvent_SendChannelReestablish_meth != NULL);
3892 LDKMessageSendEvent_SendChannelAnnouncement_class =
3893 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelAnnouncement"));
3894 CHECK(LDKMessageSendEvent_SendChannelAnnouncement_class != NULL);
3895 LDKMessageSendEvent_SendChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelAnnouncement_class, "<init>", "([BJJ)V");
3896 CHECK(LDKMessageSendEvent_SendChannelAnnouncement_meth != NULL);
3897 LDKMessageSendEvent_BroadcastChannelAnnouncement_class =
3898 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement"));
3899 CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL);
3900 LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "<init>", "(JJ)V");
3901 CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL);
3902 LDKMessageSendEvent_BroadcastChannelUpdate_class =
3903 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate"));
3904 CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL);
3905 LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "<init>", "(J)V");
3906 CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL);
3907 LDKMessageSendEvent_BroadcastNodeAnnouncement_class =
3908 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement"));
3909 CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_class != NULL);
3910 LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, "<init>", "(J)V");
3911 CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_meth != NULL);
3912 LDKMessageSendEvent_SendChannelUpdate_class =
3913 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelUpdate"));
3914 CHECK(LDKMessageSendEvent_SendChannelUpdate_class != NULL);
3915 LDKMessageSendEvent_SendChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelUpdate_class, "<init>", "([BJ)V");
3916 CHECK(LDKMessageSendEvent_SendChannelUpdate_meth != NULL);
3917 LDKMessageSendEvent_HandleError_class =
3918 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$HandleError"));
3919 CHECK(LDKMessageSendEvent_HandleError_class != NULL);
3920 LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "<init>", "([BJ)V");
3921 CHECK(LDKMessageSendEvent_HandleError_meth != NULL);
3922 LDKMessageSendEvent_SendChannelRangeQuery_class =
3923 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelRangeQuery"));
3924 CHECK(LDKMessageSendEvent_SendChannelRangeQuery_class != NULL);
3925 LDKMessageSendEvent_SendChannelRangeQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelRangeQuery_class, "<init>", "([BJ)V");
3926 CHECK(LDKMessageSendEvent_SendChannelRangeQuery_meth != NULL);
3927 LDKMessageSendEvent_SendShortIdsQuery_class =
3928 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShortIdsQuery"));
3929 CHECK(LDKMessageSendEvent_SendShortIdsQuery_class != NULL);
3930 LDKMessageSendEvent_SendShortIdsQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShortIdsQuery_class, "<init>", "([BJ)V");
3931 CHECK(LDKMessageSendEvent_SendShortIdsQuery_meth != NULL);
3932 LDKMessageSendEvent_SendReplyChannelRange_class =
3933 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendReplyChannelRange"));
3934 CHECK(LDKMessageSendEvent_SendReplyChannelRange_class != NULL);
3935 LDKMessageSendEvent_SendReplyChannelRange_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendReplyChannelRange_class, "<init>", "([BJ)V");
3936 CHECK(LDKMessageSendEvent_SendReplyChannelRange_meth != NULL);
3937 LDKMessageSendEvent_SendGossipTimestampFilter_class =
3938 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendGossipTimestampFilter"));
3939 CHECK(LDKMessageSendEvent_SendGossipTimestampFilter_class != NULL);
3940 LDKMessageSendEvent_SendGossipTimestampFilter_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendGossipTimestampFilter_class, "<init>", "([BJ)V");
3941 CHECK(LDKMessageSendEvent_SendGossipTimestampFilter_meth != NULL);
3943 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3944 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
3946 case LDKMessageSendEvent_SendAcceptChannel: {
3947 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3948 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_accept_channel.node_id.compressed_form);
3949 LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
3950 int64_t msg_ref = 0;
3951 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3952 msg_ref = tag_ptr(msg_var.inner, false);
3953 return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref);
3955 case LDKMessageSendEvent_SendOpenChannel: {
3956 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3957 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_open_channel.node_id.compressed_form);
3958 LDKOpenChannel msg_var = obj->send_open_channel.msg;
3959 int64_t msg_ref = 0;
3960 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3961 msg_ref = tag_ptr(msg_var.inner, false);
3962 return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref);
3964 case LDKMessageSendEvent_SendFundingCreated: {
3965 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3966 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_created.node_id.compressed_form);
3967 LDKFundingCreated msg_var = obj->send_funding_created.msg;
3968 int64_t msg_ref = 0;
3969 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3970 msg_ref = tag_ptr(msg_var.inner, false);
3971 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref);
3973 case LDKMessageSendEvent_SendFundingSigned: {
3974 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3975 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_signed.node_id.compressed_form);
3976 LDKFundingSigned msg_var = obj->send_funding_signed.msg;
3977 int64_t msg_ref = 0;
3978 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3979 msg_ref = tag_ptr(msg_var.inner, false);
3980 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref);
3982 case LDKMessageSendEvent_SendChannelReady: {
3983 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3984 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_ready.node_id.compressed_form);
3985 LDKChannelReady msg_var = obj->send_channel_ready.msg;
3986 int64_t msg_ref = 0;
3987 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3988 msg_ref = tag_ptr(msg_var.inner, false);
3989 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReady_class, LDKMessageSendEvent_SendChannelReady_meth, node_id_arr, msg_ref);
3991 case LDKMessageSendEvent_SendAnnouncementSignatures: {
3992 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3993 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_announcement_signatures.node_id.compressed_form);
3994 LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
3995 int64_t msg_ref = 0;
3996 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3997 msg_ref = tag_ptr(msg_var.inner, false);
3998 return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref);
4000 case LDKMessageSendEvent_UpdateHTLCs: {
4001 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4002 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->update_htl_cs.node_id.compressed_form);
4003 LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
4004 int64_t updates_ref = 0;
4005 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var);
4006 updates_ref = tag_ptr(updates_var.inner, false);
4007 return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref);
4009 case LDKMessageSendEvent_SendRevokeAndACK: {
4010 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4011 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_revoke_and_ack.node_id.compressed_form);
4012 LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
4013 int64_t msg_ref = 0;
4014 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4015 msg_ref = tag_ptr(msg_var.inner, false);
4016 return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref);
4018 case LDKMessageSendEvent_SendClosingSigned: {
4019 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4020 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_closing_signed.node_id.compressed_form);
4021 LDKClosingSigned msg_var = obj->send_closing_signed.msg;
4022 int64_t msg_ref = 0;
4023 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4024 msg_ref = tag_ptr(msg_var.inner, false);
4025 return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref);
4027 case LDKMessageSendEvent_SendShutdown: {
4028 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4029 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_shutdown.node_id.compressed_form);
4030 LDKShutdown msg_var = obj->send_shutdown.msg;
4031 int64_t msg_ref = 0;
4032 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4033 msg_ref = tag_ptr(msg_var.inner, false);
4034 return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref);
4036 case LDKMessageSendEvent_SendChannelReestablish: {
4037 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4038 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_reestablish.node_id.compressed_form);
4039 LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
4040 int64_t msg_ref = 0;
4041 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4042 msg_ref = tag_ptr(msg_var.inner, false);
4043 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref);
4045 case LDKMessageSendEvent_SendChannelAnnouncement: {
4046 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4047 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_announcement.node_id.compressed_form);
4048 LDKChannelAnnouncement msg_var = obj->send_channel_announcement.msg;
4049 int64_t msg_ref = 0;
4050 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4051 msg_ref = tag_ptr(msg_var.inner, false);
4052 LDKChannelUpdate update_msg_var = obj->send_channel_announcement.update_msg;
4053 int64_t update_msg_ref = 0;
4054 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
4055 update_msg_ref = tag_ptr(update_msg_var.inner, false);
4056 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelAnnouncement_class, LDKMessageSendEvent_SendChannelAnnouncement_meth, node_id_arr, msg_ref, update_msg_ref);
4058 case LDKMessageSendEvent_BroadcastChannelAnnouncement: {
4059 LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
4060 int64_t msg_ref = 0;
4061 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4062 msg_ref = tag_ptr(msg_var.inner, false);
4063 LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
4064 int64_t update_msg_ref = 0;
4065 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
4066 update_msg_ref = tag_ptr(update_msg_var.inner, false);
4067 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref);
4069 case LDKMessageSendEvent_BroadcastChannelUpdate: {
4070 LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
4071 int64_t msg_ref = 0;
4072 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4073 msg_ref = tag_ptr(msg_var.inner, false);
4074 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref);
4076 case LDKMessageSendEvent_BroadcastNodeAnnouncement: {
4077 LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
4078 int64_t msg_ref = 0;
4079 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4080 msg_ref = tag_ptr(msg_var.inner, false);
4081 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref);
4083 case LDKMessageSendEvent_SendChannelUpdate: {
4084 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4085 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_update.node_id.compressed_form);
4086 LDKChannelUpdate msg_var = obj->send_channel_update.msg;
4087 int64_t msg_ref = 0;
4088 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4089 msg_ref = tag_ptr(msg_var.inner, false);
4090 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref);
4092 case LDKMessageSendEvent_HandleError: {
4093 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4094 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->handle_error.node_id.compressed_form);
4095 int64_t action_ref = tag_ptr(&obj->handle_error.action, false);
4096 return (*env)->NewObject(env, LDKMessageSendEvent_HandleError_class, LDKMessageSendEvent_HandleError_meth, node_id_arr, action_ref);
4098 case LDKMessageSendEvent_SendChannelRangeQuery: {
4099 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4100 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_range_query.node_id.compressed_form);
4101 LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
4102 int64_t msg_ref = 0;
4103 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4104 msg_ref = tag_ptr(msg_var.inner, false);
4105 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref);
4107 case LDKMessageSendEvent_SendShortIdsQuery: {
4108 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4109 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_short_ids_query.node_id.compressed_form);
4110 LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
4111 int64_t msg_ref = 0;
4112 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4113 msg_ref = tag_ptr(msg_var.inner, false);
4114 return (*env)->NewObject(env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref);
4116 case LDKMessageSendEvent_SendReplyChannelRange: {
4117 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4118 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_reply_channel_range.node_id.compressed_form);
4119 LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
4120 int64_t msg_ref = 0;
4121 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4122 msg_ref = tag_ptr(msg_var.inner, false);
4123 return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref);
4125 case LDKMessageSendEvent_SendGossipTimestampFilter: {
4126 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4127 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_gossip_timestamp_filter.node_id.compressed_form);
4128 LDKGossipTimestampFilter msg_var = obj->send_gossip_timestamp_filter.msg;
4129 int64_t msg_ref = 0;
4130 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4131 msg_ref = tag_ptr(msg_var.inner, false);
4132 return (*env)->NewObject(env, LDKMessageSendEvent_SendGossipTimestampFilter_class, LDKMessageSendEvent_SendGossipTimestampFilter_meth, node_id_arr, msg_ref);
4137 static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) {
4138 LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen };
4139 for (size_t i = 0; i < ret.datalen; i++) {
4140 ret.data[i] = MessageSendEvent_clone(&orig->data[i]);
4144 static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
4147 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4148 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
4149 int64_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv);
4153 static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
4156 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4157 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
4158 LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv);
4159 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
4160 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
4164 static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) {
4165 LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen };
4166 for (size_t i = 0; i < ret.datalen; i++) {
4167 ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]);
4171 static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_a(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){
4172 return ThirtyTwoBytes_clone(&owner->a);
4174 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4175 LDKC2Tuple_TxidBlockHashZ* owner_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(owner);
4176 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
4177 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidBlockHashZ_get_a(owner_conv).data);
4181 static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_b(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){
4182 return ThirtyTwoBytes_clone(&owner->b);
4184 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4185 LDKC2Tuple_TxidBlockHashZ* owner_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(owner);
4186 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
4187 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidBlockHashZ_get_b(owner_conv).data);
4191 static inline LDKCVec_C2Tuple_TxidBlockHashZZ CVec_C2Tuple_TxidBlockHashZZ_clone(const LDKCVec_C2Tuple_TxidBlockHashZZ *orig) {
4192 LDKCVec_C2Tuple_TxidBlockHashZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ) * orig->datalen, "LDKCVec_C2Tuple_TxidBlockHashZZ clone bytes"), .datalen = orig->datalen };
4193 for (size_t i = 0; i < ret.datalen; i++) {
4194 ret.data[i] = C2Tuple_TxidBlockHashZ_clone(&orig->data[i]);
4198 static jclass LDKMonitorEvent_HTLCEvent_class = NULL;
4199 static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL;
4200 static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL;
4201 static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL;
4202 static jclass LDKMonitorEvent_Completed_class = NULL;
4203 static jmethodID LDKMonitorEvent_Completed_meth = NULL;
4204 static jclass LDKMonitorEvent_UpdateFailed_class = NULL;
4205 static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL;
4206 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) {
4207 LDKMonitorEvent_HTLCEvent_class =
4208 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent"));
4209 CHECK(LDKMonitorEvent_HTLCEvent_class != NULL);
4210 LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "<init>", "(J)V");
4211 CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL);
4212 LDKMonitorEvent_CommitmentTxConfirmed_class =
4213 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed"));
4214 CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL);
4215 LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "<init>", "(J)V");
4216 CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL);
4217 LDKMonitorEvent_Completed_class =
4218 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$Completed"));
4219 CHECK(LDKMonitorEvent_Completed_class != NULL);
4220 LDKMonitorEvent_Completed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_Completed_class, "<init>", "(JJ)V");
4221 CHECK(LDKMonitorEvent_Completed_meth != NULL);
4222 LDKMonitorEvent_UpdateFailed_class =
4223 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed"));
4224 CHECK(LDKMonitorEvent_UpdateFailed_class != NULL);
4225 LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "<init>", "(J)V");
4226 CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL);
4228 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4229 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
4231 case LDKMonitorEvent_HTLCEvent: {
4232 LDKHTLCUpdate htlc_event_var = obj->htlc_event;
4233 int64_t htlc_event_ref = 0;
4234 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var);
4235 htlc_event_ref = tag_ptr(htlc_event_var.inner, false);
4236 return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref);
4238 case LDKMonitorEvent_CommitmentTxConfirmed: {
4239 LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
4240 int64_t commitment_tx_confirmed_ref = 0;
4241 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var);
4242 commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
4243 return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref);
4245 case LDKMonitorEvent_Completed: {
4246 LDKOutPoint funding_txo_var = obj->completed.funding_txo;
4247 int64_t funding_txo_ref = 0;
4248 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4249 funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
4250 int64_t monitor_update_id_conv = obj->completed.monitor_update_id;
4251 return (*env)->NewObject(env, LDKMonitorEvent_Completed_class, LDKMonitorEvent_Completed_meth, funding_txo_ref, monitor_update_id_conv);
4253 case LDKMonitorEvent_UpdateFailed: {
4254 LDKOutPoint update_failed_var = obj->update_failed;
4255 int64_t update_failed_ref = 0;
4256 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var);
4257 update_failed_ref = tag_ptr(update_failed_var.inner, false);
4258 return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref);
4263 static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) {
4264 LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen };
4265 for (size_t i = 0; i < ret.datalen; i++) {
4266 ret.data[i] = MonitorEvent_clone(&orig->data[i]);
4270 static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
4271 LDKOutPoint ret = owner->a;
4272 ret.is_owned = false;
4275 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4276 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
4277 LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv);
4278 int64_t ret_ref = 0;
4279 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4280 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4284 static inline struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
4285 return CVec_MonitorEventZ_clone(&owner->b);
4287 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4288 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
4289 LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv);
4290 int64_tArray ret_arr = NULL;
4291 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
4292 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
4293 for (size_t o = 0; o < ret_var.datalen; o++) {
4294 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
4295 *ret_conv_14_copy = ret_var.data[o];
4296 int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
4297 ret_arr_ptr[o] = ret_conv_14_ref;
4299 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
4304 static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
4307 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
4308 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
4309 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
4310 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form);
4314 static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) {
4315 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen };
4316 for (size_t i = 0; i < ret.datalen; i++) {
4317 ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]);
4321 static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
4322 LDKFixedPenaltyScorer ret = *owner->contents.result;
4323 ret.is_owned = false;
4326 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4327 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
4328 LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv);
4329 int64_t ret_ref = 0;
4330 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4331 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4335 static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
4336 CHECK(!owner->result_ok);
4337 return DecodeError_clone(&*owner->contents.err);
4339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4340 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
4341 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4342 *ret_copy = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
4343 int64_t ret_ref = tag_ptr(ret_copy, true);
4347 static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
4350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4351 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
4352 int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv);
4356 static inline uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
4359 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4360 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
4361 int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv);
4365 static jclass LDKCOption_C2Tuple_u64u64ZZ_Some_class = NULL;
4366 static jmethodID LDKCOption_C2Tuple_u64u64ZZ_Some_meth = NULL;
4367 static jclass LDKCOption_C2Tuple_u64u64ZZ_None_class = NULL;
4368 static jmethodID LDKCOption_C2Tuple_u64u64ZZ_None_meth = NULL;
4369 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1u64u64ZZ_init (JNIEnv *env, jclass clz) {
4370 LDKCOption_C2Tuple_u64u64ZZ_Some_class =
4371 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_u64u64ZZ$Some"));
4372 CHECK(LDKCOption_C2Tuple_u64u64ZZ_Some_class != NULL);
4373 LDKCOption_C2Tuple_u64u64ZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_u64u64ZZ_Some_class, "<init>", "(J)V");
4374 CHECK(LDKCOption_C2Tuple_u64u64ZZ_Some_meth != NULL);
4375 LDKCOption_C2Tuple_u64u64ZZ_None_class =
4376 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_u64u64ZZ$None"));
4377 CHECK(LDKCOption_C2Tuple_u64u64ZZ_None_class != NULL);
4378 LDKCOption_C2Tuple_u64u64ZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_u64u64ZZ_None_class, "<init>", "()V");
4379 CHECK(LDKCOption_C2Tuple_u64u64ZZ_None_meth != NULL);
4381 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1u64u64ZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4382 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
4384 case LDKCOption_C2Tuple_u64u64ZZ_Some: {
4385 LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
4386 *some_conv = obj->some;
4387 *some_conv = C2Tuple_u64u64Z_clone(some_conv);
4388 return (*env)->NewObject(env, LDKCOption_C2Tuple_u64u64ZZ_Some_class, LDKCOption_C2Tuple_u64u64ZZ_Some_meth, tag_ptr(some_conv, true));
4390 case LDKCOption_C2Tuple_u64u64ZZ_None: {
4391 return (*env)->NewObject(env, LDKCOption_C2Tuple_u64u64ZZ_None_class, LDKCOption_C2Tuple_u64u64ZZ_None_meth);
4396 static inline struct LDKEightU16s C2Tuple_Z_get_a(LDKC2Tuple_Z *NONNULL_PTR owner){
4399 JNIEXPORT int16_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4400 LDKC2Tuple_Z* owner_conv = (LDKC2Tuple_Z*)untag_ptr(owner);
4401 int16_tArray ret_arr = (*env)->NewShortArray(env, 8);
4402 (*env)->SetShortArrayRegion(env, ret_arr, 0, 8, C2Tuple_Z_get_a(owner_conv).data);
4406 static inline struct LDKEightU16s C2Tuple_Z_get_b(LDKC2Tuple_Z *NONNULL_PTR owner){
4409 JNIEXPORT int16_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4410 LDKC2Tuple_Z* owner_conv = (LDKC2Tuple_Z*)untag_ptr(owner);
4411 int16_tArray ret_arr = (*env)->NewShortArray(env, 8);
4412 (*env)->SetShortArrayRegion(env, ret_arr, 0, 8, C2Tuple_Z_get_b(owner_conv).data);
4416 static inline struct LDKEightU16s C2Tuple__u168_u168Z_get_a(LDKC2Tuple__u168_u168Z *NONNULL_PTR owner){
4419 JNIEXPORT int16_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4420 LDKC2Tuple__u168_u168Z* owner_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(owner);
4421 int16_tArray ret_arr = (*env)->NewShortArray(env, 8);
4422 (*env)->SetShortArrayRegion(env, ret_arr, 0, 8, C2Tuple__u168_u168Z_get_a(owner_conv).data);
4426 static inline struct LDKEightU16s C2Tuple__u168_u168Z_get_b(LDKC2Tuple__u168_u168Z *NONNULL_PTR owner){
4429 JNIEXPORT int16_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
4430 LDKC2Tuple__u168_u168Z* owner_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(owner);
4431 int16_tArray ret_arr = (*env)->NewShortArray(env, 8);
4432 (*env)->SetShortArrayRegion(env, ret_arr, 0, 8, C2Tuple__u168_u168Z_get_b(owner_conv).data);
4436 static jclass LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_class = NULL;
4437 static jmethodID LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_meth = NULL;
4438 static jclass LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_class = NULL;
4439 static jmethodID LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_meth = NULL;
4440 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1EightU16sEightU16sZZ_init (JNIEnv *env, jclass clz) {
4441 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_class =
4442 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_EightU16sEightU16sZZ$Some"));
4443 CHECK(LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_class != NULL);
4444 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_class, "<init>", "(J)V");
4445 CHECK(LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_meth != NULL);
4446 LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_class =
4447 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_EightU16sEightU16sZZ$None"));
4448 CHECK(LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_class != NULL);
4449 LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_class, "<init>", "()V");
4450 CHECK(LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_meth != NULL);
4452 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1EightU16sEightU16sZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4453 LDKCOption_C2Tuple_EightU16sEightU16sZZ *obj = (LDKCOption_C2Tuple_EightU16sEightU16sZZ*)untag_ptr(ptr);
4455 case LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some: {
4456 LDKC2Tuple__u168_u168Z* some_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
4457 *some_conv = obj->some;
4458 *some_conv = C2Tuple__u168_u168Z_clone(some_conv);
4459 return (*env)->NewObject(env, LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_class, LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_meth, tag_ptr(some_conv, true));
4461 case LDKCOption_C2Tuple_EightU16sEightU16sZZ_None: {
4462 return (*env)->NewObject(env, LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_class, LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_meth);
4467 static inline LDKCVec_NodeIdZ CVec_NodeIdZ_clone(const LDKCVec_NodeIdZ *orig) {
4468 LDKCVec_NodeIdZ ret = { .data = MALLOC(sizeof(LDKNodeId) * orig->datalen, "LDKCVec_NodeIdZ clone bytes"), .datalen = orig->datalen };
4469 for (size_t i = 0; i < ret.datalen; i++) {
4470 ret.data[i] = NodeId_clone(&orig->data[i]);
4474 typedef struct LDKLogger_JCalls {
4475 atomic_size_t refcnt;
4480 static void LDKLogger_JCalls_free(void* this_arg) {
4481 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
4482 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4484 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4485 if (get_jenv_res == JNI_EDETACHED) {
4486 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4488 DO_ASSERT(get_jenv_res == JNI_OK);
4490 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
4491 if (get_jenv_res == JNI_EDETACHED) {
4492 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4497 void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) {
4498 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
4500 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4501 if (get_jenv_res == JNI_EDETACHED) {
4502 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4504 DO_ASSERT(get_jenv_res == JNI_OK);
4506 LDKRecord record_var = *record;
4507 int64_t record_ref = 0;
4508 record_var = Record_clone(&record_var);
4509 CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var);
4510 record_ref = tag_ptr(record_var.inner, record_var.is_owned);
4511 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4513 (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref);
4514 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4515 (*env)->ExceptionDescribe(env);
4516 (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception.");
4518 if (get_jenv_res == JNI_EDETACHED) {
4519 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4522 static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
4523 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
4524 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4526 static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) {
4527 jclass c = (*env)->GetObjectClass(env, o);
4529 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
4530 atomic_init(&calls->refcnt, 1);
4531 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
4532 calls->o = (*env)->NewWeakGlobalRef(env, o);
4533 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V");
4534 CHECK(calls->log_meth != NULL);
4537 .this_arg = (void*) calls,
4538 .log = log_LDKLogger_jcall,
4539 .free = LDKLogger_JCalls_free,
4543 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new(JNIEnv *env, jclass clz, jobject o) {
4544 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
4545 *res_ptr = LDKLogger_init(env, clz, o);
4546 return tag_ptr(res_ptr, true);
4548 static inline struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
4549 LDKProbabilisticScorer ret = *owner->contents.result;
4550 ret.is_owned = false;
4553 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4554 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
4555 LDKProbabilisticScorer ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_ok(owner_conv);
4556 int64_t ret_ref = 0;
4557 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4558 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4562 static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
4563 CHECK(!owner->result_ok);
4564 return DecodeError_clone(&*owner->contents.err);
4566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4567 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
4568 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4569 *ret_copy = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
4570 int64_t ret_ref = tag_ptr(ret_copy, true);
4574 static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
4575 LDKInitFeatures ret = *owner->contents.result;
4576 ret.is_owned = false;
4579 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4580 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
4581 LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv);
4582 int64_t ret_ref = 0;
4583 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4584 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4588 static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
4589 CHECK(!owner->result_ok);
4590 return DecodeError_clone(&*owner->contents.err);
4592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4593 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
4594 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4595 *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
4596 int64_t ret_ref = tag_ptr(ret_copy, true);
4600 static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
4601 LDKChannelFeatures ret = *owner->contents.result;
4602 ret.is_owned = false;
4605 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4606 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
4607 LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv);
4608 int64_t ret_ref = 0;
4609 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4610 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4614 static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
4615 CHECK(!owner->result_ok);
4616 return DecodeError_clone(&*owner->contents.err);
4618 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4619 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
4620 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4621 *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
4622 int64_t ret_ref = tag_ptr(ret_copy, true);
4626 static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
4627 LDKNodeFeatures ret = *owner->contents.result;
4628 ret.is_owned = false;
4631 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4632 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
4633 LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv);
4634 int64_t ret_ref = 0;
4635 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4636 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4640 static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
4641 CHECK(!owner->result_ok);
4642 return DecodeError_clone(&*owner->contents.err);
4644 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4645 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
4646 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4647 *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
4648 int64_t ret_ref = tag_ptr(ret_copy, true);
4652 static inline struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
4653 LDKInvoiceFeatures ret = *owner->contents.result;
4654 ret.is_owned = false;
4657 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4658 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
4659 LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner_conv);
4660 int64_t ret_ref = 0;
4661 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4662 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4666 static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
4667 CHECK(!owner->result_ok);
4668 return DecodeError_clone(&*owner->contents.err);
4670 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4671 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
4672 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4673 *ret_copy = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
4674 int64_t ret_ref = tag_ptr(ret_copy, true);
4678 static inline struct LDKBlindedHopFeatures CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){
4679 LDKBlindedHopFeatures ret = *owner->contents.result;
4680 ret.is_owned = false;
4683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4684 LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner);
4685 LDKBlindedHopFeatures ret_var = CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(owner_conv);
4686 int64_t ret_ref = 0;
4687 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4688 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4692 static inline struct LDKDecodeError CResult_BlindedHopFeaturesDecodeErrorZ_get_err(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){
4693 CHECK(!owner->result_ok);
4694 return DecodeError_clone(&*owner->contents.err);
4696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4697 LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner);
4698 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4699 *ret_copy = CResult_BlindedHopFeaturesDecodeErrorZ_get_err(owner_conv);
4700 int64_t ret_ref = tag_ptr(ret_copy, true);
4704 static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
4705 LDKChannelTypeFeatures ret = *owner->contents.result;
4706 ret.is_owned = false;
4709 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4710 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
4711 LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv);
4712 int64_t ret_ref = 0;
4713 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4714 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4718 static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
4719 CHECK(!owner->result_ok);
4720 return DecodeError_clone(&*owner->contents.err);
4722 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4723 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
4724 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4725 *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
4726 int64_t ret_ref = tag_ptr(ret_copy, true);
4730 static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
4731 LDKNodeId ret = *owner->contents.result;
4732 ret.is_owned = false;
4735 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4736 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
4737 LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv);
4738 int64_t ret_ref = 0;
4739 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4740 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4744 static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
4745 CHECK(!owner->result_ok);
4746 return DecodeError_clone(&*owner->contents.err);
4748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4749 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
4750 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4751 *ret_copy = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
4752 int64_t ret_ref = tag_ptr(ret_copy, true);
4756 static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
4757 CHECK(owner->result_ok);
4758 return COption_NetworkUpdateZ_clone(&*owner->contents.result);
4760 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4761 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
4762 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
4763 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv);
4764 int64_t ret_ref = tag_ptr(ret_copy, true);
4768 static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
4769 CHECK(!owner->result_ok);
4770 return DecodeError_clone(&*owner->contents.err);
4772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4773 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
4774 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4775 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
4776 int64_t ret_ref = tag_ptr(ret_copy, true);
4780 static inline struct LDKTxOut CResult_TxOutUtxoLookupErrorZ_get_ok(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR owner){
4781 CHECK(owner->result_ok);
4782 return TxOut_clone(&*owner->contents.result);
4784 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4785 LDKCResult_TxOutUtxoLookupErrorZ* owner_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(owner);
4786 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
4787 *ret_ref = CResult_TxOutUtxoLookupErrorZ_get_ok(owner_conv);
4788 return tag_ptr(ret_ref, true);
4791 static inline enum LDKUtxoLookupError CResult_TxOutUtxoLookupErrorZ_get_err(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR owner){
4792 CHECK(!owner->result_ok);
4793 return UtxoLookupError_clone(&*owner->contents.err);
4795 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4796 LDKCResult_TxOutUtxoLookupErrorZ* owner_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(owner);
4797 jclass ret_conv = LDKUtxoLookupError_to_java(env, CResult_TxOutUtxoLookupErrorZ_get_err(owner_conv));
4801 static jclass LDKUtxoResult_Sync_class = NULL;
4802 static jmethodID LDKUtxoResult_Sync_meth = NULL;
4803 static jclass LDKUtxoResult_Async_class = NULL;
4804 static jmethodID LDKUtxoResult_Async_meth = NULL;
4805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKUtxoResult_init (JNIEnv *env, jclass clz) {
4806 LDKUtxoResult_Sync_class =
4807 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKUtxoResult$Sync"));
4808 CHECK(LDKUtxoResult_Sync_class != NULL);
4809 LDKUtxoResult_Sync_meth = (*env)->GetMethodID(env, LDKUtxoResult_Sync_class, "<init>", "(J)V");
4810 CHECK(LDKUtxoResult_Sync_meth != NULL);
4811 LDKUtxoResult_Async_class =
4812 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKUtxoResult$Async"));
4813 CHECK(LDKUtxoResult_Async_class != NULL);
4814 LDKUtxoResult_Async_meth = (*env)->GetMethodID(env, LDKUtxoResult_Async_class, "<init>", "(J)V");
4815 CHECK(LDKUtxoResult_Async_meth != NULL);
4817 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKUtxoResult_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4818 LDKUtxoResult *obj = (LDKUtxoResult*)untag_ptr(ptr);
4820 case LDKUtxoResult_Sync: {
4821 LDKCResult_TxOutUtxoLookupErrorZ* sync_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
4822 *sync_conv = obj->sync;
4823 *sync_conv = CResult_TxOutUtxoLookupErrorZ_clone(sync_conv);
4824 return (*env)->NewObject(env, LDKUtxoResult_Sync_class, LDKUtxoResult_Sync_meth, tag_ptr(sync_conv, true));
4826 case LDKUtxoResult_Async: {
4827 LDKUtxoFuture async_var = obj->async;
4828 int64_t async_ref = 0;
4829 CHECK_INNER_FIELD_ACCESS_OR_NULL(async_var);
4830 async_ref = tag_ptr(async_var.inner, false);
4831 return (*env)->NewObject(env, LDKUtxoResult_Async_class, LDKUtxoResult_Async_meth, async_ref);
4836 typedef struct LDKUtxoLookup_JCalls {
4837 atomic_size_t refcnt;
4840 jmethodID get_utxo_meth;
4841 } LDKUtxoLookup_JCalls;
4842 static void LDKUtxoLookup_JCalls_free(void* this_arg) {
4843 LDKUtxoLookup_JCalls *j_calls = (LDKUtxoLookup_JCalls*) this_arg;
4844 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4846 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4847 if (get_jenv_res == JNI_EDETACHED) {
4848 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4850 DO_ASSERT(get_jenv_res == JNI_OK);
4852 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
4853 if (get_jenv_res == JNI_EDETACHED) {
4854 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4859 LDKUtxoResult get_utxo_LDKUtxoLookup_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
4860 LDKUtxoLookup_JCalls *j_calls = (LDKUtxoLookup_JCalls*) this_arg;
4862 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
4863 if (get_jenv_res == JNI_EDETACHED) {
4864 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
4866 DO_ASSERT(get_jenv_res == JNI_OK);
4868 int8_tArray genesis_hash_arr = (*env)->NewByteArray(env, 32);
4869 (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash);
4870 int64_t short_channel_id_conv = short_channel_id;
4871 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
4873 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id_conv);
4874 if (UNLIKELY((*env)->ExceptionCheck(env))) {
4875 (*env)->ExceptionDescribe(env);
4876 (*env)->FatalError(env, "A call to get_utxo in LDKUtxoLookup from rust threw an exception.");
4878 void* ret_ptr = untag_ptr(ret);
4879 CHECK_ACCESS(ret_ptr);
4880 LDKUtxoResult ret_conv = *(LDKUtxoResult*)(ret_ptr);
4881 FREE(untag_ptr(ret));
4882 if (get_jenv_res == JNI_EDETACHED) {
4883 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
4887 static void LDKUtxoLookup_JCalls_cloned(LDKUtxoLookup* new_obj) {
4888 LDKUtxoLookup_JCalls *j_calls = (LDKUtxoLookup_JCalls*) new_obj->this_arg;
4889 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4891 static inline LDKUtxoLookup LDKUtxoLookup_init (JNIEnv *env, jclass clz, jobject o) {
4892 jclass c = (*env)->GetObjectClass(env, o);
4894 LDKUtxoLookup_JCalls *calls = MALLOC(sizeof(LDKUtxoLookup_JCalls), "LDKUtxoLookup_JCalls");
4895 atomic_init(&calls->refcnt, 1);
4896 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
4897 calls->o = (*env)->NewWeakGlobalRef(env, o);
4898 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
4899 CHECK(calls->get_utxo_meth != NULL);
4901 LDKUtxoLookup ret = {
4902 .this_arg = (void*) calls,
4903 .get_utxo = get_utxo_LDKUtxoLookup_jcall,
4904 .free = LDKUtxoLookup_JCalls_free,
4908 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKUtxoLookup_1new(JNIEnv *env, jclass clz, jobject o) {
4909 LDKUtxoLookup *res_ptr = MALLOC(sizeof(LDKUtxoLookup), "LDKUtxoLookup");
4910 *res_ptr = LDKUtxoLookup_init(env, clz, o);
4911 return tag_ptr(res_ptr, true);
4913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoLookup_1get_1utxo(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) {
4914 void* this_arg_ptr = untag_ptr(this_arg);
4915 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4916 LDKUtxoLookup* this_arg_conv = (LDKUtxoLookup*)this_arg_ptr;
4917 uint8_t genesis_hash_arr[32];
4918 CHECK((*env)->GetArrayLength(env, genesis_hash) == 32);
4919 (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr);
4920 uint8_t (*genesis_hash_ref)[32] = &genesis_hash_arr;
4921 LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
4922 *ret_copy = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
4923 int64_t ret_ref = tag_ptr(ret_copy, true);
4927 static jclass LDKCOption_UtxoLookupZ_Some_class = NULL;
4928 static jmethodID LDKCOption_UtxoLookupZ_Some_meth = NULL;
4929 static jclass LDKCOption_UtxoLookupZ_None_class = NULL;
4930 static jmethodID LDKCOption_UtxoLookupZ_None_meth = NULL;
4931 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1UtxoLookupZ_init (JNIEnv *env, jclass clz) {
4932 LDKCOption_UtxoLookupZ_Some_class =
4933 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_UtxoLookupZ$Some"));
4934 CHECK(LDKCOption_UtxoLookupZ_Some_class != NULL);
4935 LDKCOption_UtxoLookupZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_UtxoLookupZ_Some_class, "<init>", "(J)V");
4936 CHECK(LDKCOption_UtxoLookupZ_Some_meth != NULL);
4937 LDKCOption_UtxoLookupZ_None_class =
4938 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_UtxoLookupZ$None"));
4939 CHECK(LDKCOption_UtxoLookupZ_None_class != NULL);
4940 LDKCOption_UtxoLookupZ_None_meth = (*env)->GetMethodID(env, LDKCOption_UtxoLookupZ_None_class, "<init>", "()V");
4941 CHECK(LDKCOption_UtxoLookupZ_None_meth != NULL);
4943 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1UtxoLookupZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4944 LDKCOption_UtxoLookupZ *obj = (LDKCOption_UtxoLookupZ*)untag_ptr(ptr);
4946 case LDKCOption_UtxoLookupZ_Some: {
4947 LDKUtxoLookup* some_ret = MALLOC(sizeof(LDKUtxoLookup), "LDKUtxoLookup");
4948 *some_ret = obj->some;
4949 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
4950 if ((*some_ret).free == LDKUtxoLookup_JCalls_free) {
4951 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4952 LDKUtxoLookup_JCalls_cloned(&(*some_ret));
4954 return (*env)->NewObject(env, LDKCOption_UtxoLookupZ_Some_class, LDKCOption_UtxoLookupZ_Some_meth, tag_ptr(some_ret, true));
4956 case LDKCOption_UtxoLookupZ_None: {
4957 return (*env)->NewObject(env, LDKCOption_UtxoLookupZ_None_class, LDKCOption_UtxoLookupZ_None_meth);
4962 static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
4963 CHECK(owner->result_ok);
4964 return *owner->contents.result;
4966 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4967 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
4968 jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv);
4972 static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
4973 LDKLightningError ret = *owner->contents.err;
4974 ret.is_owned = false;
4977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4978 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
4979 LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv);
4980 int64_t ret_ref = 0;
4981 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4982 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4986 static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
4987 LDKChannelAnnouncement ret = owner->a;
4988 ret.is_owned = false;
4991 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
4992 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
4993 LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv);
4994 int64_t ret_ref = 0;
4995 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4996 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5000 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
5001 LDKChannelUpdate ret = owner->b;
5002 ret.is_owned = false;
5005 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
5006 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
5007 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv);
5008 int64_t ret_ref = 0;
5009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5014 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
5015 LDKChannelUpdate ret = owner->c;
5016 ret.is_owned = false;
5019 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
5020 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
5021 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv);
5022 int64_t ret_ref = 0;
5023 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5024 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5028 static jclass LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class = NULL;
5029 static jmethodID LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth = NULL;
5030 static jclass LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class = NULL;
5031 static jmethodID LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth = NULL;
5032 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_init (JNIEnv *env, jclass clz) {
5033 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class =
5034 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ$Some"));
5035 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class != NULL);
5036 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class, "<init>", "(J)V");
5037 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth != NULL);
5038 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class =
5039 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ$None"));
5040 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class != NULL);
5041 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class, "<init>", "()V");
5042 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth != NULL);
5044 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5045 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *obj = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(ptr);
5047 case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some: {
5048 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* some_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
5049 *some_conv = obj->some;
5050 *some_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(some_conv);
5051 return (*env)->NewObject(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth, tag_ptr(some_conv, true));
5053 case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None: {
5054 return (*env)->NewObject(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth);
5059 static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
5060 CHECK(owner->result_ok);
5061 return *owner->contents.result;
5063 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5064 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
5065 CResult_NoneLightningErrorZ_get_ok(owner_conv);
5068 static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
5069 LDKLightningError ret = *owner->contents.err;
5070 ret.is_owned = false;
5073 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5074 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
5075 LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv);
5076 int64_t ret_ref = 0;
5077 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5078 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5082 static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
5083 LDKChannelUpdateInfo ret = *owner->contents.result;
5084 ret.is_owned = false;
5087 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5088 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
5089 LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv);
5090 int64_t ret_ref = 0;
5091 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5092 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5096 static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
5097 CHECK(!owner->result_ok);
5098 return DecodeError_clone(&*owner->contents.err);
5100 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5101 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
5102 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5103 *ret_copy = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
5104 int64_t ret_ref = tag_ptr(ret_copy, true);
5108 static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
5109 LDKChannelInfo ret = *owner->contents.result;
5110 ret.is_owned = false;
5113 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5114 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
5115 LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv);
5116 int64_t ret_ref = 0;
5117 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5118 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5122 static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
5123 CHECK(!owner->result_ok);
5124 return DecodeError_clone(&*owner->contents.err);
5126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5127 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
5128 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5129 *ret_copy = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
5130 int64_t ret_ref = tag_ptr(ret_copy, true);
5134 static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
5135 LDKRoutingFees ret = *owner->contents.result;
5136 ret.is_owned = false;
5139 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5140 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
5141 LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv);
5142 int64_t ret_ref = 0;
5143 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5144 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5148 static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
5149 CHECK(!owner->result_ok);
5150 return DecodeError_clone(&*owner->contents.err);
5152 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5153 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
5154 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5155 *ret_copy = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
5156 int64_t ret_ref = tag_ptr(ret_copy, true);
5160 static jclass LDKNetAddress_IPv4_class = NULL;
5161 static jmethodID LDKNetAddress_IPv4_meth = NULL;
5162 static jclass LDKNetAddress_IPv6_class = NULL;
5163 static jmethodID LDKNetAddress_IPv6_meth = NULL;
5164 static jclass LDKNetAddress_OnionV2_class = NULL;
5165 static jmethodID LDKNetAddress_OnionV2_meth = NULL;
5166 static jclass LDKNetAddress_OnionV3_class = NULL;
5167 static jmethodID LDKNetAddress_OnionV3_meth = NULL;
5168 static jclass LDKNetAddress_Hostname_class = NULL;
5169 static jmethodID LDKNetAddress_Hostname_meth = NULL;
5170 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv *env, jclass clz) {
5171 LDKNetAddress_IPv4_class =
5172 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv4"));
5173 CHECK(LDKNetAddress_IPv4_class != NULL);
5174 LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "<init>", "([BS)V");
5175 CHECK(LDKNetAddress_IPv4_meth != NULL);
5176 LDKNetAddress_IPv6_class =
5177 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv6"));
5178 CHECK(LDKNetAddress_IPv6_class != NULL);
5179 LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "<init>", "([BS)V");
5180 CHECK(LDKNetAddress_IPv6_meth != NULL);
5181 LDKNetAddress_OnionV2_class =
5182 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV2"));
5183 CHECK(LDKNetAddress_OnionV2_class != NULL);
5184 LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "<init>", "([B)V");
5185 CHECK(LDKNetAddress_OnionV2_meth != NULL);
5186 LDKNetAddress_OnionV3_class =
5187 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV3"));
5188 CHECK(LDKNetAddress_OnionV3_class != NULL);
5189 LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "<init>", "([BSBS)V");
5190 CHECK(LDKNetAddress_OnionV3_meth != NULL);
5191 LDKNetAddress_Hostname_class =
5192 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$Hostname"));
5193 CHECK(LDKNetAddress_Hostname_class != NULL);
5194 LDKNetAddress_Hostname_meth = (*env)->GetMethodID(env, LDKNetAddress_Hostname_class, "<init>", "(JS)V");
5195 CHECK(LDKNetAddress_Hostname_meth != NULL);
5197 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5198 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
5200 case LDKNetAddress_IPv4: {
5201 int8_tArray addr_arr = (*env)->NewByteArray(env, 4);
5202 (*env)->SetByteArrayRegion(env, addr_arr, 0, 4, obj->i_pv4.addr.data);
5203 int16_t port_conv = obj->i_pv4.port;
5204 return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_arr, port_conv);
5206 case LDKNetAddress_IPv6: {
5207 int8_tArray addr_arr = (*env)->NewByteArray(env, 16);
5208 (*env)->SetByteArrayRegion(env, addr_arr, 0, 16, obj->i_pv6.addr.data);
5209 int16_t port_conv = obj->i_pv6.port;
5210 return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, port_conv);
5212 case LDKNetAddress_OnionV2: {
5213 int8_tArray onion_v2_arr = (*env)->NewByteArray(env, 12);
5214 (*env)->SetByteArrayRegion(env, onion_v2_arr, 0, 12, obj->onion_v2.data);
5215 return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, onion_v2_arr);
5217 case LDKNetAddress_OnionV3: {
5218 int8_tArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32);
5219 (*env)->SetByteArrayRegion(env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data);
5220 int16_t checksum_conv = obj->onion_v3.checksum;
5221 int8_t version_conv = obj->onion_v3.version;
5222 int16_t port_conv = obj->onion_v3.port;
5223 return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, checksum_conv, version_conv, port_conv);
5225 case LDKNetAddress_Hostname: {
5226 LDKHostname hostname_var = obj->hostname.hostname;
5227 int64_t hostname_ref = 0;
5228 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_var);
5229 hostname_ref = tag_ptr(hostname_var.inner, false);
5230 int16_t port_conv = obj->hostname.port;
5231 return (*env)->NewObject(env, LDKNetAddress_Hostname_class, LDKNetAddress_Hostname_meth, hostname_ref, port_conv);
5236 static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) {
5237 LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen };
5238 for (size_t i = 0; i < ret.datalen; i++) {
5239 ret.data[i] = NetAddress_clone(&orig->data[i]);
5243 static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
5244 LDKNodeAnnouncementInfo ret = *owner->contents.result;
5245 ret.is_owned = false;
5248 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5249 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
5250 LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv);
5251 int64_t ret_ref = 0;
5252 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5253 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5257 static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
5258 CHECK(!owner->result_ok);
5259 return DecodeError_clone(&*owner->contents.err);
5261 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5262 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
5263 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5264 *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
5265 int64_t ret_ref = tag_ptr(ret_copy, true);
5269 static inline struct LDKNodeAlias CResult_NodeAliasDecodeErrorZ_get_ok(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
5270 LDKNodeAlias ret = *owner->contents.result;
5271 ret.is_owned = false;
5274 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5275 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
5276 LDKNodeAlias ret_var = CResult_NodeAliasDecodeErrorZ_get_ok(owner_conv);
5277 int64_t ret_ref = 0;
5278 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5279 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5283 static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
5284 CHECK(!owner->result_ok);
5285 return DecodeError_clone(&*owner->contents.err);
5287 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5288 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
5289 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5290 *ret_copy = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
5291 int64_t ret_ref = tag_ptr(ret_copy, true);
5295 static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
5296 LDKNodeInfo ret = *owner->contents.result;
5297 ret.is_owned = false;
5300 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5301 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
5302 LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv);
5303 int64_t ret_ref = 0;
5304 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5305 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5309 static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
5310 CHECK(!owner->result_ok);
5311 return DecodeError_clone(&*owner->contents.err);
5313 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5314 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
5315 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5316 *ret_copy = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
5317 int64_t ret_ref = tag_ptr(ret_copy, true);
5321 static inline struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
5322 LDKNetworkGraph ret = *owner->contents.result;
5323 ret.is_owned = false;
5326 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5327 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
5328 LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv);
5329 int64_t ret_ref = 0;
5330 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5331 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5335 static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
5336 CHECK(!owner->result_ok);
5337 return DecodeError_clone(&*owner->contents.err);
5339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5340 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
5341 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5342 *ret_copy = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
5343 int64_t ret_ref = tag_ptr(ret_copy, true);
5347 static jclass LDKCOption_CVec_NetAddressZZ_Some_class = NULL;
5348 static jmethodID LDKCOption_CVec_NetAddressZZ_Some_meth = NULL;
5349 static jclass LDKCOption_CVec_NetAddressZZ_None_class = NULL;
5350 static jmethodID LDKCOption_CVec_NetAddressZZ_None_meth = NULL;
5351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1NetAddressZZ_init (JNIEnv *env, jclass clz) {
5352 LDKCOption_CVec_NetAddressZZ_Some_class =
5353 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some"));
5354 CHECK(LDKCOption_CVec_NetAddressZZ_Some_class != NULL);
5355 LDKCOption_CVec_NetAddressZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_Some_class, "<init>", "([J)V");
5356 CHECK(LDKCOption_CVec_NetAddressZZ_Some_meth != NULL);
5357 LDKCOption_CVec_NetAddressZZ_None_class =
5358 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None"));
5359 CHECK(LDKCOption_CVec_NetAddressZZ_None_class != NULL);
5360 LDKCOption_CVec_NetAddressZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_None_class, "<init>", "()V");
5361 CHECK(LDKCOption_CVec_NetAddressZZ_None_meth != NULL);
5363 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5364 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
5366 case LDKCOption_CVec_NetAddressZZ_Some: {
5367 LDKCVec_NetAddressZ some_var = obj->some;
5368 int64_tArray some_arr = NULL;
5369 some_arr = (*env)->NewLongArray(env, some_var.datalen);
5370 int64_t *some_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, some_arr, NULL);
5371 for (size_t m = 0; m < some_var.datalen; m++) {
5372 int64_t some_conv_12_ref = tag_ptr(&some_var.data[m], false);
5373 some_arr_ptr[m] = some_conv_12_ref;
5375 (*env)->ReleasePrimitiveArrayCritical(env, some_arr, some_arr_ptr, 0);
5376 return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_Some_class, LDKCOption_CVec_NetAddressZZ_Some_meth, some_arr);
5378 case LDKCOption_CVec_NetAddressZZ_None: {
5379 return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_None_class, LDKCOption_CVec_NetAddressZZ_None_meth);
5384 static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5385 LDKDelayedPaymentOutputDescriptor ret = *owner->contents.result;
5386 ret.is_owned = false;
5389 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5390 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5391 LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
5392 int64_t ret_ref = 0;
5393 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5394 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5398 static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5399 CHECK(!owner->result_ok);
5400 return DecodeError_clone(&*owner->contents.err);
5402 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5403 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5404 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5405 *ret_copy = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
5406 int64_t ret_ref = tag_ptr(ret_copy, true);
5410 static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5411 LDKStaticPaymentOutputDescriptor ret = *owner->contents.result;
5412 ret.is_owned = false;
5415 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5416 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5417 LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
5418 int64_t ret_ref = 0;
5419 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5420 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5424 static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5425 CHECK(!owner->result_ok);
5426 return DecodeError_clone(&*owner->contents.err);
5428 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5429 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5430 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5431 *ret_copy = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
5432 int64_t ret_ref = tag_ptr(ret_copy, true);
5436 static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5437 CHECK(owner->result_ok);
5438 return SpendableOutputDescriptor_clone(&*owner->contents.result);
5440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5441 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5442 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
5443 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
5444 int64_t ret_ref = tag_ptr(ret_copy, true);
5448 static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5449 CHECK(!owner->result_ok);
5450 return DecodeError_clone(&*owner->contents.err);
5452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5453 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5454 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5455 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
5456 int64_t ret_ref = tag_ptr(ret_copy, true);
5460 static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) {
5461 LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen };
5462 for (size_t i = 0; i < ret.datalen; i++) {
5463 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
5467 static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
5470 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
5471 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
5472 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
5473 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form);
5477 static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
5480 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
5481 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
5482 LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv);
5483 jobjectArray ret_arr = NULL;
5484 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
5486 for (size_t i = 0; i < ret_var.datalen; i++) {
5487 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
5488 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
5489 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
5495 static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
5496 CHECK(owner->result_ok);
5497 return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result);
5499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5500 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
5501 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
5502 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv);
5503 return tag_ptr(ret_conv, true);
5506 static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
5507 CHECK(!owner->result_ok);
5508 return *owner->contents.err;
5510 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5511 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
5512 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv);
5515 static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
5516 CHECK(owner->result_ok);
5517 return *owner->contents.result;
5519 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5520 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
5521 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
5522 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form);
5526 static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
5527 CHECK(!owner->result_ok);
5528 return *owner->contents.err;
5530 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5531 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
5532 CResult_SignatureNoneZ_get_err(owner_conv);
5535 static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
5536 CHECK(owner->result_ok);
5537 return *owner->contents.result;
5539 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5540 LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
5541 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
5542 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyNoneZ_get_ok(owner_conv).compressed_form);
5546 static inline void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
5547 CHECK(!owner->result_ok);
5548 return *owner->contents.err;
5550 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5551 LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
5552 CResult_PublicKeyNoneZ_get_err(owner_conv);
5555 static jclass LDKCOption_ScalarZ_Some_class = NULL;
5556 static jmethodID LDKCOption_ScalarZ_Some_meth = NULL;
5557 static jclass LDKCOption_ScalarZ_None_class = NULL;
5558 static jmethodID LDKCOption_ScalarZ_None_meth = NULL;
5559 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ScalarZ_init (JNIEnv *env, jclass clz) {
5560 LDKCOption_ScalarZ_Some_class =
5561 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ScalarZ$Some"));
5562 CHECK(LDKCOption_ScalarZ_Some_class != NULL);
5563 LDKCOption_ScalarZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ScalarZ_Some_class, "<init>", "(J)V");
5564 CHECK(LDKCOption_ScalarZ_Some_meth != NULL);
5565 LDKCOption_ScalarZ_None_class =
5566 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ScalarZ$None"));
5567 CHECK(LDKCOption_ScalarZ_None_class != NULL);
5568 LDKCOption_ScalarZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ScalarZ_None_class, "<init>", "()V");
5569 CHECK(LDKCOption_ScalarZ_None_meth != NULL);
5571 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ScalarZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5572 LDKCOption_ScalarZ *obj = (LDKCOption_ScalarZ*)untag_ptr(ptr);
5574 case LDKCOption_ScalarZ_Some: {
5575 LDKBigEndianScalar* some_ref = &obj->some;
5576 return (*env)->NewObject(env, LDKCOption_ScalarZ_Some_class, LDKCOption_ScalarZ_Some_meth, tag_ptr(some_ref, false));
5578 case LDKCOption_ScalarZ_None: {
5579 return (*env)->NewObject(env, LDKCOption_ScalarZ_None_class, LDKCOption_ScalarZ_None_meth);
5584 static inline struct LDKThirtyTwoBytes CResult_SharedSecretNoneZ_get_ok(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
5585 CHECK(owner->result_ok);
5586 return ThirtyTwoBytes_clone(&*owner->contents.result);
5588 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5589 LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
5590 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5591 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SharedSecretNoneZ_get_ok(owner_conv).data);
5595 static inline void CResult_SharedSecretNoneZ_get_err(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
5596 CHECK(!owner->result_ok);
5597 return *owner->contents.err;
5599 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5600 LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
5601 CResult_SharedSecretNoneZ_get_err(owner_conv);
5604 static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
5605 CHECK(owner->result_ok);
5606 return *owner->contents.result;
5608 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5609 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
5610 int8_tArray ret_arr = (*env)->NewByteArray(env, 68);
5611 (*env)->SetByteArrayRegion(env, ret_arr, 0, 68, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form);
5615 static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
5616 CHECK(!owner->result_ok);
5617 return *owner->contents.err;
5619 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5620 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
5621 CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
5624 typedef struct LDKChannelSigner_JCalls {
5625 atomic_size_t refcnt;
5628 jmethodID get_per_commitment_point_meth;
5629 jmethodID release_commitment_secret_meth;
5630 jmethodID validate_holder_commitment_meth;
5631 jmethodID channel_keys_id_meth;
5632 jmethodID provide_channel_parameters_meth;
5633 } LDKChannelSigner_JCalls;
5634 static void LDKChannelSigner_JCalls_free(void* this_arg) {
5635 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5636 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5638 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5639 if (get_jenv_res == JNI_EDETACHED) {
5640 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5642 DO_ASSERT(get_jenv_res == JNI_OK);
5644 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
5645 if (get_jenv_res == JNI_EDETACHED) {
5646 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5651 LDKPublicKey get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) {
5652 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5654 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5655 if (get_jenv_res == JNI_EDETACHED) {
5656 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5658 DO_ASSERT(get_jenv_res == JNI_OK);
5660 int64_t idx_conv = idx;
5661 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5663 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv);
5664 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5665 (*env)->ExceptionDescribe(env);
5666 (*env)->FatalError(env, "A call to get_per_commitment_point in LDKChannelSigner from rust threw an exception.");
5668 LDKPublicKey ret_ref;
5669 CHECK((*env)->GetArrayLength(env, ret) == 33);
5670 (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
5671 if (get_jenv_res == JNI_EDETACHED) {
5672 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5676 LDKThirtyTwoBytes release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) {
5677 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5679 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5680 if (get_jenv_res == JNI_EDETACHED) {
5681 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5683 DO_ASSERT(get_jenv_res == JNI_OK);
5685 int64_t idx_conv = idx;
5686 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5688 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv);
5689 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5690 (*env)->ExceptionDescribe(env);
5691 (*env)->FatalError(env, "A call to release_commitment_secret in LDKChannelSigner from rust threw an exception.");
5693 LDKThirtyTwoBytes ret_ref;
5694 CHECK((*env)->GetArrayLength(env, ret) == 32);
5695 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
5696 if (get_jenv_res == JNI_EDETACHED) {
5697 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5701 LDKCResult_NoneNoneZ validate_holder_commitment_LDKChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
5702 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5704 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5705 if (get_jenv_res == JNI_EDETACHED) {
5706 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5708 DO_ASSERT(get_jenv_res == JNI_OK);
5710 LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
5711 int64_t holder_tx_ref = 0;
5712 holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var);
5713 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var);
5714 holder_tx_ref = tag_ptr(holder_tx_var.inner, holder_tx_var.is_owned);
5715 LDKCVec_PaymentPreimageZ preimages_var = preimages;
5716 jobjectArray preimages_arr = NULL;
5717 preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL);
5719 for (size_t i = 0; i < preimages_var.datalen; i++) {
5720 int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32);
5721 (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data);
5722 (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr);
5725 FREE(preimages_var.data);
5726 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5728 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_holder_commitment_meth, holder_tx_ref, preimages_arr);
5729 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5730 (*env)->ExceptionDescribe(env);
5731 (*env)->FatalError(env, "A call to validate_holder_commitment in LDKChannelSigner from rust threw an exception.");
5733 void* ret_ptr = untag_ptr(ret);
5734 CHECK_ACCESS(ret_ptr);
5735 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
5736 FREE(untag_ptr(ret));
5737 if (get_jenv_res == JNI_EDETACHED) {
5738 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5742 LDKThirtyTwoBytes channel_keys_id_LDKChannelSigner_jcall(const void* this_arg) {
5743 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5745 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5746 if (get_jenv_res == JNI_EDETACHED) {
5747 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5749 DO_ASSERT(get_jenv_res == JNI_OK);
5751 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5753 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth);
5754 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5755 (*env)->ExceptionDescribe(env);
5756 (*env)->FatalError(env, "A call to channel_keys_id in LDKChannelSigner from rust threw an exception.");
5758 LDKThirtyTwoBytes ret_ref;
5759 CHECK((*env)->GetArrayLength(env, ret) == 32);
5760 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
5761 if (get_jenv_res == JNI_EDETACHED) {
5762 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5766 void provide_channel_parameters_LDKChannelSigner_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
5767 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5769 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5770 if (get_jenv_res == JNI_EDETACHED) {
5771 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5773 DO_ASSERT(get_jenv_res == JNI_OK);
5775 LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
5776 int64_t channel_parameters_ref = 0;
5777 channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
5778 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
5779 channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
5780 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5782 (*env)->CallVoidMethod(env, obj, j_calls->provide_channel_parameters_meth, channel_parameters_ref);
5783 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5784 (*env)->ExceptionDescribe(env);
5785 (*env)->FatalError(env, "A call to provide_channel_parameters in LDKChannelSigner from rust threw an exception.");
5787 if (get_jenv_res == JNI_EDETACHED) {
5788 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5791 static inline LDKChannelSigner LDKChannelSigner_init (JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
5792 jclass c = (*env)->GetObjectClass(env, o);
5794 LDKChannelSigner_JCalls *calls = MALLOC(sizeof(LDKChannelSigner_JCalls), "LDKChannelSigner_JCalls");
5795 atomic_init(&calls->refcnt, 1);
5796 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
5797 calls->o = (*env)->NewWeakGlobalRef(env, o);
5798 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)[B");
5799 CHECK(calls->get_per_commitment_point_meth != NULL);
5800 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B");
5801 CHECK(calls->release_commitment_secret_meth != NULL);
5802 calls->validate_holder_commitment_meth = (*env)->GetMethodID(env, c, "validate_holder_commitment", "(J[[B)J");
5803 CHECK(calls->validate_holder_commitment_meth != NULL);
5804 calls->channel_keys_id_meth = (*env)->GetMethodID(env, c, "channel_keys_id", "()[B");
5805 CHECK(calls->channel_keys_id_meth != NULL);
5806 calls->provide_channel_parameters_meth = (*env)->GetMethodID(env, c, "provide_channel_parameters", "(J)V");
5807 CHECK(calls->provide_channel_parameters_meth != NULL);
5809 LDKChannelPublicKeys pubkeys_conv;
5810 pubkeys_conv.inner = untag_ptr(pubkeys);
5811 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
5812 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
5814 LDKChannelSigner ret = {
5815 .this_arg = (void*) calls,
5816 .get_per_commitment_point = get_per_commitment_point_LDKChannelSigner_jcall,
5817 .release_commitment_secret = release_commitment_secret_LDKChannelSigner_jcall,
5818 .validate_holder_commitment = validate_holder_commitment_LDKChannelSigner_jcall,
5819 .channel_keys_id = channel_keys_id_LDKChannelSigner_jcall,
5820 .provide_channel_parameters = provide_channel_parameters_LDKChannelSigner_jcall,
5821 .free = LDKChannelSigner_JCalls_free,
5822 .pubkeys = pubkeys_conv,
5823 .set_pubkeys = NULL,
5827 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelSigner_1new(JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
5828 LDKChannelSigner *res_ptr = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner");
5829 *res_ptr = LDKChannelSigner_init(env, clz, o, pubkeys);
5830 return tag_ptr(res_ptr, true);
5832 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
5833 void* this_arg_ptr = untag_ptr(this_arg);
5834 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5835 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
5836 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
5837 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form);
5841 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
5842 void* this_arg_ptr = untag_ptr(this_arg);
5843 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5844 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
5845 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5846 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data);
5850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1validate_1holder_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t holder_tx, jobjectArray preimages) {
5851 void* this_arg_ptr = untag_ptr(this_arg);
5852 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5853 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
5854 LDKHolderCommitmentTransaction holder_tx_conv;
5855 holder_tx_conv.inner = untag_ptr(holder_tx);
5856 holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
5857 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
5858 holder_tx_conv.is_owned = false;
5859 LDKCVec_PaymentPreimageZ preimages_constr;
5860 preimages_constr.datalen = (*env)->GetArrayLength(env, preimages);
5861 if (preimages_constr.datalen > 0)
5862 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
5864 preimages_constr.data = NULL;
5865 for (size_t i = 0; i < preimages_constr.datalen; i++) {
5866 int8_tArray preimages_conv_8 = (*env)->GetObjectArrayElement(env, preimages, i);
5867 LDKThirtyTwoBytes preimages_conv_8_ref;
5868 CHECK((*env)->GetArrayLength(env, preimages_conv_8) == 32);
5869 (*env)->GetByteArrayRegion(env, preimages_conv_8, 0, 32, preimages_conv_8_ref.data);
5870 preimages_constr.data[i] = preimages_conv_8_ref;
5872 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
5873 *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
5874 return tag_ptr(ret_conv, true);
5877 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
5878 void* this_arg_ptr = untag_ptr(this_arg);
5879 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5880 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
5881 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5882 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data);
5886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1provide_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) {
5887 void* this_arg_ptr = untag_ptr(this_arg);
5888 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5889 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
5890 LDKChannelTransactionParameters channel_parameters_conv;
5891 channel_parameters_conv.inner = untag_ptr(channel_parameters);
5892 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
5893 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
5894 channel_parameters_conv.is_owned = false;
5895 (this_arg_conv->provide_channel_parameters)(this_arg_conv->this_arg, &channel_parameters_conv);
5898 LDKChannelPublicKeys LDKChannelSigner_set_get_pubkeys(LDKChannelSigner* this_arg) {
5899 if (this_arg->set_pubkeys != NULL)
5900 this_arg->set_pubkeys(this_arg);
5901 return this_arg->pubkeys;
5903 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
5904 void* this_arg_ptr = untag_ptr(this_arg);
5905 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5906 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
5907 LDKChannelPublicKeys ret_var = LDKChannelSigner_set_get_pubkeys(this_arg_conv);
5908 int64_t ret_ref = 0;
5909 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5910 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5914 typedef struct LDKEcdsaChannelSigner_JCalls {
5915 atomic_size_t refcnt;
5918 LDKChannelSigner_JCalls* ChannelSigner;
5919 jmethodID sign_counterparty_commitment_meth;
5920 jmethodID validate_counterparty_revocation_meth;
5921 jmethodID sign_holder_commitment_and_htlcs_meth;
5922 jmethodID sign_justice_revoked_output_meth;
5923 jmethodID sign_justice_revoked_htlc_meth;
5924 jmethodID sign_counterparty_htlc_transaction_meth;
5925 jmethodID sign_closing_transaction_meth;
5926 jmethodID sign_holder_anchor_input_meth;
5927 jmethodID sign_channel_announcement_with_funding_key_meth;
5928 } LDKEcdsaChannelSigner_JCalls;
5929 static void LDKEcdsaChannelSigner_JCalls_free(void* this_arg) {
5930 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
5931 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5933 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5934 if (get_jenv_res == JNI_EDETACHED) {
5935 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5937 DO_ASSERT(get_jenv_res == JNI_OK);
5939 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
5940 if (get_jenv_res == JNI_EDETACHED) {
5941 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5946 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
5947 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
5949 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5950 if (get_jenv_res == JNI_EDETACHED) {
5951 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5953 DO_ASSERT(get_jenv_res == JNI_OK);
5955 LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
5956 int64_t commitment_tx_ref = 0;
5957 commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var);
5958 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
5959 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
5960 LDKCVec_PaymentPreimageZ preimages_var = preimages;
5961 jobjectArray preimages_arr = NULL;
5962 preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL);
5964 for (size_t i = 0; i < preimages_var.datalen; i++) {
5965 int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32);
5966 (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data);
5967 (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr);
5970 FREE(preimages_var.data);
5971 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5973 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_commitment_meth, commitment_tx_ref, preimages_arr);
5974 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5975 (*env)->ExceptionDescribe(env);
5976 (*env)->FatalError(env, "A call to sign_counterparty_commitment in LDKEcdsaChannelSigner from rust threw an exception.");
5978 void* ret_ptr = untag_ptr(ret);
5979 CHECK_ACCESS(ret_ptr);
5980 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
5981 FREE(untag_ptr(ret));
5982 if (get_jenv_res == JNI_EDETACHED) {
5983 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5987 LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKEcdsaChannelSigner_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
5988 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
5990 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5991 if (get_jenv_res == JNI_EDETACHED) {
5992 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5994 DO_ASSERT(get_jenv_res == JNI_OK);
5996 int64_t idx_conv = idx;
5997 int8_tArray secret_arr = (*env)->NewByteArray(env, 32);
5998 (*env)->SetByteArrayRegion(env, secret_arr, 0, 32, *secret);
5999 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6001 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_counterparty_revocation_meth, idx_conv, secret_arr);
6002 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6003 (*env)->ExceptionDescribe(env);
6004 (*env)->FatalError(env, "A call to validate_counterparty_revocation in LDKEcdsaChannelSigner from rust threw an exception.");
6006 void* ret_ptr = untag_ptr(ret);
6007 CHECK_ACCESS(ret_ptr);
6008 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
6009 FREE(untag_ptr(ret));
6010 if (get_jenv_res == JNI_EDETACHED) {
6011 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6015 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
6016 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6018 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6019 if (get_jenv_res == JNI_EDETACHED) {
6020 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6022 DO_ASSERT(get_jenv_res == JNI_OK);
6024 LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
6025 int64_t commitment_tx_ref = 0;
6026 commitment_tx_var = HolderCommitmentTransaction_clone(&commitment_tx_var);
6027 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
6028 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
6029 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6031 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref);
6032 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6033 (*env)->ExceptionDescribe(env);
6034 (*env)->FatalError(env, "A call to sign_holder_commitment_and_htlcs in LDKEcdsaChannelSigner from rust threw an exception.");
6036 void* ret_ptr = untag_ptr(ret);
6037 CHECK_ACCESS(ret_ptr);
6038 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
6039 FREE(untag_ptr(ret));
6040 if (get_jenv_res == JNI_EDETACHED) {
6041 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6045 LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32]) {
6046 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6048 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6049 if (get_jenv_res == JNI_EDETACHED) {
6050 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6052 DO_ASSERT(get_jenv_res == JNI_OK);
6054 LDKTransaction justice_tx_var = justice_tx;
6055 int8_tArray justice_tx_arr = (*env)->NewByteArray(env, justice_tx_var.datalen);
6056 (*env)->SetByteArrayRegion(env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data);
6057 Transaction_free(justice_tx_var);
6058 int64_t input_conv = input;
6059 int64_t amount_conv = amount;
6060 int8_tArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
6061 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
6062 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6064 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);
6065 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6066 (*env)->ExceptionDescribe(env);
6067 (*env)->FatalError(env, "A call to sign_justice_revoked_output in LDKEcdsaChannelSigner from rust threw an exception.");
6069 void* ret_ptr = untag_ptr(ret);
6070 CHECK_ACCESS(ret_ptr);
6071 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6072 FREE(untag_ptr(ret));
6073 if (get_jenv_res == JNI_EDETACHED) {
6074 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6078 LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
6079 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6081 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6082 if (get_jenv_res == JNI_EDETACHED) {
6083 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6085 DO_ASSERT(get_jenv_res == JNI_OK);
6087 LDKTransaction justice_tx_var = justice_tx;
6088 int8_tArray justice_tx_arr = (*env)->NewByteArray(env, justice_tx_var.datalen);
6089 (*env)->SetByteArrayRegion(env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data);
6090 Transaction_free(justice_tx_var);
6091 int64_t input_conv = input;
6092 int64_t amount_conv = amount;
6093 int8_tArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
6094 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
6095 LDKHTLCOutputInCommitment htlc_var = *htlc;
6096 int64_t htlc_ref = 0;
6097 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
6098 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
6099 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
6100 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6102 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);
6103 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6104 (*env)->ExceptionDescribe(env);
6105 (*env)->FatalError(env, "A call to sign_justice_revoked_htlc in LDKEcdsaChannelSigner from rust threw an exception.");
6107 void* ret_ptr = untag_ptr(ret);
6108 CHECK_ACCESS(ret_ptr);
6109 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6110 FREE(untag_ptr(ret));
6111 if (get_jenv_res == JNI_EDETACHED) {
6112 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6116 LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
6117 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6119 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6120 if (get_jenv_res == JNI_EDETACHED) {
6121 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6123 DO_ASSERT(get_jenv_res == JNI_OK);
6125 LDKTransaction htlc_tx_var = htlc_tx;
6126 int8_tArray htlc_tx_arr = (*env)->NewByteArray(env, htlc_tx_var.datalen);
6127 (*env)->SetByteArrayRegion(env, htlc_tx_arr, 0, htlc_tx_var.datalen, htlc_tx_var.data);
6128 Transaction_free(htlc_tx_var);
6129 int64_t input_conv = input;
6130 int64_t amount_conv = amount;
6131 int8_tArray per_commitment_point_arr = (*env)->NewByteArray(env, 33);
6132 (*env)->SetByteArrayRegion(env, per_commitment_point_arr, 0, 33, per_commitment_point.compressed_form);
6133 LDKHTLCOutputInCommitment htlc_var = *htlc;
6134 int64_t htlc_ref = 0;
6135 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
6136 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
6137 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
6138 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6140 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);
6141 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6142 (*env)->ExceptionDescribe(env);
6143 (*env)->FatalError(env, "A call to sign_counterparty_htlc_transaction in LDKEcdsaChannelSigner from rust threw an exception.");
6145 void* ret_ptr = untag_ptr(ret);
6146 CHECK_ACCESS(ret_ptr);
6147 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6148 FREE(untag_ptr(ret));
6149 if (get_jenv_res == JNI_EDETACHED) {
6150 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6154 LDKCResult_SignatureNoneZ sign_closing_transaction_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
6155 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6157 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6158 if (get_jenv_res == JNI_EDETACHED) {
6159 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6161 DO_ASSERT(get_jenv_res == JNI_OK);
6163 LDKClosingTransaction closing_tx_var = *closing_tx;
6164 int64_t closing_tx_ref = 0;
6165 closing_tx_var = ClosingTransaction_clone(&closing_tx_var);
6166 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
6167 closing_tx_ref = tag_ptr(closing_tx_var.inner, closing_tx_var.is_owned);
6168 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6170 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_closing_transaction_meth, closing_tx_ref);
6171 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6172 (*env)->ExceptionDescribe(env);
6173 (*env)->FatalError(env, "A call to sign_closing_transaction in LDKEcdsaChannelSigner from rust threw an exception.");
6175 void* ret_ptr = untag_ptr(ret);
6176 CHECK_ACCESS(ret_ptr);
6177 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6178 FREE(untag_ptr(ret));
6179 if (get_jenv_res == JNI_EDETACHED) {
6180 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6184 LDKCResult_SignatureNoneZ sign_holder_anchor_input_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction anchor_tx, uintptr_t input) {
6185 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6187 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6188 if (get_jenv_res == JNI_EDETACHED) {
6189 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6191 DO_ASSERT(get_jenv_res == JNI_OK);
6193 LDKTransaction anchor_tx_var = anchor_tx;
6194 int8_tArray anchor_tx_arr = (*env)->NewByteArray(env, anchor_tx_var.datalen);
6195 (*env)->SetByteArrayRegion(env, anchor_tx_arr, 0, anchor_tx_var.datalen, anchor_tx_var.data);
6196 Transaction_free(anchor_tx_var);
6197 int64_t input_conv = input;
6198 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6200 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_anchor_input_meth, anchor_tx_arr, input_conv);
6201 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6202 (*env)->ExceptionDescribe(env);
6203 (*env)->FatalError(env, "A call to sign_holder_anchor_input in LDKEcdsaChannelSigner from rust threw an exception.");
6205 void* ret_ptr = untag_ptr(ret);
6206 CHECK_ACCESS(ret_ptr);
6207 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6208 FREE(untag_ptr(ret));
6209 if (get_jenv_res == JNI_EDETACHED) {
6210 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6214 LDKCResult_SignatureNoneZ sign_channel_announcement_with_funding_key_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
6215 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6217 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6218 if (get_jenv_res == JNI_EDETACHED) {
6219 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6221 DO_ASSERT(get_jenv_res == JNI_OK);
6223 LDKUnsignedChannelAnnouncement msg_var = *msg;
6224 int64_t msg_ref = 0;
6225 msg_var = UnsignedChannelAnnouncement_clone(&msg_var);
6226 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
6227 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
6228 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6230 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_channel_announcement_with_funding_key_meth, msg_ref);
6231 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6232 (*env)->ExceptionDescribe(env);
6233 (*env)->FatalError(env, "A call to sign_channel_announcement_with_funding_key in LDKEcdsaChannelSigner from rust threw an exception.");
6235 void* ret_ptr = untag_ptr(ret);
6236 CHECK_ACCESS(ret_ptr);
6237 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6238 FREE(untag_ptr(ret));
6239 if (get_jenv_res == JNI_EDETACHED) {
6240 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6244 static void LDKEcdsaChannelSigner_JCalls_cloned(LDKEcdsaChannelSigner* new_obj) {
6245 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) new_obj->this_arg;
6246 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6247 atomic_fetch_add_explicit(&j_calls->ChannelSigner->refcnt, 1, memory_order_release);
6249 static inline LDKEcdsaChannelSigner LDKEcdsaChannelSigner_init (JNIEnv *env, jclass clz, jobject o, jobject ChannelSigner, int64_t pubkeys) {
6250 jclass c = (*env)->GetObjectClass(env, o);
6252 LDKEcdsaChannelSigner_JCalls *calls = MALLOC(sizeof(LDKEcdsaChannelSigner_JCalls), "LDKEcdsaChannelSigner_JCalls");
6253 atomic_init(&calls->refcnt, 1);
6254 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6255 calls->o = (*env)->NewWeakGlobalRef(env, o);
6256 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(J[[B)J");
6257 CHECK(calls->sign_counterparty_commitment_meth != NULL);
6258 calls->validate_counterparty_revocation_meth = (*env)->GetMethodID(env, c, "validate_counterparty_revocation", "(J[B)J");
6259 CHECK(calls->validate_counterparty_revocation_meth != NULL);
6260 calls->sign_holder_commitment_and_htlcs_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_and_htlcs", "(J)J");
6261 CHECK(calls->sign_holder_commitment_and_htlcs_meth != NULL);
6262 calls->sign_justice_revoked_output_meth = (*env)->GetMethodID(env, c, "sign_justice_revoked_output", "([BJJ[B)J");
6263 CHECK(calls->sign_justice_revoked_output_meth != NULL);
6264 calls->sign_justice_revoked_htlc_meth = (*env)->GetMethodID(env, c, "sign_justice_revoked_htlc", "([BJJ[BJ)J");
6265 CHECK(calls->sign_justice_revoked_htlc_meth != NULL);
6266 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "([BJJ[BJ)J");
6267 CHECK(calls->sign_counterparty_htlc_transaction_meth != NULL);
6268 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
6269 CHECK(calls->sign_closing_transaction_meth != NULL);
6270 calls->sign_holder_anchor_input_meth = (*env)->GetMethodID(env, c, "sign_holder_anchor_input", "([BJ)J");
6271 CHECK(calls->sign_holder_anchor_input_meth != NULL);
6272 calls->sign_channel_announcement_with_funding_key_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement_with_funding_key", "(J)J");
6273 CHECK(calls->sign_channel_announcement_with_funding_key_meth != NULL);
6275 LDKChannelPublicKeys pubkeys_conv;
6276 pubkeys_conv.inner = untag_ptr(pubkeys);
6277 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
6278 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
6280 LDKEcdsaChannelSigner ret = {
6281 .this_arg = (void*) calls,
6282 .sign_counterparty_commitment = sign_counterparty_commitment_LDKEcdsaChannelSigner_jcall,
6283 .validate_counterparty_revocation = validate_counterparty_revocation_LDKEcdsaChannelSigner_jcall,
6284 .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKEcdsaChannelSigner_jcall,
6285 .sign_justice_revoked_output = sign_justice_revoked_output_LDKEcdsaChannelSigner_jcall,
6286 .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKEcdsaChannelSigner_jcall,
6287 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKEcdsaChannelSigner_jcall,
6288 .sign_closing_transaction = sign_closing_transaction_LDKEcdsaChannelSigner_jcall,
6289 .sign_holder_anchor_input = sign_holder_anchor_input_LDKEcdsaChannelSigner_jcall,
6290 .sign_channel_announcement_with_funding_key = sign_channel_announcement_with_funding_key_LDKEcdsaChannelSigner_jcall,
6291 .free = LDKEcdsaChannelSigner_JCalls_free,
6292 .ChannelSigner = LDKChannelSigner_init(env, clz, ChannelSigner, pubkeys),
6294 calls->ChannelSigner = ret.ChannelSigner.this_arg;
6297 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEcdsaChannelSigner_1new(JNIEnv *env, jclass clz, jobject o, jobject ChannelSigner, int64_t pubkeys) {
6298 LDKEcdsaChannelSigner *res_ptr = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner");
6299 *res_ptr = LDKEcdsaChannelSigner_init(env, clz, o, ChannelSigner, pubkeys);
6300 return tag_ptr(res_ptr, true);
6302 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEcdsaChannelSigner_1get_1ChannelSigner(JNIEnv *env, jclass clz, int64_t arg) {
6303 LDKEcdsaChannelSigner *inp = (LDKEcdsaChannelSigner *)untag_ptr(arg);
6304 return tag_ptr(&inp->ChannelSigner, false);
6306 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1counterparty_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx, jobjectArray preimages) {
6307 void* this_arg_ptr = untag_ptr(this_arg);
6308 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6309 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6310 LDKCommitmentTransaction commitment_tx_conv;
6311 commitment_tx_conv.inner = untag_ptr(commitment_tx);
6312 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
6313 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
6314 commitment_tx_conv.is_owned = false;
6315 LDKCVec_PaymentPreimageZ preimages_constr;
6316 preimages_constr.datalen = (*env)->GetArrayLength(env, preimages);
6317 if (preimages_constr.datalen > 0)
6318 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
6320 preimages_constr.data = NULL;
6321 for (size_t i = 0; i < preimages_constr.datalen; i++) {
6322 int8_tArray preimages_conv_8 = (*env)->GetObjectArrayElement(env, preimages, i);
6323 LDKThirtyTwoBytes preimages_conv_8_ref;
6324 CHECK((*env)->GetArrayLength(env, preimages_conv_8) == 32);
6325 (*env)->GetByteArrayRegion(env, preimages_conv_8, 0, 32, preimages_conv_8_ref.data);
6326 preimages_constr.data[i] = preimages_conv_8_ref;
6328 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
6329 *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, preimages_constr);
6330 return tag_ptr(ret_conv, true);
6333 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1validate_1counterparty_1revocation(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx, int8_tArray secret) {
6334 void* this_arg_ptr = untag_ptr(this_arg);
6335 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6336 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6337 uint8_t secret_arr[32];
6338 CHECK((*env)->GetArrayLength(env, secret) == 32);
6339 (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_arr);
6340 uint8_t (*secret_ref)[32] = &secret_arr;
6341 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
6342 *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref);
6343 return tag_ptr(ret_conv, true);
6346 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1holder_1commitment_1and_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) {
6347 void* this_arg_ptr = untag_ptr(this_arg);
6348 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6349 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6350 LDKHolderCommitmentTransaction commitment_tx_conv;
6351 commitment_tx_conv.inner = untag_ptr(commitment_tx);
6352 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
6353 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
6354 commitment_tx_conv.is_owned = false;
6355 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
6356 *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv);
6357 return tag_ptr(ret_conv, true);
6360 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_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) {
6361 void* this_arg_ptr = untag_ptr(this_arg);
6362 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6363 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6364 LDKTransaction justice_tx_ref;
6365 justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
6366 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
6367 (*env)->GetByteArrayRegion(env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data);
6368 justice_tx_ref.data_is_owned = true;
6369 uint8_t per_commitment_key_arr[32];
6370 CHECK((*env)->GetArrayLength(env, per_commitment_key) == 32);
6371 (*env)->GetByteArrayRegion(env, per_commitment_key, 0, 32, per_commitment_key_arr);
6372 uint8_t (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
6373 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6374 *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref);
6375 return tag_ptr(ret_conv, true);
6378 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_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) {
6379 void* this_arg_ptr = untag_ptr(this_arg);
6380 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6381 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6382 LDKTransaction justice_tx_ref;
6383 justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
6384 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
6385 (*env)->GetByteArrayRegion(env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data);
6386 justice_tx_ref.data_is_owned = true;
6387 uint8_t per_commitment_key_arr[32];
6388 CHECK((*env)->GetArrayLength(env, per_commitment_key) == 32);
6389 (*env)->GetByteArrayRegion(env, per_commitment_key, 0, 32, per_commitment_key_arr);
6390 uint8_t (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
6391 LDKHTLCOutputInCommitment htlc_conv;
6392 htlc_conv.inner = untag_ptr(htlc);
6393 htlc_conv.is_owned = ptr_is_owned(htlc);
6394 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
6395 htlc_conv.is_owned = false;
6396 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6397 *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);
6398 return tag_ptr(ret_conv, true);
6401 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_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) {
6402 void* this_arg_ptr = untag_ptr(this_arg);
6403 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6404 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6405 LDKTransaction htlc_tx_ref;
6406 htlc_tx_ref.datalen = (*env)->GetArrayLength(env, htlc_tx);
6407 htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
6408 (*env)->GetByteArrayRegion(env, htlc_tx, 0, htlc_tx_ref.datalen, htlc_tx_ref.data);
6409 htlc_tx_ref.data_is_owned = true;
6410 LDKPublicKey per_commitment_point_ref;
6411 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
6412 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
6413 LDKHTLCOutputInCommitment htlc_conv;
6414 htlc_conv.inner = untag_ptr(htlc);
6415 htlc_conv.is_owned = ptr_is_owned(htlc);
6416 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
6417 htlc_conv.is_owned = false;
6418 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6419 *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);
6420 return tag_ptr(ret_conv, true);
6423 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1closing_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int64_t closing_tx) {
6424 void* this_arg_ptr = untag_ptr(this_arg);
6425 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6426 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6427 LDKClosingTransaction closing_tx_conv;
6428 closing_tx_conv.inner = untag_ptr(closing_tx);
6429 closing_tx_conv.is_owned = ptr_is_owned(closing_tx);
6430 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv);
6431 closing_tx_conv.is_owned = false;
6432 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6433 *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv);
6434 return tag_ptr(ret_conv, true);
6437 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1holder_1anchor_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray anchor_tx, int64_t input) {
6438 void* this_arg_ptr = untag_ptr(this_arg);
6439 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6440 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6441 LDKTransaction anchor_tx_ref;
6442 anchor_tx_ref.datalen = (*env)->GetArrayLength(env, anchor_tx);
6443 anchor_tx_ref.data = MALLOC(anchor_tx_ref.datalen, "LDKTransaction Bytes");
6444 (*env)->GetByteArrayRegion(env, anchor_tx, 0, anchor_tx_ref.datalen, anchor_tx_ref.data);
6445 anchor_tx_ref.data_is_owned = true;
6446 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6447 *ret_conv = (this_arg_conv->sign_holder_anchor_input)(this_arg_conv->this_arg, anchor_tx_ref, input);
6448 return tag_ptr(ret_conv, true);
6451 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1channel_1announcement_1with_1funding_1key(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
6452 void* this_arg_ptr = untag_ptr(this_arg);
6453 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6454 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6455 LDKUnsignedChannelAnnouncement msg_conv;
6456 msg_conv.inner = untag_ptr(msg);
6457 msg_conv.is_owned = ptr_is_owned(msg);
6458 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
6459 msg_conv.is_owned = false;
6460 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6461 *ret_conv = (this_arg_conv->sign_channel_announcement_with_funding_key)(this_arg_conv->this_arg, &msg_conv);
6462 return tag_ptr(ret_conv, true);
6465 typedef struct LDKWriteableEcdsaChannelSigner_JCalls {
6466 atomic_size_t refcnt;
6469 LDKEcdsaChannelSigner_JCalls* EcdsaChannelSigner;
6470 LDKChannelSigner_JCalls* ChannelSigner;
6471 jmethodID write_meth;
6472 } LDKWriteableEcdsaChannelSigner_JCalls;
6473 static void LDKWriteableEcdsaChannelSigner_JCalls_free(void* this_arg) {
6474 LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg;
6475 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
6477 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6478 if (get_jenv_res == JNI_EDETACHED) {
6479 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6481 DO_ASSERT(get_jenv_res == JNI_OK);
6483 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
6484 if (get_jenv_res == JNI_EDETACHED) {
6485 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6490 LDKCVec_u8Z write_LDKWriteableEcdsaChannelSigner_jcall(const void* this_arg) {
6491 LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg;
6493 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6494 if (get_jenv_res == JNI_EDETACHED) {
6495 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6497 DO_ASSERT(get_jenv_res == JNI_OK);
6499 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6501 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
6502 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6503 (*env)->ExceptionDescribe(env);
6504 (*env)->FatalError(env, "A call to write in LDKWriteableEcdsaChannelSigner from rust threw an exception.");
6506 LDKCVec_u8Z ret_ref;
6507 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
6508 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
6509 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
6510 if (get_jenv_res == JNI_EDETACHED) {
6511 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6515 static void LDKWriteableEcdsaChannelSigner_JCalls_cloned(LDKWriteableEcdsaChannelSigner* new_obj) {
6516 LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) new_obj->this_arg;
6517 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6518 atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->refcnt, 1, memory_order_release);
6519 atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->ChannelSigner->refcnt, 1, memory_order_release);
6521 static inline LDKWriteableEcdsaChannelSigner LDKWriteableEcdsaChannelSigner_init (JNIEnv *env, jclass clz, jobject o, jobject EcdsaChannelSigner, jobject ChannelSigner, int64_t pubkeys) {
6522 jclass c = (*env)->GetObjectClass(env, o);
6524 LDKWriteableEcdsaChannelSigner_JCalls *calls = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner_JCalls), "LDKWriteableEcdsaChannelSigner_JCalls");
6525 atomic_init(&calls->refcnt, 1);
6526 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6527 calls->o = (*env)->NewWeakGlobalRef(env, o);
6528 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
6529 CHECK(calls->write_meth != NULL);
6531 LDKChannelPublicKeys pubkeys_conv;
6532 pubkeys_conv.inner = untag_ptr(pubkeys);
6533 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
6534 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
6536 LDKWriteableEcdsaChannelSigner ret = {
6537 .this_arg = (void*) calls,
6538 .write = write_LDKWriteableEcdsaChannelSigner_jcall,
6539 .cloned = LDKWriteableEcdsaChannelSigner_JCalls_cloned,
6540 .free = LDKWriteableEcdsaChannelSigner_JCalls_free,
6541 .EcdsaChannelSigner = LDKEcdsaChannelSigner_init(env, clz, EcdsaChannelSigner, ChannelSigner, pubkeys),
6543 calls->EcdsaChannelSigner = ret.EcdsaChannelSigner.this_arg;
6544 calls->ChannelSigner = ret.EcdsaChannelSigner.ChannelSigner.this_arg;
6547 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1new(JNIEnv *env, jclass clz, jobject o, jobject EcdsaChannelSigner, jobject ChannelSigner, int64_t pubkeys) {
6548 LDKWriteableEcdsaChannelSigner *res_ptr = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
6549 *res_ptr = LDKWriteableEcdsaChannelSigner_init(env, clz, o, EcdsaChannelSigner, ChannelSigner, pubkeys);
6550 return tag_ptr(res_ptr, true);
6552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1get_1EcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t arg) {
6553 LDKWriteableEcdsaChannelSigner *inp = (LDKWriteableEcdsaChannelSigner *)untag_ptr(arg);
6554 return tag_ptr(&inp->EcdsaChannelSigner, false);
6556 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1get_1ChannelSigner(JNIEnv *env, jclass clz, int64_t arg) {
6557 LDKWriteableEcdsaChannelSigner *inp = (LDKWriteableEcdsaChannelSigner *)untag_ptr(arg);
6558 return tag_ptr(&inp->EcdsaChannelSigner.ChannelSigner, false);
6560 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
6561 void* this_arg_ptr = untag_ptr(this_arg);
6562 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6563 LDKWriteableEcdsaChannelSigner* this_arg_conv = (LDKWriteableEcdsaChannelSigner*)this_arg_ptr;
6564 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
6565 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
6566 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
6567 CVec_u8Z_free(ret_var);
6571 static inline struct LDKWriteableEcdsaChannelSigner CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){
6572 CHECK(owner->result_ok);
6573 return WriteableEcdsaChannelSigner_clone(&*owner->contents.result);
6575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6576 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner);
6577 LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
6578 *ret_ret = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv);
6579 return tag_ptr(ret_ret, true);
6582 static inline struct LDKDecodeError CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){
6583 CHECK(!owner->result_ok);
6584 return DecodeError_clone(&*owner->contents.err);
6586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6587 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner);
6588 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6589 *ret_copy = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(owner_conv);
6590 int64_t ret_ref = tag_ptr(ret_copy, true);
6594 static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
6595 LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
6596 for (size_t i = 0; i < ret.datalen; i++) {
6597 ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
6601 static inline struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
6602 CHECK(owner->result_ok);
6603 return CVec_CVec_u8ZZ_clone(&*owner->contents.result);
6605 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6606 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
6607 LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv);
6608 jobjectArray ret_arr = NULL;
6609 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
6611 for (size_t i = 0; i < ret_var.datalen; i++) {
6612 LDKCVec_u8Z ret_conv_8_var = ret_var.data[i];
6613 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen);
6614 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data);
6615 CVec_u8Z_free(ret_conv_8_var);
6616 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
6623 static inline void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
6624 CHECK(!owner->result_ok);
6625 return *owner->contents.err;
6627 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6628 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
6629 CResult_CVec_CVec_u8ZZNoneZ_get_err(owner_conv);
6632 static inline struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
6633 LDKInMemorySigner ret = *owner->contents.result;
6634 ret.is_owned = false;
6637 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6638 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
6639 LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv);
6640 int64_t ret_ref = 0;
6641 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6642 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6646 static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
6647 CHECK(!owner->result_ok);
6648 return DecodeError_clone(&*owner->contents.err);
6650 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6651 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
6652 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6653 *ret_copy = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
6654 int64_t ret_ref = tag_ptr(ret_copy, true);
6658 static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
6659 LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
6660 for (size_t i = 0; i < ret.datalen; i++) {
6661 ret.data[i] = TxOut_clone(&orig->data[i]);
6665 static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
6666 CHECK(owner->result_ok);
6667 return *owner->contents.result;
6669 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6670 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
6671 LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv);
6672 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
6673 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
6677 static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
6678 CHECK(!owner->result_ok);
6679 return *owner->contents.err;
6681 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6682 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
6683 CResult_TransactionNoneZ_get_err(owner_conv);
6686 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6687 return ThirtyTwoBytes_clone(&owner->a);
6689 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
6690 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6691 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6692 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data);
6696 static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6697 LDKChannelMonitor ret = owner->b;
6698 ret.is_owned = false;
6701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
6702 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6703 LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv);
6704 int64_t ret_ref = 0;
6705 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6706 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6710 static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(const LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *orig) {
6711 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ clone bytes"), .datalen = orig->datalen };
6712 for (size_t i = 0; i < ret.datalen; i++) {
6713 ret.data[i] = C2Tuple_BlockHashChannelMonitorZ_clone(&orig->data[i]);
6717 static inline struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner){
6718 CHECK(owner->result_ok);
6719 return CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(&*owner->contents.result);
6721 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6722 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(owner);
6723 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret_var = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(owner_conv);
6724 int64_tArray ret_arr = NULL;
6725 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
6726 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
6727 for (size_t j = 0; j < ret_var.datalen; j++) {
6728 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv_35_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
6729 *ret_conv_35_conv = ret_var.data[j];
6730 ret_arr_ptr[j] = tag_ptr(ret_conv_35_conv, true);
6732 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
6737 static inline enum LDKIOError CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner){
6738 CHECK(!owner->result_ok);
6739 return *owner->contents.err;
6741 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6742 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(owner);
6743 jclass ret_conv = LDKIOError_to_java(env, CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(owner_conv));
6747 static jclass LDKCOption_u16Z_Some_class = NULL;
6748 static jmethodID LDKCOption_u16Z_Some_meth = NULL;
6749 static jclass LDKCOption_u16Z_None_class = NULL;
6750 static jmethodID LDKCOption_u16Z_None_meth = NULL;
6751 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u16Z_init (JNIEnv *env, jclass clz) {
6752 LDKCOption_u16Z_Some_class =
6753 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$Some"));
6754 CHECK(LDKCOption_u16Z_Some_class != NULL);
6755 LDKCOption_u16Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_Some_class, "<init>", "(S)V");
6756 CHECK(LDKCOption_u16Z_Some_meth != NULL);
6757 LDKCOption_u16Z_None_class =
6758 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$None"));
6759 CHECK(LDKCOption_u16Z_None_class != NULL);
6760 LDKCOption_u16Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_None_class, "<init>", "()V");
6761 CHECK(LDKCOption_u16Z_None_meth != NULL);
6763 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u16Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
6764 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
6766 case LDKCOption_u16Z_Some: {
6767 int16_t some_conv = obj->some;
6768 return (*env)->NewObject(env, LDKCOption_u16Z_Some_class, LDKCOption_u16Z_Some_meth, some_conv);
6770 case LDKCOption_u16Z_None: {
6771 return (*env)->NewObject(env, LDKCOption_u16Z_None_class, LDKCOption_u16Z_None_meth);
6776 static inline struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
6777 CHECK(owner->result_ok);
6778 return ThirtyTwoBytes_clone(&*owner->contents.result);
6780 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6781 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
6782 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6783 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult__u832APIErrorZ_get_ok(owner_conv).data);
6787 static inline struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
6788 CHECK(!owner->result_ok);
6789 return APIError_clone(&*owner->contents.err);
6791 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6792 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
6793 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
6794 *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv);
6795 int64_t ret_ref = tag_ptr(ret_copy, true);
6799 static jclass LDKRecentPaymentDetails_Pending_class = NULL;
6800 static jmethodID LDKRecentPaymentDetails_Pending_meth = NULL;
6801 static jclass LDKRecentPaymentDetails_Fulfilled_class = NULL;
6802 static jmethodID LDKRecentPaymentDetails_Fulfilled_meth = NULL;
6803 static jclass LDKRecentPaymentDetails_Abandoned_class = NULL;
6804 static jmethodID LDKRecentPaymentDetails_Abandoned_meth = NULL;
6805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRecentPaymentDetails_init (JNIEnv *env, jclass clz) {
6806 LDKRecentPaymentDetails_Pending_class =
6807 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRecentPaymentDetails$Pending"));
6808 CHECK(LDKRecentPaymentDetails_Pending_class != NULL);
6809 LDKRecentPaymentDetails_Pending_meth = (*env)->GetMethodID(env, LDKRecentPaymentDetails_Pending_class, "<init>", "([BJ)V");
6810 CHECK(LDKRecentPaymentDetails_Pending_meth != NULL);
6811 LDKRecentPaymentDetails_Fulfilled_class =
6812 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRecentPaymentDetails$Fulfilled"));
6813 CHECK(LDKRecentPaymentDetails_Fulfilled_class != NULL);
6814 LDKRecentPaymentDetails_Fulfilled_meth = (*env)->GetMethodID(env, LDKRecentPaymentDetails_Fulfilled_class, "<init>", "([B)V");
6815 CHECK(LDKRecentPaymentDetails_Fulfilled_meth != NULL);
6816 LDKRecentPaymentDetails_Abandoned_class =
6817 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRecentPaymentDetails$Abandoned"));
6818 CHECK(LDKRecentPaymentDetails_Abandoned_class != NULL);
6819 LDKRecentPaymentDetails_Abandoned_meth = (*env)->GetMethodID(env, LDKRecentPaymentDetails_Abandoned_class, "<init>", "([B)V");
6820 CHECK(LDKRecentPaymentDetails_Abandoned_meth != NULL);
6822 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRecentPaymentDetails_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
6823 LDKRecentPaymentDetails *obj = (LDKRecentPaymentDetails*)untag_ptr(ptr);
6825 case LDKRecentPaymentDetails_Pending: {
6826 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
6827 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->pending.payment_hash.data);
6828 int64_t total_msat_conv = obj->pending.total_msat;
6829 return (*env)->NewObject(env, LDKRecentPaymentDetails_Pending_class, LDKRecentPaymentDetails_Pending_meth, payment_hash_arr, total_msat_conv);
6831 case LDKRecentPaymentDetails_Fulfilled: {
6832 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
6833 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->fulfilled.payment_hash.data);
6834 return (*env)->NewObject(env, LDKRecentPaymentDetails_Fulfilled_class, LDKRecentPaymentDetails_Fulfilled_meth, payment_hash_arr);
6836 case LDKRecentPaymentDetails_Abandoned: {
6837 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
6838 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->abandoned.payment_hash.data);
6839 return (*env)->NewObject(env, LDKRecentPaymentDetails_Abandoned_class, LDKRecentPaymentDetails_Abandoned_meth, payment_hash_arr);
6844 static inline LDKCVec_RecentPaymentDetailsZ CVec_RecentPaymentDetailsZ_clone(const LDKCVec_RecentPaymentDetailsZ *orig) {
6845 LDKCVec_RecentPaymentDetailsZ ret = { .data = MALLOC(sizeof(LDKRecentPaymentDetails) * orig->datalen, "LDKCVec_RecentPaymentDetailsZ clone bytes"), .datalen = orig->datalen };
6846 for (size_t i = 0; i < ret.datalen; i++) {
6847 ret.data[i] = RecentPaymentDetails_clone(&orig->data[i]);
6851 static jclass LDKPaymentSendFailure_ParameterError_class = NULL;
6852 static jmethodID LDKPaymentSendFailure_ParameterError_meth = NULL;
6853 static jclass LDKPaymentSendFailure_PathParameterError_class = NULL;
6854 static jmethodID LDKPaymentSendFailure_PathParameterError_meth = NULL;
6855 static jclass LDKPaymentSendFailure_AllFailedResendSafe_class = NULL;
6856 static jmethodID LDKPaymentSendFailure_AllFailedResendSafe_meth = NULL;
6857 static jclass LDKPaymentSendFailure_DuplicatePayment_class = NULL;
6858 static jmethodID LDKPaymentSendFailure_DuplicatePayment_meth = NULL;
6859 static jclass LDKPaymentSendFailure_PartialFailure_class = NULL;
6860 static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL;
6861 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) {
6862 LDKPaymentSendFailure_ParameterError_class =
6863 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError"));
6864 CHECK(LDKPaymentSendFailure_ParameterError_class != NULL);
6865 LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "<init>", "(J)V");
6866 CHECK(LDKPaymentSendFailure_ParameterError_meth != NULL);
6867 LDKPaymentSendFailure_PathParameterError_class =
6868 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError"));
6869 CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL);
6870 LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "<init>", "([J)V");
6871 CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL);
6872 LDKPaymentSendFailure_AllFailedResendSafe_class =
6873 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedResendSafe"));
6874 CHECK(LDKPaymentSendFailure_AllFailedResendSafe_class != NULL);
6875 LDKPaymentSendFailure_AllFailedResendSafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedResendSafe_class, "<init>", "([J)V");
6876 CHECK(LDKPaymentSendFailure_AllFailedResendSafe_meth != NULL);
6877 LDKPaymentSendFailure_DuplicatePayment_class =
6878 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$DuplicatePayment"));
6879 CHECK(LDKPaymentSendFailure_DuplicatePayment_class != NULL);
6880 LDKPaymentSendFailure_DuplicatePayment_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_DuplicatePayment_class, "<init>", "()V");
6881 CHECK(LDKPaymentSendFailure_DuplicatePayment_meth != NULL);
6882 LDKPaymentSendFailure_PartialFailure_class =
6883 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure"));
6884 CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL);
6885 LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "([JJ[B)V");
6886 CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL);
6888 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
6889 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
6891 case LDKPaymentSendFailure_ParameterError: {
6892 int64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false);
6893 return (*env)->NewObject(env, LDKPaymentSendFailure_ParameterError_class, LDKPaymentSendFailure_ParameterError_meth, parameter_error_ref);
6895 case LDKPaymentSendFailure_PathParameterError: {
6896 LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
6897 int64_tArray path_parameter_error_arr = NULL;
6898 path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen);
6899 int64_t *path_parameter_error_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_parameter_error_arr, NULL);
6900 for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
6901 LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
6902 *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w];
6903 *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
6904 path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true);
6906 (*env)->ReleasePrimitiveArrayCritical(env, path_parameter_error_arr, path_parameter_error_arr_ptr, 0);
6907 return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth, path_parameter_error_arr);
6909 case LDKPaymentSendFailure_AllFailedResendSafe: {
6910 LDKCVec_APIErrorZ all_failed_resend_safe_var = obj->all_failed_resend_safe;
6911 int64_tArray all_failed_resend_safe_arr = NULL;
6912 all_failed_resend_safe_arr = (*env)->NewLongArray(env, all_failed_resend_safe_var.datalen);
6913 int64_t *all_failed_resend_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_resend_safe_arr, NULL);
6914 for (size_t k = 0; k < all_failed_resend_safe_var.datalen; k++) {
6915 int64_t all_failed_resend_safe_conv_10_ref = tag_ptr(&all_failed_resend_safe_var.data[k], false);
6916 all_failed_resend_safe_arr_ptr[k] = all_failed_resend_safe_conv_10_ref;
6918 (*env)->ReleasePrimitiveArrayCritical(env, all_failed_resend_safe_arr, all_failed_resend_safe_arr_ptr, 0);
6919 return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedResendSafe_class, LDKPaymentSendFailure_AllFailedResendSafe_meth, all_failed_resend_safe_arr);
6921 case LDKPaymentSendFailure_DuplicatePayment: {
6922 return (*env)->NewObject(env, LDKPaymentSendFailure_DuplicatePayment_class, LDKPaymentSendFailure_DuplicatePayment_meth);
6924 case LDKPaymentSendFailure_PartialFailure: {
6925 LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
6926 int64_tArray results_arr = NULL;
6927 results_arr = (*env)->NewLongArray(env, results_var.datalen);
6928 int64_t *results_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, results_arr, NULL);
6929 for (size_t w = 0; w < results_var.datalen; w++) {
6930 LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
6931 *results_conv_22_conv = results_var.data[w];
6932 *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
6933 results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true);
6935 (*env)->ReleasePrimitiveArrayCritical(env, results_arr, results_arr_ptr, 0);
6936 LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
6937 int64_t failed_paths_retry_ref = 0;
6938 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var);
6939 failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false);
6940 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
6941 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->partial_failure.payment_id.data);
6942 return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, results_arr, failed_paths_retry_ref, payment_id_arr);
6947 static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
6948 CHECK(owner->result_ok);
6949 return *owner->contents.result;
6951 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6952 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
6953 CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
6956 static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
6957 CHECK(!owner->result_ok);
6958 return PaymentSendFailure_clone(&*owner->contents.err);
6960 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6961 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
6962 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
6963 *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
6964 int64_t ret_ref = tag_ptr(ret_copy, true);
6968 static inline void CResult_NoneRetryableSendFailureZ_get_ok(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner){
6969 CHECK(owner->result_ok);
6970 return *owner->contents.result;
6972 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6973 LDKCResult_NoneRetryableSendFailureZ* owner_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(owner);
6974 CResult_NoneRetryableSendFailureZ_get_ok(owner_conv);
6977 static inline enum LDKRetryableSendFailure CResult_NoneRetryableSendFailureZ_get_err(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner){
6978 CHECK(!owner->result_ok);
6979 return RetryableSendFailure_clone(&*owner->contents.err);
6981 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6982 LDKCResult_NoneRetryableSendFailureZ* owner_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(owner);
6983 jclass ret_conv = LDKRetryableSendFailure_to_java(env, CResult_NoneRetryableSendFailureZ_get_err(owner_conv));
6987 static inline struct LDKThirtyTwoBytes CResult_PaymentHashPaymentSendFailureZ_get_ok(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner){
6988 CHECK(owner->result_ok);
6989 return ThirtyTwoBytes_clone(&*owner->contents.result);
6991 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6992 LDKCResult_PaymentHashPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(owner);
6993 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6994 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentHashPaymentSendFailureZ_get_ok(owner_conv).data);
6998 static inline struct LDKPaymentSendFailure CResult_PaymentHashPaymentSendFailureZ_get_err(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner){
6999 CHECK(!owner->result_ok);
7000 return PaymentSendFailure_clone(&*owner->contents.err);
7002 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7003 LDKCResult_PaymentHashPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(owner);
7004 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
7005 *ret_copy = CResult_PaymentHashPaymentSendFailureZ_get_err(owner_conv);
7006 int64_t ret_ref = tag_ptr(ret_copy, true);
7010 static inline struct LDKThirtyTwoBytes CResult_PaymentHashRetryableSendFailureZ_get_ok(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR owner){
7011 CHECK(owner->result_ok);
7012 return ThirtyTwoBytes_clone(&*owner->contents.result);
7014 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7015 LDKCResult_PaymentHashRetryableSendFailureZ* owner_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(owner);
7016 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7017 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentHashRetryableSendFailureZ_get_ok(owner_conv).data);
7021 static inline enum LDKRetryableSendFailure CResult_PaymentHashRetryableSendFailureZ_get_err(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR owner){
7022 CHECK(!owner->result_ok);
7023 return RetryableSendFailure_clone(&*owner->contents.err);
7025 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7026 LDKCResult_PaymentHashRetryableSendFailureZ* owner_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(owner);
7027 jclass ret_conv = LDKRetryableSendFailure_to_java(env, CResult_PaymentHashRetryableSendFailureZ_get_err(owner_conv));
7031 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
7032 return ThirtyTwoBytes_clone(&owner->a);
7034 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7035 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
7036 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7037 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data);
7041 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
7042 return ThirtyTwoBytes_clone(&owner->b);
7044 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7045 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
7046 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7047 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data);
7051 static inline struct LDKC2Tuple_PaymentHashPaymentIdZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
7052 CHECK(owner->result_ok);
7053 return C2Tuple_PaymentHashPaymentIdZ_clone(&*owner->contents.result);
7055 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7056 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
7057 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
7058 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv);
7059 return tag_ptr(ret_conv, true);
7062 static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
7063 CHECK(!owner->result_ok);
7064 return PaymentSendFailure_clone(&*owner->contents.err);
7066 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7067 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
7068 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
7069 *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv);
7070 int64_t ret_ref = tag_ptr(ret_copy, true);
7074 static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) {
7075 LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen };
7076 for (size_t i = 0; i < ret.datalen; i++) {
7077 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
7081 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
7082 return ThirtyTwoBytes_clone(&owner->a);
7084 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7085 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
7086 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7087 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data);
7091 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
7092 return ThirtyTwoBytes_clone(&owner->b);
7094 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7095 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
7096 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7097 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data);
7101 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
7102 CHECK(owner->result_ok);
7103 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
7105 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7106 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
7107 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
7108 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv);
7109 return tag_ptr(ret_conv, true);
7112 static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
7113 CHECK(!owner->result_ok);
7114 return *owner->contents.err;
7116 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7117 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
7118 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner_conv);
7121 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
7122 CHECK(owner->result_ok);
7123 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
7125 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7126 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
7127 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
7128 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv);
7129 return tag_ptr(ret_conv, true);
7132 static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
7133 CHECK(!owner->result_ok);
7134 return APIError_clone(&*owner->contents.err);
7136 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7137 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
7138 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
7139 *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv);
7140 int64_t ret_ref = tag_ptr(ret_copy, true);
7144 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
7145 CHECK(owner->result_ok);
7146 return ThirtyTwoBytes_clone(&*owner->contents.result);
7148 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7149 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
7150 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7151 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data);
7155 static inline void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
7156 CHECK(!owner->result_ok);
7157 return *owner->contents.err;
7159 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7160 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
7161 CResult_PaymentSecretNoneZ_get_err(owner_conv);
7164 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
7165 CHECK(owner->result_ok);
7166 return ThirtyTwoBytes_clone(&*owner->contents.result);
7168 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7169 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
7170 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7171 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data);
7175 static inline struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
7176 CHECK(!owner->result_ok);
7177 return APIError_clone(&*owner->contents.err);
7179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7180 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
7181 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
7182 *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv);
7183 int64_t ret_ref = tag_ptr(ret_copy, true);
7187 static inline struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
7188 CHECK(owner->result_ok);
7189 return ThirtyTwoBytes_clone(&*owner->contents.result);
7191 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7192 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
7193 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7194 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data);
7198 static inline struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
7199 CHECK(!owner->result_ok);
7200 return APIError_clone(&*owner->contents.err);
7202 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7203 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
7204 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
7205 *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv);
7206 int64_t ret_ref = tag_ptr(ret_copy, true);
7210 static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
7211 LDKCounterpartyForwardingInfo ret = *owner->contents.result;
7212 ret.is_owned = false;
7215 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7216 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
7217 LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(owner_conv);
7218 int64_t ret_ref = 0;
7219 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7220 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7224 static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
7225 CHECK(!owner->result_ok);
7226 return DecodeError_clone(&*owner->contents.err);
7228 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7229 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
7230 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7231 *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
7232 int64_t ret_ref = tag_ptr(ret_copy, true);
7236 static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
7237 LDKChannelCounterparty ret = *owner->contents.result;
7238 ret.is_owned = false;
7241 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7242 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
7243 LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_ok(owner_conv);
7244 int64_t ret_ref = 0;
7245 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7246 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7250 static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
7251 CHECK(!owner->result_ok);
7252 return DecodeError_clone(&*owner->contents.err);
7254 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7255 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
7256 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7257 *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
7258 int64_t ret_ref = tag_ptr(ret_copy, true);
7262 static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
7263 LDKChannelDetails ret = *owner->contents.result;
7264 ret.is_owned = false;
7267 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7268 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
7269 LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_get_ok(owner_conv);
7270 int64_t ret_ref = 0;
7271 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7272 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7276 static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
7277 CHECK(!owner->result_ok);
7278 return DecodeError_clone(&*owner->contents.err);
7280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7281 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
7282 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7283 *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
7284 int64_t ret_ref = tag_ptr(ret_copy, true);
7288 static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
7289 LDKPhantomRouteHints ret = *owner->contents.result;
7290 ret.is_owned = false;
7293 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7294 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
7295 LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_ok(owner_conv);
7296 int64_t ret_ref = 0;
7297 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7298 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7302 static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
7303 CHECK(!owner->result_ok);
7304 return DecodeError_clone(&*owner->contents.err);
7306 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7307 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
7308 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7309 *ret_copy = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
7310 int64_t ret_ref = tag_ptr(ret_copy, true);
7314 static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
7315 LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
7316 for (size_t i = 0; i < ret.datalen; i++) {
7317 ret.data[i] = ChannelMonitor_clone(&orig->data[i]);
7321 typedef struct LDKWatch_JCalls {
7322 atomic_size_t refcnt;
7325 jmethodID watch_channel_meth;
7326 jmethodID update_channel_meth;
7327 jmethodID release_pending_monitor_events_meth;
7329 static void LDKWatch_JCalls_free(void* this_arg) {
7330 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
7331 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7333 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7334 if (get_jenv_res == JNI_EDETACHED) {
7335 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7337 DO_ASSERT(get_jenv_res == JNI_OK);
7339 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7340 if (get_jenv_res == JNI_EDETACHED) {
7341 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7346 LDKChannelMonitorUpdateStatus watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
7347 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
7349 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7350 if (get_jenv_res == JNI_EDETACHED) {
7351 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7353 DO_ASSERT(get_jenv_res == JNI_OK);
7355 LDKOutPoint funding_txo_var = funding_txo;
7356 int64_t funding_txo_ref = 0;
7357 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
7358 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
7359 LDKChannelMonitor monitor_var = monitor;
7360 int64_t monitor_ref = 0;
7361 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
7362 monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
7363 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7365 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
7366 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7367 (*env)->ExceptionDescribe(env);
7368 (*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception.");
7370 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
7371 if (get_jenv_res == JNI_EDETACHED) {
7372 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7376 LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, const LDKChannelMonitorUpdate * update) {
7377 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
7379 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7380 if (get_jenv_res == JNI_EDETACHED) {
7381 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7383 DO_ASSERT(get_jenv_res == JNI_OK);
7385 LDKOutPoint funding_txo_var = funding_txo;
7386 int64_t funding_txo_ref = 0;
7387 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
7388 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
7389 LDKChannelMonitorUpdate update_var = *update;
7390 int64_t update_ref = 0;
7391 update_var = ChannelMonitorUpdate_clone(&update_var);
7392 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
7393 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
7394 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7396 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref);
7397 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7398 (*env)->ExceptionDescribe(env);
7399 (*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception.");
7401 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
7402 if (get_jenv_res == JNI_EDETACHED) {
7403 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7407 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
7408 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
7410 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7411 if (get_jenv_res == JNI_EDETACHED) {
7412 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7414 DO_ASSERT(get_jenv_res == JNI_OK);
7416 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7418 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth);
7419 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7420 (*env)->ExceptionDescribe(env);
7421 (*env)->FatalError(env, "A call to release_pending_monitor_events in LDKWatch from rust threw an exception.");
7423 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr;
7424 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
7425 if (ret_constr.datalen > 0)
7426 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
7428 ret_constr.data = NULL;
7429 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
7430 for (size_t x = 0; x < ret_constr.datalen; x++) {
7431 int64_t ret_conv_49 = ret_vals[x];
7432 void* ret_conv_49_ptr = untag_ptr(ret_conv_49);
7433 CHECK_ACCESS(ret_conv_49_ptr);
7434 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr);
7435 FREE(untag_ptr(ret_conv_49));
7436 ret_constr.data[x] = ret_conv_49_conv;
7438 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
7439 if (get_jenv_res == JNI_EDETACHED) {
7440 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7444 static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
7445 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
7446 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7448 static inline LDKWatch LDKWatch_init (JNIEnv *env, jclass clz, jobject o) {
7449 jclass c = (*env)->GetObjectClass(env, o);
7451 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
7452 atomic_init(&calls->refcnt, 1);
7453 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7454 calls->o = (*env)->NewWeakGlobalRef(env, o);
7455 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
7456 CHECK(calls->watch_channel_meth != NULL);
7457 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
7458 CHECK(calls->update_channel_meth != NULL);
7459 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()[J");
7460 CHECK(calls->release_pending_monitor_events_meth != NULL);
7463 .this_arg = (void*) calls,
7464 .watch_channel = watch_channel_LDKWatch_jcall,
7465 .update_channel = update_channel_LDKWatch_jcall,
7466 .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
7467 .free = LDKWatch_JCalls_free,
7471 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new(JNIEnv *env, jclass clz, jobject o) {
7472 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
7473 *res_ptr = LDKWatch_init(env, clz, o);
7474 return tag_ptr(res_ptr, true);
7476 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) {
7477 void* this_arg_ptr = untag_ptr(this_arg);
7478 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7479 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
7480 LDKOutPoint funding_txo_conv;
7481 funding_txo_conv.inner = untag_ptr(funding_txo);
7482 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
7483 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
7484 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
7485 LDKChannelMonitor monitor_conv;
7486 monitor_conv.inner = untag_ptr(monitor);
7487 monitor_conv.is_owned = ptr_is_owned(monitor);
7488 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
7489 monitor_conv = ChannelMonitor_clone(&monitor_conv);
7490 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv));
7494 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t update) {
7495 void* this_arg_ptr = untag_ptr(this_arg);
7496 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7497 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
7498 LDKOutPoint funding_txo_conv;
7499 funding_txo_conv.inner = untag_ptr(funding_txo);
7500 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
7501 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
7502 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
7503 LDKChannelMonitorUpdate update_conv;
7504 update_conv.inner = untag_ptr(update);
7505 update_conv.is_owned = ptr_is_owned(update);
7506 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
7507 update_conv.is_owned = false;
7508 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, &update_conv));
7512 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
7513 void* this_arg_ptr = untag_ptr(this_arg);
7514 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7515 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
7516 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
7517 int64_tArray ret_arr = NULL;
7518 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
7519 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
7520 for (size_t x = 0; x < ret_var.datalen; x++) {
7521 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
7522 *ret_conv_49_conv = ret_var.data[x];
7523 ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true);
7525 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
7530 typedef struct LDKBroadcasterInterface_JCalls {
7531 atomic_size_t refcnt;
7534 jmethodID broadcast_transaction_meth;
7535 } LDKBroadcasterInterface_JCalls;
7536 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
7537 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
7538 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7540 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7541 if (get_jenv_res == JNI_EDETACHED) {
7542 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7544 DO_ASSERT(get_jenv_res == JNI_OK);
7546 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7547 if (get_jenv_res == JNI_EDETACHED) {
7548 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7553 void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
7554 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
7556 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7557 if (get_jenv_res == JNI_EDETACHED) {
7558 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7560 DO_ASSERT(get_jenv_res == JNI_OK);
7562 LDKTransaction tx_var = tx;
7563 int8_tArray tx_arr = (*env)->NewByteArray(env, tx_var.datalen);
7564 (*env)->SetByteArrayRegion(env, tx_arr, 0, tx_var.datalen, tx_var.data);
7565 Transaction_free(tx_var);
7566 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7568 (*env)->CallVoidMethod(env, obj, j_calls->broadcast_transaction_meth, tx_arr);
7569 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7570 (*env)->ExceptionDescribe(env);
7571 (*env)->FatalError(env, "A call to broadcast_transaction in LDKBroadcasterInterface from rust threw an exception.");
7573 if (get_jenv_res == JNI_EDETACHED) {
7574 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7577 static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
7578 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
7579 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7581 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv *env, jclass clz, jobject o) {
7582 jclass c = (*env)->GetObjectClass(env, o);
7584 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
7585 atomic_init(&calls->refcnt, 1);
7586 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7587 calls->o = (*env)->NewWeakGlobalRef(env, o);
7588 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "([B)V");
7589 CHECK(calls->broadcast_transaction_meth != NULL);
7591 LDKBroadcasterInterface ret = {
7592 .this_arg = (void*) calls,
7593 .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
7594 .free = LDKBroadcasterInterface_JCalls_free,
7598 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new(JNIEnv *env, jclass clz, jobject o) {
7599 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
7600 *res_ptr = LDKBroadcasterInterface_init(env, clz, o);
7601 return tag_ptr(res_ptr, true);
7603 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray tx) {
7604 void* this_arg_ptr = untag_ptr(this_arg);
7605 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7606 LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
7607 LDKTransaction tx_ref;
7608 tx_ref.datalen = (*env)->GetArrayLength(env, tx);
7609 tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
7610 (*env)->GetByteArrayRegion(env, tx, 0, tx_ref.datalen, tx_ref.data);
7611 tx_ref.data_is_owned = true;
7612 (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
7615 typedef struct LDKEntropySource_JCalls {
7616 atomic_size_t refcnt;
7619 jmethodID get_secure_random_bytes_meth;
7620 } LDKEntropySource_JCalls;
7621 static void LDKEntropySource_JCalls_free(void* this_arg) {
7622 LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) this_arg;
7623 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7625 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7626 if (get_jenv_res == JNI_EDETACHED) {
7627 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7629 DO_ASSERT(get_jenv_res == JNI_OK);
7631 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7632 if (get_jenv_res == JNI_EDETACHED) {
7633 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7638 LDKThirtyTwoBytes get_secure_random_bytes_LDKEntropySource_jcall(const void* this_arg) {
7639 LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) this_arg;
7641 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7642 if (get_jenv_res == JNI_EDETACHED) {
7643 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7645 DO_ASSERT(get_jenv_res == JNI_OK);
7647 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7649 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth);
7650 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7651 (*env)->ExceptionDescribe(env);
7652 (*env)->FatalError(env, "A call to get_secure_random_bytes in LDKEntropySource from rust threw an exception.");
7654 LDKThirtyTwoBytes ret_ref;
7655 CHECK((*env)->GetArrayLength(env, ret) == 32);
7656 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
7657 if (get_jenv_res == JNI_EDETACHED) {
7658 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7662 static void LDKEntropySource_JCalls_cloned(LDKEntropySource* new_obj) {
7663 LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) new_obj->this_arg;
7664 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7666 static inline LDKEntropySource LDKEntropySource_init (JNIEnv *env, jclass clz, jobject o) {
7667 jclass c = (*env)->GetObjectClass(env, o);
7669 LDKEntropySource_JCalls *calls = MALLOC(sizeof(LDKEntropySource_JCalls), "LDKEntropySource_JCalls");
7670 atomic_init(&calls->refcnt, 1);
7671 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7672 calls->o = (*env)->NewWeakGlobalRef(env, o);
7673 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B");
7674 CHECK(calls->get_secure_random_bytes_meth != NULL);
7676 LDKEntropySource ret = {
7677 .this_arg = (void*) calls,
7678 .get_secure_random_bytes = get_secure_random_bytes_LDKEntropySource_jcall,
7679 .free = LDKEntropySource_JCalls_free,
7683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEntropySource_1new(JNIEnv *env, jclass clz, jobject o) {
7684 LDKEntropySource *res_ptr = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource");
7685 *res_ptr = LDKEntropySource_init(env, clz, o);
7686 return tag_ptr(res_ptr, true);
7688 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_EntropySource_1get_1secure_1random_1bytes(JNIEnv *env, jclass clz, int64_t this_arg) {
7689 void* this_arg_ptr = untag_ptr(this_arg);
7690 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7691 LDKEntropySource* this_arg_conv = (LDKEntropySource*)this_arg_ptr;
7692 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7693 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data);
7697 static jclass LDKUnsignedGossipMessage_ChannelAnnouncement_class = NULL;
7698 static jmethodID LDKUnsignedGossipMessage_ChannelAnnouncement_meth = NULL;
7699 static jclass LDKUnsignedGossipMessage_ChannelUpdate_class = NULL;
7700 static jmethodID LDKUnsignedGossipMessage_ChannelUpdate_meth = NULL;
7701 static jclass LDKUnsignedGossipMessage_NodeAnnouncement_class = NULL;
7702 static jmethodID LDKUnsignedGossipMessage_NodeAnnouncement_meth = NULL;
7703 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKUnsignedGossipMessage_init (JNIEnv *env, jclass clz) {
7704 LDKUnsignedGossipMessage_ChannelAnnouncement_class =
7705 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKUnsignedGossipMessage$ChannelAnnouncement"));
7706 CHECK(LDKUnsignedGossipMessage_ChannelAnnouncement_class != NULL);
7707 LDKUnsignedGossipMessage_ChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKUnsignedGossipMessage_ChannelAnnouncement_class, "<init>", "(J)V");
7708 CHECK(LDKUnsignedGossipMessage_ChannelAnnouncement_meth != NULL);
7709 LDKUnsignedGossipMessage_ChannelUpdate_class =
7710 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKUnsignedGossipMessage$ChannelUpdate"));
7711 CHECK(LDKUnsignedGossipMessage_ChannelUpdate_class != NULL);
7712 LDKUnsignedGossipMessage_ChannelUpdate_meth = (*env)->GetMethodID(env, LDKUnsignedGossipMessage_ChannelUpdate_class, "<init>", "(J)V");
7713 CHECK(LDKUnsignedGossipMessage_ChannelUpdate_meth != NULL);
7714 LDKUnsignedGossipMessage_NodeAnnouncement_class =
7715 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKUnsignedGossipMessage$NodeAnnouncement"));
7716 CHECK(LDKUnsignedGossipMessage_NodeAnnouncement_class != NULL);
7717 LDKUnsignedGossipMessage_NodeAnnouncement_meth = (*env)->GetMethodID(env, LDKUnsignedGossipMessage_NodeAnnouncement_class, "<init>", "(J)V");
7718 CHECK(LDKUnsignedGossipMessage_NodeAnnouncement_meth != NULL);
7720 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKUnsignedGossipMessage_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
7721 LDKUnsignedGossipMessage *obj = (LDKUnsignedGossipMessage*)untag_ptr(ptr);
7723 case LDKUnsignedGossipMessage_ChannelAnnouncement: {
7724 LDKUnsignedChannelAnnouncement channel_announcement_var = obj->channel_announcement;
7725 int64_t channel_announcement_ref = 0;
7726 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_announcement_var);
7727 channel_announcement_ref = tag_ptr(channel_announcement_var.inner, false);
7728 return (*env)->NewObject(env, LDKUnsignedGossipMessage_ChannelAnnouncement_class, LDKUnsignedGossipMessage_ChannelAnnouncement_meth, channel_announcement_ref);
7730 case LDKUnsignedGossipMessage_ChannelUpdate: {
7731 LDKUnsignedChannelUpdate channel_update_var = obj->channel_update;
7732 int64_t channel_update_ref = 0;
7733 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_update_var);
7734 channel_update_ref = tag_ptr(channel_update_var.inner, false);
7735 return (*env)->NewObject(env, LDKUnsignedGossipMessage_ChannelUpdate_class, LDKUnsignedGossipMessage_ChannelUpdate_meth, channel_update_ref);
7737 case LDKUnsignedGossipMessage_NodeAnnouncement: {
7738 LDKUnsignedNodeAnnouncement node_announcement_var = obj->node_announcement;
7739 int64_t node_announcement_ref = 0;
7740 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_announcement_var);
7741 node_announcement_ref = tag_ptr(node_announcement_var.inner, false);
7742 return (*env)->NewObject(env, LDKUnsignedGossipMessage_NodeAnnouncement_class, LDKUnsignedGossipMessage_NodeAnnouncement_meth, node_announcement_ref);
7747 typedef struct LDKNodeSigner_JCalls {
7748 atomic_size_t refcnt;
7751 jmethodID get_inbound_payment_key_material_meth;
7752 jmethodID get_node_id_meth;
7753 jmethodID ecdh_meth;
7754 jmethodID sign_invoice_meth;
7755 jmethodID sign_gossip_message_meth;
7756 } LDKNodeSigner_JCalls;
7757 static void LDKNodeSigner_JCalls_free(void* this_arg) {
7758 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
7759 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7761 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7762 if (get_jenv_res == JNI_EDETACHED) {
7763 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7765 DO_ASSERT(get_jenv_res == JNI_OK);
7767 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7768 if (get_jenv_res == JNI_EDETACHED) {
7769 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7774 LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const void* this_arg) {
7775 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
7777 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7778 if (get_jenv_res == JNI_EDETACHED) {
7779 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7781 DO_ASSERT(get_jenv_res == JNI_OK);
7783 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7785 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_inbound_payment_key_material_meth);
7786 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7787 (*env)->ExceptionDescribe(env);
7788 (*env)->FatalError(env, "A call to get_inbound_payment_key_material in LDKNodeSigner from rust threw an exception.");
7790 LDKThirtyTwoBytes ret_ref;
7791 CHECK((*env)->GetArrayLength(env, ret) == 32);
7792 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
7793 if (get_jenv_res == JNI_EDETACHED) {
7794 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7798 LDKCResult_PublicKeyNoneZ get_node_id_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient) {
7799 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
7801 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7802 if (get_jenv_res == JNI_EDETACHED) {
7803 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7805 DO_ASSERT(get_jenv_res == JNI_OK);
7807 jclass recipient_conv = LDKRecipient_to_java(env, recipient);
7808 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7810 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_node_id_meth, recipient_conv);
7811 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7812 (*env)->ExceptionDescribe(env);
7813 (*env)->FatalError(env, "A call to get_node_id in LDKNodeSigner from rust threw an exception.");
7815 void* ret_ptr = untag_ptr(ret);
7816 CHECK_ACCESS(ret_ptr);
7817 LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr);
7818 FREE(untag_ptr(ret));
7819 if (get_jenv_res == JNI_EDETACHED) {
7820 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7824 LDKCResult_SharedSecretNoneZ ecdh_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient, LDKPublicKey other_key, LDKCOption_ScalarZ tweak) {
7825 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
7827 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7828 if (get_jenv_res == JNI_EDETACHED) {
7829 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7831 DO_ASSERT(get_jenv_res == JNI_OK);
7833 jclass recipient_conv = LDKRecipient_to_java(env, recipient);
7834 int8_tArray other_key_arr = (*env)->NewByteArray(env, 33);
7835 (*env)->SetByteArrayRegion(env, other_key_arr, 0, 33, other_key.compressed_form);
7836 LDKCOption_ScalarZ *tweak_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
7837 *tweak_copy = tweak;
7838 int64_t tweak_ref = tag_ptr(tweak_copy, true);
7839 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7841 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->ecdh_meth, recipient_conv, other_key_arr, tweak_ref);
7842 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7843 (*env)->ExceptionDescribe(env);
7844 (*env)->FatalError(env, "A call to ecdh in LDKNodeSigner from rust threw an exception.");
7846 void* ret_ptr = untag_ptr(ret);
7847 CHECK_ACCESS(ret_ptr);
7848 LDKCResult_SharedSecretNoneZ ret_conv = *(LDKCResult_SharedSecretNoneZ*)(ret_ptr);
7849 FREE(untag_ptr(ret));
7850 if (get_jenv_res == JNI_EDETACHED) {
7851 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7855 LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_U5Z invoice_data, LDKRecipient recipient) {
7856 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
7858 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7859 if (get_jenv_res == JNI_EDETACHED) {
7860 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7862 DO_ASSERT(get_jenv_res == JNI_OK);
7864 LDKu8slice hrp_bytes_var = hrp_bytes;
7865 int8_tArray hrp_bytes_arr = (*env)->NewByteArray(env, hrp_bytes_var.datalen);
7866 (*env)->SetByteArrayRegion(env, hrp_bytes_arr, 0, hrp_bytes_var.datalen, hrp_bytes_var.data);
7867 LDKCVec_U5Z invoice_data_var = invoice_data;
7868 jobjectArray invoice_data_arr = NULL;
7869 invoice_data_arr = (*env)->NewByteArray(env, invoice_data_var.datalen);
7870 int8_t *invoice_data_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, invoice_data_arr, NULL);
7871 for (size_t h = 0; h < invoice_data_var.datalen; h++) {
7872 uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0;
7873 invoice_data_arr_ptr[h] = invoice_data_conv_7_val;
7875 (*env)->ReleasePrimitiveArrayCritical(env, invoice_data_arr, invoice_data_arr_ptr, 0);
7876 FREE(invoice_data_var.data);
7877 jclass recipient_conv = LDKRecipient_to_java(env, recipient);
7878 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7880 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, hrp_bytes_arr, invoice_data_arr, recipient_conv);
7881 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7882 (*env)->ExceptionDescribe(env);
7883 (*env)->FatalError(env, "A call to sign_invoice in LDKNodeSigner from rust threw an exception.");
7885 void* ret_ptr = untag_ptr(ret);
7886 CHECK_ACCESS(ret_ptr);
7887 LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
7888 FREE(untag_ptr(ret));
7889 if (get_jenv_res == JNI_EDETACHED) {
7890 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7894 LDKCResult_SignatureNoneZ sign_gossip_message_LDKNodeSigner_jcall(const void* this_arg, LDKUnsignedGossipMessage msg) {
7895 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
7897 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7898 if (get_jenv_res == JNI_EDETACHED) {
7899 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7901 DO_ASSERT(get_jenv_res == JNI_OK);
7903 LDKUnsignedGossipMessage *msg_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
7905 int64_t msg_ref = tag_ptr(msg_copy, true);
7906 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7908 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_gossip_message_meth, msg_ref);
7909 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7910 (*env)->ExceptionDescribe(env);
7911 (*env)->FatalError(env, "A call to sign_gossip_message in LDKNodeSigner from rust threw an exception.");
7913 void* ret_ptr = untag_ptr(ret);
7914 CHECK_ACCESS(ret_ptr);
7915 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
7916 FREE(untag_ptr(ret));
7917 if (get_jenv_res == JNI_EDETACHED) {
7918 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7922 static void LDKNodeSigner_JCalls_cloned(LDKNodeSigner* new_obj) {
7923 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) new_obj->this_arg;
7924 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7926 static inline LDKNodeSigner LDKNodeSigner_init (JNIEnv *env, jclass clz, jobject o) {
7927 jclass c = (*env)->GetObjectClass(env, o);
7929 LDKNodeSigner_JCalls *calls = MALLOC(sizeof(LDKNodeSigner_JCalls), "LDKNodeSigner_JCalls");
7930 atomic_init(&calls->refcnt, 1);
7931 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7932 calls->o = (*env)->NewWeakGlobalRef(env, o);
7933 calls->get_inbound_payment_key_material_meth = (*env)->GetMethodID(env, c, "get_inbound_payment_key_material", "()[B");
7934 CHECK(calls->get_inbound_payment_key_material_meth != NULL);
7935 calls->get_node_id_meth = (*env)->GetMethodID(env, c, "get_node_id", "(Lorg/ldk/enums/Recipient;)J");
7936 CHECK(calls->get_node_id_meth != NULL);
7937 calls->ecdh_meth = (*env)->GetMethodID(env, c, "ecdh", "(Lorg/ldk/enums/Recipient;[BJ)J");
7938 CHECK(calls->ecdh_meth != NULL);
7939 calls->sign_invoice_meth = (*env)->GetMethodID(env, c, "sign_invoice", "([B[BLorg/ldk/enums/Recipient;)J");
7940 CHECK(calls->sign_invoice_meth != NULL);
7941 calls->sign_gossip_message_meth = (*env)->GetMethodID(env, c, "sign_gossip_message", "(J)J");
7942 CHECK(calls->sign_gossip_message_meth != NULL);
7944 LDKNodeSigner ret = {
7945 .this_arg = (void*) calls,
7946 .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKNodeSigner_jcall,
7947 .get_node_id = get_node_id_LDKNodeSigner_jcall,
7948 .ecdh = ecdh_LDKNodeSigner_jcall,
7949 .sign_invoice = sign_invoice_LDKNodeSigner_jcall,
7950 .sign_gossip_message = sign_gossip_message_LDKNodeSigner_jcall,
7951 .free = LDKNodeSigner_JCalls_free,
7955 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKNodeSigner_1new(JNIEnv *env, jclass clz, jobject o) {
7956 LDKNodeSigner *res_ptr = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner");
7957 *res_ptr = LDKNodeSigner_init(env, clz, o);
7958 return tag_ptr(res_ptr, true);
7960 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1inbound_1payment_1key_1material(JNIEnv *env, jclass clz, int64_t this_arg) {
7961 void* this_arg_ptr = untag_ptr(this_arg);
7962 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7963 LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
7964 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7965 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data);
7969 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient) {
7970 void* this_arg_ptr = untag_ptr(this_arg);
7971 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7972 LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
7973 LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
7974 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
7975 *ret_conv = (this_arg_conv->get_node_id)(this_arg_conv->this_arg, recipient_conv);
7976 return tag_ptr(ret_conv, true);
7979 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1ecdh(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient, int8_tArray other_key, int64_t tweak) {
7980 void* this_arg_ptr = untag_ptr(this_arg);
7981 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7982 LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
7983 LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
7984 LDKPublicKey other_key_ref;
7985 CHECK((*env)->GetArrayLength(env, other_key) == 33);
7986 (*env)->GetByteArrayRegion(env, other_key, 0, 33, other_key_ref.compressed_form);
7987 void* tweak_ptr = untag_ptr(tweak);
7988 CHECK_ACCESS(tweak_ptr);
7989 LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
7990 // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
7991 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
7992 *ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
7993 return tag_ptr(ret_conv, true);
7996 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray hrp_bytes, jobjectArray invoice_data, jclass recipient) {
7997 void* this_arg_ptr = untag_ptr(this_arg);
7998 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7999 LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
8000 LDKu8slice hrp_bytes_ref;
8001 hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes);
8002 hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL);
8003 LDKCVec_U5Z invoice_data_constr;
8004 invoice_data_constr.datalen = (*env)->GetArrayLength(env, invoice_data);
8005 if (invoice_data_constr.datalen > 0)
8006 invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements");
8008 invoice_data_constr.data = NULL;
8009 int8_t* invoice_data_vals = (*env)->GetByteArrayElements (env, invoice_data, NULL);
8010 for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
8011 int8_t invoice_data_conv_7 = invoice_data_vals[h];
8013 invoice_data_constr.data[h] = (LDKU5){ ._0 = invoice_data_conv_7 };
8015 (*env)->ReleaseByteArrayElements(env, invoice_data, invoice_data_vals, 0);
8016 LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
8017 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
8018 *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, recipient_conv);
8019 (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0);
8020 return tag_ptr(ret_conv, true);
8023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1gossip_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
8024 void* this_arg_ptr = untag_ptr(this_arg);
8025 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8026 LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
8027 void* msg_ptr = untag_ptr(msg);
8028 CHECK_ACCESS(msg_ptr);
8029 LDKUnsignedGossipMessage msg_conv = *(LDKUnsignedGossipMessage*)(msg_ptr);
8030 msg_conv = UnsignedGossipMessage_clone((LDKUnsignedGossipMessage*)untag_ptr(msg));
8031 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
8032 *ret_conv = (this_arg_conv->sign_gossip_message)(this_arg_conv->this_arg, msg_conv);
8033 return tag_ptr(ret_conv, true);
8036 typedef struct LDKSignerProvider_JCalls {
8037 atomic_size_t refcnt;
8040 jmethodID generate_channel_keys_id_meth;
8041 jmethodID derive_channel_signer_meth;
8042 jmethodID read_chan_signer_meth;
8043 jmethodID get_destination_script_meth;
8044 jmethodID get_shutdown_scriptpubkey_meth;
8045 } LDKSignerProvider_JCalls;
8046 static void LDKSignerProvider_JCalls_free(void* this_arg) {
8047 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8048 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8050 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8051 if (get_jenv_res == JNI_EDETACHED) {
8052 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8054 DO_ASSERT(get_jenv_res == JNI_OK);
8056 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
8057 if (get_jenv_res == JNI_EDETACHED) {
8058 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8063 LDKThirtyTwoBytes generate_channel_keys_id_LDKSignerProvider_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis, LDKU128 user_channel_id) {
8064 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8066 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8067 if (get_jenv_res == JNI_EDETACHED) {
8068 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8070 DO_ASSERT(get_jenv_res == JNI_OK);
8072 jboolean inbound_conv = inbound;
8073 int64_t channel_value_satoshis_conv = channel_value_satoshis;
8074 int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16);
8075 (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, user_channel_id.le_bytes);
8076 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8078 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->generate_channel_keys_id_meth, inbound_conv, channel_value_satoshis_conv, user_channel_id_arr);
8079 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8080 (*env)->ExceptionDescribe(env);
8081 (*env)->FatalError(env, "A call to generate_channel_keys_id in LDKSignerProvider from rust threw an exception.");
8083 LDKThirtyTwoBytes ret_ref;
8084 CHECK((*env)->GetArrayLength(env, ret) == 32);
8085 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
8086 if (get_jenv_res == JNI_EDETACHED) {
8087 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8091 LDKWriteableEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) {
8092 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8094 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8095 if (get_jenv_res == JNI_EDETACHED) {
8096 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8098 DO_ASSERT(get_jenv_res == JNI_OK);
8100 int64_t channel_value_satoshis_conv = channel_value_satoshis;
8101 int8_tArray channel_keys_id_arr = (*env)->NewByteArray(env, 32);
8102 (*env)->SetByteArrayRegion(env, channel_keys_id_arr, 0, 32, channel_keys_id.data);
8103 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8105 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->derive_channel_signer_meth, channel_value_satoshis_conv, channel_keys_id_arr);
8106 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8107 (*env)->ExceptionDescribe(env);
8108 (*env)->FatalError(env, "A call to derive_channel_signer in LDKSignerProvider from rust threw an exception.");
8110 void* ret_ptr = untag_ptr(ret);
8111 CHECK_ACCESS(ret_ptr);
8112 LDKWriteableEcdsaChannelSigner ret_conv = *(LDKWriteableEcdsaChannelSigner*)(ret_ptr);
8113 FREE(untag_ptr(ret));
8114 if (get_jenv_res == JNI_EDETACHED) {
8115 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8119 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) {
8120 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8122 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8123 if (get_jenv_res == JNI_EDETACHED) {
8124 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8126 DO_ASSERT(get_jenv_res == JNI_OK);
8128 LDKu8slice reader_var = reader;
8129 int8_tArray reader_arr = (*env)->NewByteArray(env, reader_var.datalen);
8130 (*env)->SetByteArrayRegion(env, reader_arr, 0, reader_var.datalen, reader_var.data);
8131 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8133 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr);
8134 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8135 (*env)->ExceptionDescribe(env);
8136 (*env)->FatalError(env, "A call to read_chan_signer in LDKSignerProvider from rust threw an exception.");
8138 void* ret_ptr = untag_ptr(ret);
8139 CHECK_ACCESS(ret_ptr);
8140 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(ret_ptr);
8141 FREE(untag_ptr(ret));
8142 if (get_jenv_res == JNI_EDETACHED) {
8143 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8147 LDKCVec_u8Z get_destination_script_LDKSignerProvider_jcall(const void* this_arg) {
8148 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8150 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8151 if (get_jenv_res == JNI_EDETACHED) {
8152 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8154 DO_ASSERT(get_jenv_res == JNI_OK);
8156 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8158 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth);
8159 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8160 (*env)->ExceptionDescribe(env);
8161 (*env)->FatalError(env, "A call to get_destination_script in LDKSignerProvider from rust threw an exception.");
8163 LDKCVec_u8Z ret_ref;
8164 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
8165 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
8166 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
8167 if (get_jenv_res == JNI_EDETACHED) {
8168 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8172 LDKShutdownScript get_shutdown_scriptpubkey_LDKSignerProvider_jcall(const void* this_arg) {
8173 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8175 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8176 if (get_jenv_res == JNI_EDETACHED) {
8177 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8179 DO_ASSERT(get_jenv_res == JNI_OK);
8181 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8183 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_shutdown_scriptpubkey_meth);
8184 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8185 (*env)->ExceptionDescribe(env);
8186 (*env)->FatalError(env, "A call to get_shutdown_scriptpubkey in LDKSignerProvider from rust threw an exception.");
8188 LDKShutdownScript ret_conv;
8189 ret_conv.inner = untag_ptr(ret);
8190 ret_conv.is_owned = ptr_is_owned(ret);
8191 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
8192 if (get_jenv_res == JNI_EDETACHED) {
8193 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8197 static void LDKSignerProvider_JCalls_cloned(LDKSignerProvider* new_obj) {
8198 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) new_obj->this_arg;
8199 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8201 static inline LDKSignerProvider LDKSignerProvider_init (JNIEnv *env, jclass clz, jobject o) {
8202 jclass c = (*env)->GetObjectClass(env, o);
8204 LDKSignerProvider_JCalls *calls = MALLOC(sizeof(LDKSignerProvider_JCalls), "LDKSignerProvider_JCalls");
8205 atomic_init(&calls->refcnt, 1);
8206 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
8207 calls->o = (*env)->NewWeakGlobalRef(env, o);
8208 calls->generate_channel_keys_id_meth = (*env)->GetMethodID(env, c, "generate_channel_keys_id", "(ZJ[B)[B");
8209 CHECK(calls->generate_channel_keys_id_meth != NULL);
8210 calls->derive_channel_signer_meth = (*env)->GetMethodID(env, c, "derive_channel_signer", "(J[B)J");
8211 CHECK(calls->derive_channel_signer_meth != NULL);
8212 calls->read_chan_signer_meth = (*env)->GetMethodID(env, c, "read_chan_signer", "([B)J");
8213 CHECK(calls->read_chan_signer_meth != NULL);
8214 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()[B");
8215 CHECK(calls->get_destination_script_meth != NULL);
8216 calls->get_shutdown_scriptpubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_scriptpubkey", "()J");
8217 CHECK(calls->get_shutdown_scriptpubkey_meth != NULL);
8219 LDKSignerProvider ret = {
8220 .this_arg = (void*) calls,
8221 .generate_channel_keys_id = generate_channel_keys_id_LDKSignerProvider_jcall,
8222 .derive_channel_signer = derive_channel_signer_LDKSignerProvider_jcall,
8223 .read_chan_signer = read_chan_signer_LDKSignerProvider_jcall,
8224 .get_destination_script = get_destination_script_LDKSignerProvider_jcall,
8225 .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKSignerProvider_jcall,
8226 .free = LDKSignerProvider_JCalls_free,
8230 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSignerProvider_1new(JNIEnv *env, jclass clz, jobject o) {
8231 LDKSignerProvider *res_ptr = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider");
8232 *res_ptr = LDKSignerProvider_init(env, clz, o);
8233 return tag_ptr(res_ptr, true);
8235 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignerProvider_1generate_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis, int8_tArray user_channel_id) {
8236 void* this_arg_ptr = untag_ptr(this_arg);
8237 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8238 LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
8239 LDKU128 user_channel_id_ref;
8240 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
8241 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
8242 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
8243 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->generate_channel_keys_id)(this_arg_conv->this_arg, inbound, channel_value_satoshis, user_channel_id_ref).data);
8247 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignerProvider_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray channel_keys_id) {
8248 void* this_arg_ptr = untag_ptr(this_arg);
8249 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8250 LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
8251 LDKThirtyTwoBytes channel_keys_id_ref;
8252 CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32);
8253 (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data);
8254 LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
8255 *ret_ret = (this_arg_conv->derive_channel_signer)(this_arg_conv->this_arg, channel_value_satoshis, channel_keys_id_ref);
8256 return tag_ptr(ret_ret, true);
8259 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignerProvider_1read_1chan_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray reader) {
8260 void* this_arg_ptr = untag_ptr(this_arg);
8261 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8262 LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
8263 LDKu8slice reader_ref;
8264 reader_ref.datalen = (*env)->GetArrayLength(env, reader);
8265 reader_ref.data = (*env)->GetByteArrayElements (env, reader, NULL);
8266 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
8267 *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
8268 (*env)->ReleaseByteArrayElements(env, reader, (int8_t*)reader_ref.data, 0);
8269 return tag_ptr(ret_conv, true);
8272 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignerProvider_1get_1destination_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
8273 void* this_arg_ptr = untag_ptr(this_arg);
8274 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8275 LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
8276 LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
8277 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
8278 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
8279 CVec_u8Z_free(ret_var);
8283 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignerProvider_1get_1shutdown_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
8284 void* this_arg_ptr = untag_ptr(this_arg);
8285 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8286 LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
8287 LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
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 typedef struct LDKFeeEstimator_JCalls {
8295 atomic_size_t refcnt;
8298 jmethodID get_est_sat_per_1000_weight_meth;
8299 } LDKFeeEstimator_JCalls;
8300 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
8301 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
8302 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8304 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8305 if (get_jenv_res == JNI_EDETACHED) {
8306 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8308 DO_ASSERT(get_jenv_res == JNI_OK);
8310 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
8311 if (get_jenv_res == JNI_EDETACHED) {
8312 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8317 uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
8318 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
8320 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8321 if (get_jenv_res == JNI_EDETACHED) {
8322 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8324 DO_ASSERT(get_jenv_res == JNI_OK);
8326 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(env, confirmation_target);
8327 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8329 int32_t ret = (*env)->CallIntMethod(env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
8330 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8331 (*env)->ExceptionDescribe(env);
8332 (*env)->FatalError(env, "A call to get_est_sat_per_1000_weight in LDKFeeEstimator from rust threw an exception.");
8334 if (get_jenv_res == JNI_EDETACHED) {
8335 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8339 static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
8340 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
8341 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8343 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv *env, jclass clz, jobject o) {
8344 jclass c = (*env)->GetObjectClass(env, o);
8346 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
8347 atomic_init(&calls->refcnt, 1);
8348 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
8349 calls->o = (*env)->NewWeakGlobalRef(env, o);
8350 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/enums/ConfirmationTarget;)I");
8351 CHECK(calls->get_est_sat_per_1000_weight_meth != NULL);
8353 LDKFeeEstimator ret = {
8354 .this_arg = (void*) calls,
8355 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
8356 .free = LDKFeeEstimator_JCalls_free,
8360 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new(JNIEnv *env, jclass clz, jobject o) {
8361 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
8362 *res_ptr = LDKFeeEstimator_init(env, clz, o);
8363 return tag_ptr(res_ptr, true);
8365 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) {
8366 void* this_arg_ptr = untag_ptr(this_arg);
8367 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8368 LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
8369 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(env, confirmation_target);
8370 int32_t ret_conv = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
8374 typedef struct LDKRouter_JCalls {
8375 atomic_size_t refcnt;
8378 jmethodID find_route_meth;
8379 jmethodID find_route_with_id_meth;
8381 static void LDKRouter_JCalls_free(void* this_arg) {
8382 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
8383 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8385 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8386 if (get_jenv_res == JNI_EDETACHED) {
8387 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8389 DO_ASSERT(get_jenv_res == JNI_OK);
8391 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
8392 if (get_jenv_res == JNI_EDETACHED) {
8393 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8398 LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, const LDKInFlightHtlcs * inflight_htlcs) {
8399 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
8401 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8402 if (get_jenv_res == JNI_EDETACHED) {
8403 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8405 DO_ASSERT(get_jenv_res == JNI_OK);
8407 int8_tArray payer_arr = (*env)->NewByteArray(env, 33);
8408 (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form);
8409 LDKRouteParameters route_params_var = *route_params;
8410 int64_t route_params_ref = 0;
8411 route_params_var = RouteParameters_clone(&route_params_var);
8412 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
8413 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
8414 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
8415 int64_tArray first_hops_arr = NULL;
8416 if (first_hops != NULL) {
8417 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
8418 first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen);
8419 int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL);
8420 for (size_t q = 0; q < first_hops_var.datalen; q++) {
8421 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
8422 int64_t first_hops_conv_16_ref = 0;
8423 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
8424 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
8425 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
8427 (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0);
8429 LDKInFlightHtlcs inflight_htlcs_var = *inflight_htlcs;
8430 int64_t inflight_htlcs_ref = 0;
8431 inflight_htlcs_var = InFlightHtlcs_clone(&inflight_htlcs_var);
8432 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var);
8433 inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned);
8434 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8436 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref);
8437 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8438 (*env)->ExceptionDescribe(env);
8439 (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception.");
8441 void* ret_ptr = untag_ptr(ret);
8442 CHECK_ACCESS(ret_ptr);
8443 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
8444 FREE(untag_ptr(ret));
8445 if (get_jenv_res == JNI_EDETACHED) {
8446 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8450 LDKCResult_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, const LDKInFlightHtlcs * inflight_htlcs, LDKThirtyTwoBytes _payment_hash, LDKThirtyTwoBytes _payment_id) {
8451 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
8453 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8454 if (get_jenv_res == JNI_EDETACHED) {
8455 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8457 DO_ASSERT(get_jenv_res == JNI_OK);
8459 int8_tArray payer_arr = (*env)->NewByteArray(env, 33);
8460 (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form);
8461 LDKRouteParameters route_params_var = *route_params;
8462 int64_t route_params_ref = 0;
8463 route_params_var = RouteParameters_clone(&route_params_var);
8464 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
8465 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
8466 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
8467 int64_tArray first_hops_arr = NULL;
8468 if (first_hops != NULL) {
8469 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
8470 first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen);
8471 int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL);
8472 for (size_t q = 0; q < first_hops_var.datalen; q++) {
8473 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
8474 int64_t first_hops_conv_16_ref = 0;
8475 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
8476 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
8477 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
8479 (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0);
8481 LDKInFlightHtlcs inflight_htlcs_var = *inflight_htlcs;
8482 int64_t inflight_htlcs_ref = 0;
8483 inflight_htlcs_var = InFlightHtlcs_clone(&inflight_htlcs_var);
8484 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var);
8485 inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned);
8486 int8_tArray _payment_hash_arr = (*env)->NewByteArray(env, 32);
8487 (*env)->SetByteArrayRegion(env, _payment_hash_arr, 0, 32, _payment_hash.data);
8488 int8_tArray _payment_id_arr = (*env)->NewByteArray(env, 32);
8489 (*env)->SetByteArrayRegion(env, _payment_id_arr, 0, 32, _payment_id.data);
8490 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8492 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_with_id_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref, _payment_hash_arr, _payment_id_arr);
8493 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8494 (*env)->ExceptionDescribe(env);
8495 (*env)->FatalError(env, "A call to find_route_with_id in LDKRouter from rust threw an exception.");
8497 void* ret_ptr = untag_ptr(ret);
8498 CHECK_ACCESS(ret_ptr);
8499 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
8500 FREE(untag_ptr(ret));
8501 if (get_jenv_res == JNI_EDETACHED) {
8502 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8506 static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
8507 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
8508 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8510 static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) {
8511 jclass c = (*env)->GetObjectClass(env, o);
8513 LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
8514 atomic_init(&calls->refcnt, 1);
8515 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
8516 calls->o = (*env)->NewWeakGlobalRef(env, o);
8517 calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[JJ)J");
8518 CHECK(calls->find_route_meth != NULL);
8519 calls->find_route_with_id_meth = (*env)->GetMethodID(env, c, "find_route_with_id", "([BJ[JJ[B[B)J");
8520 CHECK(calls->find_route_with_id_meth != NULL);
8523 .this_arg = (void*) calls,
8524 .find_route = find_route_LDKRouter_jcall,
8525 .find_route_with_id = find_route_with_id_LDKRouter_jcall,
8526 .free = LDKRouter_JCalls_free,
8530 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, jclass clz, jobject o) {
8531 LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
8532 *res_ptr = LDKRouter_init(env, clz, o);
8533 return tag_ptr(res_ptr, true);
8535 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, int64_tArray first_hops, int64_t inflight_htlcs) {
8536 void* this_arg_ptr = untag_ptr(this_arg);
8537 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8538 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
8539 LDKPublicKey payer_ref;
8540 CHECK((*env)->GetArrayLength(env, payer) == 33);
8541 (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_ref.compressed_form);
8542 LDKRouteParameters route_params_conv;
8543 route_params_conv.inner = untag_ptr(route_params);
8544 route_params_conv.is_owned = ptr_is_owned(route_params);
8545 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
8546 route_params_conv.is_owned = false;
8547 LDKCVec_ChannelDetailsZ first_hops_constr;
8548 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
8549 if (first_hops != NULL) {
8550 first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
8551 if (first_hops_constr.datalen > 0)
8552 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
8554 first_hops_constr.data = NULL;
8555 int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
8556 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
8557 int64_t first_hops_conv_16 = first_hops_vals[q];
8558 LDKChannelDetails first_hops_conv_16_conv;
8559 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
8560 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
8561 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
8562 first_hops_conv_16_conv.is_owned = false;
8563 first_hops_constr.data[q] = first_hops_conv_16_conv;
8565 (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
8566 first_hops_ptr = &first_hops_constr;
8568 LDKInFlightHtlcs inflight_htlcs_conv;
8569 inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
8570 inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
8571 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
8572 inflight_htlcs_conv.is_owned = false;
8573 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
8574 *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, &inflight_htlcs_conv);
8575 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
8576 return tag_ptr(ret_conv, true);
8579 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs, int8_tArray _payment_hash, int8_tArray _payment_id) {
8580 void* this_arg_ptr = untag_ptr(this_arg);
8581 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8582 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
8583 LDKPublicKey payer_ref;
8584 CHECK((*env)->GetArrayLength(env, payer) == 33);
8585 (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_ref.compressed_form);
8586 LDKRouteParameters route_params_conv;
8587 route_params_conv.inner = untag_ptr(route_params);
8588 route_params_conv.is_owned = ptr_is_owned(route_params);
8589 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
8590 route_params_conv.is_owned = false;
8591 LDKCVec_ChannelDetailsZ first_hops_constr;
8592 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
8593 if (first_hops != NULL) {
8594 first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
8595 if (first_hops_constr.datalen > 0)
8596 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
8598 first_hops_constr.data = NULL;
8599 int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
8600 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
8601 int64_t first_hops_conv_16 = first_hops_vals[q];
8602 LDKChannelDetails first_hops_conv_16_conv;
8603 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
8604 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
8605 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
8606 first_hops_conv_16_conv.is_owned = false;
8607 first_hops_constr.data[q] = first_hops_conv_16_conv;
8609 (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
8610 first_hops_ptr = &first_hops_constr;
8612 LDKInFlightHtlcs inflight_htlcs_conv;
8613 inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
8614 inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
8615 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
8616 inflight_htlcs_conv.is_owned = false;
8617 LDKThirtyTwoBytes _payment_hash_ref;
8618 CHECK((*env)->GetArrayLength(env, _payment_hash) == 32);
8619 (*env)->GetByteArrayRegion(env, _payment_hash, 0, 32, _payment_hash_ref.data);
8620 LDKThirtyTwoBytes _payment_id_ref;
8621 CHECK((*env)->GetArrayLength(env, _payment_id) == 32);
8622 (*env)->GetByteArrayRegion(env, _payment_id, 0, 32, _payment_id_ref.data);
8623 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
8624 *ret_conv = (this_arg_conv->find_route_with_id)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, &inflight_htlcs_conv, _payment_hash_ref, _payment_id_ref);
8625 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
8626 return tag_ptr(ret_conv, true);
8629 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
8630 return ThirtyTwoBytes_clone(&owner->a);
8632 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
8633 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
8634 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
8635 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data);
8639 static inline struct LDKChannelManager C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
8640 LDKChannelManager ret = owner->b;
8641 ret.is_owned = false;
8644 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
8645 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
8646 LDKChannelManager ret_var = C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv);
8647 int64_t ret_ref = 0;
8648 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8649 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8653 static inline struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
8654 CHECK(owner->result_ok);
8655 return &*owner->contents.result;
8657 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8658 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
8659 int64_t ret_ret = tag_ptr(CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv), false);
8663 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
8664 CHECK(!owner->result_ok);
8665 return DecodeError_clone(&*owner->contents.err);
8667 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8668 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
8669 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8670 *ret_copy = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
8671 int64_t ret_ref = tag_ptr(ret_copy, true);
8675 static inline struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
8676 LDKChannelConfig ret = *owner->contents.result;
8677 ret.is_owned = false;
8680 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8681 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
8682 LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv);
8683 int64_t ret_ref = 0;
8684 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8685 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8689 static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
8690 CHECK(!owner->result_ok);
8691 return DecodeError_clone(&*owner->contents.err);
8693 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8694 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
8695 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8696 *ret_copy = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
8697 int64_t ret_ref = tag_ptr(ret_copy, true);
8701 static jclass LDKCOption_APIErrorZ_Some_class = NULL;
8702 static jmethodID LDKCOption_APIErrorZ_Some_meth = NULL;
8703 static jclass LDKCOption_APIErrorZ_None_class = NULL;
8704 static jmethodID LDKCOption_APIErrorZ_None_meth = NULL;
8705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1APIErrorZ_init (JNIEnv *env, jclass clz) {
8706 LDKCOption_APIErrorZ_Some_class =
8707 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_APIErrorZ$Some"));
8708 CHECK(LDKCOption_APIErrorZ_Some_class != NULL);
8709 LDKCOption_APIErrorZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_APIErrorZ_Some_class, "<init>", "(J)V");
8710 CHECK(LDKCOption_APIErrorZ_Some_meth != NULL);
8711 LDKCOption_APIErrorZ_None_class =
8712 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_APIErrorZ$None"));
8713 CHECK(LDKCOption_APIErrorZ_None_class != NULL);
8714 LDKCOption_APIErrorZ_None_meth = (*env)->GetMethodID(env, LDKCOption_APIErrorZ_None_class, "<init>", "()V");
8715 CHECK(LDKCOption_APIErrorZ_None_meth != NULL);
8717 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1APIErrorZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
8718 LDKCOption_APIErrorZ *obj = (LDKCOption_APIErrorZ*)untag_ptr(ptr);
8720 case LDKCOption_APIErrorZ_Some: {
8721 int64_t some_ref = tag_ptr(&obj->some, false);
8722 return (*env)->NewObject(env, LDKCOption_APIErrorZ_Some_class, LDKCOption_APIErrorZ_Some_meth, some_ref);
8724 case LDKCOption_APIErrorZ_None: {
8725 return (*env)->NewObject(env, LDKCOption_APIErrorZ_None_class, LDKCOption_APIErrorZ_None_meth);
8730 static inline struct LDKCOption_APIErrorZ CResult_COption_APIErrorZDecodeErrorZ_get_ok(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR owner){
8731 CHECK(owner->result_ok);
8732 return COption_APIErrorZ_clone(&*owner->contents.result);
8734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8735 LDKCResult_COption_APIErrorZDecodeErrorZ* owner_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(owner);
8736 LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
8737 *ret_copy = CResult_COption_APIErrorZDecodeErrorZ_get_ok(owner_conv);
8738 int64_t ret_ref = tag_ptr(ret_copy, true);
8742 static inline struct LDKDecodeError CResult_COption_APIErrorZDecodeErrorZ_get_err(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR owner){
8743 CHECK(!owner->result_ok);
8744 return DecodeError_clone(&*owner->contents.err);
8746 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8747 LDKCResult_COption_APIErrorZDecodeErrorZ* owner_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(owner);
8748 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8749 *ret_copy = CResult_COption_APIErrorZDecodeErrorZ_get_err(owner_conv);
8750 int64_t ret_ref = tag_ptr(ret_copy, true);
8754 static inline struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
8755 LDKOutPoint ret = *owner->contents.result;
8756 ret.is_owned = false;
8759 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8760 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
8761 LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv);
8762 int64_t ret_ref = 0;
8763 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8764 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8768 static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
8769 CHECK(!owner->result_ok);
8770 return DecodeError_clone(&*owner->contents.err);
8772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8773 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
8774 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8775 *ret_copy = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
8776 int64_t ret_ref = tag_ptr(ret_copy, true);
8780 typedef struct LDKType_JCalls {
8781 atomic_size_t refcnt;
8784 jmethodID type_id_meth;
8785 jmethodID debug_str_meth;
8786 jmethodID write_meth;
8788 static void LDKType_JCalls_free(void* this_arg) {
8789 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
8790 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8792 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8793 if (get_jenv_res == JNI_EDETACHED) {
8794 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8796 DO_ASSERT(get_jenv_res == JNI_OK);
8798 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
8799 if (get_jenv_res == JNI_EDETACHED) {
8800 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8805 uint16_t type_id_LDKType_jcall(const void* this_arg) {
8806 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
8808 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8809 if (get_jenv_res == JNI_EDETACHED) {
8810 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8812 DO_ASSERT(get_jenv_res == JNI_OK);
8814 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8816 int16_t ret = (*env)->CallShortMethod(env, obj, j_calls->type_id_meth);
8817 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8818 (*env)->ExceptionDescribe(env);
8819 (*env)->FatalError(env, "A call to type_id in LDKType from rust threw an exception.");
8821 if (get_jenv_res == JNI_EDETACHED) {
8822 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8826 LDKStr debug_str_LDKType_jcall(const void* this_arg) {
8827 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
8829 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8830 if (get_jenv_res == JNI_EDETACHED) {
8831 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8833 DO_ASSERT(get_jenv_res == JNI_OK);
8835 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8837 jstring ret = (*env)->CallObjectMethod(env, obj, j_calls->debug_str_meth);
8838 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8839 (*env)->ExceptionDescribe(env);
8840 (*env)->FatalError(env, "A call to debug_str in LDKType from rust threw an exception.");
8842 LDKStr ret_conv = java_to_owned_str(env, ret);
8843 if (get_jenv_res == JNI_EDETACHED) {
8844 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8848 LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
8849 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
8851 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8852 if (get_jenv_res == JNI_EDETACHED) {
8853 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8855 DO_ASSERT(get_jenv_res == JNI_OK);
8857 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8859 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
8860 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8861 (*env)->ExceptionDescribe(env);
8862 (*env)->FatalError(env, "A call to write in LDKType from rust threw an exception.");
8864 LDKCVec_u8Z ret_ref;
8865 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
8866 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
8867 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
8868 if (get_jenv_res == JNI_EDETACHED) {
8869 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8873 static void LDKType_JCalls_cloned(LDKType* new_obj) {
8874 LDKType_JCalls *j_calls = (LDKType_JCalls*) new_obj->this_arg;
8875 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8877 static inline LDKType LDKType_init (JNIEnv *env, jclass clz, jobject o) {
8878 jclass c = (*env)->GetObjectClass(env, o);
8880 LDKType_JCalls *calls = MALLOC(sizeof(LDKType_JCalls), "LDKType_JCalls");
8881 atomic_init(&calls->refcnt, 1);
8882 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
8883 calls->o = (*env)->NewWeakGlobalRef(env, o);
8884 calls->type_id_meth = (*env)->GetMethodID(env, c, "type_id", "()S");
8885 CHECK(calls->type_id_meth != NULL);
8886 calls->debug_str_meth = (*env)->GetMethodID(env, c, "debug_str", "()Ljava/lang/String;");
8887 CHECK(calls->debug_str_meth != NULL);
8888 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
8889 CHECK(calls->write_meth != NULL);
8892 .this_arg = (void*) calls,
8893 .type_id = type_id_LDKType_jcall,
8894 .debug_str = debug_str_LDKType_jcall,
8895 .write = write_LDKType_jcall,
8896 .cloned = LDKType_JCalls_cloned,
8897 .free = LDKType_JCalls_free,
8901 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKType_1new(JNIEnv *env, jclass clz, jobject o) {
8902 LDKType *res_ptr = MALLOC(sizeof(LDKType), "LDKType");
8903 *res_ptr = LDKType_init(env, clz, o);
8904 return tag_ptr(res_ptr, true);
8906 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Type_1type_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
8907 void* this_arg_ptr = untag_ptr(this_arg);
8908 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8909 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
8910 int16_t ret_conv = (this_arg_conv->type_id)(this_arg_conv->this_arg);
8914 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Type_1debug_1str(JNIEnv *env, jclass clz, int64_t this_arg) {
8915 void* this_arg_ptr = untag_ptr(this_arg);
8916 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8917 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
8918 LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
8919 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
8924 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Type_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
8925 void* this_arg_ptr = untag_ptr(this_arg);
8926 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8927 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
8928 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
8929 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
8930 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
8931 CVec_u8Z_free(ret_var);
8935 static jclass LDKCOption_TypeZ_Some_class = NULL;
8936 static jmethodID LDKCOption_TypeZ_Some_meth = NULL;
8937 static jclass LDKCOption_TypeZ_None_class = NULL;
8938 static jmethodID LDKCOption_TypeZ_None_meth = NULL;
8939 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1TypeZ_init (JNIEnv *env, jclass clz) {
8940 LDKCOption_TypeZ_Some_class =
8941 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$Some"));
8942 CHECK(LDKCOption_TypeZ_Some_class != NULL);
8943 LDKCOption_TypeZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_Some_class, "<init>", "(J)V");
8944 CHECK(LDKCOption_TypeZ_Some_meth != NULL);
8945 LDKCOption_TypeZ_None_class =
8946 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$None"));
8947 CHECK(LDKCOption_TypeZ_None_class != NULL);
8948 LDKCOption_TypeZ_None_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_None_class, "<init>", "()V");
8949 CHECK(LDKCOption_TypeZ_None_meth != NULL);
8951 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1TypeZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
8952 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
8954 case LDKCOption_TypeZ_Some: {
8955 LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
8956 *some_ret = Type_clone(&obj->some);
8957 return (*env)->NewObject(env, LDKCOption_TypeZ_Some_class, LDKCOption_TypeZ_Some_meth, tag_ptr(some_ret, true));
8959 case LDKCOption_TypeZ_None: {
8960 return (*env)->NewObject(env, LDKCOption_TypeZ_None_class, LDKCOption_TypeZ_None_meth);
8965 static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
8966 CHECK(owner->result_ok);
8967 return COption_TypeZ_clone(&*owner->contents.result);
8969 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8970 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
8971 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
8972 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv);
8973 int64_t ret_ref = tag_ptr(ret_copy, true);
8977 static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
8978 CHECK(!owner->result_ok);
8979 return DecodeError_clone(&*owner->contents.err);
8981 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8982 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
8983 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8984 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
8985 int64_t ret_ref = tag_ptr(ret_copy, true);
8989 static jclass LDKPaymentError_Invoice_class = NULL;
8990 static jmethodID LDKPaymentError_Invoice_meth = NULL;
8991 static jclass LDKPaymentError_Sending_class = NULL;
8992 static jmethodID LDKPaymentError_Sending_meth = NULL;
8993 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentError_init (JNIEnv *env, jclass clz) {
8994 LDKPaymentError_Invoice_class =
8995 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Invoice"));
8996 CHECK(LDKPaymentError_Invoice_class != NULL);
8997 LDKPaymentError_Invoice_meth = (*env)->GetMethodID(env, LDKPaymentError_Invoice_class, "<init>", "(Ljava/lang/String;)V");
8998 CHECK(LDKPaymentError_Invoice_meth != NULL);
8999 LDKPaymentError_Sending_class =
9000 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Sending"));
9001 CHECK(LDKPaymentError_Sending_class != NULL);
9002 LDKPaymentError_Sending_meth = (*env)->GetMethodID(env, LDKPaymentError_Sending_class, "<init>", "(Lorg/ldk/enums/RetryableSendFailure;)V");
9003 CHECK(LDKPaymentError_Sending_meth != NULL);
9005 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9006 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
9008 case LDKPaymentError_Invoice: {
9009 LDKStr invoice_str = obj->invoice;
9010 jstring invoice_conv = str_ref_to_java(env, invoice_str.chars, invoice_str.len);
9011 return (*env)->NewObject(env, LDKPaymentError_Invoice_class, LDKPaymentError_Invoice_meth, invoice_conv);
9013 case LDKPaymentError_Sending: {
9014 jclass sending_conv = LDKRetryableSendFailure_to_java(env, obj->sending);
9015 return (*env)->NewObject(env, LDKPaymentError_Sending_class, LDKPaymentError_Sending_meth, sending_conv);
9020 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
9021 CHECK(owner->result_ok);
9022 return ThirtyTwoBytes_clone(&*owner->contents.result);
9024 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9025 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
9026 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
9027 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentIdPaymentErrorZ_get_ok(owner_conv).data);
9031 static inline struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
9032 CHECK(!owner->result_ok);
9033 return PaymentError_clone(&*owner->contents.err);
9035 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9036 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
9037 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
9038 *ret_copy = CResult_PaymentIdPaymentErrorZ_get_err(owner_conv);
9039 int64_t ret_ref = tag_ptr(ret_copy, true);
9043 static inline void CResult_NonePaymentErrorZ_get_ok(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){
9044 CHECK(owner->result_ok);
9045 return *owner->contents.result;
9047 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9048 LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner);
9049 CResult_NonePaymentErrorZ_get_ok(owner_conv);
9052 static inline struct LDKPaymentError CResult_NonePaymentErrorZ_get_err(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){
9053 CHECK(!owner->result_ok);
9054 return PaymentError_clone(&*owner->contents.err);
9056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9057 LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner);
9058 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
9059 *ret_copy = CResult_NonePaymentErrorZ_get_err(owner_conv);
9060 int64_t ret_ref = tag_ptr(ret_copy, true);
9064 static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
9065 CHECK(owner->result_ok);
9066 return *owner->contents.result;
9068 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9069 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
9070 LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
9071 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
9075 static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
9076 CHECK(!owner->result_ok);
9077 return *owner->contents.err;
9079 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9080 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
9081 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_StringErrorZ_get_err(owner_conv));
9085 static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
9086 CHECK(owner->result_ok);
9087 return *owner->contents.result;
9089 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9090 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
9091 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
9092 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form);
9096 static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
9097 CHECK(!owner->result_ok);
9098 return *owner->contents.err;
9100 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9101 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
9102 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PublicKeyErrorZ_get_err(owner_conv));
9106 static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
9107 LDKChannelMonitorUpdate ret = *owner->contents.result;
9108 ret.is_owned = false;
9111 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9112 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
9113 LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
9114 int64_t ret_ref = 0;
9115 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9116 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9120 static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
9121 CHECK(!owner->result_ok);
9122 return DecodeError_clone(&*owner->contents.err);
9124 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9125 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
9126 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9127 *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
9128 int64_t ret_ref = tag_ptr(ret_copy, true);
9132 static jclass LDKCOption_MonitorEventZ_Some_class = NULL;
9133 static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL;
9134 static jclass LDKCOption_MonitorEventZ_None_class = NULL;
9135 static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL;
9136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) {
9137 LDKCOption_MonitorEventZ_Some_class =
9138 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some"));
9139 CHECK(LDKCOption_MonitorEventZ_Some_class != NULL);
9140 LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "<init>", "(J)V");
9141 CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL);
9142 LDKCOption_MonitorEventZ_None_class =
9143 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$None"));
9144 CHECK(LDKCOption_MonitorEventZ_None_class != NULL);
9145 LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "<init>", "()V");
9146 CHECK(LDKCOption_MonitorEventZ_None_meth != NULL);
9148 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9149 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
9151 case LDKCOption_MonitorEventZ_Some: {
9152 int64_t some_ref = tag_ptr(&obj->some, false);
9153 return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref);
9155 case LDKCOption_MonitorEventZ_None: {
9156 return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth);
9161 static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
9162 CHECK(owner->result_ok);
9163 return COption_MonitorEventZ_clone(&*owner->contents.result);
9165 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9166 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
9167 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
9168 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
9169 int64_t ret_ref = tag_ptr(ret_copy, true);
9173 static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
9174 CHECK(!owner->result_ok);
9175 return DecodeError_clone(&*owner->contents.err);
9177 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9178 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
9179 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9180 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
9181 int64_t ret_ref = tag_ptr(ret_copy, true);
9185 static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
9186 LDKHTLCUpdate ret = *owner->contents.result;
9187 ret.is_owned = false;
9190 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9191 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
9192 LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
9193 int64_t ret_ref = 0;
9194 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9195 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9199 static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
9200 CHECK(!owner->result_ok);
9201 return DecodeError_clone(&*owner->contents.err);
9203 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9204 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
9205 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9206 *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
9207 int64_t ret_ref = tag_ptr(ret_copy, true);
9211 static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
9212 LDKOutPoint ret = owner->a;
9213 ret.is_owned = false;
9216 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9217 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
9218 LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
9219 int64_t ret_ref = 0;
9220 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9221 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9225 static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
9226 return CVec_u8Z_clone(&owner->b);
9228 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9229 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
9230 LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
9231 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9232 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9233 CVec_u8Z_free(ret_var);
9237 static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
9240 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9241 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
9242 int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
9246 static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
9247 return CVec_u8Z_clone(&owner->b);
9249 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9250 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
9251 LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv);
9252 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9253 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9254 CVec_u8Z_free(ret_var);
9258 static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) {
9259 LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen };
9260 for (size_t i = 0; i < ret.datalen; i++) {
9261 ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]);
9265 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
9266 return ThirtyTwoBytes_clone(&owner->a);
9268 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9269 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
9270 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
9271 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data);
9275 static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
9276 return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b);
9278 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9279 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
9280 LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv);
9281 int64_tArray ret_arr = NULL;
9282 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
9283 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
9284 for (size_t v = 0; v < ret_var.datalen; v++) {
9285 LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
9286 *ret_conv_21_conv = ret_var.data[v];
9287 ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true);
9289 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
9294 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) {
9295 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 };
9296 for (size_t i = 0; i < ret.datalen; i++) {
9297 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]);
9301 static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) {
9302 LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen };
9303 for (size_t i = 0; i < ret.datalen; i++) {
9304 ret.data[i] = Event_clone(&orig->data[i]);
9308 static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
9311 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9312 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
9313 int32_t ret_conv = C2Tuple_u32TxOutZ_get_a(owner_conv);
9317 static inline struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
9318 return TxOut_clone(&owner->b);
9320 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9321 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
9322 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
9323 *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv);
9324 return tag_ptr(ret_ref, true);
9327 static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) {
9328 LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen };
9329 for (size_t i = 0; i < ret.datalen; i++) {
9330 ret.data[i] = C2Tuple_u32TxOutZ_clone(&orig->data[i]);
9334 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
9335 return ThirtyTwoBytes_clone(&owner->a);
9337 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9338 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
9339 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
9340 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data);
9344 static inline struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
9345 return CVec_C2Tuple_u32TxOutZZ_clone(&owner->b);
9347 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9348 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
9349 LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv);
9350 int64_tArray ret_arr = NULL;
9351 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
9352 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
9353 for (size_t u = 0; u < ret_var.datalen; u++) {
9354 LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
9355 *ret_conv_20_conv = ret_var.data[u];
9356 ret_arr_ptr[u] = tag_ptr(ret_conv_20_conv, true);
9358 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
9363 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) {
9364 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 };
9365 for (size_t i = 0; i < ret.datalen; i++) {
9366 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(&orig->data[i]);
9370 static jclass LDKBalance_ClaimableOnChannelClose_class = NULL;
9371 static jmethodID LDKBalance_ClaimableOnChannelClose_meth = NULL;
9372 static jclass LDKBalance_ClaimableAwaitingConfirmations_class = NULL;
9373 static jmethodID LDKBalance_ClaimableAwaitingConfirmations_meth = NULL;
9374 static jclass LDKBalance_ContentiousClaimable_class = NULL;
9375 static jmethodID LDKBalance_ContentiousClaimable_meth = NULL;
9376 static jclass LDKBalance_MaybeTimeoutClaimableHTLC_class = NULL;
9377 static jmethodID LDKBalance_MaybeTimeoutClaimableHTLC_meth = NULL;
9378 static jclass LDKBalance_MaybePreimageClaimableHTLC_class = NULL;
9379 static jmethodID LDKBalance_MaybePreimageClaimableHTLC_meth = NULL;
9380 static jclass LDKBalance_CounterpartyRevokedOutputClaimable_class = NULL;
9381 static jmethodID LDKBalance_CounterpartyRevokedOutputClaimable_meth = NULL;
9382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBalance_init (JNIEnv *env, jclass clz) {
9383 LDKBalance_ClaimableOnChannelClose_class =
9384 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableOnChannelClose"));
9385 CHECK(LDKBalance_ClaimableOnChannelClose_class != NULL);
9386 LDKBalance_ClaimableOnChannelClose_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableOnChannelClose_class, "<init>", "(J)V");
9387 CHECK(LDKBalance_ClaimableOnChannelClose_meth != NULL);
9388 LDKBalance_ClaimableAwaitingConfirmations_class =
9389 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableAwaitingConfirmations"));
9390 CHECK(LDKBalance_ClaimableAwaitingConfirmations_class != NULL);
9391 LDKBalance_ClaimableAwaitingConfirmations_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableAwaitingConfirmations_class, "<init>", "(JI)V");
9392 CHECK(LDKBalance_ClaimableAwaitingConfirmations_meth != NULL);
9393 LDKBalance_ContentiousClaimable_class =
9394 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ContentiousClaimable"));
9395 CHECK(LDKBalance_ContentiousClaimable_class != NULL);
9396 LDKBalance_ContentiousClaimable_meth = (*env)->GetMethodID(env, LDKBalance_ContentiousClaimable_class, "<init>", "(JI)V");
9397 CHECK(LDKBalance_ContentiousClaimable_meth != NULL);
9398 LDKBalance_MaybeTimeoutClaimableHTLC_class =
9399 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybeTimeoutClaimableHTLC"));
9400 CHECK(LDKBalance_MaybeTimeoutClaimableHTLC_class != NULL);
9401 LDKBalance_MaybeTimeoutClaimableHTLC_meth = (*env)->GetMethodID(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, "<init>", "(JI)V");
9402 CHECK(LDKBalance_MaybeTimeoutClaimableHTLC_meth != NULL);
9403 LDKBalance_MaybePreimageClaimableHTLC_class =
9404 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybePreimageClaimableHTLC"));
9405 CHECK(LDKBalance_MaybePreimageClaimableHTLC_class != NULL);
9406 LDKBalance_MaybePreimageClaimableHTLC_meth = (*env)->GetMethodID(env, LDKBalance_MaybePreimageClaimableHTLC_class, "<init>", "(JI)V");
9407 CHECK(LDKBalance_MaybePreimageClaimableHTLC_meth != NULL);
9408 LDKBalance_CounterpartyRevokedOutputClaimable_class =
9409 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$CounterpartyRevokedOutputClaimable"));
9410 CHECK(LDKBalance_CounterpartyRevokedOutputClaimable_class != NULL);
9411 LDKBalance_CounterpartyRevokedOutputClaimable_meth = (*env)->GetMethodID(env, LDKBalance_CounterpartyRevokedOutputClaimable_class, "<init>", "(J)V");
9412 CHECK(LDKBalance_CounterpartyRevokedOutputClaimable_meth != NULL);
9414 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9415 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
9417 case LDKBalance_ClaimableOnChannelClose: {
9418 int64_t claimable_amount_satoshis_conv = obj->claimable_on_channel_close.claimable_amount_satoshis;
9419 return (*env)->NewObject(env, LDKBalance_ClaimableOnChannelClose_class, LDKBalance_ClaimableOnChannelClose_meth, claimable_amount_satoshis_conv);
9421 case LDKBalance_ClaimableAwaitingConfirmations: {
9422 int64_t claimable_amount_satoshis_conv = obj->claimable_awaiting_confirmations.claimable_amount_satoshis;
9423 int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height;
9424 return (*env)->NewObject(env, LDKBalance_ClaimableAwaitingConfirmations_class, LDKBalance_ClaimableAwaitingConfirmations_meth, claimable_amount_satoshis_conv, confirmation_height_conv);
9426 case LDKBalance_ContentiousClaimable: {
9427 int64_t claimable_amount_satoshis_conv = obj->contentious_claimable.claimable_amount_satoshis;
9428 int32_t timeout_height_conv = obj->contentious_claimable.timeout_height;
9429 return (*env)->NewObject(env, LDKBalance_ContentiousClaimable_class, LDKBalance_ContentiousClaimable_meth, claimable_amount_satoshis_conv, timeout_height_conv);
9431 case LDKBalance_MaybeTimeoutClaimableHTLC: {
9432 int64_t claimable_amount_satoshis_conv = obj->maybe_timeout_claimable_htlc.claimable_amount_satoshis;
9433 int32_t claimable_height_conv = obj->maybe_timeout_claimable_htlc.claimable_height;
9434 return (*env)->NewObject(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, LDKBalance_MaybeTimeoutClaimableHTLC_meth, claimable_amount_satoshis_conv, claimable_height_conv);
9436 case LDKBalance_MaybePreimageClaimableHTLC: {
9437 int64_t claimable_amount_satoshis_conv = obj->maybe_preimage_claimable_htlc.claimable_amount_satoshis;
9438 int32_t expiry_height_conv = obj->maybe_preimage_claimable_htlc.expiry_height;
9439 return (*env)->NewObject(env, LDKBalance_MaybePreimageClaimableHTLC_class, LDKBalance_MaybePreimageClaimableHTLC_meth, claimable_amount_satoshis_conv, expiry_height_conv);
9441 case LDKBalance_CounterpartyRevokedOutputClaimable: {
9442 int64_t claimable_amount_satoshis_conv = obj->counterparty_revoked_output_claimable.claimable_amount_satoshis;
9443 return (*env)->NewObject(env, LDKBalance_CounterpartyRevokedOutputClaimable_class, LDKBalance_CounterpartyRevokedOutputClaimable_meth, claimable_amount_satoshis_conv);
9448 static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
9449 LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
9450 for (size_t i = 0; i < ret.datalen; i++) {
9451 ret.data[i] = Balance_clone(&orig->data[i]);
9455 static inline struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
9456 CHECK(owner->result_ok);
9457 return C2Tuple_BlockHashChannelMonitorZ_clone(&*owner->contents.result);
9459 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9460 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
9461 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
9462 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv);
9463 return tag_ptr(ret_conv, true);
9466 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
9467 CHECK(!owner->result_ok);
9468 return DecodeError_clone(&*owner->contents.err);
9470 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9471 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
9472 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9473 *ret_copy = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
9474 int64_t ret_ref = tag_ptr(ret_copy, true);
9478 static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
9481 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9482 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
9483 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
9484 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form);
9488 static inline struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
9489 return Type_clone(&owner->b);
9491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9492 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
9493 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
9494 *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv);
9495 return tag_ptr(ret_ret, true);
9498 static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) {
9499 LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen };
9500 for (size_t i = 0; i < ret.datalen; i++) {
9501 ret.data[i] = C2Tuple_PublicKeyTypeZ_clone(&orig->data[i]);
9505 typedef struct LDKCustomOnionMessageContents_JCalls {
9506 atomic_size_t refcnt;
9509 jmethodID tlv_type_meth;
9510 jmethodID write_meth;
9511 } LDKCustomOnionMessageContents_JCalls;
9512 static void LDKCustomOnionMessageContents_JCalls_free(void* this_arg) {
9513 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
9514 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9516 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9517 if (get_jenv_res == JNI_EDETACHED) {
9518 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9520 DO_ASSERT(get_jenv_res == JNI_OK);
9522 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
9523 if (get_jenv_res == JNI_EDETACHED) {
9524 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9529 uint64_t tlv_type_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
9530 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
9532 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9533 if (get_jenv_res == JNI_EDETACHED) {
9534 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9536 DO_ASSERT(get_jenv_res == JNI_OK);
9538 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9540 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->tlv_type_meth);
9541 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9542 (*env)->ExceptionDescribe(env);
9543 (*env)->FatalError(env, "A call to tlv_type in LDKCustomOnionMessageContents from rust threw an exception.");
9545 if (get_jenv_res == JNI_EDETACHED) {
9546 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9550 LDKCVec_u8Z write_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
9551 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
9553 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9554 if (get_jenv_res == JNI_EDETACHED) {
9555 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9557 DO_ASSERT(get_jenv_res == JNI_OK);
9559 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9561 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
9562 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9563 (*env)->ExceptionDescribe(env);
9564 (*env)->FatalError(env, "A call to write in LDKCustomOnionMessageContents from rust threw an exception.");
9566 LDKCVec_u8Z ret_ref;
9567 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
9568 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
9569 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
9570 if (get_jenv_res == JNI_EDETACHED) {
9571 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9575 static void LDKCustomOnionMessageContents_JCalls_cloned(LDKCustomOnionMessageContents* new_obj) {
9576 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) new_obj->this_arg;
9577 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9579 static inline LDKCustomOnionMessageContents LDKCustomOnionMessageContents_init (JNIEnv *env, jclass clz, jobject o) {
9580 jclass c = (*env)->GetObjectClass(env, o);
9582 LDKCustomOnionMessageContents_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageContents_JCalls), "LDKCustomOnionMessageContents_JCalls");
9583 atomic_init(&calls->refcnt, 1);
9584 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
9585 calls->o = (*env)->NewWeakGlobalRef(env, o);
9586 calls->tlv_type_meth = (*env)->GetMethodID(env, c, "tlv_type", "()J");
9587 CHECK(calls->tlv_type_meth != NULL);
9588 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
9589 CHECK(calls->write_meth != NULL);
9591 LDKCustomOnionMessageContents ret = {
9592 .this_arg = (void*) calls,
9593 .tlv_type = tlv_type_LDKCustomOnionMessageContents_jcall,
9594 .write = write_LDKCustomOnionMessageContents_jcall,
9595 .cloned = LDKCustomOnionMessageContents_JCalls_cloned,
9596 .free = LDKCustomOnionMessageContents_JCalls_free,
9600 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageContents_1new(JNIEnv *env, jclass clz, jobject o) {
9601 LDKCustomOnionMessageContents *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
9602 *res_ptr = LDKCustomOnionMessageContents_init(env, clz, o);
9603 return tag_ptr(res_ptr, true);
9605 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1tlv_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
9606 void* this_arg_ptr = untag_ptr(this_arg);
9607 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9608 LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
9609 int64_t ret_conv = (this_arg_conv->tlv_type)(this_arg_conv->this_arg);
9613 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
9614 void* this_arg_ptr = untag_ptr(this_arg);
9615 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9616 LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
9617 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
9618 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9619 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9620 CVec_u8Z_free(ret_var);
9624 static jclass LDKCOption_CustomOnionMessageContentsZ_Some_class = NULL;
9625 static jmethodID LDKCOption_CustomOnionMessageContentsZ_Some_meth = NULL;
9626 static jclass LDKCOption_CustomOnionMessageContentsZ_None_class = NULL;
9627 static jmethodID LDKCOption_CustomOnionMessageContentsZ_None_meth = NULL;
9628 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CustomOnionMessageContentsZ_init (JNIEnv *env, jclass clz) {
9629 LDKCOption_CustomOnionMessageContentsZ_Some_class =
9630 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CustomOnionMessageContentsZ$Some"));
9631 CHECK(LDKCOption_CustomOnionMessageContentsZ_Some_class != NULL);
9632 LDKCOption_CustomOnionMessageContentsZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CustomOnionMessageContentsZ_Some_class, "<init>", "(J)V");
9633 CHECK(LDKCOption_CustomOnionMessageContentsZ_Some_meth != NULL);
9634 LDKCOption_CustomOnionMessageContentsZ_None_class =
9635 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CustomOnionMessageContentsZ$None"));
9636 CHECK(LDKCOption_CustomOnionMessageContentsZ_None_class != NULL);
9637 LDKCOption_CustomOnionMessageContentsZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CustomOnionMessageContentsZ_None_class, "<init>", "()V");
9638 CHECK(LDKCOption_CustomOnionMessageContentsZ_None_meth != NULL);
9640 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CustomOnionMessageContentsZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9641 LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr);
9643 case LDKCOption_CustomOnionMessageContentsZ_Some: {
9644 LDKCustomOnionMessageContents* some_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
9645 *some_ret = CustomOnionMessageContents_clone(&obj->some);
9646 return (*env)->NewObject(env, LDKCOption_CustomOnionMessageContentsZ_Some_class, LDKCOption_CustomOnionMessageContentsZ_Some_meth, tag_ptr(some_ret, true));
9648 case LDKCOption_CustomOnionMessageContentsZ_None: {
9649 return (*env)->NewObject(env, LDKCOption_CustomOnionMessageContentsZ_None_class, LDKCOption_CustomOnionMessageContentsZ_None_meth);
9654 static inline struct LDKCOption_CustomOnionMessageContentsZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
9655 CHECK(owner->result_ok);
9656 return COption_CustomOnionMessageContentsZ_clone(&*owner->contents.result);
9658 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9659 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
9660 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
9661 *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(owner_conv);
9662 int64_t ret_ref = tag_ptr(ret_copy, true);
9666 static inline struct LDKDecodeError CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
9667 CHECK(!owner->result_ok);
9668 return DecodeError_clone(&*owner->contents.err);
9670 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9671 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
9672 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9673 *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(owner_conv);
9674 int64_t ret_ref = tag_ptr(ret_copy, true);
9678 static jclass LDKCOption_NetAddressZ_Some_class = NULL;
9679 static jmethodID LDKCOption_NetAddressZ_Some_meth = NULL;
9680 static jclass LDKCOption_NetAddressZ_None_class = NULL;
9681 static jmethodID LDKCOption_NetAddressZ_None_meth = NULL;
9682 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetAddressZ_init (JNIEnv *env, jclass clz) {
9683 LDKCOption_NetAddressZ_Some_class =
9684 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetAddressZ$Some"));
9685 CHECK(LDKCOption_NetAddressZ_Some_class != NULL);
9686 LDKCOption_NetAddressZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NetAddressZ_Some_class, "<init>", "(J)V");
9687 CHECK(LDKCOption_NetAddressZ_Some_meth != NULL);
9688 LDKCOption_NetAddressZ_None_class =
9689 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetAddressZ$None"));
9690 CHECK(LDKCOption_NetAddressZ_None_class != NULL);
9691 LDKCOption_NetAddressZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NetAddressZ_None_class, "<init>", "()V");
9692 CHECK(LDKCOption_NetAddressZ_None_meth != NULL);
9694 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetAddressZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9695 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
9697 case LDKCOption_NetAddressZ_Some: {
9698 int64_t some_ref = tag_ptr(&obj->some, false);
9699 return (*env)->NewObject(env, LDKCOption_NetAddressZ_Some_class, LDKCOption_NetAddressZ_Some_meth, some_ref);
9701 case LDKCOption_NetAddressZ_None: {
9702 return (*env)->NewObject(env, LDKCOption_NetAddressZ_None_class, LDKCOption_NetAddressZ_None_meth);
9707 static inline struct LDKPublicKey C2Tuple_PublicKeyCOption_NetAddressZZ_get_a(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR owner){
9710 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9711 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(owner);
9712 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
9713 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C2Tuple_PublicKeyCOption_NetAddressZZ_get_a(owner_conv).compressed_form);
9717 static inline struct LDKCOption_NetAddressZ C2Tuple_PublicKeyCOption_NetAddressZZ_get_b(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR owner){
9718 return COption_NetAddressZ_clone(&owner->b);
9720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9721 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(owner);
9722 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
9723 *ret_copy = C2Tuple_PublicKeyCOption_NetAddressZZ_get_b(owner_conv);
9724 int64_t ret_ref = tag_ptr(ret_copy, true);
9728 static inline LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_clone(const LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ *orig) {
9729 LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ clone bytes"), .datalen = orig->datalen };
9730 for (size_t i = 0; i < ret.datalen; i++) {
9731 ret.data[i] = C2Tuple_PublicKeyCOption_NetAddressZZ_clone(&orig->data[i]);
9735 static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
9736 CHECK(owner->result_ok);
9737 return CVec_u8Z_clone(&*owner->contents.result);
9739 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9740 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
9741 LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv);
9742 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9743 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9744 CVec_u8Z_free(ret_var);
9748 static inline struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
9749 LDKPeerHandleError ret = *owner->contents.err;
9750 ret.is_owned = false;
9753 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9754 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
9755 LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv);
9756 int64_t ret_ref = 0;
9757 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9758 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9762 static inline void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
9763 CHECK(owner->result_ok);
9764 return *owner->contents.result;
9766 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9767 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
9768 CResult_NonePeerHandleErrorZ_get_ok(owner_conv);
9771 static inline struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
9772 LDKPeerHandleError ret = *owner->contents.err;
9773 ret.is_owned = false;
9776 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9777 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
9778 LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv);
9779 int64_t ret_ref = 0;
9780 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9781 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9785 static inline bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
9786 CHECK(owner->result_ok);
9787 return *owner->contents.result;
9789 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9790 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
9791 jboolean ret_conv = CResult_boolPeerHandleErrorZ_get_ok(owner_conv);
9795 static inline struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
9796 LDKPeerHandleError ret = *owner->contents.err;
9797 ret.is_owned = false;
9800 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9801 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
9802 LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv);
9803 int64_t ret_ref = 0;
9804 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9805 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9809 static jclass LDKSendError_Secp256k1_class = NULL;
9810 static jmethodID LDKSendError_Secp256k1_meth = NULL;
9811 static jclass LDKSendError_TooBigPacket_class = NULL;
9812 static jmethodID LDKSendError_TooBigPacket_meth = NULL;
9813 static jclass LDKSendError_TooFewBlindedHops_class = NULL;
9814 static jmethodID LDKSendError_TooFewBlindedHops_meth = NULL;
9815 static jclass LDKSendError_InvalidFirstHop_class = NULL;
9816 static jmethodID LDKSendError_InvalidFirstHop_meth = NULL;
9817 static jclass LDKSendError_InvalidMessage_class = NULL;
9818 static jmethodID LDKSendError_InvalidMessage_meth = NULL;
9819 static jclass LDKSendError_BufferFull_class = NULL;
9820 static jmethodID LDKSendError_BufferFull_meth = NULL;
9821 static jclass LDKSendError_GetNodeIdFailed_class = NULL;
9822 static jmethodID LDKSendError_GetNodeIdFailed_meth = NULL;
9823 static jclass LDKSendError_BlindedPathAdvanceFailed_class = NULL;
9824 static jmethodID LDKSendError_BlindedPathAdvanceFailed_meth = NULL;
9825 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSendError_init (JNIEnv *env, jclass clz) {
9826 LDKSendError_Secp256k1_class =
9827 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$Secp256k1"));
9828 CHECK(LDKSendError_Secp256k1_class != NULL);
9829 LDKSendError_Secp256k1_meth = (*env)->GetMethodID(env, LDKSendError_Secp256k1_class, "<init>", "(Lorg/ldk/enums/Secp256k1Error;)V");
9830 CHECK(LDKSendError_Secp256k1_meth != NULL);
9831 LDKSendError_TooBigPacket_class =
9832 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$TooBigPacket"));
9833 CHECK(LDKSendError_TooBigPacket_class != NULL);
9834 LDKSendError_TooBigPacket_meth = (*env)->GetMethodID(env, LDKSendError_TooBigPacket_class, "<init>", "()V");
9835 CHECK(LDKSendError_TooBigPacket_meth != NULL);
9836 LDKSendError_TooFewBlindedHops_class =
9837 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$TooFewBlindedHops"));
9838 CHECK(LDKSendError_TooFewBlindedHops_class != NULL);
9839 LDKSendError_TooFewBlindedHops_meth = (*env)->GetMethodID(env, LDKSendError_TooFewBlindedHops_class, "<init>", "()V");
9840 CHECK(LDKSendError_TooFewBlindedHops_meth != NULL);
9841 LDKSendError_InvalidFirstHop_class =
9842 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$InvalidFirstHop"));
9843 CHECK(LDKSendError_InvalidFirstHop_class != NULL);
9844 LDKSendError_InvalidFirstHop_meth = (*env)->GetMethodID(env, LDKSendError_InvalidFirstHop_class, "<init>", "()V");
9845 CHECK(LDKSendError_InvalidFirstHop_meth != NULL);
9846 LDKSendError_InvalidMessage_class =
9847 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$InvalidMessage"));
9848 CHECK(LDKSendError_InvalidMessage_class != NULL);
9849 LDKSendError_InvalidMessage_meth = (*env)->GetMethodID(env, LDKSendError_InvalidMessage_class, "<init>", "()V");
9850 CHECK(LDKSendError_InvalidMessage_meth != NULL);
9851 LDKSendError_BufferFull_class =
9852 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$BufferFull"));
9853 CHECK(LDKSendError_BufferFull_class != NULL);
9854 LDKSendError_BufferFull_meth = (*env)->GetMethodID(env, LDKSendError_BufferFull_class, "<init>", "()V");
9855 CHECK(LDKSendError_BufferFull_meth != NULL);
9856 LDKSendError_GetNodeIdFailed_class =
9857 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$GetNodeIdFailed"));
9858 CHECK(LDKSendError_GetNodeIdFailed_class != NULL);
9859 LDKSendError_GetNodeIdFailed_meth = (*env)->GetMethodID(env, LDKSendError_GetNodeIdFailed_class, "<init>", "()V");
9860 CHECK(LDKSendError_GetNodeIdFailed_meth != NULL);
9861 LDKSendError_BlindedPathAdvanceFailed_class =
9862 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$BlindedPathAdvanceFailed"));
9863 CHECK(LDKSendError_BlindedPathAdvanceFailed_class != NULL);
9864 LDKSendError_BlindedPathAdvanceFailed_meth = (*env)->GetMethodID(env, LDKSendError_BlindedPathAdvanceFailed_class, "<init>", "()V");
9865 CHECK(LDKSendError_BlindedPathAdvanceFailed_meth != NULL);
9867 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSendError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9868 LDKSendError *obj = (LDKSendError*)untag_ptr(ptr);
9870 case LDKSendError_Secp256k1: {
9871 jclass secp256k1_conv = LDKSecp256k1Error_to_java(env, obj->secp256k1);
9872 return (*env)->NewObject(env, LDKSendError_Secp256k1_class, LDKSendError_Secp256k1_meth, secp256k1_conv);
9874 case LDKSendError_TooBigPacket: {
9875 return (*env)->NewObject(env, LDKSendError_TooBigPacket_class, LDKSendError_TooBigPacket_meth);
9877 case LDKSendError_TooFewBlindedHops: {
9878 return (*env)->NewObject(env, LDKSendError_TooFewBlindedHops_class, LDKSendError_TooFewBlindedHops_meth);
9880 case LDKSendError_InvalidFirstHop: {
9881 return (*env)->NewObject(env, LDKSendError_InvalidFirstHop_class, LDKSendError_InvalidFirstHop_meth);
9883 case LDKSendError_InvalidMessage: {
9884 return (*env)->NewObject(env, LDKSendError_InvalidMessage_class, LDKSendError_InvalidMessage_meth);
9886 case LDKSendError_BufferFull: {
9887 return (*env)->NewObject(env, LDKSendError_BufferFull_class, LDKSendError_BufferFull_meth);
9889 case LDKSendError_GetNodeIdFailed: {
9890 return (*env)->NewObject(env, LDKSendError_GetNodeIdFailed_class, LDKSendError_GetNodeIdFailed_meth);
9892 case LDKSendError_BlindedPathAdvanceFailed: {
9893 return (*env)->NewObject(env, LDKSendError_BlindedPathAdvanceFailed_class, LDKSendError_BlindedPathAdvanceFailed_meth);
9898 static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
9899 CHECK(owner->result_ok);
9900 return *owner->contents.result;
9902 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9903 LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
9904 CResult_NoneSendErrorZ_get_ok(owner_conv);
9907 static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
9908 CHECK(!owner->result_ok);
9909 return SendError_clone(&*owner->contents.err);
9911 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9912 LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
9913 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
9914 *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv);
9915 int64_t ret_ref = tag_ptr(ret_copy, true);
9919 static jclass LDKParseError_Bech32Error_class = NULL;
9920 static jmethodID LDKParseError_Bech32Error_meth = NULL;
9921 static jclass LDKParseError_ParseAmountError_class = NULL;
9922 static jmethodID LDKParseError_ParseAmountError_meth = NULL;
9923 static jclass LDKParseError_MalformedSignature_class = NULL;
9924 static jmethodID LDKParseError_MalformedSignature_meth = NULL;
9925 static jclass LDKParseError_BadPrefix_class = NULL;
9926 static jmethodID LDKParseError_BadPrefix_meth = NULL;
9927 static jclass LDKParseError_UnknownCurrency_class = NULL;
9928 static jmethodID LDKParseError_UnknownCurrency_meth = NULL;
9929 static jclass LDKParseError_UnknownSiPrefix_class = NULL;
9930 static jmethodID LDKParseError_UnknownSiPrefix_meth = NULL;
9931 static jclass LDKParseError_MalformedHRP_class = NULL;
9932 static jmethodID LDKParseError_MalformedHRP_meth = NULL;
9933 static jclass LDKParseError_TooShortDataPart_class = NULL;
9934 static jmethodID LDKParseError_TooShortDataPart_meth = NULL;
9935 static jclass LDKParseError_UnexpectedEndOfTaggedFields_class = NULL;
9936 static jmethodID LDKParseError_UnexpectedEndOfTaggedFields_meth = NULL;
9937 static jclass LDKParseError_DescriptionDecodeError_class = NULL;
9938 static jmethodID LDKParseError_DescriptionDecodeError_meth = NULL;
9939 static jclass LDKParseError_PaddingError_class = NULL;
9940 static jmethodID LDKParseError_PaddingError_meth = NULL;
9941 static jclass LDKParseError_IntegerOverflowError_class = NULL;
9942 static jmethodID LDKParseError_IntegerOverflowError_meth = NULL;
9943 static jclass LDKParseError_InvalidSegWitProgramLength_class = NULL;
9944 static jmethodID LDKParseError_InvalidSegWitProgramLength_meth = NULL;
9945 static jclass LDKParseError_InvalidPubKeyHashLength_class = NULL;
9946 static jmethodID LDKParseError_InvalidPubKeyHashLength_meth = NULL;
9947 static jclass LDKParseError_InvalidScriptHashLength_class = NULL;
9948 static jmethodID LDKParseError_InvalidScriptHashLength_meth = NULL;
9949 static jclass LDKParseError_InvalidRecoveryId_class = NULL;
9950 static jmethodID LDKParseError_InvalidRecoveryId_meth = NULL;
9951 static jclass LDKParseError_InvalidSliceLength_class = NULL;
9952 static jmethodID LDKParseError_InvalidSliceLength_meth = NULL;
9953 static jclass LDKParseError_Skip_class = NULL;
9954 static jmethodID LDKParseError_Skip_meth = NULL;
9955 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseError_init (JNIEnv *env, jclass clz) {
9956 LDKParseError_Bech32Error_class =
9957 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Bech32Error"));
9958 CHECK(LDKParseError_Bech32Error_class != NULL);
9959 LDKParseError_Bech32Error_meth = (*env)->GetMethodID(env, LDKParseError_Bech32Error_class, "<init>", "(J)V");
9960 CHECK(LDKParseError_Bech32Error_meth != NULL);
9961 LDKParseError_ParseAmountError_class =
9962 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$ParseAmountError"));
9963 CHECK(LDKParseError_ParseAmountError_class != NULL);
9964 LDKParseError_ParseAmountError_meth = (*env)->GetMethodID(env, LDKParseError_ParseAmountError_class, "<init>", "(I)V");
9965 CHECK(LDKParseError_ParseAmountError_meth != NULL);
9966 LDKParseError_MalformedSignature_class =
9967 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedSignature"));
9968 CHECK(LDKParseError_MalformedSignature_class != NULL);
9969 LDKParseError_MalformedSignature_meth = (*env)->GetMethodID(env, LDKParseError_MalformedSignature_class, "<init>", "(Lorg/ldk/enums/Secp256k1Error;)V");
9970 CHECK(LDKParseError_MalformedSignature_meth != NULL);
9971 LDKParseError_BadPrefix_class =
9972 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$BadPrefix"));
9973 CHECK(LDKParseError_BadPrefix_class != NULL);
9974 LDKParseError_BadPrefix_meth = (*env)->GetMethodID(env, LDKParseError_BadPrefix_class, "<init>", "()V");
9975 CHECK(LDKParseError_BadPrefix_meth != NULL);
9976 LDKParseError_UnknownCurrency_class =
9977 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownCurrency"));
9978 CHECK(LDKParseError_UnknownCurrency_class != NULL);
9979 LDKParseError_UnknownCurrency_meth = (*env)->GetMethodID(env, LDKParseError_UnknownCurrency_class, "<init>", "()V");
9980 CHECK(LDKParseError_UnknownCurrency_meth != NULL);
9981 LDKParseError_UnknownSiPrefix_class =
9982 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownSiPrefix"));
9983 CHECK(LDKParseError_UnknownSiPrefix_class != NULL);
9984 LDKParseError_UnknownSiPrefix_meth = (*env)->GetMethodID(env, LDKParseError_UnknownSiPrefix_class, "<init>", "()V");
9985 CHECK(LDKParseError_UnknownSiPrefix_meth != NULL);
9986 LDKParseError_MalformedHRP_class =
9987 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedHRP"));
9988 CHECK(LDKParseError_MalformedHRP_class != NULL);
9989 LDKParseError_MalformedHRP_meth = (*env)->GetMethodID(env, LDKParseError_MalformedHRP_class, "<init>", "()V");
9990 CHECK(LDKParseError_MalformedHRP_meth != NULL);
9991 LDKParseError_TooShortDataPart_class =
9992 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$TooShortDataPart"));
9993 CHECK(LDKParseError_TooShortDataPart_class != NULL);
9994 LDKParseError_TooShortDataPart_meth = (*env)->GetMethodID(env, LDKParseError_TooShortDataPart_class, "<init>", "()V");
9995 CHECK(LDKParseError_TooShortDataPart_meth != NULL);
9996 LDKParseError_UnexpectedEndOfTaggedFields_class =
9997 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnexpectedEndOfTaggedFields"));
9998 CHECK(LDKParseError_UnexpectedEndOfTaggedFields_class != NULL);
9999 LDKParseError_UnexpectedEndOfTaggedFields_meth = (*env)->GetMethodID(env, LDKParseError_UnexpectedEndOfTaggedFields_class, "<init>", "()V");
10000 CHECK(LDKParseError_UnexpectedEndOfTaggedFields_meth != NULL);
10001 LDKParseError_DescriptionDecodeError_class =
10002 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$DescriptionDecodeError"));
10003 CHECK(LDKParseError_DescriptionDecodeError_class != NULL);
10004 LDKParseError_DescriptionDecodeError_meth = (*env)->GetMethodID(env, LDKParseError_DescriptionDecodeError_class, "<init>", "(I)V");
10005 CHECK(LDKParseError_DescriptionDecodeError_meth != NULL);
10006 LDKParseError_PaddingError_class =
10007 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$PaddingError"));
10008 CHECK(LDKParseError_PaddingError_class != NULL);
10009 LDKParseError_PaddingError_meth = (*env)->GetMethodID(env, LDKParseError_PaddingError_class, "<init>", "()V");
10010 CHECK(LDKParseError_PaddingError_meth != NULL);
10011 LDKParseError_IntegerOverflowError_class =
10012 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$IntegerOverflowError"));
10013 CHECK(LDKParseError_IntegerOverflowError_class != NULL);
10014 LDKParseError_IntegerOverflowError_meth = (*env)->GetMethodID(env, LDKParseError_IntegerOverflowError_class, "<init>", "()V");
10015 CHECK(LDKParseError_IntegerOverflowError_meth != NULL);
10016 LDKParseError_InvalidSegWitProgramLength_class =
10017 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSegWitProgramLength"));
10018 CHECK(LDKParseError_InvalidSegWitProgramLength_class != NULL);
10019 LDKParseError_InvalidSegWitProgramLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSegWitProgramLength_class, "<init>", "()V");
10020 CHECK(LDKParseError_InvalidSegWitProgramLength_meth != NULL);
10021 LDKParseError_InvalidPubKeyHashLength_class =
10022 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidPubKeyHashLength"));
10023 CHECK(LDKParseError_InvalidPubKeyHashLength_class != NULL);
10024 LDKParseError_InvalidPubKeyHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidPubKeyHashLength_class, "<init>", "()V");
10025 CHECK(LDKParseError_InvalidPubKeyHashLength_meth != NULL);
10026 LDKParseError_InvalidScriptHashLength_class =
10027 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidScriptHashLength"));
10028 CHECK(LDKParseError_InvalidScriptHashLength_class != NULL);
10029 LDKParseError_InvalidScriptHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidScriptHashLength_class, "<init>", "()V");
10030 CHECK(LDKParseError_InvalidScriptHashLength_meth != NULL);
10031 LDKParseError_InvalidRecoveryId_class =
10032 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidRecoveryId"));
10033 CHECK(LDKParseError_InvalidRecoveryId_class != NULL);
10034 LDKParseError_InvalidRecoveryId_meth = (*env)->GetMethodID(env, LDKParseError_InvalidRecoveryId_class, "<init>", "()V");
10035 CHECK(LDKParseError_InvalidRecoveryId_meth != NULL);
10036 LDKParseError_InvalidSliceLength_class =
10037 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSliceLength"));
10038 CHECK(LDKParseError_InvalidSliceLength_class != NULL);
10039 LDKParseError_InvalidSliceLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSliceLength_class, "<init>", "(Ljava/lang/String;)V");
10040 CHECK(LDKParseError_InvalidSliceLength_meth != NULL);
10041 LDKParseError_Skip_class =
10042 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Skip"));
10043 CHECK(LDKParseError_Skip_class != NULL);
10044 LDKParseError_Skip_meth = (*env)->GetMethodID(env, LDKParseError_Skip_class, "<init>", "()V");
10045 CHECK(LDKParseError_Skip_meth != NULL);
10047 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
10048 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
10050 case LDKParseError_Bech32Error: {
10051 int64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
10052 return (*env)->NewObject(env, LDKParseError_Bech32Error_class, LDKParseError_Bech32Error_meth, bech32_error_ref);
10054 case LDKParseError_ParseAmountError: {
10055 /*obj->parse_amount_error*/
10056 return (*env)->NewObject(env, LDKParseError_ParseAmountError_class, LDKParseError_ParseAmountError_meth, 0);
10058 case LDKParseError_MalformedSignature: {
10059 jclass malformed_signature_conv = LDKSecp256k1Error_to_java(env, obj->malformed_signature);
10060 return (*env)->NewObject(env, LDKParseError_MalformedSignature_class, LDKParseError_MalformedSignature_meth, malformed_signature_conv);
10062 case LDKParseError_BadPrefix: {
10063 return (*env)->NewObject(env, LDKParseError_BadPrefix_class, LDKParseError_BadPrefix_meth);
10065 case LDKParseError_UnknownCurrency: {
10066 return (*env)->NewObject(env, LDKParseError_UnknownCurrency_class, LDKParseError_UnknownCurrency_meth);
10068 case LDKParseError_UnknownSiPrefix: {
10069 return (*env)->NewObject(env, LDKParseError_UnknownSiPrefix_class, LDKParseError_UnknownSiPrefix_meth);
10071 case LDKParseError_MalformedHRP: {
10072 return (*env)->NewObject(env, LDKParseError_MalformedHRP_class, LDKParseError_MalformedHRP_meth);
10074 case LDKParseError_TooShortDataPart: {
10075 return (*env)->NewObject(env, LDKParseError_TooShortDataPart_class, LDKParseError_TooShortDataPart_meth);
10077 case LDKParseError_UnexpectedEndOfTaggedFields: {
10078 return (*env)->NewObject(env, LDKParseError_UnexpectedEndOfTaggedFields_class, LDKParseError_UnexpectedEndOfTaggedFields_meth);
10080 case LDKParseError_DescriptionDecodeError: {
10081 /*obj->description_decode_error*/
10082 return (*env)->NewObject(env, LDKParseError_DescriptionDecodeError_class, LDKParseError_DescriptionDecodeError_meth, 0);
10084 case LDKParseError_PaddingError: {
10085 return (*env)->NewObject(env, LDKParseError_PaddingError_class, LDKParseError_PaddingError_meth);
10087 case LDKParseError_IntegerOverflowError: {
10088 return (*env)->NewObject(env, LDKParseError_IntegerOverflowError_class, LDKParseError_IntegerOverflowError_meth);
10090 case LDKParseError_InvalidSegWitProgramLength: {
10091 return (*env)->NewObject(env, LDKParseError_InvalidSegWitProgramLength_class, LDKParseError_InvalidSegWitProgramLength_meth);
10093 case LDKParseError_InvalidPubKeyHashLength: {
10094 return (*env)->NewObject(env, LDKParseError_InvalidPubKeyHashLength_class, LDKParseError_InvalidPubKeyHashLength_meth);
10096 case LDKParseError_InvalidScriptHashLength: {
10097 return (*env)->NewObject(env, LDKParseError_InvalidScriptHashLength_class, LDKParseError_InvalidScriptHashLength_meth);
10099 case LDKParseError_InvalidRecoveryId: {
10100 return (*env)->NewObject(env, LDKParseError_InvalidRecoveryId_class, LDKParseError_InvalidRecoveryId_meth);
10102 case LDKParseError_InvalidSliceLength: {
10103 LDKStr invalid_slice_length_str = obj->invalid_slice_length;
10104 jstring invalid_slice_length_conv = str_ref_to_java(env, invalid_slice_length_str.chars, invalid_slice_length_str.len);
10105 return (*env)->NewObject(env, LDKParseError_InvalidSliceLength_class, LDKParseError_InvalidSliceLength_meth, invalid_slice_length_conv);
10107 case LDKParseError_Skip: {
10108 return (*env)->NewObject(env, LDKParseError_Skip_class, LDKParseError_Skip_meth);
10113 static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
10114 CHECK(owner->result_ok);
10115 return SiPrefix_clone(&*owner->contents.result);
10117 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10118 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
10119 jclass ret_conv = LDKSiPrefix_to_java(env, CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
10123 static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
10124 CHECK(!owner->result_ok);
10125 return ParseError_clone(&*owner->contents.err);
10127 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10128 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
10129 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
10130 *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
10131 int64_t ret_ref = tag_ptr(ret_copy, true);
10135 static jclass LDKParseOrSemanticError_ParseError_class = NULL;
10136 static jmethodID LDKParseOrSemanticError_ParseError_meth = NULL;
10137 static jclass LDKParseOrSemanticError_SemanticError_class = NULL;
10138 static jmethodID LDKParseOrSemanticError_SemanticError_meth = NULL;
10139 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseOrSemanticError_init (JNIEnv *env, jclass clz) {
10140 LDKParseOrSemanticError_ParseError_class =
10141 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$ParseError"));
10142 CHECK(LDKParseOrSemanticError_ParseError_class != NULL);
10143 LDKParseOrSemanticError_ParseError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_ParseError_class, "<init>", "(J)V");
10144 CHECK(LDKParseOrSemanticError_ParseError_meth != NULL);
10145 LDKParseOrSemanticError_SemanticError_class =
10146 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$SemanticError"));
10147 CHECK(LDKParseOrSemanticError_SemanticError_class != NULL);
10148 LDKParseOrSemanticError_SemanticError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_SemanticError_class, "<init>", "(Lorg/ldk/enums/SemanticError;)V");
10149 CHECK(LDKParseOrSemanticError_SemanticError_meth != NULL);
10151 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
10152 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
10154 case LDKParseOrSemanticError_ParseError: {
10155 int64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
10156 return (*env)->NewObject(env, LDKParseOrSemanticError_ParseError_class, LDKParseOrSemanticError_ParseError_meth, parse_error_ref);
10158 case LDKParseOrSemanticError_SemanticError: {
10159 jclass semantic_error_conv = LDKSemanticError_to_java(env, obj->semantic_error);
10160 return (*env)->NewObject(env, LDKParseOrSemanticError_SemanticError_class, LDKParseOrSemanticError_SemanticError_meth, semantic_error_conv);
10165 static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
10166 LDKInvoice ret = *owner->contents.result;
10167 ret.is_owned = false;
10170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10171 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
10172 LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
10173 int64_t ret_ref = 0;
10174 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10175 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10179 static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
10180 CHECK(!owner->result_ok);
10181 return ParseOrSemanticError_clone(&*owner->contents.err);
10183 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10184 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
10185 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
10186 *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
10187 int64_t ret_ref = tag_ptr(ret_copy, true);
10191 static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
10192 LDKSignedRawInvoice ret = *owner->contents.result;
10193 ret.is_owned = false;
10196 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10197 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
10198 LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
10199 int64_t ret_ref = 0;
10200 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10201 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10205 static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
10206 CHECK(!owner->result_ok);
10207 return ParseError_clone(&*owner->contents.err);
10209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10210 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
10211 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
10212 *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
10213 int64_t ret_ref = tag_ptr(ret_copy, true);
10217 static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
10218 LDKRawInvoice ret = owner->a;
10219 ret.is_owned = false;
10222 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
10223 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
10224 LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
10225 int64_t ret_ref = 0;
10226 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10227 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10231 static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
10232 return ThirtyTwoBytes_clone(&owner->b);
10234 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
10235 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
10236 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
10237 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data);
10241 static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
10242 LDKInvoiceSignature ret = owner->c;
10243 ret.is_owned = false;
10246 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
10247 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
10248 LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
10249 int64_t ret_ref = 0;
10250 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10251 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10255 static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
10256 LDKPayeePubKey ret = *owner->contents.result;
10257 ret.is_owned = false;
10260 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10261 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
10262 LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
10263 int64_t ret_ref = 0;
10264 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10265 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10269 static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
10270 CHECK(!owner->result_ok);
10271 return *owner->contents.err;
10273 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10274 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
10275 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PayeePubKeyErrorZ_get_err(owner_conv));
10279 static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
10280 LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
10281 for (size_t i = 0; i < ret.datalen; i++) {
10282 ret.data[i] = PrivateRoute_clone(&orig->data[i]);
10286 static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
10287 LDKPositiveTimestamp ret = *owner->contents.result;
10288 ret.is_owned = false;
10291 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10292 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
10293 LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
10294 int64_t ret_ref = 0;
10295 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10296 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10300 static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
10301 CHECK(!owner->result_ok);
10302 return CreationError_clone(&*owner->contents.err);
10304 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10305 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
10306 jclass ret_conv = LDKCreationError_to_java(env, CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
10310 static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
10311 CHECK(owner->result_ok);
10312 return *owner->contents.result;
10314 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10315 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
10316 CResult_NoneSemanticErrorZ_get_ok(owner_conv);
10319 static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
10320 CHECK(!owner->result_ok);
10321 return SemanticError_clone(&*owner->contents.err);
10323 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10324 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
10325 jclass ret_conv = LDKSemanticError_to_java(env, CResult_NoneSemanticErrorZ_get_err(owner_conv));
10329 static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
10330 LDKInvoice ret = *owner->contents.result;
10331 ret.is_owned = false;
10334 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10335 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
10336 LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
10337 int64_t ret_ref = 0;
10338 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10339 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10343 static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
10344 CHECK(!owner->result_ok);
10345 return SemanticError_clone(&*owner->contents.err);
10347 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10348 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
10349 jclass ret_conv = LDKSemanticError_to_java(env, CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
10353 static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
10354 LDKDescription ret = *owner->contents.result;
10355 ret.is_owned = false;
10358 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10359 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
10360 LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
10361 int64_t ret_ref = 0;
10362 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10363 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10367 static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
10368 CHECK(!owner->result_ok);
10369 return CreationError_clone(&*owner->contents.err);
10371 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10372 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
10373 jclass ret_conv = LDKCreationError_to_java(env, CResult_DescriptionCreationErrorZ_get_err(owner_conv));
10377 static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
10378 LDKPrivateRoute ret = *owner->contents.result;
10379 ret.is_owned = false;
10382 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10383 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
10384 LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
10385 int64_t ret_ref = 0;
10386 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10387 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10391 static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
10392 CHECK(!owner->result_ok);
10393 return CreationError_clone(&*owner->contents.err);
10395 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10396 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
10397 jclass ret_conv = LDKCreationError_to_java(env, CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
10401 static jclass LDKGraphSyncError_DecodeError_class = NULL;
10402 static jmethodID LDKGraphSyncError_DecodeError_meth = NULL;
10403 static jclass LDKGraphSyncError_LightningError_class = NULL;
10404 static jmethodID LDKGraphSyncError_LightningError_meth = NULL;
10405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGraphSyncError_init (JNIEnv *env, jclass clz) {
10406 LDKGraphSyncError_DecodeError_class =
10407 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$DecodeError"));
10408 CHECK(LDKGraphSyncError_DecodeError_class != NULL);
10409 LDKGraphSyncError_DecodeError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_DecodeError_class, "<init>", "(J)V");
10410 CHECK(LDKGraphSyncError_DecodeError_meth != NULL);
10411 LDKGraphSyncError_LightningError_class =
10412 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$LightningError"));
10413 CHECK(LDKGraphSyncError_LightningError_class != NULL);
10414 LDKGraphSyncError_LightningError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_LightningError_class, "<init>", "(J)V");
10415 CHECK(LDKGraphSyncError_LightningError_meth != NULL);
10417 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
10418 LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
10420 case LDKGraphSyncError_DecodeError: {
10421 int64_t decode_error_ref = tag_ptr(&obj->decode_error, false);
10422 return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref);
10424 case LDKGraphSyncError_LightningError: {
10425 LDKLightningError lightning_error_var = obj->lightning_error;
10426 int64_t lightning_error_ref = 0;
10427 CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var);
10428 lightning_error_ref = tag_ptr(lightning_error_var.inner, false);
10429 return (*env)->NewObject(env, LDKGraphSyncError_LightningError_class, LDKGraphSyncError_LightningError_meth, lightning_error_ref);
10434 static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
10435 CHECK(owner->result_ok);
10436 return *owner->contents.result;
10438 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10439 LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
10440 int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv);
10444 static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
10445 CHECK(!owner->result_ok);
10446 return GraphSyncError_clone(&*owner->contents.err);
10448 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10449 LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
10450 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
10451 *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv);
10452 int64_t ret_ref = tag_ptr(ret_copy, true);
10456 static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
10457 CHECK(owner->result_ok);
10458 return NetAddress_clone(&*owner->contents.result);
10460 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10461 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
10462 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
10463 *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
10464 int64_t ret_ref = tag_ptr(ret_copy, true);
10468 static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
10469 CHECK(!owner->result_ok);
10470 return DecodeError_clone(&*owner->contents.err);
10472 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10473 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
10474 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10475 *ret_copy = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
10476 int64_t ret_ref = tag_ptr(ret_copy, true);
10480 static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
10481 LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
10482 for (size_t i = 0; i < ret.datalen; i++) {
10483 ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
10487 static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
10488 LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
10489 for (size_t i = 0; i < ret.datalen; i++) {
10490 ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
10494 static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
10495 LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
10496 for (size_t i = 0; i < ret.datalen; i++) {
10497 ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
10501 static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
10502 LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
10503 for (size_t i = 0; i < ret.datalen; i++) {
10504 ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
10508 static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
10509 LDKAcceptChannel ret = *owner->contents.result;
10510 ret.is_owned = false;
10513 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10514 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
10515 LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv);
10516 int64_t ret_ref = 0;
10517 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10518 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10522 static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
10523 CHECK(!owner->result_ok);
10524 return DecodeError_clone(&*owner->contents.err);
10526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10527 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
10528 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10529 *ret_copy = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
10530 int64_t ret_ref = tag_ptr(ret_copy, true);
10534 static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
10535 LDKAnnouncementSignatures ret = *owner->contents.result;
10536 ret.is_owned = false;
10539 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10540 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
10541 LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
10542 int64_t ret_ref = 0;
10543 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10544 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10548 static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
10549 CHECK(!owner->result_ok);
10550 return DecodeError_clone(&*owner->contents.err);
10552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10553 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
10554 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10555 *ret_copy = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
10556 int64_t ret_ref = tag_ptr(ret_copy, true);
10560 static inline struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
10561 LDKChannelReestablish ret = *owner->contents.result;
10562 ret.is_owned = false;
10565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10566 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
10567 LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv);
10568 int64_t ret_ref = 0;
10569 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10570 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10574 static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
10575 CHECK(!owner->result_ok);
10576 return DecodeError_clone(&*owner->contents.err);
10578 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10579 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
10580 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10581 *ret_copy = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
10582 int64_t ret_ref = tag_ptr(ret_copy, true);
10586 static inline struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
10587 LDKClosingSigned ret = *owner->contents.result;
10588 ret.is_owned = false;
10591 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10592 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
10593 LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv);
10594 int64_t ret_ref = 0;
10595 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10596 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10600 static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
10601 CHECK(!owner->result_ok);
10602 return DecodeError_clone(&*owner->contents.err);
10604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10605 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
10606 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10607 *ret_copy = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
10608 int64_t ret_ref = tag_ptr(ret_copy, true);
10612 static inline struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
10613 LDKClosingSignedFeeRange ret = *owner->contents.result;
10614 ret.is_owned = false;
10617 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10618 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
10619 LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv);
10620 int64_t ret_ref = 0;
10621 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10622 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10626 static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
10627 CHECK(!owner->result_ok);
10628 return DecodeError_clone(&*owner->contents.err);
10630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10631 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
10632 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10633 *ret_copy = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
10634 int64_t ret_ref = tag_ptr(ret_copy, true);
10638 static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
10639 LDKCommitmentSigned ret = *owner->contents.result;
10640 ret.is_owned = false;
10643 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10644 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
10645 LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv);
10646 int64_t ret_ref = 0;
10647 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10648 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10652 static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
10653 CHECK(!owner->result_ok);
10654 return DecodeError_clone(&*owner->contents.err);
10656 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10657 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
10658 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10659 *ret_copy = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
10660 int64_t ret_ref = tag_ptr(ret_copy, true);
10664 static inline struct LDKFundingCreated CResult_FundingCreatedDecodeErrorZ_get_ok(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
10665 LDKFundingCreated ret = *owner->contents.result;
10666 ret.is_owned = false;
10669 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10670 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
10671 LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv);
10672 int64_t ret_ref = 0;
10673 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10674 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10678 static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
10679 CHECK(!owner->result_ok);
10680 return DecodeError_clone(&*owner->contents.err);
10682 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10683 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
10684 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10685 *ret_copy = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
10686 int64_t ret_ref = tag_ptr(ret_copy, true);
10690 static inline struct LDKFundingSigned CResult_FundingSignedDecodeErrorZ_get_ok(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
10691 LDKFundingSigned ret = *owner->contents.result;
10692 ret.is_owned = false;
10695 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10696 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
10697 LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv);
10698 int64_t ret_ref = 0;
10699 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10700 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10704 static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
10705 CHECK(!owner->result_ok);
10706 return DecodeError_clone(&*owner->contents.err);
10708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10709 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
10710 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10711 *ret_copy = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
10712 int64_t ret_ref = tag_ptr(ret_copy, true);
10716 static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
10717 LDKChannelReady ret = *owner->contents.result;
10718 ret.is_owned = false;
10721 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10722 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
10723 LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv);
10724 int64_t ret_ref = 0;
10725 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10726 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10730 static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
10731 CHECK(!owner->result_ok);
10732 return DecodeError_clone(&*owner->contents.err);
10734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10735 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
10736 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10737 *ret_copy = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
10738 int64_t ret_ref = tag_ptr(ret_copy, true);
10742 static inline struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
10743 LDKInit ret = *owner->contents.result;
10744 ret.is_owned = false;
10747 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10748 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
10749 LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv);
10750 int64_t ret_ref = 0;
10751 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10752 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10756 static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
10757 CHECK(!owner->result_ok);
10758 return DecodeError_clone(&*owner->contents.err);
10760 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10761 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
10762 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10763 *ret_copy = CResult_InitDecodeErrorZ_get_err(owner_conv);
10764 int64_t ret_ref = tag_ptr(ret_copy, true);
10768 static inline struct LDKOpenChannel CResult_OpenChannelDecodeErrorZ_get_ok(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
10769 LDKOpenChannel ret = *owner->contents.result;
10770 ret.is_owned = false;
10773 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10774 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
10775 LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_get_ok(owner_conv);
10776 int64_t ret_ref = 0;
10777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10782 static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
10783 CHECK(!owner->result_ok);
10784 return DecodeError_clone(&*owner->contents.err);
10786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10787 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
10788 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10789 *ret_copy = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
10790 int64_t ret_ref = tag_ptr(ret_copy, true);
10794 static inline struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
10795 LDKRevokeAndACK ret = *owner->contents.result;
10796 ret.is_owned = false;
10799 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10800 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
10801 LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_get_ok(owner_conv);
10802 int64_t ret_ref = 0;
10803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10808 static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
10809 CHECK(!owner->result_ok);
10810 return DecodeError_clone(&*owner->contents.err);
10812 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10813 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
10814 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10815 *ret_copy = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
10816 int64_t ret_ref = tag_ptr(ret_copy, true);
10820 static inline struct LDKShutdown CResult_ShutdownDecodeErrorZ_get_ok(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
10821 LDKShutdown ret = *owner->contents.result;
10822 ret.is_owned = false;
10825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10826 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
10827 LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv);
10828 int64_t ret_ref = 0;
10829 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10830 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10834 static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
10835 CHECK(!owner->result_ok);
10836 return DecodeError_clone(&*owner->contents.err);
10838 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10839 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
10840 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10841 *ret_copy = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
10842 int64_t ret_ref = tag_ptr(ret_copy, true);
10846 static inline struct LDKUpdateFailHTLC CResult_UpdateFailHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
10847 LDKUpdateFailHTLC ret = *owner->contents.result;
10848 ret.is_owned = false;
10851 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10852 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
10853 LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv);
10854 int64_t ret_ref = 0;
10855 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10856 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10860 static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
10861 CHECK(!owner->result_ok);
10862 return DecodeError_clone(&*owner->contents.err);
10864 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10865 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
10866 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10867 *ret_copy = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
10868 int64_t ret_ref = tag_ptr(ret_copy, true);
10872 static inline struct LDKUpdateFailMalformedHTLC CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
10873 LDKUpdateFailMalformedHTLC ret = *owner->contents.result;
10874 ret.is_owned = false;
10877 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10878 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
10879 LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv);
10880 int64_t ret_ref = 0;
10881 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10882 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10886 static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
10887 CHECK(!owner->result_ok);
10888 return DecodeError_clone(&*owner->contents.err);
10890 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10891 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
10892 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10893 *ret_copy = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
10894 int64_t ret_ref = tag_ptr(ret_copy, true);
10898 static inline struct LDKUpdateFee CResult_UpdateFeeDecodeErrorZ_get_ok(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
10899 LDKUpdateFee ret = *owner->contents.result;
10900 ret.is_owned = false;
10903 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10904 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
10905 LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv);
10906 int64_t ret_ref = 0;
10907 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10908 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10912 static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
10913 CHECK(!owner->result_ok);
10914 return DecodeError_clone(&*owner->contents.err);
10916 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10917 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
10918 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10919 *ret_copy = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
10920 int64_t ret_ref = tag_ptr(ret_copy, true);
10924 static inline struct LDKUpdateFulfillHTLC CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
10925 LDKUpdateFulfillHTLC ret = *owner->contents.result;
10926 ret.is_owned = false;
10929 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10930 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
10931 LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv);
10932 int64_t ret_ref = 0;
10933 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10934 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10938 static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
10939 CHECK(!owner->result_ok);
10940 return DecodeError_clone(&*owner->contents.err);
10942 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10943 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
10944 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10945 *ret_copy = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
10946 int64_t ret_ref = tag_ptr(ret_copy, true);
10950 static inline struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
10951 LDKUpdateAddHTLC ret = *owner->contents.result;
10952 ret.is_owned = false;
10955 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10956 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
10957 LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner_conv);
10958 int64_t ret_ref = 0;
10959 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10960 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10964 static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
10965 CHECK(!owner->result_ok);
10966 return DecodeError_clone(&*owner->contents.err);
10968 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10969 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
10970 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10971 *ret_copy = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
10972 int64_t ret_ref = tag_ptr(ret_copy, true);
10976 static inline struct LDKOnionMessage CResult_OnionMessageDecodeErrorZ_get_ok(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
10977 LDKOnionMessage ret = *owner->contents.result;
10978 ret.is_owned = false;
10981 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10982 LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
10983 LDKOnionMessage ret_var = CResult_OnionMessageDecodeErrorZ_get_ok(owner_conv);
10984 int64_t ret_ref = 0;
10985 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10986 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10990 static inline struct LDKDecodeError CResult_OnionMessageDecodeErrorZ_get_err(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
10991 CHECK(!owner->result_ok);
10992 return DecodeError_clone(&*owner->contents.err);
10994 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10995 LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
10996 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10997 *ret_copy = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv);
10998 int64_t ret_ref = tag_ptr(ret_copy, true);
11002 static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
11003 LDKPing ret = *owner->contents.result;
11004 ret.is_owned = false;
11007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11008 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
11009 LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv);
11010 int64_t ret_ref = 0;
11011 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11012 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11016 static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
11017 CHECK(!owner->result_ok);
11018 return DecodeError_clone(&*owner->contents.err);
11020 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11021 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
11022 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11023 *ret_copy = CResult_PingDecodeErrorZ_get_err(owner_conv);
11024 int64_t ret_ref = tag_ptr(ret_copy, true);
11028 static inline struct LDKPong CResult_PongDecodeErrorZ_get_ok(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
11029 LDKPong ret = *owner->contents.result;
11030 ret.is_owned = false;
11033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11034 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
11035 LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv);
11036 int64_t ret_ref = 0;
11037 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11038 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11042 static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
11043 CHECK(!owner->result_ok);
11044 return DecodeError_clone(&*owner->contents.err);
11046 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11047 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
11048 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11049 *ret_copy = CResult_PongDecodeErrorZ_get_err(owner_conv);
11050 int64_t ret_ref = tag_ptr(ret_copy, true);
11054 static inline struct LDKUnsignedChannelAnnouncement CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11055 LDKUnsignedChannelAnnouncement ret = *owner->contents.result;
11056 ret.is_owned = false;
11059 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11060 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
11061 LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
11062 int64_t ret_ref = 0;
11063 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11064 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11068 static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11069 CHECK(!owner->result_ok);
11070 return DecodeError_clone(&*owner->contents.err);
11072 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11073 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
11074 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11075 *ret_copy = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
11076 int64_t ret_ref = tag_ptr(ret_copy, true);
11080 static inline struct LDKChannelAnnouncement CResult_ChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11081 LDKChannelAnnouncement ret = *owner->contents.result;
11082 ret.is_owned = false;
11085 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11086 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
11087 LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
11088 int64_t ret_ref = 0;
11089 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11090 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11094 static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11095 CHECK(!owner->result_ok);
11096 return DecodeError_clone(&*owner->contents.err);
11098 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11099 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
11100 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11101 *ret_copy = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
11102 int64_t ret_ref = tag_ptr(ret_copy, true);
11106 static inline struct LDKUnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
11107 LDKUnsignedChannelUpdate ret = *owner->contents.result;
11108 ret.is_owned = false;
11111 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11112 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
11113 LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv);
11114 int64_t ret_ref = 0;
11115 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11116 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11120 static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
11121 CHECK(!owner->result_ok);
11122 return DecodeError_clone(&*owner->contents.err);
11124 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11125 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
11126 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11127 *ret_copy = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
11128 int64_t ret_ref = tag_ptr(ret_copy, true);
11132 static inline struct LDKChannelUpdate CResult_ChannelUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
11133 LDKChannelUpdate ret = *owner->contents.result;
11134 ret.is_owned = false;
11137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11138 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
11139 LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_get_ok(owner_conv);
11140 int64_t ret_ref = 0;
11141 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11142 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11146 static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
11147 CHECK(!owner->result_ok);
11148 return DecodeError_clone(&*owner->contents.err);
11150 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11151 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
11152 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11153 *ret_copy = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
11154 int64_t ret_ref = tag_ptr(ret_copy, true);
11158 static inline struct LDKErrorMessage CResult_ErrorMessageDecodeErrorZ_get_ok(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
11159 LDKErrorMessage ret = *owner->contents.result;
11160 ret.is_owned = false;
11163 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11164 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
11165 LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(owner_conv);
11166 int64_t ret_ref = 0;
11167 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11168 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11172 static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
11173 CHECK(!owner->result_ok);
11174 return DecodeError_clone(&*owner->contents.err);
11176 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11177 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
11178 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11179 *ret_copy = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
11180 int64_t ret_ref = tag_ptr(ret_copy, true);
11184 static inline struct LDKWarningMessage CResult_WarningMessageDecodeErrorZ_get_ok(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
11185 LDKWarningMessage ret = *owner->contents.result;
11186 ret.is_owned = false;
11189 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11190 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
11191 LDKWarningMessage ret_var = CResult_WarningMessageDecodeErrorZ_get_ok(owner_conv);
11192 int64_t ret_ref = 0;
11193 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11194 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11198 static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
11199 CHECK(!owner->result_ok);
11200 return DecodeError_clone(&*owner->contents.err);
11202 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11203 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
11204 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11205 *ret_copy = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
11206 int64_t ret_ref = tag_ptr(ret_copy, true);
11210 static inline struct LDKUnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11211 LDKUnsignedNodeAnnouncement ret = *owner->contents.result;
11212 ret.is_owned = false;
11215 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11216 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
11217 LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
11218 int64_t ret_ref = 0;
11219 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11220 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11224 static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11225 CHECK(!owner->result_ok);
11226 return DecodeError_clone(&*owner->contents.err);
11228 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11229 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
11230 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11231 *ret_copy = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
11232 int64_t ret_ref = tag_ptr(ret_copy, true);
11236 static inline struct LDKNodeAnnouncement CResult_NodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11237 LDKNodeAnnouncement ret = *owner->contents.result;
11238 ret.is_owned = false;
11241 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11242 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
11243 LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
11244 int64_t ret_ref = 0;
11245 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11246 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11250 static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11251 CHECK(!owner->result_ok);
11252 return DecodeError_clone(&*owner->contents.err);
11254 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11255 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
11256 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11257 *ret_copy = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
11258 int64_t ret_ref = tag_ptr(ret_copy, true);
11262 static inline struct LDKQueryShortChannelIds CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
11263 LDKQueryShortChannelIds ret = *owner->contents.result;
11264 ret.is_owned = false;
11267 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11268 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
11269 LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv);
11270 int64_t ret_ref = 0;
11271 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11272 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11276 static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
11277 CHECK(!owner->result_ok);
11278 return DecodeError_clone(&*owner->contents.err);
11280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11281 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
11282 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11283 *ret_copy = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
11284 int64_t ret_ref = tag_ptr(ret_copy, true);
11288 static inline struct LDKReplyShortChannelIdsEnd CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
11289 LDKReplyShortChannelIdsEnd ret = *owner->contents.result;
11290 ret.is_owned = false;
11293 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11294 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
11295 LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv);
11296 int64_t ret_ref = 0;
11297 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11298 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11302 static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
11303 CHECK(!owner->result_ok);
11304 return DecodeError_clone(&*owner->contents.err);
11306 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11307 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
11308 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11309 *ret_copy = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
11310 int64_t ret_ref = tag_ptr(ret_copy, true);
11314 static inline struct LDKQueryChannelRange CResult_QueryChannelRangeDecodeErrorZ_get_ok(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
11315 LDKQueryChannelRange ret = *owner->contents.result;
11316 ret.is_owned = false;
11319 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11320 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
11321 LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv);
11322 int64_t ret_ref = 0;
11323 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11324 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11328 static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
11329 CHECK(!owner->result_ok);
11330 return DecodeError_clone(&*owner->contents.err);
11332 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11333 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
11334 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11335 *ret_copy = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
11336 int64_t ret_ref = tag_ptr(ret_copy, true);
11340 static inline struct LDKReplyChannelRange CResult_ReplyChannelRangeDecodeErrorZ_get_ok(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
11341 LDKReplyChannelRange ret = *owner->contents.result;
11342 ret.is_owned = false;
11345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11346 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
11347 LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner_conv);
11348 int64_t ret_ref = 0;
11349 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11350 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11354 static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
11355 CHECK(!owner->result_ok);
11356 return DecodeError_clone(&*owner->contents.err);
11358 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11359 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
11360 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11361 *ret_copy = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
11362 int64_t ret_ref = tag_ptr(ret_copy, true);
11366 static inline struct LDKGossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_get_ok(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
11367 LDKGossipTimestampFilter ret = *owner->contents.result;
11368 ret.is_owned = false;
11371 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11372 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
11373 LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv);
11374 int64_t ret_ref = 0;
11375 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11376 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11380 static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
11381 CHECK(!owner->result_ok);
11382 return DecodeError_clone(&*owner->contents.err);
11384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11385 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
11386 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11387 *ret_copy = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
11388 int64_t ret_ref = tag_ptr(ret_copy, true);
11392 static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) {
11393 LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen };
11394 for (size_t i = 0; i < ret.datalen; i++) {
11395 ret.data[i] = PhantomRouteHints_clone(&orig->data[i]);
11399 static jclass LDKSignOrCreationError_SignError_class = NULL;
11400 static jmethodID LDKSignOrCreationError_SignError_meth = NULL;
11401 static jclass LDKSignOrCreationError_CreationError_class = NULL;
11402 static jmethodID LDKSignOrCreationError_CreationError_meth = NULL;
11403 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSignOrCreationError_init (JNIEnv *env, jclass clz) {
11404 LDKSignOrCreationError_SignError_class =
11405 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$SignError"));
11406 CHECK(LDKSignOrCreationError_SignError_class != NULL);
11407 LDKSignOrCreationError_SignError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_SignError_class, "<init>", "()V");
11408 CHECK(LDKSignOrCreationError_SignError_meth != NULL);
11409 LDKSignOrCreationError_CreationError_class =
11410 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$CreationError"));
11411 CHECK(LDKSignOrCreationError_CreationError_class != NULL);
11412 LDKSignOrCreationError_CreationError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_CreationError_class, "<init>", "(Lorg/ldk/enums/CreationError;)V");
11413 CHECK(LDKSignOrCreationError_CreationError_meth != NULL);
11415 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
11416 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
11418 case LDKSignOrCreationError_SignError: {
11419 return (*env)->NewObject(env, LDKSignOrCreationError_SignError_class, LDKSignOrCreationError_SignError_meth);
11421 case LDKSignOrCreationError_CreationError: {
11422 jclass creation_error_conv = LDKCreationError_to_java(env, obj->creation_error);
11423 return (*env)->NewObject(env, LDKSignOrCreationError_CreationError_class, LDKSignOrCreationError_CreationError_meth, creation_error_conv);
11428 static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
11429 LDKInvoice ret = *owner->contents.result;
11430 ret.is_owned = false;
11433 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11434 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
11435 LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_get_ok(owner_conv);
11436 int64_t ret_ref = 0;
11437 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11438 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11442 static inline struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
11443 CHECK(!owner->result_ok);
11444 return SignOrCreationError_clone(&*owner->contents.err);
11446 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11447 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
11448 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
11449 *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv);
11450 int64_t ret_ref = tag_ptr(ret_copy, true);
11454 typedef struct LDKFilter_JCalls {
11455 atomic_size_t refcnt;
11458 jmethodID register_tx_meth;
11459 jmethodID register_output_meth;
11460 } LDKFilter_JCalls;
11461 static void LDKFilter_JCalls_free(void* this_arg) {
11462 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
11463 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11465 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11466 if (get_jenv_res == JNI_EDETACHED) {
11467 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11469 DO_ASSERT(get_jenv_res == JNI_OK);
11471 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11472 if (get_jenv_res == JNI_EDETACHED) {
11473 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11478 void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
11479 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
11481 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11482 if (get_jenv_res == JNI_EDETACHED) {
11483 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11485 DO_ASSERT(get_jenv_res == JNI_OK);
11487 int8_tArray txid_arr = (*env)->NewByteArray(env, 32);
11488 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
11489 LDKu8slice script_pubkey_var = script_pubkey;
11490 int8_tArray script_pubkey_arr = (*env)->NewByteArray(env, script_pubkey_var.datalen);
11491 (*env)->SetByteArrayRegion(env, script_pubkey_arr, 0, script_pubkey_var.datalen, script_pubkey_var.data);
11492 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11493 CHECK(obj != NULL);
11494 (*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr);
11495 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11496 (*env)->ExceptionDescribe(env);
11497 (*env)->FatalError(env, "A call to register_tx in LDKFilter from rust threw an exception.");
11499 if (get_jenv_res == JNI_EDETACHED) {
11500 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11503 void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
11504 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
11506 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11507 if (get_jenv_res == JNI_EDETACHED) {
11508 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11510 DO_ASSERT(get_jenv_res == JNI_OK);
11512 LDKWatchedOutput output_var = output;
11513 int64_t output_ref = 0;
11514 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
11515 output_ref = tag_ptr(output_var.inner, output_var.is_owned);
11516 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11517 CHECK(obj != NULL);
11518 (*env)->CallVoidMethod(env, obj, j_calls->register_output_meth, output_ref);
11519 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11520 (*env)->ExceptionDescribe(env);
11521 (*env)->FatalError(env, "A call to register_output in LDKFilter from rust threw an exception.");
11523 if (get_jenv_res == JNI_EDETACHED) {
11524 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11527 static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
11528 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
11529 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11531 static inline LDKFilter LDKFilter_init (JNIEnv *env, jclass clz, jobject o) {
11532 jclass c = (*env)->GetObjectClass(env, o);
11534 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
11535 atomic_init(&calls->refcnt, 1);
11536 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11537 calls->o = (*env)->NewWeakGlobalRef(env, o);
11538 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([B[B)V");
11539 CHECK(calls->register_tx_meth != NULL);
11540 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(J)V");
11541 CHECK(calls->register_output_meth != NULL);
11544 .this_arg = (void*) calls,
11545 .register_tx = register_tx_LDKFilter_jcall,
11546 .register_output = register_output_LDKFilter_jcall,
11547 .free = LDKFilter_JCalls_free,
11551 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new(JNIEnv *env, jclass clz, jobject o) {
11552 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
11553 *res_ptr = LDKFilter_init(env, clz, o);
11554 return tag_ptr(res_ptr, true);
11556 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) {
11557 void* this_arg_ptr = untag_ptr(this_arg);
11558 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11559 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
11560 uint8_t txid_arr[32];
11561 CHECK((*env)->GetArrayLength(env, txid) == 32);
11562 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
11563 uint8_t (*txid_ref)[32] = &txid_arr;
11564 LDKu8slice script_pubkey_ref;
11565 script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
11566 script_pubkey_ref.data = (*env)->GetByteArrayElements (env, script_pubkey, NULL);
11567 (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
11568 (*env)->ReleaseByteArrayElements(env, script_pubkey, (int8_t*)script_pubkey_ref.data, 0);
11571 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEnv *env, jclass clz, int64_t this_arg, int64_t output) {
11572 void* this_arg_ptr = untag_ptr(this_arg);
11573 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11574 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
11575 LDKWatchedOutput output_conv;
11576 output_conv.inner = untag_ptr(output);
11577 output_conv.is_owned = ptr_is_owned(output);
11578 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
11579 output_conv = WatchedOutput_clone(&output_conv);
11580 (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
11583 static jclass LDKCOption_FilterZ_Some_class = NULL;
11584 static jmethodID LDKCOption_FilterZ_Some_meth = NULL;
11585 static jclass LDKCOption_FilterZ_None_class = NULL;
11586 static jmethodID LDKCOption_FilterZ_None_meth = NULL;
11587 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1FilterZ_init (JNIEnv *env, jclass clz) {
11588 LDKCOption_FilterZ_Some_class =
11589 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$Some"));
11590 CHECK(LDKCOption_FilterZ_Some_class != NULL);
11591 LDKCOption_FilterZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_Some_class, "<init>", "(J)V");
11592 CHECK(LDKCOption_FilterZ_Some_meth != NULL);
11593 LDKCOption_FilterZ_None_class =
11594 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$None"));
11595 CHECK(LDKCOption_FilterZ_None_class != NULL);
11596 LDKCOption_FilterZ_None_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_None_class, "<init>", "()V");
11597 CHECK(LDKCOption_FilterZ_None_meth != NULL);
11599 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1FilterZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
11600 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
11602 case LDKCOption_FilterZ_Some: {
11603 LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
11604 *some_ret = obj->some;
11605 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
11606 if ((*some_ret).free == LDKFilter_JCalls_free) {
11607 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
11608 LDKFilter_JCalls_cloned(&(*some_ret));
11610 return (*env)->NewObject(env, LDKCOption_FilterZ_Some_class, LDKCOption_FilterZ_Some_meth, tag_ptr(some_ret, true));
11612 case LDKCOption_FilterZ_None: {
11613 return (*env)->NewObject(env, LDKCOption_FilterZ_None_class, LDKCOption_FilterZ_None_meth);
11618 static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
11619 LDKLockedChannelMonitor ret = *owner->contents.result;
11620 ret.is_owned = false;
11623 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11624 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
11625 LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv);
11626 int64_t ret_ref = 0;
11627 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11628 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11632 static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
11633 CHECK(!owner->result_ok);
11634 return *owner->contents.err;
11636 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11637 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
11638 CResult_LockedChannelMonitorNoneZ_get_err(owner_conv);
11641 static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) {
11642 LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen };
11643 for (size_t i = 0; i < ret.datalen; i++) {
11644 ret.data[i] = OutPoint_clone(&orig->data[i]);
11648 static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) {
11649 LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen };
11650 for (size_t i = 0; i < ret.datalen; i++) {
11651 ret.data[i] = MonitorUpdateId_clone(&orig->data[i]);
11655 static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){
11656 LDKOutPoint ret = owner->a;
11657 ret.is_owned = false;
11660 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
11661 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner);
11662 LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv);
11663 int64_t ret_ref = 0;
11664 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11665 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11669 static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){
11670 return CVec_MonitorUpdateIdZ_clone(&owner->b);
11672 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
11673 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner);
11674 LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv);
11675 int64_tArray ret_arr = NULL;
11676 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
11677 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
11678 for (size_t r = 0; r < ret_var.datalen; r++) {
11679 LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r];
11680 int64_t ret_conv_17_ref = 0;
11681 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var);
11682 ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned);
11683 ret_arr_ptr[r] = ret_conv_17_ref;
11685 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
11686 FREE(ret_var.data);
11690 static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) {
11691 LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen };
11692 for (size_t i = 0; i < ret.datalen; i++) {
11693 ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]);
11697 typedef struct LDKMessageSendEventsProvider_JCalls {
11698 atomic_size_t refcnt;
11701 jmethodID get_and_clear_pending_msg_events_meth;
11702 } LDKMessageSendEventsProvider_JCalls;
11703 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
11704 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
11705 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11707 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11708 if (get_jenv_res == JNI_EDETACHED) {
11709 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11711 DO_ASSERT(get_jenv_res == JNI_OK);
11713 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11714 if (get_jenv_res == JNI_EDETACHED) {
11715 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11720 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
11721 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
11723 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11724 if (get_jenv_res == JNI_EDETACHED) {
11725 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11727 DO_ASSERT(get_jenv_res == JNI_OK);
11729 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11730 CHECK(obj != NULL);
11731 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth);
11732 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11733 (*env)->ExceptionDescribe(env);
11734 (*env)->FatalError(env, "A call to get_and_clear_pending_msg_events in LDKMessageSendEventsProvider from rust threw an exception.");
11736 LDKCVec_MessageSendEventZ ret_constr;
11737 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
11738 if (ret_constr.datalen > 0)
11739 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
11741 ret_constr.data = NULL;
11742 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
11743 for (size_t s = 0; s < ret_constr.datalen; s++) {
11744 int64_t ret_conv_18 = ret_vals[s];
11745 void* ret_conv_18_ptr = untag_ptr(ret_conv_18);
11746 CHECK_ACCESS(ret_conv_18_ptr);
11747 LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
11748 FREE(untag_ptr(ret_conv_18));
11749 ret_constr.data[s] = ret_conv_18_conv;
11751 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
11752 if (get_jenv_res == JNI_EDETACHED) {
11753 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11757 static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
11758 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
11759 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11761 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
11762 jclass c = (*env)->GetObjectClass(env, o);
11764 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
11765 atomic_init(&calls->refcnt, 1);
11766 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11767 calls->o = (*env)->NewWeakGlobalRef(env, o);
11768 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()[J");
11769 CHECK(calls->get_and_clear_pending_msg_events_meth != NULL);
11771 LDKMessageSendEventsProvider ret = {
11772 .this_arg = (void*) calls,
11773 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
11774 .free = LDKMessageSendEventsProvider_JCalls_free,
11778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new(JNIEnv *env, jclass clz, jobject o) {
11779 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
11780 *res_ptr = LDKMessageSendEventsProvider_init(env, clz, o);
11781 return tag_ptr(res_ptr, true);
11783 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
11784 void* this_arg_ptr = untag_ptr(this_arg);
11785 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11786 LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
11787 LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
11788 int64_tArray ret_arr = NULL;
11789 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
11790 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
11791 for (size_t s = 0; s < ret_var.datalen; s++) {
11792 LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
11793 *ret_conv_18_copy = ret_var.data[s];
11794 int64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true);
11795 ret_arr_ptr[s] = ret_conv_18_ref;
11797 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
11798 FREE(ret_var.data);
11802 typedef struct LDKOnionMessageProvider_JCalls {
11803 atomic_size_t refcnt;
11806 jmethodID next_onion_message_for_peer_meth;
11807 } LDKOnionMessageProvider_JCalls;
11808 static void LDKOnionMessageProvider_JCalls_free(void* this_arg) {
11809 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
11810 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11812 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11813 if (get_jenv_res == JNI_EDETACHED) {
11814 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11816 DO_ASSERT(get_jenv_res == JNI_OK);
11818 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11819 if (get_jenv_res == JNI_EDETACHED) {
11820 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11825 LDKOnionMessage next_onion_message_for_peer_LDKOnionMessageProvider_jcall(const void* this_arg, LDKPublicKey peer_node_id) {
11826 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
11828 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11829 if (get_jenv_res == JNI_EDETACHED) {
11830 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11832 DO_ASSERT(get_jenv_res == JNI_OK);
11834 int8_tArray peer_node_id_arr = (*env)->NewByteArray(env, 33);
11835 (*env)->SetByteArrayRegion(env, peer_node_id_arr, 0, 33, peer_node_id.compressed_form);
11836 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11837 CHECK(obj != NULL);
11838 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->next_onion_message_for_peer_meth, peer_node_id_arr);
11839 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11840 (*env)->ExceptionDescribe(env);
11841 (*env)->FatalError(env, "A call to next_onion_message_for_peer in LDKOnionMessageProvider from rust threw an exception.");
11843 LDKOnionMessage ret_conv;
11844 ret_conv.inner = untag_ptr(ret);
11845 ret_conv.is_owned = ptr_is_owned(ret);
11846 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
11847 if (get_jenv_res == JNI_EDETACHED) {
11848 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11852 static void LDKOnionMessageProvider_JCalls_cloned(LDKOnionMessageProvider* new_obj) {
11853 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) new_obj->this_arg;
11854 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11856 static inline LDKOnionMessageProvider LDKOnionMessageProvider_init (JNIEnv *env, jclass clz, jobject o) {
11857 jclass c = (*env)->GetObjectClass(env, o);
11859 LDKOnionMessageProvider_JCalls *calls = MALLOC(sizeof(LDKOnionMessageProvider_JCalls), "LDKOnionMessageProvider_JCalls");
11860 atomic_init(&calls->refcnt, 1);
11861 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11862 calls->o = (*env)->NewWeakGlobalRef(env, o);
11863 calls->next_onion_message_for_peer_meth = (*env)->GetMethodID(env, c, "next_onion_message_for_peer", "([B)J");
11864 CHECK(calls->next_onion_message_for_peer_meth != NULL);
11866 LDKOnionMessageProvider ret = {
11867 .this_arg = (void*) calls,
11868 .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageProvider_jcall,
11869 .free = LDKOnionMessageProvider_JCalls_free,
11873 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageProvider_1new(JNIEnv *env, jclass clz, jobject o) {
11874 LDKOnionMessageProvider *res_ptr = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
11875 *res_ptr = LDKOnionMessageProvider_init(env, clz, o);
11876 return tag_ptr(res_ptr, true);
11878 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageProvider_1next_1onion_1message_1for_1peer(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray peer_node_id) {
11879 void* this_arg_ptr = untag_ptr(this_arg);
11880 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11881 LDKOnionMessageProvider* this_arg_conv = (LDKOnionMessageProvider*)this_arg_ptr;
11882 LDKPublicKey peer_node_id_ref;
11883 CHECK((*env)->GetArrayLength(env, peer_node_id) == 33);
11884 (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form);
11885 LDKOnionMessage ret_var = (this_arg_conv->next_onion_message_for_peer)(this_arg_conv->this_arg, peer_node_id_ref);
11886 int64_t ret_ref = 0;
11887 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11888 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11892 typedef struct LDKEventHandler_JCalls {
11893 atomic_size_t refcnt;
11896 jmethodID handle_event_meth;
11897 } LDKEventHandler_JCalls;
11898 static void LDKEventHandler_JCalls_free(void* this_arg) {
11899 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
11900 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11902 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11903 if (get_jenv_res == JNI_EDETACHED) {
11904 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11906 DO_ASSERT(get_jenv_res == JNI_OK);
11908 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11909 if (get_jenv_res == JNI_EDETACHED) {
11910 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11915 void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) {
11916 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
11918 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11919 if (get_jenv_res == JNI_EDETACHED) {
11920 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11922 DO_ASSERT(get_jenv_res == JNI_OK);
11924 LDKEvent *event_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
11925 *event_copy = event;
11926 int64_t event_ref = tag_ptr(event_copy, true);
11927 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11928 CHECK(obj != NULL);
11929 (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, event_ref);
11930 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11931 (*env)->ExceptionDescribe(env);
11932 (*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception.");
11934 if (get_jenv_res == JNI_EDETACHED) {
11935 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11938 static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
11939 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
11940 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11942 static inline LDKEventHandler LDKEventHandler_init (JNIEnv *env, jclass clz, jobject o) {
11943 jclass c = (*env)->GetObjectClass(env, o);
11945 LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
11946 atomic_init(&calls->refcnt, 1);
11947 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11948 calls->o = (*env)->NewWeakGlobalRef(env, o);
11949 calls->handle_event_meth = (*env)->GetMethodID(env, c, "handle_event", "(J)V");
11950 CHECK(calls->handle_event_meth != NULL);
11952 LDKEventHandler ret = {
11953 .this_arg = (void*) calls,
11954 .handle_event = handle_event_LDKEventHandler_jcall,
11955 .free = LDKEventHandler_JCalls_free,
11959 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventHandler_1new(JNIEnv *env, jclass clz, jobject o) {
11960 LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
11961 *res_ptr = LDKEventHandler_init(env, clz, o);
11962 return tag_ptr(res_ptr, true);
11964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) {
11965 void* this_arg_ptr = untag_ptr(this_arg);
11966 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11967 LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
11968 void* event_ptr = untag_ptr(event);
11969 CHECK_ACCESS(event_ptr);
11970 LDKEvent event_conv = *(LDKEvent*)(event_ptr);
11971 event_conv = Event_clone((LDKEvent*)untag_ptr(event));
11972 (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
11975 typedef struct LDKEventsProvider_JCalls {
11976 atomic_size_t refcnt;
11979 jmethodID process_pending_events_meth;
11980 } LDKEventsProvider_JCalls;
11981 static void LDKEventsProvider_JCalls_free(void* this_arg) {
11982 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
11983 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11985 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11986 if (get_jenv_res == JNI_EDETACHED) {
11987 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11989 DO_ASSERT(get_jenv_res == JNI_OK);
11991 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11992 if (get_jenv_res == JNI_EDETACHED) {
11993 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11998 void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
11999 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
12001 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12002 if (get_jenv_res == JNI_EDETACHED) {
12003 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12005 DO_ASSERT(get_jenv_res == JNI_OK);
12007 LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
12008 *handler_ret = handler;
12009 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12010 CHECK(obj != NULL);
12011 (*env)->CallVoidMethod(env, obj, j_calls->process_pending_events_meth, tag_ptr(handler_ret, true));
12012 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12013 (*env)->ExceptionDescribe(env);
12014 (*env)->FatalError(env, "A call to process_pending_events in LDKEventsProvider from rust threw an exception.");
12016 if (get_jenv_res == JNI_EDETACHED) {
12017 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12020 static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
12021 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
12022 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12024 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
12025 jclass c = (*env)->GetObjectClass(env, o);
12027 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
12028 atomic_init(&calls->refcnt, 1);
12029 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12030 calls->o = (*env)->NewWeakGlobalRef(env, o);
12031 calls->process_pending_events_meth = (*env)->GetMethodID(env, c, "process_pending_events", "(J)V");
12032 CHECK(calls->process_pending_events_meth != NULL);
12034 LDKEventsProvider ret = {
12035 .this_arg = (void*) calls,
12036 .process_pending_events = process_pending_events_LDKEventsProvider_jcall,
12037 .free = LDKEventsProvider_JCalls_free,
12041 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new(JNIEnv *env, jclass clz, jobject o) {
12042 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
12043 *res_ptr = LDKEventsProvider_init(env, clz, o);
12044 return tag_ptr(res_ptr, true);
12046 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg, int64_t handler) {
12047 void* this_arg_ptr = untag_ptr(this_arg);
12048 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12049 LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
12050 void* handler_ptr = untag_ptr(handler);
12051 CHECK_ACCESS(handler_ptr);
12052 LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
12053 if (handler_conv.free == LDKEventHandler_JCalls_free) {
12054 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
12055 LDKEventHandler_JCalls_cloned(&handler_conv);
12057 (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
12060 typedef struct LDKPersister_JCalls {
12061 atomic_size_t refcnt;
12064 jmethodID persist_manager_meth;
12065 jmethodID persist_graph_meth;
12066 jmethodID persist_scorer_meth;
12067 } LDKPersister_JCalls;
12068 static void LDKPersister_JCalls_free(void* this_arg) {
12069 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
12070 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12072 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12073 if (get_jenv_res == JNI_EDETACHED) {
12074 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12076 DO_ASSERT(get_jenv_res == JNI_OK);
12078 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12079 if (get_jenv_res == JNI_EDETACHED) {
12080 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12085 LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
12086 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
12088 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12089 if (get_jenv_res == JNI_EDETACHED) {
12090 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12092 DO_ASSERT(get_jenv_res == JNI_OK);
12094 LDKChannelManager channel_manager_var = *channel_manager;
12095 int64_t channel_manager_ref = 0;
12096 // WARNING: we may need a move here but no clone is available for LDKChannelManager
12097 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
12098 channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned);
12099 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12100 CHECK(obj != NULL);
12101 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref);
12102 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12103 (*env)->ExceptionDescribe(env);
12104 (*env)->FatalError(env, "A call to persist_manager in LDKPersister from rust threw an exception.");
12106 void* ret_ptr = untag_ptr(ret);
12107 CHECK_ACCESS(ret_ptr);
12108 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
12109 FREE(untag_ptr(ret));
12110 if (get_jenv_res == JNI_EDETACHED) {
12111 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12115 LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) {
12116 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
12118 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12119 if (get_jenv_res == JNI_EDETACHED) {
12120 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12122 DO_ASSERT(get_jenv_res == JNI_OK);
12124 LDKNetworkGraph network_graph_var = *network_graph;
12125 int64_t network_graph_ref = 0;
12126 // WARNING: we may need a move here but no clone is available for LDKNetworkGraph
12127 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var);
12128 network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned);
12129 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12130 CHECK(obj != NULL);
12131 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_graph_meth, network_graph_ref);
12132 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12133 (*env)->ExceptionDescribe(env);
12134 (*env)->FatalError(env, "A call to persist_graph in LDKPersister from rust threw an exception.");
12136 void* ret_ptr = untag_ptr(ret);
12137 CHECK_ACCESS(ret_ptr);
12138 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
12139 FREE(untag_ptr(ret));
12140 if (get_jenv_res == JNI_EDETACHED) {
12141 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12145 LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKWriteableScore * scorer) {
12146 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
12148 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12149 if (get_jenv_res == JNI_EDETACHED) {
12150 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12152 DO_ASSERT(get_jenv_res == JNI_OK);
12154 // WARNING: This object doesn't live past this scope, needs clone!
12155 int64_t ret_scorer = tag_ptr(scorer, false);
12156 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12157 CHECK(obj != NULL);
12158 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_scorer_meth, ret_scorer);
12159 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12160 (*env)->ExceptionDescribe(env);
12161 (*env)->FatalError(env, "A call to persist_scorer in LDKPersister from rust threw an exception.");
12163 void* ret_ptr = untag_ptr(ret);
12164 CHECK_ACCESS(ret_ptr);
12165 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
12166 FREE(untag_ptr(ret));
12167 if (get_jenv_res == JNI_EDETACHED) {
12168 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12172 static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) {
12173 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg;
12174 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12176 static inline LDKPersister LDKPersister_init (JNIEnv *env, jclass clz, jobject o) {
12177 jclass c = (*env)->GetObjectClass(env, o);
12179 LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls");
12180 atomic_init(&calls->refcnt, 1);
12181 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12182 calls->o = (*env)->NewWeakGlobalRef(env, o);
12183 calls->persist_manager_meth = (*env)->GetMethodID(env, c, "persist_manager", "(J)J");
12184 CHECK(calls->persist_manager_meth != NULL);
12185 calls->persist_graph_meth = (*env)->GetMethodID(env, c, "persist_graph", "(J)J");
12186 CHECK(calls->persist_graph_meth != NULL);
12187 calls->persist_scorer_meth = (*env)->GetMethodID(env, c, "persist_scorer", "(J)J");
12188 CHECK(calls->persist_scorer_meth != NULL);
12190 LDKPersister ret = {
12191 .this_arg = (void*) calls,
12192 .persist_manager = persist_manager_LDKPersister_jcall,
12193 .persist_graph = persist_graph_LDKPersister_jcall,
12194 .persist_scorer = persist_scorer_LDKPersister_jcall,
12195 .free = LDKPersister_JCalls_free,
12199 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersister_1new(JNIEnv *env, jclass clz, jobject o) {
12200 LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister");
12201 *res_ptr = LDKPersister_init(env, clz, o);
12202 return tag_ptr(res_ptr, true);
12204 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1manager(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_manager) {
12205 void* this_arg_ptr = untag_ptr(this_arg);
12206 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12207 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
12208 LDKChannelManager channel_manager_conv;
12209 channel_manager_conv.inner = untag_ptr(channel_manager);
12210 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
12211 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
12212 channel_manager_conv.is_owned = false;
12213 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
12214 *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv);
12215 return tag_ptr(ret_conv, true);
12218 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) {
12219 void* this_arg_ptr = untag_ptr(this_arg);
12220 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12221 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
12222 LDKNetworkGraph network_graph_conv;
12223 network_graph_conv.inner = untag_ptr(network_graph);
12224 network_graph_conv.is_owned = ptr_is_owned(network_graph);
12225 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
12226 network_graph_conv.is_owned = false;
12227 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
12228 *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv);
12229 return tag_ptr(ret_conv, true);
12232 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1scorer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scorer) {
12233 void* this_arg_ptr = untag_ptr(this_arg);
12234 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12235 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
12236 void* scorer_ptr = untag_ptr(scorer);
12237 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
12238 LDKWriteableScore* scorer_conv = (LDKWriteableScore*)scorer_ptr;
12239 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
12240 *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, scorer_conv);
12241 return tag_ptr(ret_conv, true);
12244 typedef struct LDKFutureCallback_JCalls {
12245 atomic_size_t refcnt;
12248 jmethodID call_meth;
12249 } LDKFutureCallback_JCalls;
12250 static void LDKFutureCallback_JCalls_free(void* this_arg) {
12251 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
12252 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12254 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12255 if (get_jenv_res == JNI_EDETACHED) {
12256 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12258 DO_ASSERT(get_jenv_res == JNI_OK);
12260 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12261 if (get_jenv_res == JNI_EDETACHED) {
12262 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12267 void call_LDKFutureCallback_jcall(const void* this_arg) {
12268 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
12270 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12271 if (get_jenv_res == JNI_EDETACHED) {
12272 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12274 DO_ASSERT(get_jenv_res == JNI_OK);
12276 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12277 CHECK(obj != NULL);
12278 (*env)->CallVoidMethod(env, obj, j_calls->call_meth);
12279 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12280 (*env)->ExceptionDescribe(env);
12281 (*env)->FatalError(env, "A call to call in LDKFutureCallback from rust threw an exception.");
12283 if (get_jenv_res == JNI_EDETACHED) {
12284 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12287 static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) {
12288 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg;
12289 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12291 static inline LDKFutureCallback LDKFutureCallback_init (JNIEnv *env, jclass clz, jobject o) {
12292 jclass c = (*env)->GetObjectClass(env, o);
12294 LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls");
12295 atomic_init(&calls->refcnt, 1);
12296 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12297 calls->o = (*env)->NewWeakGlobalRef(env, o);
12298 calls->call_meth = (*env)->GetMethodID(env, c, "call", "()V");
12299 CHECK(calls->call_meth != NULL);
12301 LDKFutureCallback ret = {
12302 .this_arg = (void*) calls,
12303 .call = call_LDKFutureCallback_jcall,
12304 .free = LDKFutureCallback_JCalls_free,
12308 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFutureCallback_1new(JNIEnv *env, jclass clz, jobject o) {
12309 LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback");
12310 *res_ptr = LDKFutureCallback_init(env, clz, o);
12311 return tag_ptr(res_ptr, true);
12313 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FutureCallback_1call(JNIEnv *env, jclass clz, int64_t this_arg) {
12314 void* this_arg_ptr = untag_ptr(this_arg);
12315 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12316 LDKFutureCallback* this_arg_conv = (LDKFutureCallback*)this_arg_ptr;
12317 (this_arg_conv->call)(this_arg_conv->this_arg);
12320 typedef struct LDKListen_JCalls {
12321 atomic_size_t refcnt;
12324 jmethodID filtered_block_connected_meth;
12325 jmethodID block_connected_meth;
12326 jmethodID block_disconnected_meth;
12327 } LDKListen_JCalls;
12328 static void LDKListen_JCalls_free(void* this_arg) {
12329 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
12330 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12332 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12333 if (get_jenv_res == JNI_EDETACHED) {
12334 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12336 DO_ASSERT(get_jenv_res == JNI_OK);
12338 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12339 if (get_jenv_res == JNI_EDETACHED) {
12340 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12345 void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
12346 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
12348 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12349 if (get_jenv_res == JNI_EDETACHED) {
12350 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12352 DO_ASSERT(get_jenv_res == JNI_OK);
12354 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
12355 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
12356 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
12357 int64_tArray txdata_arr = NULL;
12358 txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
12359 int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL);
12360 for (size_t c = 0; c < txdata_var.datalen; c++) {
12361 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12362 *txdata_conv_28_conv = txdata_var.data[c];
12363 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
12365 (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0);
12366 FREE(txdata_var.data);
12367 int32_t height_conv = height;
12368 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12369 CHECK(obj != NULL);
12370 (*env)->CallVoidMethod(env, obj, j_calls->filtered_block_connected_meth, header_arr, txdata_arr, height_conv);
12371 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12372 (*env)->ExceptionDescribe(env);
12373 (*env)->FatalError(env, "A call to filtered_block_connected in LDKListen from rust threw an exception.");
12375 if (get_jenv_res == JNI_EDETACHED) {
12376 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12379 void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
12380 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
12382 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12383 if (get_jenv_res == JNI_EDETACHED) {
12384 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12386 DO_ASSERT(get_jenv_res == JNI_OK);
12388 LDKu8slice block_var = block;
12389 int8_tArray block_arr = (*env)->NewByteArray(env, block_var.datalen);
12390 (*env)->SetByteArrayRegion(env, block_arr, 0, block_var.datalen, block_var.data);
12391 int32_t height_conv = height;
12392 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12393 CHECK(obj != NULL);
12394 (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height_conv);
12395 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12396 (*env)->ExceptionDescribe(env);
12397 (*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception.");
12399 if (get_jenv_res == JNI_EDETACHED) {
12400 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12403 void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
12404 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
12406 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12407 if (get_jenv_res == JNI_EDETACHED) {
12408 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12410 DO_ASSERT(get_jenv_res == JNI_OK);
12412 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
12413 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
12414 int32_t height_conv = height;
12415 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12416 CHECK(obj != NULL);
12417 (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height_conv);
12418 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12419 (*env)->ExceptionDescribe(env);
12420 (*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception.");
12422 if (get_jenv_res == JNI_EDETACHED) {
12423 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12426 static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
12427 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
12428 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12430 static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) {
12431 jclass c = (*env)->GetObjectClass(env, o);
12433 LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
12434 atomic_init(&calls->refcnt, 1);
12435 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12436 calls->o = (*env)->NewWeakGlobalRef(env, o);
12437 calls->filtered_block_connected_meth = (*env)->GetMethodID(env, c, "filtered_block_connected", "([B[JI)V");
12438 CHECK(calls->filtered_block_connected_meth != NULL);
12439 calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BI)V");
12440 CHECK(calls->block_connected_meth != NULL);
12441 calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V");
12442 CHECK(calls->block_disconnected_meth != NULL);
12445 .this_arg = (void*) calls,
12446 .filtered_block_connected = filtered_block_connected_LDKListen_jcall,
12447 .block_connected = block_connected_LDKListen_jcall,
12448 .block_disconnected = block_disconnected_LDKListen_jcall,
12449 .free = LDKListen_JCalls_free,
12453 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKListen_1new(JNIEnv *env, jclass clz, jobject o) {
12454 LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
12455 *res_ptr = LDKListen_init(env, clz, o);
12456 return tag_ptr(res_ptr, true);
12458 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) {
12459 void* this_arg_ptr = untag_ptr(this_arg);
12460 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12461 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
12462 uint8_t header_arr[80];
12463 CHECK((*env)->GetArrayLength(env, header) == 80);
12464 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
12465 uint8_t (*header_ref)[80] = &header_arr;
12466 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
12467 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
12468 if (txdata_constr.datalen > 0)
12469 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
12471 txdata_constr.data = NULL;
12472 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
12473 for (size_t c = 0; c < txdata_constr.datalen; c++) {
12474 int64_t txdata_conv_28 = txdata_vals[c];
12475 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
12476 CHECK_ACCESS(txdata_conv_28_ptr);
12477 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
12478 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
12479 txdata_constr.data[c] = txdata_conv_28_conv;
12481 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
12482 (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
12485 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) {
12486 void* this_arg_ptr = untag_ptr(this_arg);
12487 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12488 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
12489 LDKu8slice block_ref;
12490 block_ref.datalen = (*env)->GetArrayLength(env, block);
12491 block_ref.data = (*env)->GetByteArrayElements (env, block, NULL);
12492 (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
12493 (*env)->ReleaseByteArrayElements(env, block, (int8_t*)block_ref.data, 0);
12496 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) {
12497 void* this_arg_ptr = untag_ptr(this_arg);
12498 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12499 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
12500 uint8_t header_arr[80];
12501 CHECK((*env)->GetArrayLength(env, header) == 80);
12502 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
12503 uint8_t (*header_ref)[80] = &header_arr;
12504 (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
12507 typedef struct LDKConfirm_JCalls {
12508 atomic_size_t refcnt;
12511 jmethodID transactions_confirmed_meth;
12512 jmethodID transaction_unconfirmed_meth;
12513 jmethodID best_block_updated_meth;
12514 jmethodID get_relevant_txids_meth;
12515 } LDKConfirm_JCalls;
12516 static void LDKConfirm_JCalls_free(void* this_arg) {
12517 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
12518 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12520 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12521 if (get_jenv_res == JNI_EDETACHED) {
12522 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12524 DO_ASSERT(get_jenv_res == JNI_OK);
12526 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12527 if (get_jenv_res == JNI_EDETACHED) {
12528 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12533 void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
12534 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
12536 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12537 if (get_jenv_res == JNI_EDETACHED) {
12538 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12540 DO_ASSERT(get_jenv_res == JNI_OK);
12542 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
12543 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
12544 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
12545 int64_tArray txdata_arr = NULL;
12546 txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
12547 int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL);
12548 for (size_t c = 0; c < txdata_var.datalen; c++) {
12549 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12550 *txdata_conv_28_conv = txdata_var.data[c];
12551 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
12553 (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0);
12554 FREE(txdata_var.data);
12555 int32_t height_conv = height;
12556 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12557 CHECK(obj != NULL);
12558 (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height_conv);
12559 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12560 (*env)->ExceptionDescribe(env);
12561 (*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception.");
12563 if (get_jenv_res == JNI_EDETACHED) {
12564 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12567 void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
12568 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
12570 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12571 if (get_jenv_res == JNI_EDETACHED) {
12572 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12574 DO_ASSERT(get_jenv_res == JNI_OK);
12576 int8_tArray txid_arr = (*env)->NewByteArray(env, 32);
12577 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
12578 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12579 CHECK(obj != NULL);
12580 (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr);
12581 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12582 (*env)->ExceptionDescribe(env);
12583 (*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception.");
12585 if (get_jenv_res == JNI_EDETACHED) {
12586 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12589 void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
12590 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
12592 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12593 if (get_jenv_res == JNI_EDETACHED) {
12594 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12596 DO_ASSERT(get_jenv_res == JNI_OK);
12598 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
12599 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
12600 int32_t height_conv = height;
12601 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12602 CHECK(obj != NULL);
12603 (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height_conv);
12604 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12605 (*env)->ExceptionDescribe(env);
12606 (*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception.");
12608 if (get_jenv_res == JNI_EDETACHED) {
12609 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12612 LDKCVec_C2Tuple_TxidBlockHashZZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
12613 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
12615 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12616 if (get_jenv_res == JNI_EDETACHED) {
12617 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12619 DO_ASSERT(get_jenv_res == JNI_OK);
12621 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12622 CHECK(obj != NULL);
12623 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth);
12624 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12625 (*env)->ExceptionDescribe(env);
12626 (*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception.");
12628 LDKCVec_C2Tuple_TxidBlockHashZZ ret_constr;
12629 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
12630 if (ret_constr.datalen > 0)
12631 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKCVec_C2Tuple_TxidBlockHashZZ Elements");
12633 ret_constr.data = NULL;
12634 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
12635 for (size_t z = 0; z < ret_constr.datalen; z++) {
12636 int64_t ret_conv_25 = ret_vals[z];
12637 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
12638 CHECK_ACCESS(ret_conv_25_ptr);
12639 LDKC2Tuple_TxidBlockHashZ ret_conv_25_conv = *(LDKC2Tuple_TxidBlockHashZ*)(ret_conv_25_ptr);
12640 FREE(untag_ptr(ret_conv_25));
12641 ret_constr.data[z] = ret_conv_25_conv;
12643 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
12644 if (get_jenv_res == JNI_EDETACHED) {
12645 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12649 static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
12650 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
12651 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12653 static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) {
12654 jclass c = (*env)->GetObjectClass(env, o);
12656 LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
12657 atomic_init(&calls->refcnt, 1);
12658 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12659 calls->o = (*env)->NewWeakGlobalRef(env, o);
12660 calls->transactions_confirmed_meth = (*env)->GetMethodID(env, c, "transactions_confirmed", "([B[JI)V");
12661 CHECK(calls->transactions_confirmed_meth != NULL);
12662 calls->transaction_unconfirmed_meth = (*env)->GetMethodID(env, c, "transaction_unconfirmed", "([B)V");
12663 CHECK(calls->transaction_unconfirmed_meth != NULL);
12664 calls->best_block_updated_meth = (*env)->GetMethodID(env, c, "best_block_updated", "([BI)V");
12665 CHECK(calls->best_block_updated_meth != NULL);
12666 calls->get_relevant_txids_meth = (*env)->GetMethodID(env, c, "get_relevant_txids", "()[J");
12667 CHECK(calls->get_relevant_txids_meth != NULL);
12670 .this_arg = (void*) calls,
12671 .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall,
12672 .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall,
12673 .best_block_updated = best_block_updated_LDKConfirm_jcall,
12674 .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall,
12675 .free = LDKConfirm_JCalls_free,
12679 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKConfirm_1new(JNIEnv *env, jclass clz, jobject o) {
12680 LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
12681 *res_ptr = LDKConfirm_init(env, clz, o);
12682 return tag_ptr(res_ptr, true);
12684 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) {
12685 void* this_arg_ptr = untag_ptr(this_arg);
12686 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12687 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
12688 uint8_t header_arr[80];
12689 CHECK((*env)->GetArrayLength(env, header) == 80);
12690 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
12691 uint8_t (*header_ref)[80] = &header_arr;
12692 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
12693 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
12694 if (txdata_constr.datalen > 0)
12695 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
12697 txdata_constr.data = NULL;
12698 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
12699 for (size_t c = 0; c < txdata_constr.datalen; c++) {
12700 int64_t txdata_conv_28 = txdata_vals[c];
12701 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
12702 CHECK_ACCESS(txdata_conv_28_ptr);
12703 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
12704 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
12705 txdata_constr.data[c] = txdata_conv_28_conv;
12707 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
12708 (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
12711 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid) {
12712 void* this_arg_ptr = untag_ptr(this_arg);
12713 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12714 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
12715 uint8_t txid_arr[32];
12716 CHECK((*env)->GetArrayLength(env, txid) == 32);
12717 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
12718 uint8_t (*txid_ref)[32] = &txid_arr;
12719 (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref);
12722 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) {
12723 void* this_arg_ptr = untag_ptr(this_arg);
12724 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12725 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
12726 uint8_t header_arr[80];
12727 CHECK((*env)->GetArrayLength(env, header) == 80);
12728 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
12729 uint8_t (*header_ref)[80] = &header_arr;
12730 (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height);
12733 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) {
12734 void* this_arg_ptr = untag_ptr(this_arg);
12735 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12736 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
12737 LDKCVec_C2Tuple_TxidBlockHashZZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
12738 int64_tArray ret_arr = NULL;
12739 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
12740 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
12741 for (size_t z = 0; z < ret_var.datalen; z++) {
12742 LDKC2Tuple_TxidBlockHashZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
12743 *ret_conv_25_conv = ret_var.data[z];
12744 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
12746 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
12747 FREE(ret_var.data);
12751 typedef struct LDKPersist_JCalls {
12752 atomic_size_t refcnt;
12755 jmethodID persist_new_channel_meth;
12756 jmethodID update_persisted_channel_meth;
12757 } LDKPersist_JCalls;
12758 static void LDKPersist_JCalls_free(void* this_arg) {
12759 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
12760 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12762 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12763 if (get_jenv_res == JNI_EDETACHED) {
12764 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12766 DO_ASSERT(get_jenv_res == JNI_OK);
12768 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12769 if (get_jenv_res == JNI_EDETACHED) {
12770 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12775 LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
12776 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
12778 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12779 if (get_jenv_res == JNI_EDETACHED) {
12780 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12782 DO_ASSERT(get_jenv_res == JNI_OK);
12784 LDKOutPoint channel_id_var = channel_id;
12785 int64_t channel_id_ref = 0;
12786 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
12787 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
12788 LDKChannelMonitor data_var = *data;
12789 int64_t data_ref = 0;
12790 data_var = ChannelMonitor_clone(&data_var);
12791 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
12792 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
12793 LDKMonitorUpdateId update_id_var = update_id;
12794 int64_t update_id_ref = 0;
12795 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
12796 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
12797 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12798 CHECK(obj != NULL);
12799 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
12800 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12801 (*env)->ExceptionDescribe(env);
12802 (*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
12804 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
12805 if (get_jenv_res == JNI_EDETACHED) {
12806 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12810 LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
12811 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
12813 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12814 if (get_jenv_res == JNI_EDETACHED) {
12815 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12817 DO_ASSERT(get_jenv_res == JNI_OK);
12819 LDKOutPoint channel_id_var = channel_id;
12820 int64_t channel_id_ref = 0;
12821 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
12822 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
12823 LDKChannelMonitorUpdate update_var = update;
12824 int64_t update_ref = 0;
12825 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
12826 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
12827 LDKChannelMonitor data_var = *data;
12828 int64_t data_ref = 0;
12829 data_var = ChannelMonitor_clone(&data_var);
12830 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
12831 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
12832 LDKMonitorUpdateId update_id_var = update_id;
12833 int64_t update_id_ref = 0;
12834 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
12835 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
12836 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12837 CHECK(obj != NULL);
12838 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
12839 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12840 (*env)->ExceptionDescribe(env);
12841 (*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception.");
12843 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
12844 if (get_jenv_res == JNI_EDETACHED) {
12845 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12849 static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
12850 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
12851 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12853 static inline LDKPersist LDKPersist_init (JNIEnv *env, jclass clz, jobject o) {
12854 jclass c = (*env)->GetObjectClass(env, o);
12856 LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
12857 atomic_init(&calls->refcnt, 1);
12858 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12859 calls->o = (*env)->NewWeakGlobalRef(env, o);
12860 calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
12861 CHECK(calls->persist_new_channel_meth != NULL);
12862 calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
12863 CHECK(calls->update_persisted_channel_meth != NULL);
12866 .this_arg = (void*) calls,
12867 .persist_new_channel = persist_new_channel_LDKPersist_jcall,
12868 .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
12869 .free = LDKPersist_JCalls_free,
12873 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new(JNIEnv *env, jclass clz, jobject o) {
12874 LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist");
12875 *res_ptr = LDKPersist_init(env, clz, o);
12876 return tag_ptr(res_ptr, true);
12878 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t data, int64_t update_id) {
12879 void* this_arg_ptr = untag_ptr(this_arg);
12880 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12881 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
12882 LDKOutPoint channel_id_conv;
12883 channel_id_conv.inner = untag_ptr(channel_id);
12884 channel_id_conv.is_owned = ptr_is_owned(channel_id);
12885 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
12886 channel_id_conv = OutPoint_clone(&channel_id_conv);
12887 LDKChannelMonitor data_conv;
12888 data_conv.inner = untag_ptr(data);
12889 data_conv.is_owned = ptr_is_owned(data);
12890 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
12891 data_conv.is_owned = false;
12892 LDKMonitorUpdateId update_id_conv;
12893 update_id_conv.inner = untag_ptr(update_id);
12894 update_id_conv.is_owned = ptr_is_owned(update_id);
12895 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
12896 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
12897 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv));
12901 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_t update_id) {
12902 void* this_arg_ptr = untag_ptr(this_arg);
12903 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12904 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
12905 LDKOutPoint channel_id_conv;
12906 channel_id_conv.inner = untag_ptr(channel_id);
12907 channel_id_conv.is_owned = ptr_is_owned(channel_id);
12908 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
12909 channel_id_conv = OutPoint_clone(&channel_id_conv);
12910 LDKChannelMonitorUpdate update_conv;
12911 update_conv.inner = untag_ptr(update);
12912 update_conv.is_owned = ptr_is_owned(update);
12913 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
12914 update_conv = ChannelMonitorUpdate_clone(&update_conv);
12915 LDKChannelMonitor data_conv;
12916 data_conv.inner = untag_ptr(data);
12917 data_conv.is_owned = ptr_is_owned(data);
12918 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
12919 data_conv.is_owned = false;
12920 LDKMonitorUpdateId update_id_conv;
12921 update_id_conv.inner = untag_ptr(update_id);
12922 update_id_conv.is_owned = ptr_is_owned(update_id);
12923 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
12924 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
12925 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, update_conv, &data_conv, update_id_conv));
12929 static jclass LDKRetry_Attempts_class = NULL;
12930 static jmethodID LDKRetry_Attempts_meth = NULL;
12931 static jclass LDKRetry_Timeout_class = NULL;
12932 static jmethodID LDKRetry_Timeout_meth = NULL;
12933 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init (JNIEnv *env, jclass clz) {
12934 LDKRetry_Attempts_class =
12935 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Attempts"));
12936 CHECK(LDKRetry_Attempts_class != NULL);
12937 LDKRetry_Attempts_meth = (*env)->GetMethodID(env, LDKRetry_Attempts_class, "<init>", "(J)V");
12938 CHECK(LDKRetry_Attempts_meth != NULL);
12939 LDKRetry_Timeout_class =
12940 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Timeout"));
12941 CHECK(LDKRetry_Timeout_class != NULL);
12942 LDKRetry_Timeout_meth = (*env)->GetMethodID(env, LDKRetry_Timeout_class, "<init>", "(J)V");
12943 CHECK(LDKRetry_Timeout_meth != NULL);
12945 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
12946 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
12948 case LDKRetry_Attempts: {
12949 int64_t attempts_conv = obj->attempts;
12950 return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv);
12952 case LDKRetry_Timeout: {
12953 int64_t timeout_conv = obj->timeout;
12954 return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv);
12959 typedef struct LDKChannelMessageHandler_JCalls {
12960 atomic_size_t refcnt;
12963 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
12964 jmethodID handle_open_channel_meth;
12965 jmethodID handle_accept_channel_meth;
12966 jmethodID handle_funding_created_meth;
12967 jmethodID handle_funding_signed_meth;
12968 jmethodID handle_channel_ready_meth;
12969 jmethodID handle_shutdown_meth;
12970 jmethodID handle_closing_signed_meth;
12971 jmethodID handle_update_add_htlc_meth;
12972 jmethodID handle_update_fulfill_htlc_meth;
12973 jmethodID handle_update_fail_htlc_meth;
12974 jmethodID handle_update_fail_malformed_htlc_meth;
12975 jmethodID handle_commitment_signed_meth;
12976 jmethodID handle_revoke_and_ack_meth;
12977 jmethodID handle_update_fee_meth;
12978 jmethodID handle_announcement_signatures_meth;
12979 jmethodID peer_disconnected_meth;
12980 jmethodID peer_connected_meth;
12981 jmethodID handle_channel_reestablish_meth;
12982 jmethodID handle_channel_update_meth;
12983 jmethodID handle_error_meth;
12984 jmethodID provided_node_features_meth;
12985 jmethodID provided_init_features_meth;
12986 } LDKChannelMessageHandler_JCalls;
12987 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
12988 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
12989 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12991 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12992 if (get_jenv_res == JNI_EDETACHED) {
12993 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12995 DO_ASSERT(get_jenv_res == JNI_OK);
12997 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12998 if (get_jenv_res == JNI_EDETACHED) {
12999 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13004 void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKOpenChannel * msg) {
13005 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13007 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13008 if (get_jenv_res == JNI_EDETACHED) {
13009 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13011 DO_ASSERT(get_jenv_res == JNI_OK);
13013 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13014 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13015 LDKOpenChannel msg_var = *msg;
13016 int64_t msg_ref = 0;
13017 msg_var = OpenChannel_clone(&msg_var);
13018 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13019 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13020 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13021 CHECK(obj != NULL);
13022 (*env)->CallVoidMethod(env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, msg_ref);
13023 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13024 (*env)->ExceptionDescribe(env);
13025 (*env)->FatalError(env, "A call to handle_open_channel in LDKChannelMessageHandler from rust threw an exception.");
13027 if (get_jenv_res == JNI_EDETACHED) {
13028 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13031 void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAcceptChannel * msg) {
13032 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13034 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13035 if (get_jenv_res == JNI_EDETACHED) {
13036 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13038 DO_ASSERT(get_jenv_res == JNI_OK);
13040 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13041 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13042 LDKAcceptChannel msg_var = *msg;
13043 int64_t msg_ref = 0;
13044 msg_var = AcceptChannel_clone(&msg_var);
13045 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13046 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13047 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13048 CHECK(obj != NULL);
13049 (*env)->CallVoidMethod(env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, msg_ref);
13050 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13051 (*env)->ExceptionDescribe(env);
13052 (*env)->FatalError(env, "A call to handle_accept_channel in LDKChannelMessageHandler from rust threw an exception.");
13054 if (get_jenv_res == JNI_EDETACHED) {
13055 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13058 void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
13059 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13061 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13062 if (get_jenv_res == JNI_EDETACHED) {
13063 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13065 DO_ASSERT(get_jenv_res == JNI_OK);
13067 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13068 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13069 LDKFundingCreated msg_var = *msg;
13070 int64_t msg_ref = 0;
13071 msg_var = FundingCreated_clone(&msg_var);
13072 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13073 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13074 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13075 CHECK(obj != NULL);
13076 (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref);
13077 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13078 (*env)->ExceptionDescribe(env);
13079 (*env)->FatalError(env, "A call to handle_funding_created in LDKChannelMessageHandler from rust threw an exception.");
13081 if (get_jenv_res == JNI_EDETACHED) {
13082 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13085 void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
13086 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13088 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13089 if (get_jenv_res == JNI_EDETACHED) {
13090 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13092 DO_ASSERT(get_jenv_res == JNI_OK);
13094 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13095 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13096 LDKFundingSigned msg_var = *msg;
13097 int64_t msg_ref = 0;
13098 msg_var = FundingSigned_clone(&msg_var);
13099 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13100 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13101 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13102 CHECK(obj != NULL);
13103 (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref);
13104 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13105 (*env)->ExceptionDescribe(env);
13106 (*env)->FatalError(env, "A call to handle_funding_signed in LDKChannelMessageHandler from rust threw an exception.");
13108 if (get_jenv_res == JNI_EDETACHED) {
13109 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13112 void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
13113 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13115 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13116 if (get_jenv_res == JNI_EDETACHED) {
13117 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13119 DO_ASSERT(get_jenv_res == JNI_OK);
13121 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13122 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13123 LDKChannelReady msg_var = *msg;
13124 int64_t msg_ref = 0;
13125 msg_var = ChannelReady_clone(&msg_var);
13126 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13127 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13128 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13129 CHECK(obj != NULL);
13130 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_ready_meth, their_node_id_arr, msg_ref);
13131 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13132 (*env)->ExceptionDescribe(env);
13133 (*env)->FatalError(env, "A call to handle_channel_ready in LDKChannelMessageHandler from rust threw an exception.");
13135 if (get_jenv_res == JNI_EDETACHED) {
13136 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13139 void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown * msg) {
13140 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13142 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13143 if (get_jenv_res == JNI_EDETACHED) {
13144 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13146 DO_ASSERT(get_jenv_res == JNI_OK);
13148 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13149 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13150 LDKShutdown msg_var = *msg;
13151 int64_t msg_ref = 0;
13152 msg_var = Shutdown_clone(&msg_var);
13153 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13154 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13155 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13156 CHECK(obj != NULL);
13157 (*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, msg_ref);
13158 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13159 (*env)->ExceptionDescribe(env);
13160 (*env)->FatalError(env, "A call to handle_shutdown in LDKChannelMessageHandler from rust threw an exception.");
13162 if (get_jenv_res == JNI_EDETACHED) {
13163 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13166 void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
13167 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13169 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13170 if (get_jenv_res == JNI_EDETACHED) {
13171 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13173 DO_ASSERT(get_jenv_res == JNI_OK);
13175 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13176 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13177 LDKClosingSigned msg_var = *msg;
13178 int64_t msg_ref = 0;
13179 msg_var = ClosingSigned_clone(&msg_var);
13180 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13181 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13182 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13183 CHECK(obj != NULL);
13184 (*env)->CallVoidMethod(env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref);
13185 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13186 (*env)->ExceptionDescribe(env);
13187 (*env)->FatalError(env, "A call to handle_closing_signed in LDKChannelMessageHandler from rust threw an exception.");
13189 if (get_jenv_res == JNI_EDETACHED) {
13190 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13193 void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
13194 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13196 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13197 if (get_jenv_res == JNI_EDETACHED) {
13198 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13200 DO_ASSERT(get_jenv_res == JNI_OK);
13202 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13203 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13204 LDKUpdateAddHTLC msg_var = *msg;
13205 int64_t msg_ref = 0;
13206 msg_var = UpdateAddHTLC_clone(&msg_var);
13207 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13208 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13209 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13210 CHECK(obj != NULL);
13211 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref);
13212 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13213 (*env)->ExceptionDescribe(env);
13214 (*env)->FatalError(env, "A call to handle_update_add_htlc in LDKChannelMessageHandler from rust threw an exception.");
13216 if (get_jenv_res == JNI_EDETACHED) {
13217 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13220 void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
13221 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13223 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13224 if (get_jenv_res == JNI_EDETACHED) {
13225 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13227 DO_ASSERT(get_jenv_res == JNI_OK);
13229 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13230 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13231 LDKUpdateFulfillHTLC msg_var = *msg;
13232 int64_t msg_ref = 0;
13233 msg_var = UpdateFulfillHTLC_clone(&msg_var);
13234 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13235 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13236 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13237 CHECK(obj != NULL);
13238 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref);
13239 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13240 (*env)->ExceptionDescribe(env);
13241 (*env)->FatalError(env, "A call to handle_update_fulfill_htlc in LDKChannelMessageHandler from rust threw an exception.");
13243 if (get_jenv_res == JNI_EDETACHED) {
13244 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13247 void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
13248 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13250 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13251 if (get_jenv_res == JNI_EDETACHED) {
13252 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13254 DO_ASSERT(get_jenv_res == JNI_OK);
13256 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13257 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13258 LDKUpdateFailHTLC msg_var = *msg;
13259 int64_t msg_ref = 0;
13260 msg_var = UpdateFailHTLC_clone(&msg_var);
13261 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13262 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13263 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13264 CHECK(obj != NULL);
13265 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref);
13266 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13267 (*env)->ExceptionDescribe(env);
13268 (*env)->FatalError(env, "A call to handle_update_fail_htlc in LDKChannelMessageHandler from rust threw an exception.");
13270 if (get_jenv_res == JNI_EDETACHED) {
13271 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13274 void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
13275 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13277 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13278 if (get_jenv_res == JNI_EDETACHED) {
13279 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13281 DO_ASSERT(get_jenv_res == JNI_OK);
13283 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13284 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13285 LDKUpdateFailMalformedHTLC msg_var = *msg;
13286 int64_t msg_ref = 0;
13287 msg_var = UpdateFailMalformedHTLC_clone(&msg_var);
13288 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13289 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13290 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13291 CHECK(obj != NULL);
13292 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref);
13293 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13294 (*env)->ExceptionDescribe(env);
13295 (*env)->FatalError(env, "A call to handle_update_fail_malformed_htlc in LDKChannelMessageHandler from rust threw an exception.");
13297 if (get_jenv_res == JNI_EDETACHED) {
13298 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13301 void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
13302 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13304 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13305 if (get_jenv_res == JNI_EDETACHED) {
13306 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13308 DO_ASSERT(get_jenv_res == JNI_OK);
13310 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13311 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13312 LDKCommitmentSigned msg_var = *msg;
13313 int64_t msg_ref = 0;
13314 msg_var = CommitmentSigned_clone(&msg_var);
13315 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13316 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13317 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13318 CHECK(obj != NULL);
13319 (*env)->CallVoidMethod(env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref);
13320 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13321 (*env)->ExceptionDescribe(env);
13322 (*env)->FatalError(env, "A call to handle_commitment_signed in LDKChannelMessageHandler from rust threw an exception.");
13324 if (get_jenv_res == JNI_EDETACHED) {
13325 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13328 void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
13329 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13331 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13332 if (get_jenv_res == JNI_EDETACHED) {
13333 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13335 DO_ASSERT(get_jenv_res == JNI_OK);
13337 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13338 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13339 LDKRevokeAndACK msg_var = *msg;
13340 int64_t msg_ref = 0;
13341 msg_var = RevokeAndACK_clone(&msg_var);
13342 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13343 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13344 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13345 CHECK(obj != NULL);
13346 (*env)->CallVoidMethod(env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref);
13347 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13348 (*env)->ExceptionDescribe(env);
13349 (*env)->FatalError(env, "A call to handle_revoke_and_ack in LDKChannelMessageHandler from rust threw an exception.");
13351 if (get_jenv_res == JNI_EDETACHED) {
13352 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13355 void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
13356 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13358 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13359 if (get_jenv_res == JNI_EDETACHED) {
13360 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13362 DO_ASSERT(get_jenv_res == JNI_OK);
13364 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13365 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13366 LDKUpdateFee msg_var = *msg;
13367 int64_t msg_ref = 0;
13368 msg_var = UpdateFee_clone(&msg_var);
13369 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13370 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13371 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13372 CHECK(obj != NULL);
13373 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref);
13374 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13375 (*env)->ExceptionDescribe(env);
13376 (*env)->FatalError(env, "A call to handle_update_fee in LDKChannelMessageHandler from rust threw an exception.");
13378 if (get_jenv_res == JNI_EDETACHED) {
13379 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13382 void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
13383 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13385 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13386 if (get_jenv_res == JNI_EDETACHED) {
13387 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13389 DO_ASSERT(get_jenv_res == JNI_OK);
13391 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13392 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13393 LDKAnnouncementSignatures msg_var = *msg;
13394 int64_t msg_ref = 0;
13395 msg_var = AnnouncementSignatures_clone(&msg_var);
13396 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13397 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13398 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13399 CHECK(obj != NULL);
13400 (*env)->CallVoidMethod(env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref);
13401 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13402 (*env)->ExceptionDescribe(env);
13403 (*env)->FatalError(env, "A call to handle_announcement_signatures in LDKChannelMessageHandler from rust threw an exception.");
13405 if (get_jenv_res == JNI_EDETACHED) {
13406 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13409 void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
13410 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13412 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13413 if (get_jenv_res == JNI_EDETACHED) {
13414 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13416 DO_ASSERT(get_jenv_res == JNI_OK);
13418 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13419 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13420 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13421 CHECK(obj != NULL);
13422 (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr);
13423 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13424 (*env)->ExceptionDescribe(env);
13425 (*env)->FatalError(env, "A call to peer_disconnected in LDKChannelMessageHandler from rust threw an exception.");
13427 if (get_jenv_res == JNI_EDETACHED) {
13428 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13431 LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg, bool inbound) {
13432 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13434 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13435 if (get_jenv_res == JNI_EDETACHED) {
13436 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13438 DO_ASSERT(get_jenv_res == JNI_OK);
13440 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13441 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13442 LDKInit msg_var = *msg;
13443 int64_t msg_ref = 0;
13444 msg_var = Init_clone(&msg_var);
13445 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13446 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13447 jboolean inbound_conv = inbound;
13448 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13449 CHECK(obj != NULL);
13450 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref, inbound_conv);
13451 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13452 (*env)->ExceptionDescribe(env);
13453 (*env)->FatalError(env, "A call to peer_connected in LDKChannelMessageHandler from rust threw an exception.");
13455 void* ret_ptr = untag_ptr(ret);
13456 CHECK_ACCESS(ret_ptr);
13457 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
13458 FREE(untag_ptr(ret));
13459 if (get_jenv_res == JNI_EDETACHED) {
13460 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13464 void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
13465 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13467 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13468 if (get_jenv_res == JNI_EDETACHED) {
13469 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13471 DO_ASSERT(get_jenv_res == JNI_OK);
13473 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13474 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13475 LDKChannelReestablish msg_var = *msg;
13476 int64_t msg_ref = 0;
13477 msg_var = ChannelReestablish_clone(&msg_var);
13478 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13479 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13480 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13481 CHECK(obj != NULL);
13482 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref);
13483 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13484 (*env)->ExceptionDescribe(env);
13485 (*env)->FatalError(env, "A call to handle_channel_reestablish in LDKChannelMessageHandler from rust threw an exception.");
13487 if (get_jenv_res == JNI_EDETACHED) {
13488 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13491 void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
13492 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13494 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13495 if (get_jenv_res == JNI_EDETACHED) {
13496 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13498 DO_ASSERT(get_jenv_res == JNI_OK);
13500 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13501 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13502 LDKChannelUpdate msg_var = *msg;
13503 int64_t msg_ref = 0;
13504 msg_var = ChannelUpdate_clone(&msg_var);
13505 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13506 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13507 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13508 CHECK(obj != NULL);
13509 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref);
13510 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13511 (*env)->ExceptionDescribe(env);
13512 (*env)->FatalError(env, "A call to handle_channel_update in LDKChannelMessageHandler from rust threw an exception.");
13514 if (get_jenv_res == JNI_EDETACHED) {
13515 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13518 void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
13519 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13521 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13522 if (get_jenv_res == JNI_EDETACHED) {
13523 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13525 DO_ASSERT(get_jenv_res == JNI_OK);
13527 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13528 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13529 LDKErrorMessage msg_var = *msg;
13530 int64_t msg_ref = 0;
13531 msg_var = ErrorMessage_clone(&msg_var);
13532 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13533 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13534 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13535 CHECK(obj != NULL);
13536 (*env)->CallVoidMethod(env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref);
13537 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13538 (*env)->ExceptionDescribe(env);
13539 (*env)->FatalError(env, "A call to handle_error in LDKChannelMessageHandler from rust threw an exception.");
13541 if (get_jenv_res == JNI_EDETACHED) {
13542 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13545 LDKNodeFeatures provided_node_features_LDKChannelMessageHandler_jcall(const void* this_arg) {
13546 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13548 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13549 if (get_jenv_res == JNI_EDETACHED) {
13550 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13552 DO_ASSERT(get_jenv_res == JNI_OK);
13554 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13555 CHECK(obj != NULL);
13556 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth);
13557 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13558 (*env)->ExceptionDescribe(env);
13559 (*env)->FatalError(env, "A call to provided_node_features in LDKChannelMessageHandler from rust threw an exception.");
13561 LDKNodeFeatures ret_conv;
13562 ret_conv.inner = untag_ptr(ret);
13563 ret_conv.is_owned = ptr_is_owned(ret);
13564 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
13565 if (get_jenv_res == JNI_EDETACHED) {
13566 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13570 LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
13571 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13573 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13574 if (get_jenv_res == JNI_EDETACHED) {
13575 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13577 DO_ASSERT(get_jenv_res == JNI_OK);
13579 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13580 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13581 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13582 CHECK(obj != NULL);
13583 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_init_features_meth, their_node_id_arr);
13584 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13585 (*env)->ExceptionDescribe(env);
13586 (*env)->FatalError(env, "A call to provided_init_features in LDKChannelMessageHandler from rust threw an exception.");
13588 LDKInitFeatures ret_conv;
13589 ret_conv.inner = untag_ptr(ret);
13590 ret_conv.is_owned = ptr_is_owned(ret);
13591 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
13592 if (get_jenv_res == JNI_EDETACHED) {
13593 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13597 static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
13598 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
13599 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
13600 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
13602 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
13603 jclass c = (*env)->GetObjectClass(env, o);
13605 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
13606 atomic_init(&calls->refcnt, 1);
13607 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
13608 calls->o = (*env)->NewWeakGlobalRef(env, o);
13609 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "([BJ)V");
13610 CHECK(calls->handle_open_channel_meth != NULL);
13611 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "([BJ)V");
13612 CHECK(calls->handle_accept_channel_meth != NULL);
13613 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "([BJ)V");
13614 CHECK(calls->handle_funding_created_meth != NULL);
13615 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "([BJ)V");
13616 CHECK(calls->handle_funding_signed_meth != NULL);
13617 calls->handle_channel_ready_meth = (*env)->GetMethodID(env, c, "handle_channel_ready", "([BJ)V");
13618 CHECK(calls->handle_channel_ready_meth != NULL);
13619 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "([BJ)V");
13620 CHECK(calls->handle_shutdown_meth != NULL);
13621 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "([BJ)V");
13622 CHECK(calls->handle_closing_signed_meth != NULL);
13623 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "([BJ)V");
13624 CHECK(calls->handle_update_add_htlc_meth != NULL);
13625 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "([BJ)V");
13626 CHECK(calls->handle_update_fulfill_htlc_meth != NULL);
13627 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "([BJ)V");
13628 CHECK(calls->handle_update_fail_htlc_meth != NULL);
13629 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "([BJ)V");
13630 CHECK(calls->handle_update_fail_malformed_htlc_meth != NULL);
13631 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "([BJ)V");
13632 CHECK(calls->handle_commitment_signed_meth != NULL);
13633 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "([BJ)V");
13634 CHECK(calls->handle_revoke_and_ack_meth != NULL);
13635 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "([BJ)V");
13636 CHECK(calls->handle_update_fee_meth != NULL);
13637 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "([BJ)V");
13638 CHECK(calls->handle_announcement_signatures_meth != NULL);
13639 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([B)V");
13640 CHECK(calls->peer_disconnected_meth != NULL);
13641 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJZ)J");
13642 CHECK(calls->peer_connected_meth != NULL);
13643 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "([BJ)V");
13644 CHECK(calls->handle_channel_reestablish_meth != NULL);
13645 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "([BJ)V");
13646 CHECK(calls->handle_channel_update_meth != NULL);
13647 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "([BJ)V");
13648 CHECK(calls->handle_error_meth != NULL);
13649 calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J");
13650 CHECK(calls->provided_node_features_meth != NULL);
13651 calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J");
13652 CHECK(calls->provided_init_features_meth != NULL);
13654 LDKChannelMessageHandler ret = {
13655 .this_arg = (void*) calls,
13656 .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
13657 .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
13658 .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
13659 .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
13660 .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall,
13661 .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
13662 .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
13663 .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
13664 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
13665 .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
13666 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
13667 .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
13668 .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
13669 .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
13670 .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
13671 .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
13672 .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
13673 .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
13674 .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
13675 .handle_error = handle_error_LDKChannelMessageHandler_jcall,
13676 .provided_node_features = provided_node_features_LDKChannelMessageHandler_jcall,
13677 .provided_init_features = provided_init_features_LDKChannelMessageHandler_jcall,
13678 .free = LDKChannelMessageHandler_JCalls_free,
13679 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider),
13681 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
13684 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
13685 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
13686 *res_ptr = LDKChannelMessageHandler_init(env, clz, o, MessageSendEventsProvider);
13687 return tag_ptr(res_ptr, true);
13689 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
13690 LDKChannelMessageHandler *inp = (LDKChannelMessageHandler *)untag_ptr(arg);
13691 return tag_ptr(&inp->MessageSendEventsProvider, false);
13693 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 msg) {
13694 void* this_arg_ptr = untag_ptr(this_arg);
13695 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13696 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13697 LDKPublicKey their_node_id_ref;
13698 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13699 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13700 LDKOpenChannel msg_conv;
13701 msg_conv.inner = untag_ptr(msg);
13702 msg_conv.is_owned = ptr_is_owned(msg);
13703 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13704 msg_conv.is_owned = false;
13705 (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13708 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 msg) {
13709 void* this_arg_ptr = untag_ptr(this_arg);
13710 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13711 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13712 LDKPublicKey their_node_id_ref;
13713 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13714 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13715 LDKAcceptChannel msg_conv;
13716 msg_conv.inner = untag_ptr(msg);
13717 msg_conv.is_owned = ptr_is_owned(msg);
13718 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13719 msg_conv.is_owned = false;
13720 (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13723 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) {
13724 void* this_arg_ptr = untag_ptr(this_arg);
13725 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13726 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13727 LDKPublicKey their_node_id_ref;
13728 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13729 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13730 LDKFundingCreated msg_conv;
13731 msg_conv.inner = untag_ptr(msg);
13732 msg_conv.is_owned = ptr_is_owned(msg);
13733 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13734 msg_conv.is_owned = false;
13735 (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13738 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) {
13739 void* this_arg_ptr = untag_ptr(this_arg);
13740 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13741 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13742 LDKPublicKey their_node_id_ref;
13743 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13744 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13745 LDKFundingSigned msg_conv;
13746 msg_conv.inner = untag_ptr(msg);
13747 msg_conv.is_owned = ptr_is_owned(msg);
13748 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13749 msg_conv.is_owned = false;
13750 (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13753 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) {
13754 void* this_arg_ptr = untag_ptr(this_arg);
13755 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13756 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13757 LDKPublicKey their_node_id_ref;
13758 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13759 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13760 LDKChannelReady msg_conv;
13761 msg_conv.inner = untag_ptr(msg);
13762 msg_conv.is_owned = ptr_is_owned(msg);
13763 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13764 msg_conv.is_owned = false;
13765 (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13768 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 msg) {
13769 void* this_arg_ptr = untag_ptr(this_arg);
13770 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13771 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13772 LDKPublicKey their_node_id_ref;
13773 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13774 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13775 LDKShutdown msg_conv;
13776 msg_conv.inner = untag_ptr(msg);
13777 msg_conv.is_owned = ptr_is_owned(msg);
13778 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13779 msg_conv.is_owned = false;
13780 (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13783 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) {
13784 void* this_arg_ptr = untag_ptr(this_arg);
13785 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13786 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13787 LDKPublicKey their_node_id_ref;
13788 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13789 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13790 LDKClosingSigned msg_conv;
13791 msg_conv.inner = untag_ptr(msg);
13792 msg_conv.is_owned = ptr_is_owned(msg);
13793 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13794 msg_conv.is_owned = false;
13795 (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13798 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) {
13799 void* this_arg_ptr = untag_ptr(this_arg);
13800 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13801 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13802 LDKPublicKey their_node_id_ref;
13803 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13804 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13805 LDKUpdateAddHTLC msg_conv;
13806 msg_conv.inner = untag_ptr(msg);
13807 msg_conv.is_owned = ptr_is_owned(msg);
13808 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13809 msg_conv.is_owned = false;
13810 (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13813 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) {
13814 void* this_arg_ptr = untag_ptr(this_arg);
13815 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13816 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13817 LDKPublicKey their_node_id_ref;
13818 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13819 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13820 LDKUpdateFulfillHTLC msg_conv;
13821 msg_conv.inner = untag_ptr(msg);
13822 msg_conv.is_owned = ptr_is_owned(msg);
13823 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13824 msg_conv.is_owned = false;
13825 (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13828 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) {
13829 void* this_arg_ptr = untag_ptr(this_arg);
13830 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13831 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13832 LDKPublicKey their_node_id_ref;
13833 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13834 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13835 LDKUpdateFailHTLC msg_conv;
13836 msg_conv.inner = untag_ptr(msg);
13837 msg_conv.is_owned = ptr_is_owned(msg);
13838 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13839 msg_conv.is_owned = false;
13840 (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13843 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) {
13844 void* this_arg_ptr = untag_ptr(this_arg);
13845 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13846 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13847 LDKPublicKey their_node_id_ref;
13848 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13849 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13850 LDKUpdateFailMalformedHTLC msg_conv;
13851 msg_conv.inner = untag_ptr(msg);
13852 msg_conv.is_owned = ptr_is_owned(msg);
13853 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13854 msg_conv.is_owned = false;
13855 (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13858 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) {
13859 void* this_arg_ptr = untag_ptr(this_arg);
13860 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13861 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13862 LDKPublicKey their_node_id_ref;
13863 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13864 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13865 LDKCommitmentSigned msg_conv;
13866 msg_conv.inner = untag_ptr(msg);
13867 msg_conv.is_owned = ptr_is_owned(msg);
13868 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13869 msg_conv.is_owned = false;
13870 (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13873 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) {
13874 void* this_arg_ptr = untag_ptr(this_arg);
13875 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13876 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13877 LDKPublicKey their_node_id_ref;
13878 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13879 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13880 LDKRevokeAndACK msg_conv;
13881 msg_conv.inner = untag_ptr(msg);
13882 msg_conv.is_owned = ptr_is_owned(msg);
13883 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13884 msg_conv.is_owned = false;
13885 (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13888 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) {
13889 void* this_arg_ptr = untag_ptr(this_arg);
13890 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13891 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13892 LDKPublicKey their_node_id_ref;
13893 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13894 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13895 LDKUpdateFee msg_conv;
13896 msg_conv.inner = untag_ptr(msg);
13897 msg_conv.is_owned = ptr_is_owned(msg);
13898 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13899 msg_conv.is_owned = false;
13900 (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13903 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) {
13904 void* this_arg_ptr = untag_ptr(this_arg);
13905 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13906 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13907 LDKPublicKey their_node_id_ref;
13908 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13909 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13910 LDKAnnouncementSignatures msg_conv;
13911 msg_conv.inner = untag_ptr(msg);
13912 msg_conv.is_owned = ptr_is_owned(msg);
13913 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13914 msg_conv.is_owned = false;
13915 (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13918 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) {
13919 void* this_arg_ptr = untag_ptr(this_arg);
13920 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13921 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13922 LDKPublicKey their_node_id_ref;
13923 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13924 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13925 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref);
13928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg, jboolean inbound) {
13929 void* this_arg_ptr = untag_ptr(this_arg);
13930 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13931 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13932 LDKPublicKey their_node_id_ref;
13933 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13934 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13936 msg_conv.inner = untag_ptr(msg);
13937 msg_conv.is_owned = ptr_is_owned(msg);
13938 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13939 msg_conv.is_owned = false;
13940 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
13941 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv, inbound);
13942 return tag_ptr(ret_conv, true);
13945 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) {
13946 void* this_arg_ptr = untag_ptr(this_arg);
13947 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13948 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13949 LDKPublicKey their_node_id_ref;
13950 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13951 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13952 LDKChannelReestablish msg_conv;
13953 msg_conv.inner = untag_ptr(msg);
13954 msg_conv.is_owned = ptr_is_owned(msg);
13955 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13956 msg_conv.is_owned = false;
13957 (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13960 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) {
13961 void* this_arg_ptr = untag_ptr(this_arg);
13962 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13963 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13964 LDKPublicKey their_node_id_ref;
13965 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13966 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13967 LDKChannelUpdate msg_conv;
13968 msg_conv.inner = untag_ptr(msg);
13969 msg_conv.is_owned = ptr_is_owned(msg);
13970 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13971 msg_conv.is_owned = false;
13972 (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13975 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) {
13976 void* this_arg_ptr = untag_ptr(this_arg);
13977 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13978 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13979 LDKPublicKey their_node_id_ref;
13980 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13981 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13982 LDKErrorMessage msg_conv;
13983 msg_conv.inner = untag_ptr(msg);
13984 msg_conv.is_owned = ptr_is_owned(msg);
13985 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13986 msg_conv.is_owned = false;
13987 (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13990 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
13991 void* this_arg_ptr = untag_ptr(this_arg);
13992 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13993 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13994 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
13995 int64_t ret_ref = 0;
13996 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
13997 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1provided_1init_1features(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) {
14002 void* this_arg_ptr = untag_ptr(this_arg);
14003 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14004 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14005 LDKPublicKey their_node_id_ref;
14006 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14007 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14008 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
14009 int64_t ret_ref = 0;
14010 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14011 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14015 typedef struct LDKRoutingMessageHandler_JCalls {
14016 atomic_size_t refcnt;
14019 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
14020 jmethodID handle_node_announcement_meth;
14021 jmethodID handle_channel_announcement_meth;
14022 jmethodID handle_channel_update_meth;
14023 jmethodID get_next_channel_announcement_meth;
14024 jmethodID get_next_node_announcement_meth;
14025 jmethodID peer_connected_meth;
14026 jmethodID handle_reply_channel_range_meth;
14027 jmethodID handle_reply_short_channel_ids_end_meth;
14028 jmethodID handle_query_channel_range_meth;
14029 jmethodID handle_query_short_channel_ids_meth;
14030 jmethodID processing_queue_high_meth;
14031 jmethodID provided_node_features_meth;
14032 jmethodID provided_init_features_meth;
14033 } LDKRoutingMessageHandler_JCalls;
14034 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
14035 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14036 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
14038 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14039 if (get_jenv_res == JNI_EDETACHED) {
14040 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14042 DO_ASSERT(get_jenv_res == JNI_OK);
14044 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
14045 if (get_jenv_res == JNI_EDETACHED) {
14046 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14051 LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
14052 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14054 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14055 if (get_jenv_res == JNI_EDETACHED) {
14056 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14058 DO_ASSERT(get_jenv_res == JNI_OK);
14060 LDKNodeAnnouncement msg_var = *msg;
14061 int64_t msg_ref = 0;
14062 msg_var = NodeAnnouncement_clone(&msg_var);
14063 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14064 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14065 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14066 CHECK(obj != NULL);
14067 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref);
14068 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14069 (*env)->ExceptionDescribe(env);
14070 (*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
14072 void* ret_ptr = untag_ptr(ret);
14073 CHECK_ACCESS(ret_ptr);
14074 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
14075 FREE(untag_ptr(ret));
14076 if (get_jenv_res == JNI_EDETACHED) {
14077 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14081 LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
14082 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14084 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14085 if (get_jenv_res == JNI_EDETACHED) {
14086 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14088 DO_ASSERT(get_jenv_res == JNI_OK);
14090 LDKChannelAnnouncement msg_var = *msg;
14091 int64_t msg_ref = 0;
14092 msg_var = ChannelAnnouncement_clone(&msg_var);
14093 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14094 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14095 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14096 CHECK(obj != NULL);
14097 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref);
14098 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14099 (*env)->ExceptionDescribe(env);
14100 (*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
14102 void* ret_ptr = untag_ptr(ret);
14103 CHECK_ACCESS(ret_ptr);
14104 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
14105 FREE(untag_ptr(ret));
14106 if (get_jenv_res == JNI_EDETACHED) {
14107 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14111 LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
14112 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14114 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14115 if (get_jenv_res == JNI_EDETACHED) {
14116 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14118 DO_ASSERT(get_jenv_res == JNI_OK);
14120 LDKChannelUpdate msg_var = *msg;
14121 int64_t msg_ref = 0;
14122 msg_var = ChannelUpdate_clone(&msg_var);
14123 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14124 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14125 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14126 CHECK(obj != NULL);
14127 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref);
14128 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14129 (*env)->ExceptionDescribe(env);
14130 (*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception.");
14132 void* ret_ptr = untag_ptr(ret);
14133 CHECK_ACCESS(ret_ptr);
14134 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
14135 FREE(untag_ptr(ret));
14136 if (get_jenv_res == JNI_EDETACHED) {
14137 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14141 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point) {
14142 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14144 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14145 if (get_jenv_res == JNI_EDETACHED) {
14146 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14148 DO_ASSERT(get_jenv_res == JNI_OK);
14150 int64_t starting_point_conv = starting_point;
14151 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14152 CHECK(obj != NULL);
14153 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_next_channel_announcement_meth, starting_point_conv);
14154 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14155 (*env)->ExceptionDescribe(env);
14156 (*env)->FatalError(env, "A call to get_next_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
14158 void* ret_ptr = untag_ptr(ret);
14159 CHECK_ACCESS(ret_ptr);
14160 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr);
14161 FREE(untag_ptr(ret));
14162 if (get_jenv_res == JNI_EDETACHED) {
14163 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14167 LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKNodeId starting_point) {
14168 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14170 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14171 if (get_jenv_res == JNI_EDETACHED) {
14172 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14174 DO_ASSERT(get_jenv_res == JNI_OK);
14176 LDKNodeId starting_point_var = starting_point;
14177 int64_t starting_point_ref = 0;
14178 CHECK_INNER_FIELD_ACCESS_OR_NULL(starting_point_var);
14179 starting_point_ref = tag_ptr(starting_point_var.inner, starting_point_var.is_owned);
14180 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14181 CHECK(obj != NULL);
14182 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_next_node_announcement_meth, starting_point_ref);
14183 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14184 (*env)->ExceptionDescribe(env);
14185 (*env)->FatalError(env, "A call to get_next_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
14187 LDKNodeAnnouncement ret_conv;
14188 ret_conv.inner = untag_ptr(ret);
14189 ret_conv.is_owned = ptr_is_owned(ret);
14190 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
14191 if (get_jenv_res == JNI_EDETACHED) {
14192 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14196 LDKCResult_NoneNoneZ peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init, bool inbound) {
14197 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14199 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14200 if (get_jenv_res == JNI_EDETACHED) {
14201 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14203 DO_ASSERT(get_jenv_res == JNI_OK);
14205 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14206 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14207 LDKInit init_var = *init;
14208 int64_t init_ref = 0;
14209 init_var = Init_clone(&init_var);
14210 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
14211 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
14212 jboolean inbound_conv = inbound;
14213 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14214 CHECK(obj != NULL);
14215 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref, inbound_conv);
14216 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14217 (*env)->ExceptionDescribe(env);
14218 (*env)->FatalError(env, "A call to peer_connected in LDKRoutingMessageHandler from rust threw an exception.");
14220 void* ret_ptr = untag_ptr(ret);
14221 CHECK_ACCESS(ret_ptr);
14222 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
14223 FREE(untag_ptr(ret));
14224 if (get_jenv_res == JNI_EDETACHED) {
14225 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14229 LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
14230 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14232 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14233 if (get_jenv_res == JNI_EDETACHED) {
14234 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14236 DO_ASSERT(get_jenv_res == JNI_OK);
14238 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14239 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14240 LDKReplyChannelRange msg_var = msg;
14241 int64_t msg_ref = 0;
14242 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14243 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14244 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14245 CHECK(obj != NULL);
14246 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref);
14247 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14248 (*env)->ExceptionDescribe(env);
14249 (*env)->FatalError(env, "A call to handle_reply_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
14251 void* ret_ptr = untag_ptr(ret);
14252 CHECK_ACCESS(ret_ptr);
14253 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
14254 FREE(untag_ptr(ret));
14255 if (get_jenv_res == JNI_EDETACHED) {
14256 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14260 LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
14261 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14263 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14264 if (get_jenv_res == JNI_EDETACHED) {
14265 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14267 DO_ASSERT(get_jenv_res == JNI_OK);
14269 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14270 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14271 LDKReplyShortChannelIdsEnd msg_var = msg;
14272 int64_t msg_ref = 0;
14273 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14274 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14275 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14276 CHECK(obj != NULL);
14277 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref);
14278 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14279 (*env)->ExceptionDescribe(env);
14280 (*env)->FatalError(env, "A call to handle_reply_short_channel_ids_end in LDKRoutingMessageHandler from rust threw an exception.");
14282 void* ret_ptr = untag_ptr(ret);
14283 CHECK_ACCESS(ret_ptr);
14284 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
14285 FREE(untag_ptr(ret));
14286 if (get_jenv_res == JNI_EDETACHED) {
14287 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14291 LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
14292 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14294 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14295 if (get_jenv_res == JNI_EDETACHED) {
14296 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14298 DO_ASSERT(get_jenv_res == JNI_OK);
14300 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14301 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14302 LDKQueryChannelRange msg_var = msg;
14303 int64_t msg_ref = 0;
14304 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14305 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14306 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14307 CHECK(obj != NULL);
14308 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref);
14309 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14310 (*env)->ExceptionDescribe(env);
14311 (*env)->FatalError(env, "A call to handle_query_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
14313 void* ret_ptr = untag_ptr(ret);
14314 CHECK_ACCESS(ret_ptr);
14315 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
14316 FREE(untag_ptr(ret));
14317 if (get_jenv_res == JNI_EDETACHED) {
14318 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14322 LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
14323 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14325 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14326 if (get_jenv_res == JNI_EDETACHED) {
14327 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14329 DO_ASSERT(get_jenv_res == JNI_OK);
14331 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14332 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14333 LDKQueryShortChannelIds msg_var = msg;
14334 int64_t msg_ref = 0;
14335 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14336 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14337 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14338 CHECK(obj != NULL);
14339 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref);
14340 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14341 (*env)->ExceptionDescribe(env);
14342 (*env)->FatalError(env, "A call to handle_query_short_channel_ids in LDKRoutingMessageHandler from rust threw an exception.");
14344 void* ret_ptr = untag_ptr(ret);
14345 CHECK_ACCESS(ret_ptr);
14346 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
14347 FREE(untag_ptr(ret));
14348 if (get_jenv_res == JNI_EDETACHED) {
14349 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14353 bool processing_queue_high_LDKRoutingMessageHandler_jcall(const void* this_arg) {
14354 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14356 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14357 if (get_jenv_res == JNI_EDETACHED) {
14358 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14360 DO_ASSERT(get_jenv_res == JNI_OK);
14362 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14363 CHECK(obj != NULL);
14364 jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->processing_queue_high_meth);
14365 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14366 (*env)->ExceptionDescribe(env);
14367 (*env)->FatalError(env, "A call to processing_queue_high in LDKRoutingMessageHandler from rust threw an exception.");
14369 if (get_jenv_res == JNI_EDETACHED) {
14370 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14374 LDKNodeFeatures provided_node_features_LDKRoutingMessageHandler_jcall(const void* this_arg) {
14375 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14377 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14378 if (get_jenv_res == JNI_EDETACHED) {
14379 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14381 DO_ASSERT(get_jenv_res == JNI_OK);
14383 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14384 CHECK(obj != NULL);
14385 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth);
14386 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14387 (*env)->ExceptionDescribe(env);
14388 (*env)->FatalError(env, "A call to provided_node_features in LDKRoutingMessageHandler from rust threw an exception.");
14390 LDKNodeFeatures ret_conv;
14391 ret_conv.inner = untag_ptr(ret);
14392 ret_conv.is_owned = ptr_is_owned(ret);
14393 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
14394 if (get_jenv_res == JNI_EDETACHED) {
14395 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14399 LDKInitFeatures provided_init_features_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
14400 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14402 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14403 if (get_jenv_res == JNI_EDETACHED) {
14404 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14406 DO_ASSERT(get_jenv_res == JNI_OK);
14408 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14409 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14410 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14411 CHECK(obj != NULL);
14412 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_init_features_meth, their_node_id_arr);
14413 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14414 (*env)->ExceptionDescribe(env);
14415 (*env)->FatalError(env, "A call to provided_init_features in LDKRoutingMessageHandler from rust threw an exception.");
14417 LDKInitFeatures ret_conv;
14418 ret_conv.inner = untag_ptr(ret);
14419 ret_conv.is_owned = ptr_is_owned(ret);
14420 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
14421 if (get_jenv_res == JNI_EDETACHED) {
14422 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14426 static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
14427 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
14428 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
14429 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
14431 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
14432 jclass c = (*env)->GetObjectClass(env, o);
14434 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
14435 atomic_init(&calls->refcnt, 1);
14436 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
14437 calls->o = (*env)->NewWeakGlobalRef(env, o);
14438 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
14439 CHECK(calls->handle_node_announcement_meth != NULL);
14440 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
14441 CHECK(calls->handle_channel_announcement_meth != NULL);
14442 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
14443 CHECK(calls->handle_channel_update_meth != NULL);
14444 calls->get_next_channel_announcement_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcement", "(J)J");
14445 CHECK(calls->get_next_channel_announcement_meth != NULL);
14446 calls->get_next_node_announcement_meth = (*env)->GetMethodID(env, c, "get_next_node_announcement", "(J)J");
14447 CHECK(calls->get_next_node_announcement_meth != NULL);
14448 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJZ)J");
14449 CHECK(calls->peer_connected_meth != NULL);
14450 calls->handle_reply_channel_range_meth = (*env)->GetMethodID(env, c, "handle_reply_channel_range", "([BJ)J");
14451 CHECK(calls->handle_reply_channel_range_meth != NULL);
14452 calls->handle_reply_short_channel_ids_end_meth = (*env)->GetMethodID(env, c, "handle_reply_short_channel_ids_end", "([BJ)J");
14453 CHECK(calls->handle_reply_short_channel_ids_end_meth != NULL);
14454 calls->handle_query_channel_range_meth = (*env)->GetMethodID(env, c, "handle_query_channel_range", "([BJ)J");
14455 CHECK(calls->handle_query_channel_range_meth != NULL);
14456 calls->handle_query_short_channel_ids_meth = (*env)->GetMethodID(env, c, "handle_query_short_channel_ids", "([BJ)J");
14457 CHECK(calls->handle_query_short_channel_ids_meth != NULL);
14458 calls->processing_queue_high_meth = (*env)->GetMethodID(env, c, "processing_queue_high", "()Z");
14459 CHECK(calls->processing_queue_high_meth != NULL);
14460 calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J");
14461 CHECK(calls->provided_node_features_meth != NULL);
14462 calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J");
14463 CHECK(calls->provided_init_features_meth != NULL);
14465 LDKRoutingMessageHandler ret = {
14466 .this_arg = (void*) calls,
14467 .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
14468 .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
14469 .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
14470 .get_next_channel_announcement = get_next_channel_announcement_LDKRoutingMessageHandler_jcall,
14471 .get_next_node_announcement = get_next_node_announcement_LDKRoutingMessageHandler_jcall,
14472 .peer_connected = peer_connected_LDKRoutingMessageHandler_jcall,
14473 .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
14474 .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
14475 .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
14476 .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
14477 .processing_queue_high = processing_queue_high_LDKRoutingMessageHandler_jcall,
14478 .provided_node_features = provided_node_features_LDKRoutingMessageHandler_jcall,
14479 .provided_init_features = provided_init_features_LDKRoutingMessageHandler_jcall,
14480 .free = LDKRoutingMessageHandler_JCalls_free,
14481 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider),
14483 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
14486 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
14487 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
14488 *res_ptr = LDKRoutingMessageHandler_init(env, clz, o, MessageSendEventsProvider);
14489 return tag_ptr(res_ptr, true);
14491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
14492 LDKRoutingMessageHandler *inp = (LDKRoutingMessageHandler *)untag_ptr(arg);
14493 return tag_ptr(&inp->MessageSendEventsProvider, false);
14495 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
14496 void* this_arg_ptr = untag_ptr(this_arg);
14497 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14498 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14499 LDKNodeAnnouncement msg_conv;
14500 msg_conv.inner = untag_ptr(msg);
14501 msg_conv.is_owned = ptr_is_owned(msg);
14502 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14503 msg_conv.is_owned = false;
14504 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14505 *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
14506 return tag_ptr(ret_conv, true);
14509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
14510 void* this_arg_ptr = untag_ptr(this_arg);
14511 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14512 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14513 LDKChannelAnnouncement msg_conv;
14514 msg_conv.inner = untag_ptr(msg);
14515 msg_conv.is_owned = ptr_is_owned(msg);
14516 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14517 msg_conv.is_owned = false;
14518 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14519 *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
14520 return tag_ptr(ret_conv, true);
14523 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
14524 void* this_arg_ptr = untag_ptr(this_arg);
14525 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14526 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14527 LDKChannelUpdate msg_conv;
14528 msg_conv.inner = untag_ptr(msg);
14529 msg_conv.is_owned = ptr_is_owned(msg);
14530 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14531 msg_conv.is_owned = false;
14532 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14533 *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
14534 return tag_ptr(ret_conv, true);
14537 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t starting_point) {
14538 void* this_arg_ptr = untag_ptr(this_arg);
14539 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14540 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14541 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
14542 *ret_copy = (this_arg_conv->get_next_channel_announcement)(this_arg_conv->this_arg, starting_point);
14543 int64_t ret_ref = tag_ptr(ret_copy, true);
14547 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t starting_point) {
14548 void* this_arg_ptr = untag_ptr(this_arg);
14549 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14550 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14551 LDKNodeId starting_point_conv;
14552 starting_point_conv.inner = untag_ptr(starting_point);
14553 starting_point_conv.is_owned = ptr_is_owned(starting_point);
14554 CHECK_INNER_FIELD_ACCESS_OR_NULL(starting_point_conv);
14555 starting_point_conv = NodeId_clone(&starting_point_conv);
14556 LDKNodeAnnouncement ret_var = (this_arg_conv->get_next_node_announcement)(this_arg_conv->this_arg, starting_point_conv);
14557 int64_t ret_ref = 0;
14558 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14559 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14563 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init, jboolean inbound) {
14564 void* this_arg_ptr = untag_ptr(this_arg);
14565 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14566 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14567 LDKPublicKey their_node_id_ref;
14568 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14569 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14571 init_conv.inner = untag_ptr(init);
14572 init_conv.is_owned = ptr_is_owned(init);
14573 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
14574 init_conv.is_owned = false;
14575 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
14576 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv, inbound);
14577 return tag_ptr(ret_conv, true);
14580 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) {
14581 void* this_arg_ptr = untag_ptr(this_arg);
14582 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14583 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14584 LDKPublicKey their_node_id_ref;
14585 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14586 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14587 LDKReplyChannelRange msg_conv;
14588 msg_conv.inner = untag_ptr(msg);
14589 msg_conv.is_owned = ptr_is_owned(msg);
14590 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14591 msg_conv = ReplyChannelRange_clone(&msg_conv);
14592 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14593 *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
14594 return tag_ptr(ret_conv, true);
14597 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) {
14598 void* this_arg_ptr = untag_ptr(this_arg);
14599 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14600 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14601 LDKPublicKey their_node_id_ref;
14602 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14603 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14604 LDKReplyShortChannelIdsEnd msg_conv;
14605 msg_conv.inner = untag_ptr(msg);
14606 msg_conv.is_owned = ptr_is_owned(msg);
14607 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14608 msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv);
14609 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14610 *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
14611 return tag_ptr(ret_conv, true);
14614 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) {
14615 void* this_arg_ptr = untag_ptr(this_arg);
14616 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14617 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14618 LDKPublicKey their_node_id_ref;
14619 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14620 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14621 LDKQueryChannelRange msg_conv;
14622 msg_conv.inner = untag_ptr(msg);
14623 msg_conv.is_owned = ptr_is_owned(msg);
14624 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14625 msg_conv = QueryChannelRange_clone(&msg_conv);
14626 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14627 *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
14628 return tag_ptr(ret_conv, true);
14631 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) {
14632 void* this_arg_ptr = untag_ptr(this_arg);
14633 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14634 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14635 LDKPublicKey their_node_id_ref;
14636 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14637 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14638 LDKQueryShortChannelIds msg_conv;
14639 msg_conv.inner = untag_ptr(msg);
14640 msg_conv.is_owned = ptr_is_owned(msg);
14641 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14642 msg_conv = QueryShortChannelIds_clone(&msg_conv);
14643 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14644 *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
14645 return tag_ptr(ret_conv, true);
14648 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1processing_1queue_1high(JNIEnv *env, jclass clz, int64_t this_arg) {
14649 void* this_arg_ptr = untag_ptr(this_arg);
14650 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14651 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14652 jboolean ret_conv = (this_arg_conv->processing_queue_high)(this_arg_conv->this_arg);
14656 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
14657 void* this_arg_ptr = untag_ptr(this_arg);
14658 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14659 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14660 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
14661 int64_t ret_ref = 0;
14662 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14663 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14667 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1provided_1init_1features(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) {
14668 void* this_arg_ptr = untag_ptr(this_arg);
14669 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14670 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14671 LDKPublicKey their_node_id_ref;
14672 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14673 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14674 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
14675 int64_t ret_ref = 0;
14676 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14677 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14681 typedef struct LDKOnionMessageHandler_JCalls {
14682 atomic_size_t refcnt;
14685 LDKOnionMessageProvider_JCalls* OnionMessageProvider;
14686 jmethodID handle_onion_message_meth;
14687 jmethodID peer_connected_meth;
14688 jmethodID peer_disconnected_meth;
14689 jmethodID provided_node_features_meth;
14690 jmethodID provided_init_features_meth;
14691 } LDKOnionMessageHandler_JCalls;
14692 static void LDKOnionMessageHandler_JCalls_free(void* this_arg) {
14693 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
14694 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
14696 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14697 if (get_jenv_res == JNI_EDETACHED) {
14698 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14700 DO_ASSERT(get_jenv_res == JNI_OK);
14702 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
14703 if (get_jenv_res == JNI_EDETACHED) {
14704 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14709 void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) {
14710 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
14712 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14713 if (get_jenv_res == JNI_EDETACHED) {
14714 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14716 DO_ASSERT(get_jenv_res == JNI_OK);
14718 int8_tArray peer_node_id_arr = (*env)->NewByteArray(env, 33);
14719 (*env)->SetByteArrayRegion(env, peer_node_id_arr, 0, 33, peer_node_id.compressed_form);
14720 LDKOnionMessage msg_var = *msg;
14721 int64_t msg_ref = 0;
14722 msg_var = OnionMessage_clone(&msg_var);
14723 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14724 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14725 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14726 CHECK(obj != NULL);
14727 (*env)->CallVoidMethod(env, obj, j_calls->handle_onion_message_meth, peer_node_id_arr, msg_ref);
14728 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14729 (*env)->ExceptionDescribe(env);
14730 (*env)->FatalError(env, "A call to handle_onion_message in LDKOnionMessageHandler from rust threw an exception.");
14732 if (get_jenv_res == JNI_EDETACHED) {
14733 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14736 LDKCResult_NoneNoneZ peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init, bool inbound) {
14737 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
14739 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14740 if (get_jenv_res == JNI_EDETACHED) {
14741 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14743 DO_ASSERT(get_jenv_res == JNI_OK);
14745 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14746 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14747 LDKInit init_var = *init;
14748 int64_t init_ref = 0;
14749 init_var = Init_clone(&init_var);
14750 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
14751 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
14752 jboolean inbound_conv = inbound;
14753 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14754 CHECK(obj != NULL);
14755 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref, inbound_conv);
14756 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14757 (*env)->ExceptionDescribe(env);
14758 (*env)->FatalError(env, "A call to peer_connected in LDKOnionMessageHandler from rust threw an exception.");
14760 void* ret_ptr = untag_ptr(ret);
14761 CHECK_ACCESS(ret_ptr);
14762 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
14763 FREE(untag_ptr(ret));
14764 if (get_jenv_res == JNI_EDETACHED) {
14765 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14769 void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
14770 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
14772 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14773 if (get_jenv_res == JNI_EDETACHED) {
14774 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14776 DO_ASSERT(get_jenv_res == JNI_OK);
14778 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14779 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14780 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14781 CHECK(obj != NULL);
14782 (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr);
14783 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14784 (*env)->ExceptionDescribe(env);
14785 (*env)->FatalError(env, "A call to peer_disconnected in LDKOnionMessageHandler from rust threw an exception.");
14787 if (get_jenv_res == JNI_EDETACHED) {
14788 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14791 LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) {
14792 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
14794 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14795 if (get_jenv_res == JNI_EDETACHED) {
14796 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14798 DO_ASSERT(get_jenv_res == JNI_OK);
14800 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14801 CHECK(obj != NULL);
14802 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth);
14803 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14804 (*env)->ExceptionDescribe(env);
14805 (*env)->FatalError(env, "A call to provided_node_features in LDKOnionMessageHandler from rust threw an exception.");
14807 LDKNodeFeatures ret_conv;
14808 ret_conv.inner = untag_ptr(ret);
14809 ret_conv.is_owned = ptr_is_owned(ret);
14810 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
14811 if (get_jenv_res == JNI_EDETACHED) {
14812 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14816 LDKInitFeatures provided_init_features_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
14817 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
14819 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14820 if (get_jenv_res == JNI_EDETACHED) {
14821 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14823 DO_ASSERT(get_jenv_res == JNI_OK);
14825 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14826 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14827 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14828 CHECK(obj != NULL);
14829 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_init_features_meth, their_node_id_arr);
14830 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14831 (*env)->ExceptionDescribe(env);
14832 (*env)->FatalError(env, "A call to provided_init_features in LDKOnionMessageHandler from rust threw an exception.");
14834 LDKInitFeatures ret_conv;
14835 ret_conv.inner = untag_ptr(ret);
14836 ret_conv.is_owned = ptr_is_owned(ret);
14837 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
14838 if (get_jenv_res == JNI_EDETACHED) {
14839 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14843 static void LDKOnionMessageHandler_JCalls_cloned(LDKOnionMessageHandler* new_obj) {
14844 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) new_obj->this_arg;
14845 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
14846 atomic_fetch_add_explicit(&j_calls->OnionMessageProvider->refcnt, 1, memory_order_release);
14848 static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject OnionMessageProvider) {
14849 jclass c = (*env)->GetObjectClass(env, o);
14851 LDKOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKOnionMessageHandler_JCalls), "LDKOnionMessageHandler_JCalls");
14852 atomic_init(&calls->refcnt, 1);
14853 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
14854 calls->o = (*env)->NewWeakGlobalRef(env, o);
14855 calls->handle_onion_message_meth = (*env)->GetMethodID(env, c, "handle_onion_message", "([BJ)V");
14856 CHECK(calls->handle_onion_message_meth != NULL);
14857 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJZ)J");
14858 CHECK(calls->peer_connected_meth != NULL);
14859 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([B)V");
14860 CHECK(calls->peer_disconnected_meth != NULL);
14861 calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J");
14862 CHECK(calls->provided_node_features_meth != NULL);
14863 calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J");
14864 CHECK(calls->provided_init_features_meth != NULL);
14866 LDKOnionMessageHandler ret = {
14867 .this_arg = (void*) calls,
14868 .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall,
14869 .peer_connected = peer_connected_LDKOnionMessageHandler_jcall,
14870 .peer_disconnected = peer_disconnected_LDKOnionMessageHandler_jcall,
14871 .provided_node_features = provided_node_features_LDKOnionMessageHandler_jcall,
14872 .provided_init_features = provided_init_features_LDKOnionMessageHandler_jcall,
14873 .free = LDKOnionMessageHandler_JCalls_free,
14874 .OnionMessageProvider = LDKOnionMessageProvider_init(env, clz, OnionMessageProvider),
14876 calls->OnionMessageProvider = ret.OnionMessageProvider.this_arg;
14879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject OnionMessageProvider) {
14880 LDKOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
14881 *res_ptr = LDKOnionMessageHandler_init(env, clz, o, OnionMessageProvider);
14882 return tag_ptr(res_ptr, true);
14884 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageHandler_1get_1OnionMessageProvider(JNIEnv *env, jclass clz, int64_t arg) {
14885 LDKOnionMessageHandler *inp = (LDKOnionMessageHandler *)untag_ptr(arg);
14886 return tag_ptr(&inp->OnionMessageProvider, false);
14888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1handle_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray peer_node_id, int64_t msg) {
14889 void* this_arg_ptr = untag_ptr(this_arg);
14890 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14891 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
14892 LDKPublicKey peer_node_id_ref;
14893 CHECK((*env)->GetArrayLength(env, peer_node_id) == 33);
14894 (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form);
14895 LDKOnionMessage msg_conv;
14896 msg_conv.inner = untag_ptr(msg);
14897 msg_conv.is_owned = ptr_is_owned(msg);
14898 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14899 msg_conv.is_owned = false;
14900 (this_arg_conv->handle_onion_message)(this_arg_conv->this_arg, peer_node_id_ref, &msg_conv);
14903 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init, jboolean inbound) {
14904 void* this_arg_ptr = untag_ptr(this_arg);
14905 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14906 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
14907 LDKPublicKey their_node_id_ref;
14908 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14909 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14911 init_conv.inner = untag_ptr(init);
14912 init_conv.is_owned = ptr_is_owned(init);
14913 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
14914 init_conv.is_owned = false;
14915 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
14916 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv, inbound);
14917 return tag_ptr(ret_conv, true);
14920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) {
14921 void* this_arg_ptr = untag_ptr(this_arg);
14922 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14923 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
14924 LDKPublicKey their_node_id_ref;
14925 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14926 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14927 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref);
14930 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
14931 void* this_arg_ptr = untag_ptr(this_arg);
14932 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14933 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
14934 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
14935 int64_t ret_ref = 0;
14936 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14937 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14941 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1provided_1init_1features(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) {
14942 void* this_arg_ptr = untag_ptr(this_arg);
14943 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14944 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
14945 LDKPublicKey their_node_id_ref;
14946 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14947 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14948 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
14949 int64_t ret_ref = 0;
14950 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14951 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14955 typedef struct LDKCustomMessageReader_JCalls {
14956 atomic_size_t refcnt;
14959 jmethodID read_meth;
14960 } LDKCustomMessageReader_JCalls;
14961 static void LDKCustomMessageReader_JCalls_free(void* this_arg) {
14962 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
14963 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
14965 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14966 if (get_jenv_res == JNI_EDETACHED) {
14967 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14969 DO_ASSERT(get_jenv_res == JNI_OK);
14971 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
14972 if (get_jenv_res == JNI_EDETACHED) {
14973 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14978 LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) {
14979 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
14981 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14982 if (get_jenv_res == JNI_EDETACHED) {
14983 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14985 DO_ASSERT(get_jenv_res == JNI_OK);
14987 int16_t message_type_conv = message_type;
14988 LDKu8slice buffer_var = buffer;
14989 int8_tArray buffer_arr = (*env)->NewByteArray(env, buffer_var.datalen);
14990 (*env)->SetByteArrayRegion(env, buffer_arr, 0, buffer_var.datalen, buffer_var.data);
14991 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14992 CHECK(obj != NULL);
14993 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_meth, message_type_conv, buffer_arr);
14994 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14995 (*env)->ExceptionDescribe(env);
14996 (*env)->FatalError(env, "A call to read in LDKCustomMessageReader from rust threw an exception.");
14998 void* ret_ptr = untag_ptr(ret);
14999 CHECK_ACCESS(ret_ptr);
15000 LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
15001 FREE(untag_ptr(ret));
15002 if (get_jenv_res == JNI_EDETACHED) {
15003 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15007 static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) {
15008 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) new_obj->this_arg;
15009 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
15011 static inline LDKCustomMessageReader LDKCustomMessageReader_init (JNIEnv *env, jclass clz, jobject o) {
15012 jclass c = (*env)->GetObjectClass(env, o);
15014 LDKCustomMessageReader_JCalls *calls = MALLOC(sizeof(LDKCustomMessageReader_JCalls), "LDKCustomMessageReader_JCalls");
15015 atomic_init(&calls->refcnt, 1);
15016 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
15017 calls->o = (*env)->NewWeakGlobalRef(env, o);
15018 calls->read_meth = (*env)->GetMethodID(env, c, "read", "(S[B)J");
15019 CHECK(calls->read_meth != NULL);
15021 LDKCustomMessageReader ret = {
15022 .this_arg = (void*) calls,
15023 .read = read_LDKCustomMessageReader_jcall,
15024 .free = LDKCustomMessageReader_JCalls_free,
15028 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageReader_1new(JNIEnv *env, jclass clz, jobject o) {
15029 LDKCustomMessageReader *res_ptr = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
15030 *res_ptr = LDKCustomMessageReader_init(env, clz, o);
15031 return tag_ptr(res_ptr, true);
15033 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) {
15034 void* this_arg_ptr = untag_ptr(this_arg);
15035 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15036 LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
15037 LDKu8slice buffer_ref;
15038 buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
15039 buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
15040 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15041 *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
15042 (*env)->ReleaseByteArrayElements(env, buffer, (int8_t*)buffer_ref.data, 0);
15043 return tag_ptr(ret_conv, true);
15046 typedef struct LDKCustomMessageHandler_JCalls {
15047 atomic_size_t refcnt;
15050 LDKCustomMessageReader_JCalls* CustomMessageReader;
15051 jmethodID handle_custom_message_meth;
15052 jmethodID get_and_clear_pending_msg_meth;
15053 } LDKCustomMessageHandler_JCalls;
15054 static void LDKCustomMessageHandler_JCalls_free(void* this_arg) {
15055 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
15056 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
15058 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15059 if (get_jenv_res == JNI_EDETACHED) {
15060 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15062 DO_ASSERT(get_jenv_res == JNI_OK);
15064 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
15065 if (get_jenv_res == JNI_EDETACHED) {
15066 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15071 LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
15072 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
15074 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15075 if (get_jenv_res == JNI_EDETACHED) {
15076 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15078 DO_ASSERT(get_jenv_res == JNI_OK);
15080 LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
15082 int8_tArray sender_node_id_arr = (*env)->NewByteArray(env, 33);
15083 (*env)->SetByteArrayRegion(env, sender_node_id_arr, 0, 33, sender_node_id.compressed_form);
15084 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15085 CHECK(obj != NULL);
15086 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true), sender_node_id_arr);
15087 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15088 (*env)->ExceptionDescribe(env);
15089 (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomMessageHandler from rust threw an exception.");
15091 void* ret_ptr = untag_ptr(ret);
15092 CHECK_ACCESS(ret_ptr);
15093 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
15094 FREE(untag_ptr(ret));
15095 if (get_jenv_res == JNI_EDETACHED) {
15096 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15100 LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
15101 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
15103 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15104 if (get_jenv_res == JNI_EDETACHED) {
15105 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15107 DO_ASSERT(get_jenv_res == JNI_OK);
15109 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15110 CHECK(obj != NULL);
15111 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_meth);
15112 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15113 (*env)->ExceptionDescribe(env);
15114 (*env)->FatalError(env, "A call to get_and_clear_pending_msg in LDKCustomMessageHandler from rust threw an exception.");
15116 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
15117 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
15118 if (ret_constr.datalen > 0)
15119 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
15121 ret_constr.data = NULL;
15122 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
15123 for (size_t z = 0; z < ret_constr.datalen; z++) {
15124 int64_t ret_conv_25 = ret_vals[z];
15125 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
15126 CHECK_ACCESS(ret_conv_25_ptr);
15127 LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
15128 FREE(untag_ptr(ret_conv_25));
15129 ret_constr.data[z] = ret_conv_25_conv;
15131 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
15132 if (get_jenv_res == JNI_EDETACHED) {
15133 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15137 static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
15138 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) new_obj->this_arg;
15139 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
15140 atomic_fetch_add_explicit(&j_calls->CustomMessageReader->refcnt, 1, memory_order_release);
15142 static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject CustomMessageReader) {
15143 jclass c = (*env)->GetObjectClass(env, o);
15145 LDKCustomMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomMessageHandler_JCalls), "LDKCustomMessageHandler_JCalls");
15146 atomic_init(&calls->refcnt, 1);
15147 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
15148 calls->o = (*env)->NewWeakGlobalRef(env, o);
15149 calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J[B)J");
15150 CHECK(calls->handle_custom_message_meth != NULL);
15151 calls->get_and_clear_pending_msg_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg", "()[J");
15152 CHECK(calls->get_and_clear_pending_msg_meth != NULL);
15154 LDKCustomMessageHandler ret = {
15155 .this_arg = (void*) calls,
15156 .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall,
15157 .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall,
15158 .free = LDKCustomMessageHandler_JCalls_free,
15159 .CustomMessageReader = LDKCustomMessageReader_init(env, clz, CustomMessageReader),
15161 calls->CustomMessageReader = ret.CustomMessageReader.this_arg;
15164 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject CustomMessageReader) {
15165 LDKCustomMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
15166 *res_ptr = LDKCustomMessageHandler_init(env, clz, o, CustomMessageReader);
15167 return tag_ptr(res_ptr, true);
15169 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageHandler_1get_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t arg) {
15170 LDKCustomMessageHandler *inp = (LDKCustomMessageHandler *)untag_ptr(arg);
15171 return tag_ptr(&inp->CustomMessageReader, false);
15173 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) {
15174 void* this_arg_ptr = untag_ptr(this_arg);
15175 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15176 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
15177 void* msg_ptr = untag_ptr(msg);
15178 CHECK_ACCESS(msg_ptr);
15179 LDKType msg_conv = *(LDKType*)(msg_ptr);
15180 if (msg_conv.free == LDKType_JCalls_free) {
15181 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
15182 LDKType_JCalls_cloned(&msg_conv);
15184 LDKPublicKey sender_node_id_ref;
15185 CHECK((*env)->GetArrayLength(env, sender_node_id) == 33);
15186 (*env)->GetByteArrayRegion(env, sender_node_id, 0, 33, sender_node_id_ref.compressed_form);
15187 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
15188 *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref);
15189 return tag_ptr(ret_conv, true);
15192 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1get_1and_1clear_1pending_1msg(JNIEnv *env, jclass clz, int64_t this_arg) {
15193 void* this_arg_ptr = untag_ptr(this_arg);
15194 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15195 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
15196 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
15197 int64_tArray ret_arr = NULL;
15198 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
15199 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
15200 for (size_t z = 0; z < ret_var.datalen; z++) {
15201 LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
15202 *ret_conv_25_conv = ret_var.data[z];
15203 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
15205 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
15206 FREE(ret_var.data);
15210 typedef struct LDKCustomOnionMessageHandler_JCalls {
15211 atomic_size_t refcnt;
15214 jmethodID handle_custom_message_meth;
15215 jmethodID read_custom_message_meth;
15216 } LDKCustomOnionMessageHandler_JCalls;
15217 static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) {
15218 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
15219 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
15221 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15222 if (get_jenv_res == JNI_EDETACHED) {
15223 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15225 DO_ASSERT(get_jenv_res == JNI_OK);
15227 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
15228 if (get_jenv_res == JNI_EDETACHED) {
15229 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15234 void handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKCustomOnionMessageContents msg) {
15235 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
15237 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15238 if (get_jenv_res == JNI_EDETACHED) {
15239 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15241 DO_ASSERT(get_jenv_res == JNI_OK);
15243 LDKCustomOnionMessageContents* msg_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
15245 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15246 CHECK(obj != NULL);
15247 (*env)->CallVoidMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true));
15248 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15249 (*env)->ExceptionDescribe(env);
15250 (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomOnionMessageHandler from rust threw an exception.");
15252 if (get_jenv_res == JNI_EDETACHED) {
15253 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15256 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, uint64_t message_type, LDKu8slice buffer) {
15257 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
15259 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15260 if (get_jenv_res == JNI_EDETACHED) {
15261 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15263 DO_ASSERT(get_jenv_res == JNI_OK);
15265 int64_t message_type_conv = message_type;
15266 LDKu8slice buffer_var = buffer;
15267 int8_tArray buffer_arr = (*env)->NewByteArray(env, buffer_var.datalen);
15268 (*env)->SetByteArrayRegion(env, buffer_arr, 0, buffer_var.datalen, buffer_var.data);
15269 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15270 CHECK(obj != NULL);
15271 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_custom_message_meth, message_type_conv, buffer_arr);
15272 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15273 (*env)->ExceptionDescribe(env);
15274 (*env)->FatalError(env, "A call to read_custom_message in LDKCustomOnionMessageHandler from rust threw an exception.");
15276 void* ret_ptr = untag_ptr(ret);
15277 CHECK_ACCESS(ret_ptr);
15278 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(ret_ptr);
15279 FREE(untag_ptr(ret));
15280 if (get_jenv_res == JNI_EDETACHED) {
15281 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15285 static void LDKCustomOnionMessageHandler_JCalls_cloned(LDKCustomOnionMessageHandler* new_obj) {
15286 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) new_obj->this_arg;
15287 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
15289 static inline LDKCustomOnionMessageHandler LDKCustomOnionMessageHandler_init (JNIEnv *env, jclass clz, jobject o) {
15290 jclass c = (*env)->GetObjectClass(env, o);
15292 LDKCustomOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageHandler_JCalls), "LDKCustomOnionMessageHandler_JCalls");
15293 atomic_init(&calls->refcnt, 1);
15294 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
15295 calls->o = (*env)->NewWeakGlobalRef(env, o);
15296 calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J)V");
15297 CHECK(calls->handle_custom_message_meth != NULL);
15298 calls->read_custom_message_meth = (*env)->GetMethodID(env, c, "read_custom_message", "(J[B)J");
15299 CHECK(calls->read_custom_message_meth != NULL);
15301 LDKCustomOnionMessageHandler ret = {
15302 .this_arg = (void*) calls,
15303 .handle_custom_message = handle_custom_message_LDKCustomOnionMessageHandler_jcall,
15304 .read_custom_message = read_custom_message_LDKCustomOnionMessageHandler_jcall,
15305 .free = LDKCustomOnionMessageHandler_JCalls_free,
15309 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageHandler_1new(JNIEnv *env, jclass clz, jobject o) {
15310 LDKCustomOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
15311 *res_ptr = LDKCustomOnionMessageHandler_init(env, clz, o);
15312 return tag_ptr(res_ptr, true);
15314 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
15315 void* this_arg_ptr = untag_ptr(this_arg);
15316 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15317 LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
15318 void* msg_ptr = untag_ptr(msg);
15319 CHECK_ACCESS(msg_ptr);
15320 LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
15321 if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
15322 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
15323 LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
15325 (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv);
15328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1read_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message_type, int8_tArray buffer) {
15329 void* this_arg_ptr = untag_ptr(this_arg);
15330 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15331 LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
15332 LDKu8slice buffer_ref;
15333 buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
15334 buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
15335 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
15336 *ret_conv = (this_arg_conv->read_custom_message)(this_arg_conv->this_arg, message_type, buffer_ref);
15337 (*env)->ReleaseByteArrayElements(env, buffer, (int8_t*)buffer_ref.data, 0);
15338 return tag_ptr(ret_conv, true);
15341 typedef struct LDKSocketDescriptor_JCalls {
15342 atomic_size_t refcnt;
15345 jmethodID send_data_meth;
15346 jmethodID disconnect_socket_meth;
15348 jmethodID hash_meth;
15349 } LDKSocketDescriptor_JCalls;
15350 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
15351 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
15352 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
15354 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15355 if (get_jenv_res == JNI_EDETACHED) {
15356 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15358 DO_ASSERT(get_jenv_res == JNI_OK);
15360 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
15361 if (get_jenv_res == JNI_EDETACHED) {
15362 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15367 uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
15368 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
15370 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15371 if (get_jenv_res == JNI_EDETACHED) {
15372 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15374 DO_ASSERT(get_jenv_res == JNI_OK);
15376 LDKu8slice data_var = data;
15377 int8_tArray data_arr = (*env)->NewByteArray(env, data_var.datalen);
15378 (*env)->SetByteArrayRegion(env, data_arr, 0, data_var.datalen, data_var.data);
15379 jboolean resume_read_conv = resume_read;
15380 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15381 CHECK(obj != NULL);
15382 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_data_meth, data_arr, resume_read_conv);
15383 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15384 (*env)->ExceptionDescribe(env);
15385 (*env)->FatalError(env, "A call to send_data in LDKSocketDescriptor from rust threw an exception.");
15387 if (get_jenv_res == JNI_EDETACHED) {
15388 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15392 void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
15393 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
15395 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15396 if (get_jenv_res == JNI_EDETACHED) {
15397 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15399 DO_ASSERT(get_jenv_res == JNI_OK);
15401 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15402 CHECK(obj != NULL);
15403 (*env)->CallVoidMethod(env, obj, j_calls->disconnect_socket_meth);
15404 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15405 (*env)->ExceptionDescribe(env);
15406 (*env)->FatalError(env, "A call to disconnect_socket in LDKSocketDescriptor from rust threw an exception.");
15408 if (get_jenv_res == JNI_EDETACHED) {
15409 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15412 bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
15413 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
15415 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15416 if (get_jenv_res == JNI_EDETACHED) {
15417 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15419 DO_ASSERT(get_jenv_res == JNI_OK);
15421 LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
15422 *other_arg_clone = SocketDescriptor_clone(other_arg);
15423 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15424 CHECK(obj != NULL);
15425 jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->eq_meth, tag_ptr(other_arg_clone, true));
15426 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15427 (*env)->ExceptionDescribe(env);
15428 (*env)->FatalError(env, "A call to eq in LDKSocketDescriptor from rust threw an exception.");
15430 if (get_jenv_res == JNI_EDETACHED) {
15431 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15435 uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
15436 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
15438 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15439 if (get_jenv_res == JNI_EDETACHED) {
15440 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15442 DO_ASSERT(get_jenv_res == JNI_OK);
15444 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15445 CHECK(obj != NULL);
15446 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->hash_meth);
15447 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15448 (*env)->ExceptionDescribe(env);
15449 (*env)->FatalError(env, "A call to hash in LDKSocketDescriptor from rust threw an exception.");
15451 if (get_jenv_res == JNI_EDETACHED) {
15452 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15456 static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
15457 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
15458 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
15460 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv *env, jclass clz, jobject o) {
15461 jclass c = (*env)->GetObjectClass(env, o);
15463 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
15464 atomic_init(&calls->refcnt, 1);
15465 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
15466 calls->o = (*env)->NewWeakGlobalRef(env, o);
15467 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "([BZ)J");
15468 CHECK(calls->send_data_meth != NULL);
15469 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
15470 CHECK(calls->disconnect_socket_meth != NULL);
15471 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
15472 CHECK(calls->eq_meth != NULL);
15473 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
15474 CHECK(calls->hash_meth != NULL);
15476 LDKSocketDescriptor ret = {
15477 .this_arg = (void*) calls,
15478 .send_data = send_data_LDKSocketDescriptor_jcall,
15479 .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
15480 .eq = eq_LDKSocketDescriptor_jcall,
15481 .hash = hash_LDKSocketDescriptor_jcall,
15482 .cloned = LDKSocketDescriptor_JCalls_cloned,
15483 .free = LDKSocketDescriptor_JCalls_free,
15487 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new(JNIEnv *env, jclass clz, jobject o) {
15488 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
15489 *res_ptr = LDKSocketDescriptor_init(env, clz, o);
15490 return tag_ptr(res_ptr, true);
15492 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) {
15493 void* this_arg_ptr = untag_ptr(this_arg);
15494 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15495 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
15496 LDKu8slice data_ref;
15497 data_ref.datalen = (*env)->GetArrayLength(env, data);
15498 data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
15499 int64_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
15500 (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0);
15504 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket(JNIEnv *env, jclass clz, int64_t this_arg) {
15505 void* this_arg_ptr = untag_ptr(this_arg);
15506 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15507 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
15508 (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
15511 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
15512 void* this_arg_ptr = untag_ptr(this_arg);
15513 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15514 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
15515 int64_t ret_conv = (this_arg_conv->hash)(this_arg_conv->this_arg);
15519 static jclass LDKEffectiveCapacity_ExactLiquidity_class = NULL;
15520 static jmethodID LDKEffectiveCapacity_ExactLiquidity_meth = NULL;
15521 static jclass LDKEffectiveCapacity_MaximumHTLC_class = NULL;
15522 static jmethodID LDKEffectiveCapacity_MaximumHTLC_meth = NULL;
15523 static jclass LDKEffectiveCapacity_Total_class = NULL;
15524 static jmethodID LDKEffectiveCapacity_Total_meth = NULL;
15525 static jclass LDKEffectiveCapacity_Infinite_class = NULL;
15526 static jmethodID LDKEffectiveCapacity_Infinite_meth = NULL;
15527 static jclass LDKEffectiveCapacity_Unknown_class = NULL;
15528 static jmethodID LDKEffectiveCapacity_Unknown_meth = NULL;
15529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEffectiveCapacity_init (JNIEnv *env, jclass clz) {
15530 LDKEffectiveCapacity_ExactLiquidity_class =
15531 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$ExactLiquidity"));
15532 CHECK(LDKEffectiveCapacity_ExactLiquidity_class != NULL);
15533 LDKEffectiveCapacity_ExactLiquidity_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_ExactLiquidity_class, "<init>", "(J)V");
15534 CHECK(LDKEffectiveCapacity_ExactLiquidity_meth != NULL);
15535 LDKEffectiveCapacity_MaximumHTLC_class =
15536 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$MaximumHTLC"));
15537 CHECK(LDKEffectiveCapacity_MaximumHTLC_class != NULL);
15538 LDKEffectiveCapacity_MaximumHTLC_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_MaximumHTLC_class, "<init>", "(J)V");
15539 CHECK(LDKEffectiveCapacity_MaximumHTLC_meth != NULL);
15540 LDKEffectiveCapacity_Total_class =
15541 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Total"));
15542 CHECK(LDKEffectiveCapacity_Total_class != NULL);
15543 LDKEffectiveCapacity_Total_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Total_class, "<init>", "(JJ)V");
15544 CHECK(LDKEffectiveCapacity_Total_meth != NULL);
15545 LDKEffectiveCapacity_Infinite_class =
15546 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Infinite"));
15547 CHECK(LDKEffectiveCapacity_Infinite_class != NULL);
15548 LDKEffectiveCapacity_Infinite_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Infinite_class, "<init>", "()V");
15549 CHECK(LDKEffectiveCapacity_Infinite_meth != NULL);
15550 LDKEffectiveCapacity_Unknown_class =
15551 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Unknown"));
15552 CHECK(LDKEffectiveCapacity_Unknown_class != NULL);
15553 LDKEffectiveCapacity_Unknown_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Unknown_class, "<init>", "()V");
15554 CHECK(LDKEffectiveCapacity_Unknown_meth != NULL);
15556 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15557 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
15559 case LDKEffectiveCapacity_ExactLiquidity: {
15560 int64_t liquidity_msat_conv = obj->exact_liquidity.liquidity_msat;
15561 return (*env)->NewObject(env, LDKEffectiveCapacity_ExactLiquidity_class, LDKEffectiveCapacity_ExactLiquidity_meth, liquidity_msat_conv);
15563 case LDKEffectiveCapacity_MaximumHTLC: {
15564 int64_t amount_msat_conv = obj->maximum_htlc.amount_msat;
15565 return (*env)->NewObject(env, LDKEffectiveCapacity_MaximumHTLC_class, LDKEffectiveCapacity_MaximumHTLC_meth, amount_msat_conv);
15567 case LDKEffectiveCapacity_Total: {
15568 int64_t capacity_msat_conv = obj->total.capacity_msat;
15569 int64_t htlc_maximum_msat_conv = obj->total.htlc_maximum_msat;
15570 return (*env)->NewObject(env, LDKEffectiveCapacity_Total_class, LDKEffectiveCapacity_Total_meth, capacity_msat_conv, htlc_maximum_msat_conv);
15572 case LDKEffectiveCapacity_Infinite: {
15573 return (*env)->NewObject(env, LDKEffectiveCapacity_Infinite_class, LDKEffectiveCapacity_Infinite_meth);
15575 case LDKEffectiveCapacity_Unknown: {
15576 return (*env)->NewObject(env, LDKEffectiveCapacity_Unknown_class, LDKEffectiveCapacity_Unknown_meth);
15581 static jclass LDKDestination_Node_class = NULL;
15582 static jmethodID LDKDestination_Node_meth = NULL;
15583 static jclass LDKDestination_BlindedPath_class = NULL;
15584 static jmethodID LDKDestination_BlindedPath_meth = NULL;
15585 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) {
15586 LDKDestination_Node_class =
15587 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node"));
15588 CHECK(LDKDestination_Node_class != NULL);
15589 LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "<init>", "([B)V");
15590 CHECK(LDKDestination_Node_meth != NULL);
15591 LDKDestination_BlindedPath_class =
15592 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedPath"));
15593 CHECK(LDKDestination_BlindedPath_class != NULL);
15594 LDKDestination_BlindedPath_meth = (*env)->GetMethodID(env, LDKDestination_BlindedPath_class, "<init>", "(J)V");
15595 CHECK(LDKDestination_BlindedPath_meth != NULL);
15597 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15598 LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
15600 case LDKDestination_Node: {
15601 int8_tArray node_arr = (*env)->NewByteArray(env, 33);
15602 (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form);
15603 return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr);
15605 case LDKDestination_BlindedPath: {
15606 LDKBlindedPath blinded_path_var = obj->blinded_path;
15607 int64_t blinded_path_ref = 0;
15608 CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_path_var);
15609 blinded_path_ref = tag_ptr(blinded_path_var.inner, false);
15610 return (*env)->NewObject(env, LDKDestination_BlindedPath_class, LDKDestination_BlindedPath_meth, blinded_path_ref);
15615 static jclass LDKOnionMessageContents_Custom_class = NULL;
15616 static jmethodID LDKOnionMessageContents_Custom_meth = NULL;
15617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKOnionMessageContents_init (JNIEnv *env, jclass clz) {
15618 LDKOnionMessageContents_Custom_class =
15619 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKOnionMessageContents$Custom"));
15620 CHECK(LDKOnionMessageContents_Custom_class != NULL);
15621 LDKOnionMessageContents_Custom_meth = (*env)->GetMethodID(env, LDKOnionMessageContents_Custom_class, "<init>", "(J)V");
15622 CHECK(LDKOnionMessageContents_Custom_meth != NULL);
15624 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageContents_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15625 LDKOnionMessageContents *obj = (LDKOnionMessageContents*)untag_ptr(ptr);
15627 case LDKOnionMessageContents_Custom: {
15628 LDKCustomOnionMessageContents* custom_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
15629 *custom_ret = CustomOnionMessageContents_clone(&obj->custom);
15630 return (*env)->NewObject(env, LDKOnionMessageContents_Custom_class, LDKOnionMessageContents_Custom_meth, tag_ptr(custom_ret, true));
15635 static jclass LDKGossipSync_P2P_class = NULL;
15636 static jmethodID LDKGossipSync_P2P_meth = NULL;
15637 static jclass LDKGossipSync_Rapid_class = NULL;
15638 static jmethodID LDKGossipSync_Rapid_meth = NULL;
15639 static jclass LDKGossipSync_None_class = NULL;
15640 static jmethodID LDKGossipSync_None_meth = NULL;
15641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGossipSync_init (JNIEnv *env, jclass clz) {
15642 LDKGossipSync_P2P_class =
15643 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$P2P"));
15644 CHECK(LDKGossipSync_P2P_class != NULL);
15645 LDKGossipSync_P2P_meth = (*env)->GetMethodID(env, LDKGossipSync_P2P_class, "<init>", "(J)V");
15646 CHECK(LDKGossipSync_P2P_meth != NULL);
15647 LDKGossipSync_Rapid_class =
15648 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$Rapid"));
15649 CHECK(LDKGossipSync_Rapid_class != NULL);
15650 LDKGossipSync_Rapid_meth = (*env)->GetMethodID(env, LDKGossipSync_Rapid_class, "<init>", "(J)V");
15651 CHECK(LDKGossipSync_Rapid_meth != NULL);
15652 LDKGossipSync_None_class =
15653 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$None"));
15654 CHECK(LDKGossipSync_None_class != NULL);
15655 LDKGossipSync_None_meth = (*env)->GetMethodID(env, LDKGossipSync_None_class, "<init>", "()V");
15656 CHECK(LDKGossipSync_None_meth != NULL);
15658 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGossipSync_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15659 LDKGossipSync *obj = (LDKGossipSync*)untag_ptr(ptr);
15661 case LDKGossipSync_P2P: {
15662 LDKP2PGossipSync p2p_var = obj->p2p;
15663 int64_t p2p_ref = 0;
15664 CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var);
15665 p2p_ref = tag_ptr(p2p_var.inner, false);
15666 return (*env)->NewObject(env, LDKGossipSync_P2P_class, LDKGossipSync_P2P_meth, p2p_ref);
15668 case LDKGossipSync_Rapid: {
15669 LDKRapidGossipSync rapid_var = obj->rapid;
15670 int64_t rapid_ref = 0;
15671 CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var);
15672 rapid_ref = tag_ptr(rapid_var.inner, false);
15673 return (*env)->NewObject(env, LDKGossipSync_Rapid_class, LDKGossipSync_Rapid_meth, rapid_ref);
15675 case LDKGossipSync_None: {
15676 return (*env)->NewObject(env, LDKGossipSync_None_class, LDKGossipSync_None_meth);
15681 static jclass LDKFallback_SegWitProgram_class = NULL;
15682 static jmethodID LDKFallback_SegWitProgram_meth = NULL;
15683 static jclass LDKFallback_PubKeyHash_class = NULL;
15684 static jmethodID LDKFallback_PubKeyHash_meth = NULL;
15685 static jclass LDKFallback_ScriptHash_class = NULL;
15686 static jmethodID LDKFallback_ScriptHash_meth = NULL;
15687 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFallback_init (JNIEnv *env, jclass clz) {
15688 LDKFallback_SegWitProgram_class =
15689 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$SegWitProgram"));
15690 CHECK(LDKFallback_SegWitProgram_class != NULL);
15691 LDKFallback_SegWitProgram_meth = (*env)->GetMethodID(env, LDKFallback_SegWitProgram_class, "<init>", "(B[B)V");
15692 CHECK(LDKFallback_SegWitProgram_meth != NULL);
15693 LDKFallback_PubKeyHash_class =
15694 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$PubKeyHash"));
15695 CHECK(LDKFallback_PubKeyHash_class != NULL);
15696 LDKFallback_PubKeyHash_meth = (*env)->GetMethodID(env, LDKFallback_PubKeyHash_class, "<init>", "([B)V");
15697 CHECK(LDKFallback_PubKeyHash_meth != NULL);
15698 LDKFallback_ScriptHash_class =
15699 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$ScriptHash"));
15700 CHECK(LDKFallback_ScriptHash_class != NULL);
15701 LDKFallback_ScriptHash_meth = (*env)->GetMethodID(env, LDKFallback_ScriptHash_class, "<init>", "([B)V");
15702 CHECK(LDKFallback_ScriptHash_meth != NULL);
15704 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFallback_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15705 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
15707 case LDKFallback_SegWitProgram: {
15708 uint8_t version_val = obj->seg_wit_program.version._0;
15709 LDKCVec_u8Z program_var = obj->seg_wit_program.program;
15710 int8_tArray program_arr = (*env)->NewByteArray(env, program_var.datalen);
15711 (*env)->SetByteArrayRegion(env, program_arr, 0, program_var.datalen, program_var.data);
15712 return (*env)->NewObject(env, LDKFallback_SegWitProgram_class, LDKFallback_SegWitProgram_meth, version_val, program_arr);
15714 case LDKFallback_PubKeyHash: {
15715 int8_tArray pub_key_hash_arr = (*env)->NewByteArray(env, 20);
15716 (*env)->SetByteArrayRegion(env, pub_key_hash_arr, 0, 20, obj->pub_key_hash.data);
15717 return (*env)->NewObject(env, LDKFallback_PubKeyHash_class, LDKFallback_PubKeyHash_meth, pub_key_hash_arr);
15719 case LDKFallback_ScriptHash: {
15720 int8_tArray script_hash_arr = (*env)->NewByteArray(env, 20);
15721 (*env)->SetByteArrayRegion(env, script_hash_arr, 0, 20, obj->script_hash.data);
15722 return (*env)->NewObject(env, LDKFallback_ScriptHash_class, LDKFallback_ScriptHash_meth, script_hash_arr);
15727 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version(JNIEnv *env, jclass clz) {
15728 LDKStr ret_str = _ldk_get_compiled_version();
15729 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
15734 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) {
15735 LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
15736 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
15741 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_U128_1le_1bytes(JNIEnv *env, jclass clz, int8_tArray val) {
15743 CHECK((*env)->GetArrayLength(env, val) == 16);
15744 (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes);
15745 int8_tArray ret_arr = (*env)->NewByteArray(env, 16);
15746 (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, U128_le_bytes(val_ref).data);
15750 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_U128_1new(JNIEnv *env, jclass clz, int8_tArray le_bytes) {
15751 LDKSixteenBytes le_bytes_ref;
15752 CHECK((*env)->GetArrayLength(env, le_bytes) == 16);
15753 (*env)->GetByteArrayRegion(env, le_bytes, 0, 16, le_bytes_ref.data);
15754 int8_tArray ret_arr = (*env)->NewByteArray(env, 16);
15755 (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, U128_new(le_bytes_ref).le_bytes);
15759 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1new(JNIEnv *env, jclass clz, int8_tArray big_endian_bytes) {
15760 LDKThirtyTwoBytes big_endian_bytes_ref;
15761 CHECK((*env)->GetArrayLength(env, big_endian_bytes) == 32);
15762 (*env)->GetByteArrayRegion(env, big_endian_bytes, 0, 32, big_endian_bytes_ref.data);
15763 LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar");
15764 *ret_ref = BigEndianScalar_new(big_endian_bytes_ref);
15765 return tag_ptr(ret_ref, true);
15768 static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) {
15769 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
15770 *ret_copy = Bech32Error_clone(arg);
15771 int64_t ret_ref = tag_ptr(ret_copy, true);
15774 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15775 LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg);
15776 int64_t ret_conv = Bech32Error_clone_ptr(arg_conv);
15780 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15781 LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig);
15782 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
15783 *ret_copy = Bech32Error_clone(orig_conv);
15784 int64_t ret_ref = tag_ptr(ret_copy, true);
15788 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bech32Error_1free(JNIEnv *env, jclass clz, int64_t o) {
15789 if (!ptr_is_owned(o)) return;
15790 void* o_ptr = untag_ptr(o);
15791 CHECK_ACCESS(o_ptr);
15792 LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr);
15793 FREE(untag_ptr(o));
15794 Bech32Error_free(o_conv);
15797 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
15798 LDKTransaction _res_ref;
15799 _res_ref.datalen = (*env)->GetArrayLength(env, _res);
15800 _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
15801 (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
15802 _res_ref.data_is_owned = true;
15803 Transaction_free(_res_ref);
15806 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Witness_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
15807 LDKWitness _res_ref;
15808 _res_ref.datalen = (*env)->GetArrayLength(env, _res);
15809 _res_ref.data = MALLOC(_res_ref.datalen, "LDKWitness Bytes");
15810 (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
15811 _res_ref.data_is_owned = true;
15812 Witness_free(_res_ref);
15815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) {
15816 LDKCVec_u8Z script_pubkey_ref;
15817 script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
15818 script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
15819 (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data);
15820 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
15821 *ret_ref = TxOut_new(script_pubkey_ref, value);
15822 return tag_ptr(ret_ref, true);
15825 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) {
15826 if (!ptr_is_owned(_res)) return;
15827 void* _res_ptr = untag_ptr(_res);
15828 CHECK_ACCESS(_res_ptr);
15829 LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
15830 FREE(untag_ptr(_res));
15831 TxOut_free(_res_conv);
15834 static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) {
15835 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
15836 *ret_ref = TxOut_clone(arg);
15837 return tag_ptr(ret_ref, true);
15839 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15840 LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg);
15841 int64_t ret_conv = TxOut_clone_ptr(arg_conv);
15845 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15846 LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig);
15847 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
15848 *ret_ref = TxOut_clone(orig_conv);
15849 return tag_ptr(ret_ref, true);
15852 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) {
15853 LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
15857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv *env, jclass clz) {
15858 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15859 *ret_conv = CResult_NoneAPIErrorZ_ok();
15860 return tag_ptr(ret_conv, true);
15863 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
15864 void* e_ptr = untag_ptr(e);
15865 CHECK_ACCESS(e_ptr);
15866 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15867 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15868 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15869 *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
15870 return tag_ptr(ret_conv, true);
15873 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15874 LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
15875 jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
15879 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15880 if (!ptr_is_owned(_res)) return;
15881 void* _res_ptr = untag_ptr(_res);
15882 CHECK_ACCESS(_res_ptr);
15883 LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
15884 FREE(untag_ptr(_res));
15885 CResult_NoneAPIErrorZ_free(_res_conv);
15888 static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
15889 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15890 *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
15891 return tag_ptr(ret_conv, true);
15893 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
15894 LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
15895 int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
15899 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
15900 LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
15901 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
15902 *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
15903 return tag_ptr(ret_conv, true);
15906 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
15907 LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
15908 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15909 if (_res_constr.datalen > 0)
15910 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
15912 _res_constr.data = NULL;
15913 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
15914 for (size_t w = 0; w < _res_constr.datalen; w++) {
15915 int64_t _res_conv_22 = _res_vals[w];
15916 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
15917 CHECK_ACCESS(_res_conv_22_ptr);
15918 LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
15919 FREE(untag_ptr(_res_conv_22));
15920 _res_constr.data[w] = _res_conv_22_conv;
15922 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
15923 CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
15926 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
15927 LDKCVec_APIErrorZ _res_constr;
15928 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
15929 if (_res_constr.datalen > 0)
15930 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
15932 _res_constr.data = NULL;
15933 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
15934 for (size_t k = 0; k < _res_constr.datalen; k++) {
15935 int64_t _res_conv_10 = _res_vals[k];
15936 void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
15937 CHECK_ACCESS(_res_conv_10_ptr);
15938 LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
15939 FREE(untag_ptr(_res_conv_10));
15940 _res_constr.data[k] = _res_conv_10_conv;
15942 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
15943 CVec_APIErrorZ_free(_res_constr);
15946 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1some(JNIEnv *env, jclass clz, jclass o) {
15947 LDKHTLCClaim o_conv = LDKHTLCClaim_from_java(env, o);
15948 LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ");
15949 *ret_copy = COption_HTLCClaimZ_some(o_conv);
15950 int64_t ret_ref = tag_ptr(ret_copy, true);
15954 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1none(JNIEnv *env, jclass clz) {
15955 LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ");
15956 *ret_copy = COption_HTLCClaimZ_none();
15957 int64_t ret_ref = tag_ptr(ret_copy, true);
15961 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15962 if (!ptr_is_owned(_res)) return;
15963 void* _res_ptr = untag_ptr(_res);
15964 CHECK_ACCESS(_res_ptr);
15965 LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr);
15966 FREE(untag_ptr(_res));
15967 COption_HTLCClaimZ_free(_res_conv);
15970 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok(JNIEnv *env, jclass clz) {
15971 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
15972 *ret_conv = CResult_NoneNoneZ_ok();
15973 return tag_ptr(ret_conv, true);
15976 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNIEnv *env, jclass clz) {
15977 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
15978 *ret_conv = CResult_NoneNoneZ_err();
15979 return tag_ptr(ret_conv, true);
15982 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
15983 LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o);
15984 jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv);
15988 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
15989 if (!ptr_is_owned(_res)) return;
15990 void* _res_ptr = untag_ptr(_res);
15991 CHECK_ACCESS(_res_ptr);
15992 LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
15993 FREE(untag_ptr(_res));
15994 CResult_NoneNoneZ_free(_res_conv);
15997 static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) {
15998 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
15999 *ret_conv = CResult_NoneNoneZ_clone(arg);
16000 return tag_ptr(ret_conv, true);
16002 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16003 LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg);
16004 int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv);
16008 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16009 LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig);
16010 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
16011 *ret_conv = CResult_NoneNoneZ_clone(orig_conv);
16012 return tag_ptr(ret_conv, true);
16015 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16016 LDKCounterpartyCommitmentSecrets o_conv;
16017 o_conv.inner = untag_ptr(o);
16018 o_conv.is_owned = ptr_is_owned(o);
16019 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16020 o_conv = CounterpartyCommitmentSecrets_clone(&o_conv);
16021 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
16022 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv);
16023 return tag_ptr(ret_conv, true);
16026 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16027 void* e_ptr = untag_ptr(e);
16028 CHECK_ACCESS(e_ptr);
16029 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16030 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16031 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
16032 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
16033 return tag_ptr(ret_conv, true);
16036 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16037 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o);
16038 jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv);
16042 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16043 if (!ptr_is_owned(_res)) return;
16044 void* _res_ptr = untag_ptr(_res);
16045 CHECK_ACCESS(_res_ptr);
16046 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr);
16047 FREE(untag_ptr(_res));
16048 CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv);
16051 static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) {
16052 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
16053 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg);
16054 return tag_ptr(ret_conv, true);
16056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16057 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg);
16058 int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv);
16062 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16063 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig);
16064 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
16065 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv);
16066 return tag_ptr(ret_conv, true);
16069 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16070 LDKTxCreationKeys o_conv;
16071 o_conv.inner = untag_ptr(o);
16072 o_conv.is_owned = ptr_is_owned(o);
16073 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16074 o_conv = TxCreationKeys_clone(&o_conv);
16075 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
16076 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
16077 return tag_ptr(ret_conv, true);
16080 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16081 void* e_ptr = untag_ptr(e);
16082 CHECK_ACCESS(e_ptr);
16083 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16084 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16085 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
16086 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
16087 return tag_ptr(ret_conv, true);
16090 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16091 LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
16092 jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
16096 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16097 if (!ptr_is_owned(_res)) return;
16098 void* _res_ptr = untag_ptr(_res);
16099 CHECK_ACCESS(_res_ptr);
16100 LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
16101 FREE(untag_ptr(_res));
16102 CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
16105 static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
16106 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
16107 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
16108 return tag_ptr(ret_conv, true);
16110 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16111 LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
16112 int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
16116 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16117 LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
16118 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
16119 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
16120 return tag_ptr(ret_conv, true);
16123 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16124 LDKChannelPublicKeys o_conv;
16125 o_conv.inner = untag_ptr(o);
16126 o_conv.is_owned = ptr_is_owned(o);
16127 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16128 o_conv = ChannelPublicKeys_clone(&o_conv);
16129 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
16130 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
16131 return tag_ptr(ret_conv, true);
16134 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16135 void* e_ptr = untag_ptr(e);
16136 CHECK_ACCESS(e_ptr);
16137 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16138 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16139 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
16140 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
16141 return tag_ptr(ret_conv, true);
16144 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16145 LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o);
16146 jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv);
16150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16151 if (!ptr_is_owned(_res)) return;
16152 void* _res_ptr = untag_ptr(_res);
16153 CHECK_ACCESS(_res_ptr);
16154 LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
16155 FREE(untag_ptr(_res));
16156 CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
16159 static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) {
16160 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
16161 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg);
16162 return tag_ptr(ret_conv, true);
16164 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16165 LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg);
16166 int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv);
16170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16171 LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig);
16172 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
16173 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv);
16174 return tag_ptr(ret_conv, true);
16177 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1some(JNIEnv *env, jclass clz, int32_t o) {
16178 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
16179 *ret_copy = COption_u32Z_some(o);
16180 int64_t ret_ref = tag_ptr(ret_copy, true);
16184 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1none(JNIEnv *env, jclass clz) {
16185 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
16186 *ret_copy = COption_u32Z_none();
16187 int64_t ret_ref = tag_ptr(ret_copy, true);
16191 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
16192 if (!ptr_is_owned(_res)) return;
16193 void* _res_ptr = untag_ptr(_res);
16194 CHECK_ACCESS(_res_ptr);
16195 LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
16196 FREE(untag_ptr(_res));
16197 COption_u32Z_free(_res_conv);
16200 static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) {
16201 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
16202 *ret_copy = COption_u32Z_clone(arg);
16203 int64_t ret_ref = tag_ptr(ret_copy, true);
16206 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16207 LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)untag_ptr(arg);
16208 int64_t ret_conv = COption_u32Z_clone_ptr(arg_conv);
16212 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16213 LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)untag_ptr(orig);
16214 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
16215 *ret_copy = COption_u32Z_clone(orig_conv);
16216 int64_t ret_ref = tag_ptr(ret_copy, true);
16220 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16221 LDKHTLCOutputInCommitment o_conv;
16222 o_conv.inner = untag_ptr(o);
16223 o_conv.is_owned = ptr_is_owned(o);
16224 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16225 o_conv = HTLCOutputInCommitment_clone(&o_conv);
16226 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
16227 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv);
16228 return tag_ptr(ret_conv, true);
16231 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16232 void* e_ptr = untag_ptr(e);
16233 CHECK_ACCESS(e_ptr);
16234 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16235 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16236 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
16237 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
16238 return tag_ptr(ret_conv, true);
16241 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16242 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o);
16243 jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv);
16247 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16248 if (!ptr_is_owned(_res)) return;
16249 void* _res_ptr = untag_ptr(_res);
16250 CHECK_ACCESS(_res_ptr);
16251 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
16252 FREE(untag_ptr(_res));
16253 CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
16256 static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) {
16257 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
16258 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg);
16259 return tag_ptr(ret_conv, true);
16261 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16262 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg);
16263 int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv);
16267 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16268 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig);
16269 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
16270 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv);
16271 return tag_ptr(ret_conv, true);
16274 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1some(JNIEnv *env, jclass clz) {
16275 jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_some());
16279 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1none(JNIEnv *env, jclass clz) {
16280 jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_none());
16284 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1free(JNIEnv *env, jclass clz, jclass _res) {
16285 LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_java(env, _res);
16286 COption_NoneZ_free(_res_conv);
16289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16290 LDKCounterpartyChannelTransactionParameters o_conv;
16291 o_conv.inner = untag_ptr(o);
16292 o_conv.is_owned = ptr_is_owned(o);
16293 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16294 o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv);
16295 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16296 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv);
16297 return tag_ptr(ret_conv, true);
16300 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16301 void* e_ptr = untag_ptr(e);
16302 CHECK_ACCESS(e_ptr);
16303 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16304 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16305 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16306 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
16307 return tag_ptr(ret_conv, true);
16310 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16311 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
16312 jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
16316 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16317 if (!ptr_is_owned(_res)) return;
16318 void* _res_ptr = untag_ptr(_res);
16319 CHECK_ACCESS(_res_ptr);
16320 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
16321 FREE(untag_ptr(_res));
16322 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
16325 static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
16326 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16327 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg);
16328 return tag_ptr(ret_conv, true);
16330 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16331 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
16332 int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
16336 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16337 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
16338 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16339 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
16340 return tag_ptr(ret_conv, true);
16343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16344 LDKChannelTransactionParameters o_conv;
16345 o_conv.inner = untag_ptr(o);
16346 o_conv.is_owned = ptr_is_owned(o);
16347 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16348 o_conv = ChannelTransactionParameters_clone(&o_conv);
16349 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16350 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv);
16351 return tag_ptr(ret_conv, true);
16354 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16355 void* e_ptr = untag_ptr(e);
16356 CHECK_ACCESS(e_ptr);
16357 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16358 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16359 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16360 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
16361 return tag_ptr(ret_conv, true);
16364 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16365 LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
16366 jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
16370 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
16375 FREE(untag_ptr(_res));
16376 CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
16379 static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
16380 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16381 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg);
16382 return tag_ptr(ret_conv, true);
16384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16385 LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
16386 int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
16390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16391 LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
16392 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16393 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
16394 return tag_ptr(ret_conv, true);
16397 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
16398 LDKCVec_SignatureZ _res_constr;
16399 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16400 if (_res_constr.datalen > 0)
16401 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
16403 _res_constr.data = NULL;
16404 for (size_t i = 0; i < _res_constr.datalen; i++) {
16405 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
16406 LDKSignature _res_conv_8_ref;
16407 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 64);
16408 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 64, _res_conv_8_ref.compact_form);
16409 _res_constr.data[i] = _res_conv_8_ref;
16411 CVec_SignatureZ_free(_res_constr);
16414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16415 LDKHolderCommitmentTransaction o_conv;
16416 o_conv.inner = untag_ptr(o);
16417 o_conv.is_owned = ptr_is_owned(o);
16418 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16419 o_conv = HolderCommitmentTransaction_clone(&o_conv);
16420 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16421 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv);
16422 return tag_ptr(ret_conv, true);
16425 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16426 void* e_ptr = untag_ptr(e);
16427 CHECK_ACCESS(e_ptr);
16428 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16429 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16430 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16431 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
16432 return tag_ptr(ret_conv, true);
16435 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16436 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
16437 jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
16441 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16442 if (!ptr_is_owned(_res)) return;
16443 void* _res_ptr = untag_ptr(_res);
16444 CHECK_ACCESS(_res_ptr);
16445 LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
16446 FREE(untag_ptr(_res));
16447 CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
16450 static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
16451 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16452 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg);
16453 return tag_ptr(ret_conv, true);
16455 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16456 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
16457 int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
16461 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16462 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
16463 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16464 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv);
16465 return tag_ptr(ret_conv, true);
16468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16469 LDKBuiltCommitmentTransaction o_conv;
16470 o_conv.inner = untag_ptr(o);
16471 o_conv.is_owned = ptr_is_owned(o);
16472 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16473 o_conv = BuiltCommitmentTransaction_clone(&o_conv);
16474 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
16475 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv);
16476 return tag_ptr(ret_conv, true);
16479 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16480 void* e_ptr = untag_ptr(e);
16481 CHECK_ACCESS(e_ptr);
16482 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16483 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16484 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
16485 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
16486 return tag_ptr(ret_conv, true);
16489 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16490 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
16491 jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
16495 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16496 if (!ptr_is_owned(_res)) return;
16497 void* _res_ptr = untag_ptr(_res);
16498 CHECK_ACCESS(_res_ptr);
16499 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
16500 FREE(untag_ptr(_res));
16501 CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
16504 static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
16505 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
16506 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg);
16507 return tag_ptr(ret_conv, true);
16509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16510 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
16511 int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
16515 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16516 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
16517 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
16518 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv);
16519 return tag_ptr(ret_conv, true);
16522 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16523 LDKTrustedClosingTransaction o_conv;
16524 o_conv.inner = untag_ptr(o);
16525 o_conv.is_owned = ptr_is_owned(o);
16526 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16527 // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction
16529 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
16530 *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv);
16531 return tag_ptr(ret_conv, true);
16534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1err(JNIEnv *env, jclass clz) {
16535 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
16536 *ret_conv = CResult_TrustedClosingTransactionNoneZ_err();
16537 return tag_ptr(ret_conv, true);
16540 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16541 LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o);
16542 jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv);
16546 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16547 if (!ptr_is_owned(_res)) return;
16548 void* _res_ptr = untag_ptr(_res);
16549 CHECK_ACCESS(_res_ptr);
16550 LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
16551 FREE(untag_ptr(_res));
16552 CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
16555 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16556 LDKCommitmentTransaction o_conv;
16557 o_conv.inner = untag_ptr(o);
16558 o_conv.is_owned = ptr_is_owned(o);
16559 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16560 o_conv = CommitmentTransaction_clone(&o_conv);
16561 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
16562 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv);
16563 return tag_ptr(ret_conv, true);
16566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16567 void* e_ptr = untag_ptr(e);
16568 CHECK_ACCESS(e_ptr);
16569 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16570 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16571 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
16572 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
16573 return tag_ptr(ret_conv, true);
16576 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16577 LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o);
16578 jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv);
16582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_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 LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
16587 FREE(untag_ptr(_res));
16588 CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
16591 static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
16592 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
16593 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg);
16594 return tag_ptr(ret_conv, true);
16596 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16597 LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
16598 int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
16602 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16603 LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
16604 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
16605 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv);
16606 return tag_ptr(ret_conv, true);
16609 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16610 LDKTrustedCommitmentTransaction o_conv;
16611 o_conv.inner = untag_ptr(o);
16612 o_conv.is_owned = ptr_is_owned(o);
16613 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16614 // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction
16616 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
16617 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv);
16618 return tag_ptr(ret_conv, true);
16621 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1err(JNIEnv *env, jclass clz) {
16622 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
16623 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err();
16624 return tag_ptr(ret_conv, true);
16627 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16628 LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o);
16629 jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv);
16633 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16634 if (!ptr_is_owned(_res)) return;
16635 void* _res_ptr = untag_ptr(_res);
16636 CHECK_ACCESS(_res_ptr);
16637 LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
16638 FREE(untag_ptr(_res));
16639 CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
16642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) {
16643 LDKCVec_SignatureZ o_constr;
16644 o_constr.datalen = (*env)->GetArrayLength(env, o);
16645 if (o_constr.datalen > 0)
16646 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
16648 o_constr.data = NULL;
16649 for (size_t i = 0; i < o_constr.datalen; i++) {
16650 int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
16651 LDKSignature o_conv_8_ref;
16652 CHECK((*env)->GetArrayLength(env, o_conv_8) == 64);
16653 (*env)->GetByteArrayRegion(env, o_conv_8, 0, 64, o_conv_8_ref.compact_form);
16654 o_constr.data[i] = o_conv_8_ref;
16656 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
16657 *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
16658 return tag_ptr(ret_conv, true);
16661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv *env, jclass clz) {
16662 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
16663 *ret_conv = CResult_CVec_SignatureZNoneZ_err();
16664 return tag_ptr(ret_conv, true);
16667 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16668 LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(o);
16669 jboolean ret_conv = CResult_CVec_SignatureZNoneZ_is_ok(o_conv);
16673 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16674 if (!ptr_is_owned(_res)) return;
16675 void* _res_ptr = untag_ptr(_res);
16676 CHECK_ACCESS(_res_ptr);
16677 LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
16678 FREE(untag_ptr(_res));
16679 CResult_CVec_SignatureZNoneZ_free(_res_conv);
16682 static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) {
16683 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
16684 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg);
16685 return tag_ptr(ret_conv, true);
16687 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16688 LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(arg);
16689 int64_t ret_conv = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv);
16693 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16694 LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(orig);
16695 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
16696 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv);
16697 return tag_ptr(ret_conv, true);
16700 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16701 LDKShutdownScript o_conv;
16702 o_conv.inner = untag_ptr(o);
16703 o_conv.is_owned = ptr_is_owned(o);
16704 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16705 o_conv = ShutdownScript_clone(&o_conv);
16706 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
16707 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv);
16708 return tag_ptr(ret_conv, true);
16711 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16712 void* e_ptr = untag_ptr(e);
16713 CHECK_ACCESS(e_ptr);
16714 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16715 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16716 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
16717 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
16718 return tag_ptr(ret_conv, true);
16721 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16722 LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o);
16723 jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv);
16727 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16728 if (!ptr_is_owned(_res)) return;
16729 void* _res_ptr = untag_ptr(_res);
16730 CHECK_ACCESS(_res_ptr);
16731 LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
16732 FREE(untag_ptr(_res));
16733 CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
16736 static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) {
16737 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
16738 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg);
16739 return tag_ptr(ret_conv, true);
16741 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16742 LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg);
16743 int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv);
16747 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16748 LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig);
16749 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
16750 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv);
16751 return tag_ptr(ret_conv, true);
16754 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16755 LDKShutdownScript o_conv;
16756 o_conv.inner = untag_ptr(o);
16757 o_conv.is_owned = ptr_is_owned(o);
16758 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16759 o_conv = ShutdownScript_clone(&o_conv);
16760 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
16761 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv);
16762 return tag_ptr(ret_conv, true);
16765 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16766 LDKInvalidShutdownScript e_conv;
16767 e_conv.inner = untag_ptr(e);
16768 e_conv.is_owned = ptr_is_owned(e);
16769 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16770 e_conv = InvalidShutdownScript_clone(&e_conv);
16771 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
16772 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
16773 return tag_ptr(ret_conv, true);
16776 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16777 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o);
16778 jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv);
16782 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16783 if (!ptr_is_owned(_res)) return;
16784 void* _res_ptr = untag_ptr(_res);
16785 CHECK_ACCESS(_res_ptr);
16786 LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
16787 FREE(untag_ptr(_res));
16788 CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
16791 static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) {
16792 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
16793 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg);
16794 return tag_ptr(ret_conv, true);
16796 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16797 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg);
16798 int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv);
16802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16803 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig);
16804 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
16805 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
16806 return tag_ptr(ret_conv, true);
16809 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
16810 LDKCVec_PublicKeyZ _res_constr;
16811 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16812 if (_res_constr.datalen > 0)
16813 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
16815 _res_constr.data = NULL;
16816 for (size_t i = 0; i < _res_constr.datalen; i++) {
16817 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
16818 LDKPublicKey _res_conv_8_ref;
16819 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33);
16820 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form);
16821 _res_constr.data[i] = _res_conv_8_ref;
16823 CVec_PublicKeyZ_free(_res_constr);
16826 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16827 LDKBlindedPath o_conv;
16828 o_conv.inner = untag_ptr(o);
16829 o_conv.is_owned = ptr_is_owned(o);
16830 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16831 o_conv = BlindedPath_clone(&o_conv);
16832 LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
16833 *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv);
16834 return tag_ptr(ret_conv, true);
16837 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1err(JNIEnv *env, jclass clz) {
16838 LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
16839 *ret_conv = CResult_BlindedPathNoneZ_err();
16840 return tag_ptr(ret_conv, true);
16843 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16844 LDKCResult_BlindedPathNoneZ* o_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(o);
16845 jboolean ret_conv = CResult_BlindedPathNoneZ_is_ok(o_conv);
16849 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16850 if (!ptr_is_owned(_res)) return;
16851 void* _res_ptr = untag_ptr(_res);
16852 CHECK_ACCESS(_res_ptr);
16853 LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr);
16854 FREE(untag_ptr(_res));
16855 CResult_BlindedPathNoneZ_free(_res_conv);
16858 static inline uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg) {
16859 LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
16860 *ret_conv = CResult_BlindedPathNoneZ_clone(arg);
16861 return tag_ptr(ret_conv, true);
16863 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16864 LDKCResult_BlindedPathNoneZ* arg_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(arg);
16865 int64_t ret_conv = CResult_BlindedPathNoneZ_clone_ptr(arg_conv);
16869 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16870 LDKCResult_BlindedPathNoneZ* orig_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(orig);
16871 LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
16872 *ret_conv = CResult_BlindedPathNoneZ_clone(orig_conv);
16873 return tag_ptr(ret_conv, true);
16876 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16877 LDKBlindedPath o_conv;
16878 o_conv.inner = untag_ptr(o);
16879 o_conv.is_owned = ptr_is_owned(o);
16880 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16881 o_conv = BlindedPath_clone(&o_conv);
16882 LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
16883 *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv);
16884 return tag_ptr(ret_conv, true);
16887 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16888 void* e_ptr = untag_ptr(e);
16889 CHECK_ACCESS(e_ptr);
16890 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16891 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16892 LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
16893 *ret_conv = CResult_BlindedPathDecodeErrorZ_err(e_conv);
16894 return tag_ptr(ret_conv, true);
16897 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16898 LDKCResult_BlindedPathDecodeErrorZ* o_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(o);
16899 jboolean ret_conv = CResult_BlindedPathDecodeErrorZ_is_ok(o_conv);
16903 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16904 if (!ptr_is_owned(_res)) return;
16905 void* _res_ptr = untag_ptr(_res);
16906 CHECK_ACCESS(_res_ptr);
16907 LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr);
16908 FREE(untag_ptr(_res));
16909 CResult_BlindedPathDecodeErrorZ_free(_res_conv);
16912 static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) {
16913 LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
16914 *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg);
16915 return tag_ptr(ret_conv, true);
16917 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16918 LDKCResult_BlindedPathDecodeErrorZ* arg_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(arg);
16919 int64_t ret_conv = CResult_BlindedPathDecodeErrorZ_clone_ptr(arg_conv);
16923 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16924 LDKCResult_BlindedPathDecodeErrorZ* orig_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(orig);
16925 LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
16926 *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(orig_conv);
16927 return tag_ptr(ret_conv, true);
16930 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16931 LDKBlindedHop o_conv;
16932 o_conv.inner = untag_ptr(o);
16933 o_conv.is_owned = ptr_is_owned(o);
16934 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16935 o_conv = BlindedHop_clone(&o_conv);
16936 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
16937 *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv);
16938 return tag_ptr(ret_conv, true);
16941 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16942 void* e_ptr = untag_ptr(e);
16943 CHECK_ACCESS(e_ptr);
16944 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16945 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16946 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
16947 *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv);
16948 return tag_ptr(ret_conv, true);
16951 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16952 LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o);
16953 jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv);
16957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16958 if (!ptr_is_owned(_res)) return;
16959 void* _res_ptr = untag_ptr(_res);
16960 CHECK_ACCESS(_res_ptr);
16961 LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr);
16962 FREE(untag_ptr(_res));
16963 CResult_BlindedHopDecodeErrorZ_free(_res_conv);
16966 static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) {
16967 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
16968 *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg);
16969 return tag_ptr(ret_conv, true);
16971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16972 LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg);
16973 int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv);
16977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16978 LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig);
16979 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
16980 *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv);
16981 return tag_ptr(ret_conv, true);
16984 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1some(JNIEnv *env, jclass clz, int64_t o) {
16985 void* o_ptr = untag_ptr(o);
16986 CHECK_ACCESS(o_ptr);
16987 LDKWriteableScore o_conv = *(LDKWriteableScore*)(o_ptr);
16988 if (o_conv.free == LDKWriteableScore_JCalls_free) {
16989 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
16990 LDKWriteableScore_JCalls_cloned(&o_conv);
16992 LDKCOption_WriteableScoreZ *ret_copy = MALLOC(sizeof(LDKCOption_WriteableScoreZ), "LDKCOption_WriteableScoreZ");
16993 *ret_copy = COption_WriteableScoreZ_some(o_conv);
16994 int64_t ret_ref = tag_ptr(ret_copy, true);
16998 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1none(JNIEnv *env, jclass clz) {
16999 LDKCOption_WriteableScoreZ *ret_copy = MALLOC(sizeof(LDKCOption_WriteableScoreZ), "LDKCOption_WriteableScoreZ");
17000 *ret_copy = COption_WriteableScoreZ_none();
17001 int64_t ret_ref = tag_ptr(ret_copy, true);
17005 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17006 if (!ptr_is_owned(_res)) return;
17007 void* _res_ptr = untag_ptr(_res);
17008 CHECK_ACCESS(_res_ptr);
17009 LDKCOption_WriteableScoreZ _res_conv = *(LDKCOption_WriteableScoreZ*)(_res_ptr);
17010 FREE(untag_ptr(_res));
17011 COption_WriteableScoreZ_free(_res_conv);
17014 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1ok(JNIEnv *env, jclass clz) {
17015 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17016 *ret_conv = CResult_NoneErrorZ_ok();
17017 return tag_ptr(ret_conv, true);
17020 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
17021 LDKIOError e_conv = LDKIOError_from_java(env, e);
17022 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17023 *ret_conv = CResult_NoneErrorZ_err(e_conv);
17024 return tag_ptr(ret_conv, true);
17027 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17028 LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o);
17029 jboolean ret_conv = CResult_NoneErrorZ_is_ok(o_conv);
17033 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17034 if (!ptr_is_owned(_res)) return;
17035 void* _res_ptr = untag_ptr(_res);
17036 CHECK_ACCESS(_res_ptr);
17037 LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
17038 FREE(untag_ptr(_res));
17039 CResult_NoneErrorZ_free(_res_conv);
17042 static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) {
17043 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17044 *ret_conv = CResult_NoneErrorZ_clone(arg);
17045 return tag_ptr(ret_conv, true);
17047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17048 LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg);
17049 int64_t ret_conv = CResult_NoneErrorZ_clone_ptr(arg_conv);
17053 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17054 LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig);
17055 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17056 *ret_conv = CResult_NoneErrorZ_clone(orig_conv);
17057 return tag_ptr(ret_conv, true);
17060 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17061 LDKCVec_ChannelDetailsZ _res_constr;
17062 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17063 if (_res_constr.datalen > 0)
17064 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
17066 _res_constr.data = NULL;
17067 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17068 for (size_t q = 0; q < _res_constr.datalen; q++) {
17069 int64_t _res_conv_16 = _res_vals[q];
17070 LDKChannelDetails _res_conv_16_conv;
17071 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
17072 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
17073 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
17074 _res_constr.data[q] = _res_conv_16_conv;
17076 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17077 CVec_ChannelDetailsZ_free(_res_constr);
17080 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17082 o_conv.inner = untag_ptr(o);
17083 o_conv.is_owned = ptr_is_owned(o);
17084 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17085 o_conv = Route_clone(&o_conv);
17086 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17087 *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
17088 return tag_ptr(ret_conv, true);
17091 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17092 LDKLightningError e_conv;
17093 e_conv.inner = untag_ptr(e);
17094 e_conv.is_owned = ptr_is_owned(e);
17095 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17096 e_conv = LightningError_clone(&e_conv);
17097 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17098 *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
17099 return tag_ptr(ret_conv, true);
17102 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17103 LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
17104 jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
17108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17109 if (!ptr_is_owned(_res)) return;
17110 void* _res_ptr = untag_ptr(_res);
17111 CHECK_ACCESS(_res_ptr);
17112 LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
17113 FREE(untag_ptr(_res));
17114 CResult_RouteLightningErrorZ_free(_res_conv);
17117 static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
17118 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17119 *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
17120 return tag_ptr(ret_conv, true);
17122 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17123 LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
17124 int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
17128 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17129 LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
17130 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17131 *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
17132 return tag_ptr(ret_conv, true);
17135 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17136 LDKCVec_RouteHopZ _res_constr;
17137 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17138 if (_res_constr.datalen > 0)
17139 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
17141 _res_constr.data = NULL;
17142 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17143 for (size_t k = 0; k < _res_constr.datalen; k++) {
17144 int64_t _res_conv_10 = _res_vals[k];
17145 LDKRouteHop _res_conv_10_conv;
17146 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
17147 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
17148 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
17149 _res_constr.data[k] = _res_conv_10_conv;
17151 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17152 CVec_RouteHopZ_free(_res_constr);
17155 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) {
17156 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
17157 *ret_copy = COption_u64Z_some(o);
17158 int64_t ret_ref = tag_ptr(ret_copy, true);
17162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) {
17163 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
17164 *ret_copy = COption_u64Z_none();
17165 int64_t ret_ref = tag_ptr(ret_copy, true);
17169 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
17170 if (!ptr_is_owned(_res)) return;
17171 void* _res_ptr = untag_ptr(_res);
17172 CHECK_ACCESS(_res_ptr);
17173 LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
17174 FREE(untag_ptr(_res));
17175 COption_u64Z_free(_res_conv);
17178 static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
17179 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
17180 *ret_copy = COption_u64Z_clone(arg);
17181 int64_t ret_ref = tag_ptr(ret_copy, true);
17184 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17185 LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
17186 int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
17190 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17191 LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
17192 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
17193 *ret_copy = COption_u64Z_clone(orig_conv);
17194 int64_t ret_ref = tag_ptr(ret_copy, true);
17198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17199 LDKInFlightHtlcs o_conv;
17200 o_conv.inner = untag_ptr(o);
17201 o_conv.is_owned = ptr_is_owned(o);
17202 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17203 o_conv = InFlightHtlcs_clone(&o_conv);
17204 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
17205 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_ok(o_conv);
17206 return tag_ptr(ret_conv, true);
17209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17210 void* e_ptr = untag_ptr(e);
17211 CHECK_ACCESS(e_ptr);
17212 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17213 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17214 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
17215 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv);
17216 return tag_ptr(ret_conv, true);
17219 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17220 LDKCResult_InFlightHtlcsDecodeErrorZ* o_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(o);
17221 jboolean ret_conv = CResult_InFlightHtlcsDecodeErrorZ_is_ok(o_conv);
17225 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17226 if (!ptr_is_owned(_res)) return;
17227 void* _res_ptr = untag_ptr(_res);
17228 CHECK_ACCESS(_res_ptr);
17229 LDKCResult_InFlightHtlcsDecodeErrorZ _res_conv = *(LDKCResult_InFlightHtlcsDecodeErrorZ*)(_res_ptr);
17230 FREE(untag_ptr(_res));
17231 CResult_InFlightHtlcsDecodeErrorZ_free(_res_conv);
17234 static inline uint64_t CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR arg) {
17235 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
17236 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone(arg);
17237 return tag_ptr(ret_conv, true);
17239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17240 LDKCResult_InFlightHtlcsDecodeErrorZ* arg_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(arg);
17241 int64_t ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(arg_conv);
17245 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17246 LDKCResult_InFlightHtlcsDecodeErrorZ* orig_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(orig);
17247 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
17248 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone(orig_conv);
17249 return tag_ptr(ret_conv, true);
17252 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17253 LDKRouteHop o_conv;
17254 o_conv.inner = untag_ptr(o);
17255 o_conv.is_owned = ptr_is_owned(o);
17256 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17257 o_conv = RouteHop_clone(&o_conv);
17258 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
17259 *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
17260 return tag_ptr(ret_conv, true);
17263 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17264 void* e_ptr = untag_ptr(e);
17265 CHECK_ACCESS(e_ptr);
17266 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17267 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17268 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
17269 *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
17270 return tag_ptr(ret_conv, true);
17273 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17274 LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
17275 jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
17279 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17280 if (!ptr_is_owned(_res)) return;
17281 void* _res_ptr = untag_ptr(_res);
17282 CHECK_ACCESS(_res_ptr);
17283 LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
17284 FREE(untag_ptr(_res));
17285 CResult_RouteHopDecodeErrorZ_free(_res_conv);
17288 static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
17289 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
17290 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
17291 return tag_ptr(ret_conv, true);
17293 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17294 LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
17295 int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
17299 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17300 LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
17301 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
17302 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
17303 return tag_ptr(ret_conv, true);
17306 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
17307 LDKCVec_CVec_RouteHopZZ _res_constr;
17308 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17309 if (_res_constr.datalen > 0)
17310 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
17312 _res_constr.data = NULL;
17313 for (size_t m = 0; m < _res_constr.datalen; m++) {
17314 int64_tArray _res_conv_12 = (*env)->GetObjectArrayElement(env, _res, m);
17315 LDKCVec_RouteHopZ _res_conv_12_constr;
17316 _res_conv_12_constr.datalen = (*env)->GetArrayLength(env, _res_conv_12);
17317 if (_res_conv_12_constr.datalen > 0)
17318 _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
17320 _res_conv_12_constr.data = NULL;
17321 int64_t* _res_conv_12_vals = (*env)->GetLongArrayElements (env, _res_conv_12, NULL);
17322 for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
17323 int64_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
17324 LDKRouteHop _res_conv_12_conv_10_conv;
17325 _res_conv_12_conv_10_conv.inner = untag_ptr(_res_conv_12_conv_10);
17326 _res_conv_12_conv_10_conv.is_owned = ptr_is_owned(_res_conv_12_conv_10);
17327 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
17328 _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
17330 (*env)->ReleaseLongArrayElements(env, _res_conv_12, _res_conv_12_vals, 0);
17331 _res_constr.data[m] = _res_conv_12_constr;
17333 CVec_CVec_RouteHopZZ_free(_res_constr);
17336 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17338 o_conv.inner = untag_ptr(o);
17339 o_conv.is_owned = ptr_is_owned(o);
17340 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17341 o_conv = Route_clone(&o_conv);
17342 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
17343 *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv);
17344 return tag_ptr(ret_conv, true);
17347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17348 void* e_ptr = untag_ptr(e);
17349 CHECK_ACCESS(e_ptr);
17350 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17351 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17352 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
17353 *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
17354 return tag_ptr(ret_conv, true);
17357 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17358 LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(o);
17359 jboolean ret_conv = CResult_RouteDecodeErrorZ_is_ok(o_conv);
17363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_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_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
17368 FREE(untag_ptr(_res));
17369 CResult_RouteDecodeErrorZ_free(_res_conv);
17372 static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) {
17373 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
17374 *ret_conv = CResult_RouteDecodeErrorZ_clone(arg);
17375 return tag_ptr(ret_conv, true);
17377 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17378 LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(arg);
17379 int64_t ret_conv = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv);
17383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17384 LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(orig);
17385 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
17386 *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv);
17387 return tag_ptr(ret_conv, true);
17390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17391 LDKRouteParameters o_conv;
17392 o_conv.inner = untag_ptr(o);
17393 o_conv.is_owned = ptr_is_owned(o);
17394 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17395 o_conv = RouteParameters_clone(&o_conv);
17396 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
17397 *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
17398 return tag_ptr(ret_conv, true);
17401 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17402 void* e_ptr = untag_ptr(e);
17403 CHECK_ACCESS(e_ptr);
17404 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17405 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17406 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
17407 *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
17408 return tag_ptr(ret_conv, true);
17411 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17412 LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(o);
17413 jboolean ret_conv = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv);
17417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17418 if (!ptr_is_owned(_res)) return;
17419 void* _res_ptr = untag_ptr(_res);
17420 CHECK_ACCESS(_res_ptr);
17421 LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
17422 FREE(untag_ptr(_res));
17423 CResult_RouteParametersDecodeErrorZ_free(_res_conv);
17426 static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) {
17427 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
17428 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg);
17429 return tag_ptr(ret_conv, true);
17431 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17432 LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(arg);
17433 int64_t ret_conv = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv);
17437 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17438 LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(orig);
17439 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
17440 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
17441 return tag_ptr(ret_conv, true);
17444 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17445 LDKCVec_RouteHintZ _res_constr;
17446 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17447 if (_res_constr.datalen > 0)
17448 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
17450 _res_constr.data = NULL;
17451 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17452 for (size_t l = 0; l < _res_constr.datalen; l++) {
17453 int64_t _res_conv_11 = _res_vals[l];
17454 LDKRouteHint _res_conv_11_conv;
17455 _res_conv_11_conv.inner = untag_ptr(_res_conv_11);
17456 _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11);
17457 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
17458 _res_constr.data[l] = _res_conv_11_conv;
17460 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17461 CVec_RouteHintZ_free(_res_constr);
17464 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17465 LDKCVec_u64Z _res_constr;
17466 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17467 if (_res_constr.datalen > 0)
17468 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
17470 _res_constr.data = NULL;
17471 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17472 for (size_t g = 0; g < _res_constr.datalen; g++) {
17473 int64_t _res_conv_6 = _res_vals[g];
17474 _res_constr.data[g] = _res_conv_6;
17476 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17477 CVec_u64Z_free(_res_constr);
17480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17481 LDKPaymentParameters o_conv;
17482 o_conv.inner = untag_ptr(o);
17483 o_conv.is_owned = ptr_is_owned(o);
17484 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17485 o_conv = PaymentParameters_clone(&o_conv);
17486 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
17487 *ret_conv = CResult_PaymentParametersDecodeErrorZ_ok(o_conv);
17488 return tag_ptr(ret_conv, true);
17491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17492 void* e_ptr = untag_ptr(e);
17493 CHECK_ACCESS(e_ptr);
17494 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17495 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17496 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
17497 *ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
17498 return tag_ptr(ret_conv, true);
17501 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17502 LDKCResult_PaymentParametersDecodeErrorZ* o_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(o);
17503 jboolean ret_conv = CResult_PaymentParametersDecodeErrorZ_is_ok(o_conv);
17507 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17508 if (!ptr_is_owned(_res)) return;
17509 void* _res_ptr = untag_ptr(_res);
17510 CHECK_ACCESS(_res_ptr);
17511 LDKCResult_PaymentParametersDecodeErrorZ _res_conv = *(LDKCResult_PaymentParametersDecodeErrorZ*)(_res_ptr);
17512 FREE(untag_ptr(_res));
17513 CResult_PaymentParametersDecodeErrorZ_free(_res_conv);
17516 static inline uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg) {
17517 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
17518 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(arg);
17519 return tag_ptr(ret_conv, true);
17521 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17522 LDKCResult_PaymentParametersDecodeErrorZ* arg_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(arg);
17523 int64_t ret_conv = CResult_PaymentParametersDecodeErrorZ_clone_ptr(arg_conv);
17527 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17528 LDKCResult_PaymentParametersDecodeErrorZ* orig_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(orig);
17529 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
17530 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(orig_conv);
17531 return tag_ptr(ret_conv, true);
17534 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17535 LDKCVec_RouteHintHopZ _res_constr;
17536 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17537 if (_res_constr.datalen > 0)
17538 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
17540 _res_constr.data = NULL;
17541 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17542 for (size_t o = 0; o < _res_constr.datalen; o++) {
17543 int64_t _res_conv_14 = _res_vals[o];
17544 LDKRouteHintHop _res_conv_14_conv;
17545 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
17546 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
17547 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
17548 _res_constr.data[o] = _res_conv_14_conv;
17550 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17551 CVec_RouteHintHopZ_free(_res_constr);
17554 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17555 LDKRouteHint o_conv;
17556 o_conv.inner = untag_ptr(o);
17557 o_conv.is_owned = ptr_is_owned(o);
17558 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17559 o_conv = RouteHint_clone(&o_conv);
17560 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
17561 *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
17562 return tag_ptr(ret_conv, true);
17565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17566 void* e_ptr = untag_ptr(e);
17567 CHECK_ACCESS(e_ptr);
17568 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17569 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17570 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
17571 *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
17572 return tag_ptr(ret_conv, true);
17575 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17576 LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(o);
17577 jboolean ret_conv = CResult_RouteHintDecodeErrorZ_is_ok(o_conv);
17581 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17582 if (!ptr_is_owned(_res)) return;
17583 void* _res_ptr = untag_ptr(_res);
17584 CHECK_ACCESS(_res_ptr);
17585 LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
17586 FREE(untag_ptr(_res));
17587 CResult_RouteHintDecodeErrorZ_free(_res_conv);
17590 static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) {
17591 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
17592 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg);
17593 return tag_ptr(ret_conv, true);
17595 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17596 LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(arg);
17597 int64_t ret_conv = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv);
17601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17602 LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(orig);
17603 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
17604 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
17605 return tag_ptr(ret_conv, true);
17608 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17609 LDKRouteHintHop o_conv;
17610 o_conv.inner = untag_ptr(o);
17611 o_conv.is_owned = ptr_is_owned(o);
17612 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17613 o_conv = RouteHintHop_clone(&o_conv);
17614 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
17615 *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
17616 return tag_ptr(ret_conv, true);
17619 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17620 void* e_ptr = untag_ptr(e);
17621 CHECK_ACCESS(e_ptr);
17622 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17623 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17624 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
17625 *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
17626 return tag_ptr(ret_conv, true);
17629 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17630 LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(o);
17631 jboolean ret_conv = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv);
17635 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17636 if (!ptr_is_owned(_res)) return;
17637 void* _res_ptr = untag_ptr(_res);
17638 CHECK_ACCESS(_res_ptr);
17639 LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
17640 FREE(untag_ptr(_res));
17641 CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
17644 static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) {
17645 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
17646 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg);
17647 return tag_ptr(ret_conv, true);
17649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17650 LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(arg);
17651 int64_t ret_conv = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv);
17655 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17656 LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(orig);
17657 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
17658 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
17659 return tag_ptr(ret_conv, true);
17662 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17663 void* o_ptr = untag_ptr(o);
17664 CHECK_ACCESS(o_ptr);
17665 LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
17666 o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
17667 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
17668 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
17669 return tag_ptr(ret_conv, true);
17672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17673 void* e_ptr = untag_ptr(e);
17674 CHECK_ACCESS(e_ptr);
17675 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17676 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17677 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
17678 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
17679 return tag_ptr(ret_conv, true);
17682 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17683 LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
17684 jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
17688 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17689 if (!ptr_is_owned(_res)) return;
17690 void* _res_ptr = untag_ptr(_res);
17691 CHECK_ACCESS(_res_ptr);
17692 LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
17693 FREE(untag_ptr(_res));
17694 CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
17697 static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
17698 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
17699 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
17700 return tag_ptr(ret_conv, true);
17702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17703 LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
17704 int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
17708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17709 LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
17710 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
17711 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
17712 return tag_ptr(ret_conv, true);
17715 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) {
17716 void* o_ptr = untag_ptr(o);
17717 CHECK_ACCESS(o_ptr);
17718 LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
17719 o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
17720 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
17721 *ret_copy = COption_NetworkUpdateZ_some(o_conv);
17722 int64_t ret_ref = tag_ptr(ret_copy, true);
17726 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1none(JNIEnv *env, jclass clz) {
17727 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
17728 *ret_copy = COption_NetworkUpdateZ_none();
17729 int64_t ret_ref = tag_ptr(ret_copy, true);
17733 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17734 if (!ptr_is_owned(_res)) return;
17735 void* _res_ptr = untag_ptr(_res);
17736 CHECK_ACCESS(_res_ptr);
17737 LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
17738 FREE(untag_ptr(_res));
17739 COption_NetworkUpdateZ_free(_res_conv);
17742 static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
17743 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
17744 *ret_copy = COption_NetworkUpdateZ_clone(arg);
17745 int64_t ret_ref = tag_ptr(ret_copy, true);
17748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17749 LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
17750 int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
17754 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17755 LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
17756 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
17757 *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
17758 int64_t ret_ref = tag_ptr(ret_copy, true);
17762 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PathFailureZ_1some(JNIEnv *env, jclass clz, int64_t o) {
17763 void* o_ptr = untag_ptr(o);
17764 CHECK_ACCESS(o_ptr);
17765 LDKPathFailure o_conv = *(LDKPathFailure*)(o_ptr);
17766 o_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(o));
17767 LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
17768 *ret_copy = COption_PathFailureZ_some(o_conv);
17769 int64_t ret_ref = tag_ptr(ret_copy, true);
17773 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PathFailureZ_1none(JNIEnv *env, jclass clz) {
17774 LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
17775 *ret_copy = COption_PathFailureZ_none();
17776 int64_t ret_ref = tag_ptr(ret_copy, true);
17780 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1PathFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17781 if (!ptr_is_owned(_res)) return;
17782 void* _res_ptr = untag_ptr(_res);
17783 CHECK_ACCESS(_res_ptr);
17784 LDKCOption_PathFailureZ _res_conv = *(LDKCOption_PathFailureZ*)(_res_ptr);
17785 FREE(untag_ptr(_res));
17786 COption_PathFailureZ_free(_res_conv);
17789 static inline uint64_t COption_PathFailureZ_clone_ptr(LDKCOption_PathFailureZ *NONNULL_PTR arg) {
17790 LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
17791 *ret_copy = COption_PathFailureZ_clone(arg);
17792 int64_t ret_ref = tag_ptr(ret_copy, true);
17795 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PathFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17796 LDKCOption_PathFailureZ* arg_conv = (LDKCOption_PathFailureZ*)untag_ptr(arg);
17797 int64_t ret_conv = COption_PathFailureZ_clone_ptr(arg_conv);
17801 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PathFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17802 LDKCOption_PathFailureZ* orig_conv = (LDKCOption_PathFailureZ*)untag_ptr(orig);
17803 LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
17804 *ret_copy = COption_PathFailureZ_clone(orig_conv);
17805 int64_t ret_ref = tag_ptr(ret_copy, true);
17809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17810 void* o_ptr = untag_ptr(o);
17811 CHECK_ACCESS(o_ptr);
17812 LDKCOption_PathFailureZ o_conv = *(LDKCOption_PathFailureZ*)(o_ptr);
17813 o_conv = COption_PathFailureZ_clone((LDKCOption_PathFailureZ*)untag_ptr(o));
17814 LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
17815 *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_ok(o_conv);
17816 return tag_ptr(ret_conv, true);
17819 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17820 void* e_ptr = untag_ptr(e);
17821 CHECK_ACCESS(e_ptr);
17822 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17823 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17824 LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
17825 *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_err(e_conv);
17826 return tag_ptr(ret_conv, true);
17829 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17830 LDKCResult_COption_PathFailureZDecodeErrorZ* o_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(o);
17831 jboolean ret_conv = CResult_COption_PathFailureZDecodeErrorZ_is_ok(o_conv);
17835 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17836 if (!ptr_is_owned(_res)) return;
17837 void* _res_ptr = untag_ptr(_res);
17838 CHECK_ACCESS(_res_ptr);
17839 LDKCResult_COption_PathFailureZDecodeErrorZ _res_conv = *(LDKCResult_COption_PathFailureZDecodeErrorZ*)(_res_ptr);
17840 FREE(untag_ptr(_res));
17841 CResult_COption_PathFailureZDecodeErrorZ_free(_res_conv);
17844 static inline uint64_t CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR arg) {
17845 LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
17846 *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(arg);
17847 return tag_ptr(ret_conv, true);
17849 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17850 LDKCResult_COption_PathFailureZDecodeErrorZ* arg_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(arg);
17851 int64_t ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(arg_conv);
17855 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17856 LDKCResult_COption_PathFailureZDecodeErrorZ* orig_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(orig);
17857 LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
17858 *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(orig_conv);
17859 return tag_ptr(ret_conv, true);
17862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some(JNIEnv *env, jclass clz, int64_t o) {
17863 void* o_ptr = untag_ptr(o);
17864 CHECK_ACCESS(o_ptr);
17865 LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr);
17866 o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o));
17867 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
17868 *ret_copy = COption_ClosureReasonZ_some(o_conv);
17869 int64_t ret_ref = tag_ptr(ret_copy, true);
17873 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none(JNIEnv *env, jclass clz) {
17874 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
17875 *ret_copy = COption_ClosureReasonZ_none();
17876 int64_t ret_ref = tag_ptr(ret_copy, true);
17880 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17881 if (!ptr_is_owned(_res)) return;
17882 void* _res_ptr = untag_ptr(_res);
17883 CHECK_ACCESS(_res_ptr);
17884 LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr);
17885 FREE(untag_ptr(_res));
17886 COption_ClosureReasonZ_free(_res_conv);
17889 static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) {
17890 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
17891 *ret_copy = COption_ClosureReasonZ_clone(arg);
17892 int64_t ret_ref = tag_ptr(ret_copy, true);
17895 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17896 LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg);
17897 int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv);
17901 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17902 LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig);
17903 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
17904 *ret_copy = COption_ClosureReasonZ_clone(orig_conv);
17905 int64_t ret_ref = tag_ptr(ret_copy, true);
17909 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17910 void* o_ptr = untag_ptr(o);
17911 CHECK_ACCESS(o_ptr);
17912 LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr);
17913 o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o));
17914 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
17915 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv);
17916 return tag_ptr(ret_conv, true);
17919 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17920 void* e_ptr = untag_ptr(e);
17921 CHECK_ACCESS(e_ptr);
17922 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17923 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17924 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
17925 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
17926 return tag_ptr(ret_conv, true);
17929 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17930 LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o);
17931 jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv);
17935 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17936 if (!ptr_is_owned(_res)) return;
17937 void* _res_ptr = untag_ptr(_res);
17938 CHECK_ACCESS(_res_ptr);
17939 LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr);
17940 FREE(untag_ptr(_res));
17941 CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv);
17944 static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) {
17945 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
17946 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg);
17947 return tag_ptr(ret_conv, true);
17949 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17950 LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg);
17951 int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv);
17955 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17956 LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig);
17957 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
17958 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv);
17959 return tag_ptr(ret_conv, true);
17962 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1some(JNIEnv *env, jclass clz, int64_t o) {
17963 void* o_ptr = untag_ptr(o);
17964 CHECK_ACCESS(o_ptr);
17965 LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr);
17966 o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o));
17967 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
17968 *ret_copy = COption_HTLCDestinationZ_some(o_conv);
17969 int64_t ret_ref = tag_ptr(ret_copy, true);
17973 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1none(JNIEnv *env, jclass clz) {
17974 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
17975 *ret_copy = COption_HTLCDestinationZ_none();
17976 int64_t ret_ref = tag_ptr(ret_copy, true);
17980 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17981 if (!ptr_is_owned(_res)) return;
17982 void* _res_ptr = untag_ptr(_res);
17983 CHECK_ACCESS(_res_ptr);
17984 LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr);
17985 FREE(untag_ptr(_res));
17986 COption_HTLCDestinationZ_free(_res_conv);
17989 static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) {
17990 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
17991 *ret_copy = COption_HTLCDestinationZ_clone(arg);
17992 int64_t ret_ref = tag_ptr(ret_copy, true);
17995 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17996 LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg);
17997 int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv);
18001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18002 LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig);
18003 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
18004 *ret_copy = COption_HTLCDestinationZ_clone(orig_conv);
18005 int64_t ret_ref = tag_ptr(ret_copy, true);
18009 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18010 void* o_ptr = untag_ptr(o);
18011 CHECK_ACCESS(o_ptr);
18012 LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr);
18013 o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o));
18014 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
18015 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv);
18016 return tag_ptr(ret_conv, true);
18019 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18020 void* e_ptr = untag_ptr(e);
18021 CHECK_ACCESS(e_ptr);
18022 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18023 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18024 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
18025 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
18026 return tag_ptr(ret_conv, true);
18029 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18030 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o);
18031 jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv);
18035 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18036 if (!ptr_is_owned(_res)) return;
18037 void* _res_ptr = untag_ptr(_res);
18038 CHECK_ACCESS(_res_ptr);
18039 LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr);
18040 FREE(untag_ptr(_res));
18041 CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv);
18044 static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) {
18045 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
18046 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg);
18047 return tag_ptr(ret_conv, true);
18049 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18050 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg);
18051 int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv);
18055 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18056 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig);
18057 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
18058 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv);
18059 return tag_ptr(ret_conv, true);
18062 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1some(JNIEnv *env, jclass clz, int8_tArray o) {
18064 CHECK((*env)->GetArrayLength(env, o) == 16);
18065 (*env)->GetByteArrayRegion(env, o, 0, 16, o_ref.le_bytes);
18066 LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
18067 *ret_copy = COption_u128Z_some(o_ref);
18068 int64_t ret_ref = tag_ptr(ret_copy, true);
18072 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1none(JNIEnv *env, jclass clz) {
18073 LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
18074 *ret_copy = COption_u128Z_none();
18075 int64_t ret_ref = tag_ptr(ret_copy, true);
18079 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
18080 if (!ptr_is_owned(_res)) return;
18081 void* _res_ptr = untag_ptr(_res);
18082 CHECK_ACCESS(_res_ptr);
18083 LDKCOption_u128Z _res_conv = *(LDKCOption_u128Z*)(_res_ptr);
18084 FREE(untag_ptr(_res));
18085 COption_u128Z_free(_res_conv);
18088 static inline uint64_t COption_u128Z_clone_ptr(LDKCOption_u128Z *NONNULL_PTR arg) {
18089 LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
18090 *ret_copy = COption_u128Z_clone(arg);
18091 int64_t ret_ref = tag_ptr(ret_copy, true);
18094 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18095 LDKCOption_u128Z* arg_conv = (LDKCOption_u128Z*)untag_ptr(arg);
18096 int64_t ret_conv = COption_u128Z_clone_ptr(arg_conv);
18100 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18101 LDKCOption_u128Z* orig_conv = (LDKCOption_u128Z*)untag_ptr(orig);
18102 LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
18103 *ret_copy = COption_u128Z_clone(orig_conv);
18104 int64_t ret_ref = tag_ptr(ret_copy, true);
18108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18109 LDKCVec_SpendableOutputDescriptorZ _res_constr;
18110 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18111 if (_res_constr.datalen > 0)
18112 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
18114 _res_constr.data = NULL;
18115 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18116 for (size_t b = 0; b < _res_constr.datalen; b++) {
18117 int64_t _res_conv_27 = _res_vals[b];
18118 void* _res_conv_27_ptr = untag_ptr(_res_conv_27);
18119 CHECK_ACCESS(_res_conv_27_ptr);
18120 LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
18121 FREE(untag_ptr(_res_conv_27));
18122 _res_constr.data[b] = _res_conv_27_conv;
18124 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18125 CVec_SpendableOutputDescriptorZ_free(_res_constr);
18128 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some(JNIEnv *env, jclass clz, int64_t o) {
18129 void* o_ptr = untag_ptr(o);
18130 CHECK_ACCESS(o_ptr);
18131 LDKEvent o_conv = *(LDKEvent*)(o_ptr);
18132 o_conv = Event_clone((LDKEvent*)untag_ptr(o));
18133 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
18134 *ret_copy = COption_EventZ_some(o_conv);
18135 int64_t ret_ref = tag_ptr(ret_copy, true);
18139 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none(JNIEnv *env, jclass clz) {
18140 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
18141 *ret_copy = COption_EventZ_none();
18142 int64_t ret_ref = tag_ptr(ret_copy, true);
18146 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18147 if (!ptr_is_owned(_res)) return;
18148 void* _res_ptr = untag_ptr(_res);
18149 CHECK_ACCESS(_res_ptr);
18150 LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr);
18151 FREE(untag_ptr(_res));
18152 COption_EventZ_free(_res_conv);
18155 static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) {
18156 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
18157 *ret_copy = COption_EventZ_clone(arg);
18158 int64_t ret_ref = tag_ptr(ret_copy, true);
18161 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18162 LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg);
18163 int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv);
18167 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18168 LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig);
18169 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
18170 *ret_copy = COption_EventZ_clone(orig_conv);
18171 int64_t ret_ref = tag_ptr(ret_copy, true);
18175 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18176 void* o_ptr = untag_ptr(o);
18177 CHECK_ACCESS(o_ptr);
18178 LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr);
18179 o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o));
18180 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
18181 *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv);
18182 return tag_ptr(ret_conv, true);
18185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18186 void* e_ptr = untag_ptr(e);
18187 CHECK_ACCESS(e_ptr);
18188 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18189 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18190 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
18191 *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
18192 return tag_ptr(ret_conv, true);
18195 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18196 LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o);
18197 jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv);
18201 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18202 if (!ptr_is_owned(_res)) return;
18203 void* _res_ptr = untag_ptr(_res);
18204 CHECK_ACCESS(_res_ptr);
18205 LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr);
18206 FREE(untag_ptr(_res));
18207 CResult_COption_EventZDecodeErrorZ_free(_res_conv);
18210 static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) {
18211 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
18212 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg);
18213 return tag_ptr(ret_conv, true);
18215 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18216 LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg);
18217 int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv);
18221 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18222 LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig);
18223 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
18224 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv);
18225 return tag_ptr(ret_conv, true);
18228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18229 LDKCVec_MessageSendEventZ _res_constr;
18230 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18231 if (_res_constr.datalen > 0)
18232 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
18234 _res_constr.data = NULL;
18235 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18236 for (size_t s = 0; s < _res_constr.datalen; s++) {
18237 int64_t _res_conv_18 = _res_vals[s];
18238 void* _res_conv_18_ptr = untag_ptr(_res_conv_18);
18239 CHECK_ACCESS(_res_conv_18_ptr);
18240 LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
18241 FREE(untag_ptr(_res_conv_18));
18242 _res_constr.data[s] = _res_conv_18_conv;
18244 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18245 CVec_MessageSendEventZ_free(_res_constr);
18248 static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
18249 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
18250 *ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
18251 return tag_ptr(ret_conv, true);
18253 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18254 LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg);
18255 int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv);
18259 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18260 LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig);
18261 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
18262 *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv);
18263 return tag_ptr(ret_conv, true);
18266 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
18267 LDKTransaction b_ref;
18268 b_ref.datalen = (*env)->GetArrayLength(env, b);
18269 b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
18270 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
18271 b_ref.data_is_owned = true;
18272 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
18273 *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref);
18274 return tag_ptr(ret_conv, true);
18277 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18278 if (!ptr_is_owned(_res)) return;
18279 void* _res_ptr = untag_ptr(_res);
18280 CHECK_ACCESS(_res_ptr);
18281 LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
18282 FREE(untag_ptr(_res));
18283 C2Tuple_usizeTransactionZ_free(_res_conv);
18286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18287 LDKCVec_C2Tuple_usizeTransactionZZ _res_constr;
18288 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18289 if (_res_constr.datalen > 0)
18290 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
18292 _res_constr.data = NULL;
18293 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18294 for (size_t c = 0; c < _res_constr.datalen; c++) {
18295 int64_t _res_conv_28 = _res_vals[c];
18296 void* _res_conv_28_ptr = untag_ptr(_res_conv_28);
18297 CHECK_ACCESS(_res_conv_28_ptr);
18298 LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
18299 FREE(untag_ptr(_res_conv_28));
18300 _res_constr.data[c] = _res_conv_28_conv;
18302 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18303 CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
18306 static inline uint64_t C2Tuple_TxidBlockHashZ_clone_ptr(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR arg) {
18307 LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
18308 *ret_conv = C2Tuple_TxidBlockHashZ_clone(arg);
18309 return tag_ptr(ret_conv, true);
18311 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18312 LDKC2Tuple_TxidBlockHashZ* arg_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(arg);
18313 int64_t ret_conv = C2Tuple_TxidBlockHashZ_clone_ptr(arg_conv);
18317 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18318 LDKC2Tuple_TxidBlockHashZ* orig_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(orig);
18319 LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
18320 *ret_conv = C2Tuple_TxidBlockHashZ_clone(orig_conv);
18321 return tag_ptr(ret_conv, true);
18324 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
18325 LDKThirtyTwoBytes a_ref;
18326 CHECK((*env)->GetArrayLength(env, a) == 32);
18327 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
18328 LDKThirtyTwoBytes b_ref;
18329 CHECK((*env)->GetArrayLength(env, b) == 32);
18330 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
18331 LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
18332 *ret_conv = C2Tuple_TxidBlockHashZ_new(a_ref, b_ref);
18333 return tag_ptr(ret_conv, true);
18336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18337 if (!ptr_is_owned(_res)) return;
18338 void* _res_ptr = untag_ptr(_res);
18339 CHECK_ACCESS(_res_ptr);
18340 LDKC2Tuple_TxidBlockHashZ _res_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_ptr);
18341 FREE(untag_ptr(_res));
18342 C2Tuple_TxidBlockHashZ_free(_res_conv);
18345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidBlockHashZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18346 LDKCVec_C2Tuple_TxidBlockHashZZ _res_constr;
18347 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18348 if (_res_constr.datalen > 0)
18349 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKCVec_C2Tuple_TxidBlockHashZZ Elements");
18351 _res_constr.data = NULL;
18352 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18353 for (size_t z = 0; z < _res_constr.datalen; z++) {
18354 int64_t _res_conv_25 = _res_vals[z];
18355 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
18356 CHECK_ACCESS(_res_conv_25_ptr);
18357 LDKC2Tuple_TxidBlockHashZ _res_conv_25_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_conv_25_ptr);
18358 FREE(untag_ptr(_res_conv_25));
18359 _res_constr.data[z] = _res_conv_25_conv;
18361 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18362 CVec_C2Tuple_TxidBlockHashZZ_free(_res_constr);
18365 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18366 LDKCVec_MonitorEventZ _res_constr;
18367 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18368 if (_res_constr.datalen > 0)
18369 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
18371 _res_constr.data = NULL;
18372 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18373 for (size_t o = 0; o < _res_constr.datalen; o++) {
18374 int64_t _res_conv_14 = _res_vals[o];
18375 void* _res_conv_14_ptr = untag_ptr(_res_conv_14);
18376 CHECK_ACCESS(_res_conv_14_ptr);
18377 LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
18378 FREE(untag_ptr(_res_conv_14));
18379 _res_constr.data[o] = _res_conv_14_conv;
18381 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18382 CVec_MonitorEventZ_free(_res_constr);
18385 static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) {
18386 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
18387 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg);
18388 return tag_ptr(ret_conv, true);
18390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18391 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg);
18392 int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv);
18396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18397 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig);
18398 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
18399 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv);
18400 return tag_ptr(ret_conv, true);
18403 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) {
18404 LDKOutPoint a_conv;
18405 a_conv.inner = untag_ptr(a);
18406 a_conv.is_owned = ptr_is_owned(a);
18407 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
18408 a_conv = OutPoint_clone(&a_conv);
18409 LDKCVec_MonitorEventZ b_constr;
18410 b_constr.datalen = (*env)->GetArrayLength(env, b);
18411 if (b_constr.datalen > 0)
18412 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
18414 b_constr.data = NULL;
18415 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
18416 for (size_t o = 0; o < b_constr.datalen; o++) {
18417 int64_t b_conv_14 = b_vals[o];
18418 void* b_conv_14_ptr = untag_ptr(b_conv_14);
18419 CHECK_ACCESS(b_conv_14_ptr);
18420 LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr);
18421 b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14));
18422 b_constr.data[o] = b_conv_14_conv;
18424 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
18425 LDKPublicKey c_ref;
18426 CHECK((*env)->GetArrayLength(env, c) == 33);
18427 (*env)->GetByteArrayRegion(env, c, 0, 33, c_ref.compressed_form);
18428 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
18429 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref);
18430 return tag_ptr(ret_conv, true);
18433 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18434 if (!ptr_is_owned(_res)) return;
18435 void* _res_ptr = untag_ptr(_res);
18436 CHECK_ACCESS(_res_ptr);
18437 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr);
18438 FREE(untag_ptr(_res));
18439 C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv);
18442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18443 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr;
18444 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18445 if (_res_constr.datalen > 0)
18446 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
18448 _res_constr.data = NULL;
18449 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18450 for (size_t x = 0; x < _res_constr.datalen; x++) {
18451 int64_t _res_conv_49 = _res_vals[x];
18452 void* _res_conv_49_ptr = untag_ptr(_res_conv_49);
18453 CHECK_ACCESS(_res_conv_49_ptr);
18454 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr);
18455 FREE(untag_ptr(_res_conv_49));
18456 _res_constr.data[x] = _res_conv_49_conv;
18458 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18459 CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr);
18462 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18463 LDKFixedPenaltyScorer o_conv;
18464 o_conv.inner = untag_ptr(o);
18465 o_conv.is_owned = ptr_is_owned(o);
18466 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18467 o_conv = FixedPenaltyScorer_clone(&o_conv);
18468 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
18469 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv);
18470 return tag_ptr(ret_conv, true);
18473 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18474 void* e_ptr = untag_ptr(e);
18475 CHECK_ACCESS(e_ptr);
18476 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18477 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18478 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
18479 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
18480 return tag_ptr(ret_conv, true);
18483 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18484 LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o);
18485 jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv);
18489 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18490 if (!ptr_is_owned(_res)) return;
18491 void* _res_ptr = untag_ptr(_res);
18492 CHECK_ACCESS(_res_ptr);
18493 LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr);
18494 FREE(untag_ptr(_res));
18495 CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv);
18498 static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) {
18499 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
18500 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg);
18501 return tag_ptr(ret_conv, true);
18503 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18504 LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg);
18505 int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv);
18509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18510 LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig);
18511 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
18512 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv);
18513 return tag_ptr(ret_conv, true);
18516 static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) {
18517 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
18518 *ret_conv = C2Tuple_u64u64Z_clone(arg);
18519 return tag_ptr(ret_conv, true);
18521 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18522 LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg);
18523 int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv);
18527 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18528 LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig);
18529 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
18530 *ret_conv = C2Tuple_u64u64Z_clone(orig_conv);
18531 return tag_ptr(ret_conv, true);
18534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
18535 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
18536 *ret_conv = C2Tuple_u64u64Z_new(a, b);
18537 return tag_ptr(ret_conv, true);
18540 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
18541 if (!ptr_is_owned(_res)) return;
18542 void* _res_ptr = untag_ptr(_res);
18543 CHECK_ACCESS(_res_ptr);
18544 LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr);
18545 FREE(untag_ptr(_res));
18546 C2Tuple_u64u64Z_free(_res_conv);
18549 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
18550 void* o_ptr = untag_ptr(o);
18551 CHECK_ACCESS(o_ptr);
18552 LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr);
18553 o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o));
18554 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
18555 *ret_copy = COption_C2Tuple_u64u64ZZ_some(o_conv);
18556 int64_t ret_ref = tag_ptr(ret_copy, true);
18560 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1none(JNIEnv *env, jclass clz) {
18561 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
18562 *ret_copy = COption_C2Tuple_u64u64ZZ_none();
18563 int64_t ret_ref = tag_ptr(ret_copy, true);
18567 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18568 if (!ptr_is_owned(_res)) return;
18569 void* _res_ptr = untag_ptr(_res);
18570 CHECK_ACCESS(_res_ptr);
18571 LDKCOption_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr);
18572 FREE(untag_ptr(_res));
18573 COption_C2Tuple_u64u64ZZ_free(_res_conv);
18576 static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) {
18577 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
18578 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg);
18579 int64_t ret_ref = tag_ptr(ret_copy, true);
18582 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18583 LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg);
18584 int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv);
18588 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18589 LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig);
18590 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
18591 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_conv);
18592 int64_t ret_ref = tag_ptr(ret_copy, true);
18596 static inline uint64_t C2Tuple_Z_clone_ptr(LDKC2Tuple_Z *NONNULL_PTR arg) {
18597 LDKC2Tuple_Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_Z), "LDKC2Tuple_Z");
18598 *ret_conv = C2Tuple_Z_clone(arg);
18599 return tag_ptr(ret_conv, true);
18601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18602 LDKC2Tuple_Z* arg_conv = (LDKC2Tuple_Z*)untag_ptr(arg);
18603 int64_t ret_conv = C2Tuple_Z_clone_ptr(arg_conv);
18607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18608 LDKC2Tuple_Z* orig_conv = (LDKC2Tuple_Z*)untag_ptr(orig);
18609 LDKC2Tuple_Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_Z), "LDKC2Tuple_Z");
18610 *ret_conv = C2Tuple_Z_clone(orig_conv);
18611 return tag_ptr(ret_conv, true);
18614 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1new(JNIEnv *env, jclass clz, int16_tArray a, int16_tArray b) {
18615 LDKEightU16s a_ref;
18616 CHECK((*env)->GetArrayLength(env, a) == 8);
18617 (*env)->GetShortArrayRegion(env, a, 0, 8, a_ref.data);
18618 LDKEightU16s b_ref;
18619 CHECK((*env)->GetArrayLength(env, b) == 8);
18620 (*env)->GetShortArrayRegion(env, b, 0, 8, b_ref.data);
18621 LDKC2Tuple_Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_Z), "LDKC2Tuple_Z");
18622 *ret_conv = C2Tuple_Z_new(a_ref, b_ref);
18623 return tag_ptr(ret_conv, true);
18626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
18627 if (!ptr_is_owned(_res)) return;
18628 void* _res_ptr = untag_ptr(_res);
18629 CHECK_ACCESS(_res_ptr);
18630 LDKC2Tuple_Z _res_conv = *(LDKC2Tuple_Z*)(_res_ptr);
18631 FREE(untag_ptr(_res));
18632 C2Tuple_Z_free(_res_conv);
18635 static inline uint64_t C2Tuple__u168_u168Z_clone_ptr(LDKC2Tuple__u168_u168Z *NONNULL_PTR arg) {
18636 LDKC2Tuple__u168_u168Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
18637 *ret_conv = C2Tuple__u168_u168Z_clone(arg);
18638 return tag_ptr(ret_conv, true);
18640 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18641 LDKC2Tuple__u168_u168Z* arg_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(arg);
18642 int64_t ret_conv = C2Tuple__u168_u168Z_clone_ptr(arg_conv);
18646 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18647 LDKC2Tuple__u168_u168Z* orig_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(orig);
18648 LDKC2Tuple__u168_u168Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
18649 *ret_conv = C2Tuple__u168_u168Z_clone(orig_conv);
18650 return tag_ptr(ret_conv, true);
18653 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1new(JNIEnv *env, jclass clz, int16_tArray a, int16_tArray b) {
18654 LDKEightU16s a_ref;
18655 CHECK((*env)->GetArrayLength(env, a) == 8);
18656 (*env)->GetShortArrayRegion(env, a, 0, 8, a_ref.data);
18657 LDKEightU16s b_ref;
18658 CHECK((*env)->GetArrayLength(env, b) == 8);
18659 (*env)->GetShortArrayRegion(env, b, 0, 8, b_ref.data);
18660 LDKC2Tuple__u168_u168Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
18661 *ret_conv = C2Tuple__u168_u168Z_new(a_ref, b_ref);
18662 return tag_ptr(ret_conv, true);
18665 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
18666 if (!ptr_is_owned(_res)) return;
18667 void* _res_ptr = untag_ptr(_res);
18668 CHECK_ACCESS(_res_ptr);
18669 LDKC2Tuple__u168_u168Z _res_conv = *(LDKC2Tuple__u168_u168Z*)(_res_ptr);
18670 FREE(untag_ptr(_res));
18671 C2Tuple__u168_u168Z_free(_res_conv);
18674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1EightU16sEightU16sZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
18675 void* o_ptr = untag_ptr(o);
18676 CHECK_ACCESS(o_ptr);
18677 LDKC2Tuple__u168_u168Z o_conv = *(LDKC2Tuple__u168_u168Z*)(o_ptr);
18678 o_conv = C2Tuple__u168_u168Z_clone((LDKC2Tuple__u168_u168Z*)untag_ptr(o));
18679 LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
18680 *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_some(o_conv);
18681 int64_t ret_ref = tag_ptr(ret_copy, true);
18685 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1EightU16sEightU16sZZ_1none(JNIEnv *env, jclass clz) {
18686 LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
18687 *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_none();
18688 int64_t ret_ref = tag_ptr(ret_copy, true);
18692 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1EightU16sEightU16sZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18693 if (!ptr_is_owned(_res)) return;
18694 void* _res_ptr = untag_ptr(_res);
18695 CHECK_ACCESS(_res_ptr);
18696 LDKCOption_C2Tuple_EightU16sEightU16sZZ _res_conv = *(LDKCOption_C2Tuple_EightU16sEightU16sZZ*)(_res_ptr);
18697 FREE(untag_ptr(_res));
18698 COption_C2Tuple_EightU16sEightU16sZZ_free(_res_conv);
18701 static inline uint64_t COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr(LDKCOption_C2Tuple_EightU16sEightU16sZZ *NONNULL_PTR arg) {
18702 LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
18703 *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_clone(arg);
18704 int64_t ret_ref = tag_ptr(ret_copy, true);
18707 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1EightU16sEightU16sZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18708 LDKCOption_C2Tuple_EightU16sEightU16sZZ* arg_conv = (LDKCOption_C2Tuple_EightU16sEightU16sZZ*)untag_ptr(arg);
18709 int64_t ret_conv = COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr(arg_conv);
18713 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1EightU16sEightU16sZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18714 LDKCOption_C2Tuple_EightU16sEightU16sZZ* orig_conv = (LDKCOption_C2Tuple_EightU16sEightU16sZZ*)untag_ptr(orig);
18715 LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
18716 *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_clone(orig_conv);
18717 int64_t ret_ref = tag_ptr(ret_copy, true);
18721 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeIdZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18722 LDKCVec_NodeIdZ _res_constr;
18723 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18724 if (_res_constr.datalen > 0)
18725 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
18727 _res_constr.data = NULL;
18728 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18729 for (size_t i = 0; i < _res_constr.datalen; i++) {
18730 int64_t _res_conv_8 = _res_vals[i];
18731 LDKNodeId _res_conv_8_conv;
18732 _res_conv_8_conv.inner = untag_ptr(_res_conv_8);
18733 _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8);
18734 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv);
18735 _res_constr.data[i] = _res_conv_8_conv;
18737 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18738 CVec_NodeIdZ_free(_res_constr);
18741 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18742 LDKProbabilisticScorer o_conv;
18743 o_conv.inner = untag_ptr(o);
18744 o_conv.is_owned = ptr_is_owned(o);
18745 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18746 // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer
18748 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
18749 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv);
18750 return tag_ptr(ret_conv, true);
18753 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18754 void* e_ptr = untag_ptr(e);
18755 CHECK_ACCESS(e_ptr);
18756 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18757 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18758 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
18759 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
18760 return tag_ptr(ret_conv, true);
18763 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18764 LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o);
18765 jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv);
18769 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18770 if (!ptr_is_owned(_res)) return;
18771 void* _res_ptr = untag_ptr(_res);
18772 CHECK_ACCESS(_res_ptr);
18773 LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr);
18774 FREE(untag_ptr(_res));
18775 CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv);
18778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18779 LDKInitFeatures o_conv;
18780 o_conv.inner = untag_ptr(o);
18781 o_conv.is_owned = ptr_is_owned(o);
18782 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18783 o_conv = InitFeatures_clone(&o_conv);
18784 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18785 *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
18786 return tag_ptr(ret_conv, true);
18789 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18790 void* e_ptr = untag_ptr(e);
18791 CHECK_ACCESS(e_ptr);
18792 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18793 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18794 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18795 *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
18796 return tag_ptr(ret_conv, true);
18799 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18800 LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o);
18801 jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
18805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18806 if (!ptr_is_owned(_res)) return;
18807 void* _res_ptr = untag_ptr(_res);
18808 CHECK_ACCESS(_res_ptr);
18809 LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
18810 FREE(untag_ptr(_res));
18811 CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
18814 static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18815 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18816 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg);
18817 return tag_ptr(ret_conv, true);
18819 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18820 LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg);
18821 int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18826 LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig);
18827 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18828 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv);
18829 return tag_ptr(ret_conv, true);
18832 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18833 LDKChannelFeatures o_conv;
18834 o_conv.inner = untag_ptr(o);
18835 o_conv.is_owned = ptr_is_owned(o);
18836 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18837 o_conv = ChannelFeatures_clone(&o_conv);
18838 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18839 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv);
18840 return tag_ptr(ret_conv, true);
18843 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18844 void* e_ptr = untag_ptr(e);
18845 CHECK_ACCESS(e_ptr);
18846 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18847 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18848 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18849 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
18850 return tag_ptr(ret_conv, true);
18853 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18854 LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o);
18855 jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv);
18859 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
18864 FREE(untag_ptr(_res));
18865 CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
18868 static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18869 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18870 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg);
18871 return tag_ptr(ret_conv, true);
18873 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18874 LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg);
18875 int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18880 LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig);
18881 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18882 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv);
18883 return tag_ptr(ret_conv, true);
18886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18887 LDKNodeFeatures 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 = NodeFeatures_clone(&o_conv);
18892 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18893 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
18894 return tag_ptr(ret_conv, true);
18897 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18898 void* e_ptr = untag_ptr(e);
18899 CHECK_ACCESS(e_ptr);
18900 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18901 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18902 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18903 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
18904 return tag_ptr(ret_conv, true);
18907 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18908 LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o);
18909 jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
18913 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18914 if (!ptr_is_owned(_res)) return;
18915 void* _res_ptr = untag_ptr(_res);
18916 CHECK_ACCESS(_res_ptr);
18917 LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
18918 FREE(untag_ptr(_res));
18919 CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
18922 static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18923 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18924 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg);
18925 return tag_ptr(ret_conv, true);
18927 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18928 LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg);
18929 int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18933 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18934 LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig);
18935 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18936 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv);
18937 return tag_ptr(ret_conv, true);
18940 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18941 LDKInvoiceFeatures o_conv;
18942 o_conv.inner = untag_ptr(o);
18943 o_conv.is_owned = ptr_is_owned(o);
18944 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18945 o_conv = InvoiceFeatures_clone(&o_conv);
18946 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18947 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
18948 return tag_ptr(ret_conv, true);
18951 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18952 void* e_ptr = untag_ptr(e);
18953 CHECK_ACCESS(e_ptr);
18954 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18955 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18956 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18957 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
18958 return tag_ptr(ret_conv, true);
18961 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18962 LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o);
18963 jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
18967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18968 if (!ptr_is_owned(_res)) return;
18969 void* _res_ptr = untag_ptr(_res);
18970 CHECK_ACCESS(_res_ptr);
18971 LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
18972 FREE(untag_ptr(_res));
18973 CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
18976 static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18977 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18978 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg);
18979 return tag_ptr(ret_conv, true);
18981 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18982 LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg);
18983 int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18988 LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig);
18989 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18990 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv);
18991 return tag_ptr(ret_conv, true);
18994 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18995 LDKBlindedHopFeatures o_conv;
18996 o_conv.inner = untag_ptr(o);
18997 o_conv.is_owned = ptr_is_owned(o);
18998 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18999 o_conv = BlindedHopFeatures_clone(&o_conv);
19000 LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
19001 *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_ok(o_conv);
19002 return tag_ptr(ret_conv, true);
19005 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19006 void* e_ptr = untag_ptr(e);
19007 CHECK_ACCESS(e_ptr);
19008 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19009 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19010 LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
19011 *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_err(e_conv);
19012 return tag_ptr(ret_conv, true);
19015 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19016 LDKCResult_BlindedHopFeaturesDecodeErrorZ* o_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(o);
19017 jboolean ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(o_conv);
19021 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19022 if (!ptr_is_owned(_res)) return;
19023 void* _res_ptr = untag_ptr(_res);
19024 CHECK_ACCESS(_res_ptr);
19025 LDKCResult_BlindedHopFeaturesDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopFeaturesDecodeErrorZ*)(_res_ptr);
19026 FREE(untag_ptr(_res));
19027 CResult_BlindedHopFeaturesDecodeErrorZ_free(_res_conv);
19030 static inline uint64_t CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR arg) {
19031 LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
19032 *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(arg);
19033 return tag_ptr(ret_conv, true);
19035 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19036 LDKCResult_BlindedHopFeaturesDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(arg);
19037 int64_t ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(arg_conv);
19041 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19042 LDKCResult_BlindedHopFeaturesDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(orig);
19043 LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
19044 *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(orig_conv);
19045 return tag_ptr(ret_conv, true);
19048 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19049 LDKChannelTypeFeatures o_conv;
19050 o_conv.inner = untag_ptr(o);
19051 o_conv.is_owned = ptr_is_owned(o);
19052 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19053 o_conv = ChannelTypeFeatures_clone(&o_conv);
19054 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
19055 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
19056 return tag_ptr(ret_conv, true);
19059 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19060 void* e_ptr = untag_ptr(e);
19061 CHECK_ACCESS(e_ptr);
19062 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19063 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19064 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
19065 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
19066 return tag_ptr(ret_conv, true);
19069 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19070 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o);
19071 jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
19075 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19076 if (!ptr_is_owned(_res)) return;
19077 void* _res_ptr = untag_ptr(_res);
19078 CHECK_ACCESS(_res_ptr);
19079 LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
19080 FREE(untag_ptr(_res));
19081 CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
19084 static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
19085 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
19086 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg);
19087 return tag_ptr(ret_conv, true);
19089 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19090 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg);
19091 int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
19095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19096 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig);
19097 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
19098 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv);
19099 return tag_ptr(ret_conv, true);
19102 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19104 o_conv.inner = untag_ptr(o);
19105 o_conv.is_owned = ptr_is_owned(o);
19106 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19107 o_conv = NodeId_clone(&o_conv);
19108 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
19109 *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv);
19110 return tag_ptr(ret_conv, true);
19113 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19114 void* e_ptr = untag_ptr(e);
19115 CHECK_ACCESS(e_ptr);
19116 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19117 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19118 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
19119 *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
19120 return tag_ptr(ret_conv, true);
19123 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19124 LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o);
19125 jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv);
19129 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19130 if (!ptr_is_owned(_res)) return;
19131 void* _res_ptr = untag_ptr(_res);
19132 CHECK_ACCESS(_res_ptr);
19133 LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
19134 FREE(untag_ptr(_res));
19135 CResult_NodeIdDecodeErrorZ_free(_res_conv);
19138 static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) {
19139 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
19140 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg);
19141 return tag_ptr(ret_conv, true);
19143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19144 LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg);
19145 int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv);
19149 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19150 LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(orig);
19151 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
19152 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv);
19153 return tag_ptr(ret_conv, true);
19156 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19157 void* o_ptr = untag_ptr(o);
19158 CHECK_ACCESS(o_ptr);
19159 LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr);
19160 o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(o));
19161 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
19162 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv);
19163 return tag_ptr(ret_conv, true);
19166 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19167 void* e_ptr = untag_ptr(e);
19168 CHECK_ACCESS(e_ptr);
19169 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19170 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19171 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
19172 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
19173 return tag_ptr(ret_conv, true);
19176 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19177 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(o);
19178 jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv);
19182 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19183 if (!ptr_is_owned(_res)) return;
19184 void* _res_ptr = untag_ptr(_res);
19185 CHECK_ACCESS(_res_ptr);
19186 LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr);
19187 FREE(untag_ptr(_res));
19188 CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv);
19191 static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) {
19192 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
19193 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg);
19194 return tag_ptr(ret_conv, true);
19196 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19197 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(arg);
19198 int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv);
19202 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19203 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(orig);
19204 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
19205 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv);
19206 return tag_ptr(ret_conv, true);
19209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1UtxoLookupZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19210 void* o_ptr = untag_ptr(o);
19211 CHECK_ACCESS(o_ptr);
19212 LDKUtxoLookup o_conv = *(LDKUtxoLookup*)(o_ptr);
19213 if (o_conv.free == LDKUtxoLookup_JCalls_free) {
19214 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
19215 LDKUtxoLookup_JCalls_cloned(&o_conv);
19217 LDKCOption_UtxoLookupZ *ret_copy = MALLOC(sizeof(LDKCOption_UtxoLookupZ), "LDKCOption_UtxoLookupZ");
19218 *ret_copy = COption_UtxoLookupZ_some(o_conv);
19219 int64_t ret_ref = tag_ptr(ret_copy, true);
19223 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1UtxoLookupZ_1none(JNIEnv *env, jclass clz) {
19224 LDKCOption_UtxoLookupZ *ret_copy = MALLOC(sizeof(LDKCOption_UtxoLookupZ), "LDKCOption_UtxoLookupZ");
19225 *ret_copy = COption_UtxoLookupZ_none();
19226 int64_t ret_ref = tag_ptr(ret_copy, true);
19230 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1UtxoLookupZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19231 if (!ptr_is_owned(_res)) return;
19232 void* _res_ptr = untag_ptr(_res);
19233 CHECK_ACCESS(_res_ptr);
19234 LDKCOption_UtxoLookupZ _res_conv = *(LDKCOption_UtxoLookupZ*)(_res_ptr);
19235 FREE(untag_ptr(_res));
19236 COption_UtxoLookupZ_free(_res_conv);
19239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) {
19240 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
19241 *ret_conv = CResult_boolLightningErrorZ_ok(o);
19242 return tag_ptr(ret_conv, true);
19245 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19246 LDKLightningError e_conv;
19247 e_conv.inner = untag_ptr(e);
19248 e_conv.is_owned = ptr_is_owned(e);
19249 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19250 e_conv = LightningError_clone(&e_conv);
19251 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
19252 *ret_conv = CResult_boolLightningErrorZ_err(e_conv);
19253 return tag_ptr(ret_conv, true);
19256 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19257 LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(o);
19258 jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv);
19262 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_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 LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
19267 FREE(untag_ptr(_res));
19268 CResult_boolLightningErrorZ_free(_res_conv);
19271 static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) {
19272 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
19273 *ret_conv = CResult_boolLightningErrorZ_clone(arg);
19274 return tag_ptr(ret_conv, true);
19276 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19277 LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(arg);
19278 int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv);
19282 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19283 LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(orig);
19284 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
19285 *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv);
19286 return tag_ptr(ret_conv, true);
19289 static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) {
19290 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
19291 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg);
19292 return tag_ptr(ret_conv, true);
19294 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19295 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(arg);
19296 int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv);
19300 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19301 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(orig);
19302 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
19303 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv);
19304 return tag_ptr(ret_conv, true);
19307 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) {
19308 LDKChannelAnnouncement a_conv;
19309 a_conv.inner = untag_ptr(a);
19310 a_conv.is_owned = ptr_is_owned(a);
19311 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
19312 a_conv = ChannelAnnouncement_clone(&a_conv);
19313 LDKChannelUpdate b_conv;
19314 b_conv.inner = untag_ptr(b);
19315 b_conv.is_owned = ptr_is_owned(b);
19316 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
19317 b_conv = ChannelUpdate_clone(&b_conv);
19318 LDKChannelUpdate c_conv;
19319 c_conv.inner = untag_ptr(c);
19320 c_conv.is_owned = ptr_is_owned(c);
19321 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
19322 c_conv = ChannelUpdate_clone(&c_conv);
19323 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
19324 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
19325 return tag_ptr(ret_conv, true);
19328 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19329 if (!ptr_is_owned(_res)) return;
19330 void* _res_ptr = untag_ptr(_res);
19331 CHECK_ACCESS(_res_ptr);
19332 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
19333 FREE(untag_ptr(_res));
19334 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
19337 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19338 void* o_ptr = untag_ptr(o);
19339 CHECK_ACCESS(o_ptr);
19340 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(o_ptr);
19341 o_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(o));
19342 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
19343 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(o_conv);
19344 int64_t ret_ref = tag_ptr(ret_copy, true);
19348 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1none(JNIEnv *env, jclass clz) {
19349 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
19350 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none();
19351 int64_t ret_ref = tag_ptr(ret_copy, true);
19355 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19356 if (!ptr_is_owned(_res)) return;
19357 void* _res_ptr = untag_ptr(_res);
19358 CHECK_ACCESS(_res_ptr);
19359 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(_res_ptr);
19360 FREE(untag_ptr(_res));
19361 COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_conv);
19364 static inline uint64_t COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR arg) {
19365 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
19366 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(arg);
19367 int64_t ret_ref = tag_ptr(ret_copy, true);
19370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19371 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* arg_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(arg);
19372 int64_t ret_conv = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(arg_conv);
19376 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19377 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* orig_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(orig);
19378 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
19379 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(orig_conv);
19380 int64_t ret_ref = tag_ptr(ret_copy, true);
19384 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok(JNIEnv *env, jclass clz) {
19385 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
19386 *ret_conv = CResult_NoneLightningErrorZ_ok();
19387 return tag_ptr(ret_conv, true);
19390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19391 LDKLightningError e_conv;
19392 e_conv.inner = untag_ptr(e);
19393 e_conv.is_owned = ptr_is_owned(e);
19394 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19395 e_conv = LightningError_clone(&e_conv);
19396 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
19397 *ret_conv = CResult_NoneLightningErrorZ_err(e_conv);
19398 return tag_ptr(ret_conv, true);
19401 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19402 LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(o);
19403 jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv);
19407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19408 if (!ptr_is_owned(_res)) return;
19409 void* _res_ptr = untag_ptr(_res);
19410 CHECK_ACCESS(_res_ptr);
19411 LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
19412 FREE(untag_ptr(_res));
19413 CResult_NoneLightningErrorZ_free(_res_conv);
19416 static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) {
19417 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
19418 *ret_conv = CResult_NoneLightningErrorZ_clone(arg);
19419 return tag_ptr(ret_conv, true);
19421 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19422 LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(arg);
19423 int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv);
19427 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19428 LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(orig);
19429 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
19430 *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv);
19431 return tag_ptr(ret_conv, true);
19434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19435 LDKChannelUpdateInfo o_conv;
19436 o_conv.inner = untag_ptr(o);
19437 o_conv.is_owned = ptr_is_owned(o);
19438 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19439 o_conv = ChannelUpdateInfo_clone(&o_conv);
19440 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
19441 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv);
19442 return tag_ptr(ret_conv, true);
19445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19446 void* e_ptr = untag_ptr(e);
19447 CHECK_ACCESS(e_ptr);
19448 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19449 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19450 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
19451 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
19452 return tag_ptr(ret_conv, true);
19455 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19456 LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(o);
19457 jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv);
19461 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19462 if (!ptr_is_owned(_res)) return;
19463 void* _res_ptr = untag_ptr(_res);
19464 CHECK_ACCESS(_res_ptr);
19465 LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr);
19466 FREE(untag_ptr(_res));
19467 CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv);
19470 static inline uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) {
19471 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
19472 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg);
19473 return tag_ptr(ret_conv, true);
19475 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19476 LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(arg);
19477 int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv);
19481 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19482 LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(orig);
19483 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
19484 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv);
19485 return tag_ptr(ret_conv, true);
19488 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19489 LDKChannelInfo o_conv;
19490 o_conv.inner = untag_ptr(o);
19491 o_conv.is_owned = ptr_is_owned(o);
19492 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19493 o_conv = ChannelInfo_clone(&o_conv);
19494 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
19495 *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
19496 return tag_ptr(ret_conv, true);
19499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19500 void* e_ptr = untag_ptr(e);
19501 CHECK_ACCESS(e_ptr);
19502 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19503 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19504 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
19505 *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
19506 return tag_ptr(ret_conv, true);
19509 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19510 LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(o);
19511 jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv);
19515 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19516 if (!ptr_is_owned(_res)) return;
19517 void* _res_ptr = untag_ptr(_res);
19518 CHECK_ACCESS(_res_ptr);
19519 LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
19520 FREE(untag_ptr(_res));
19521 CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
19524 static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
19525 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
19526 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg);
19527 return tag_ptr(ret_conv, true);
19529 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19530 LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(arg);
19531 int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
19535 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19536 LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(orig);
19537 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
19538 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
19539 return tag_ptr(ret_conv, true);
19542 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19543 LDKRoutingFees o_conv;
19544 o_conv.inner = untag_ptr(o);
19545 o_conv.is_owned = ptr_is_owned(o);
19546 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19547 o_conv = RoutingFees_clone(&o_conv);
19548 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
19549 *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv);
19550 return tag_ptr(ret_conv, true);
19553 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19554 void* e_ptr = untag_ptr(e);
19555 CHECK_ACCESS(e_ptr);
19556 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19557 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19558 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
19559 *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
19560 return tag_ptr(ret_conv, true);
19563 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19564 LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(o);
19565 jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv);
19569 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19570 if (!ptr_is_owned(_res)) return;
19571 void* _res_ptr = untag_ptr(_res);
19572 CHECK_ACCESS(_res_ptr);
19573 LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
19574 FREE(untag_ptr(_res));
19575 CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
19578 static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) {
19579 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
19580 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg);
19581 return tag_ptr(ret_conv, true);
19583 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19584 LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(arg);
19585 int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv);
19589 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19590 LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(orig);
19591 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
19592 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv);
19593 return tag_ptr(ret_conv, true);
19596 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
19597 LDKCVec_NetAddressZ _res_constr;
19598 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
19599 if (_res_constr.datalen > 0)
19600 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
19602 _res_constr.data = NULL;
19603 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
19604 for (size_t m = 0; m < _res_constr.datalen; m++) {
19605 int64_t _res_conv_12 = _res_vals[m];
19606 void* _res_conv_12_ptr = untag_ptr(_res_conv_12);
19607 CHECK_ACCESS(_res_conv_12_ptr);
19608 LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
19609 FREE(untag_ptr(_res_conv_12));
19610 _res_constr.data[m] = _res_conv_12_conv;
19612 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
19613 CVec_NetAddressZ_free(_res_constr);
19616 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19617 LDKNodeAnnouncementInfo o_conv;
19618 o_conv.inner = untag_ptr(o);
19619 o_conv.is_owned = ptr_is_owned(o);
19620 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19621 o_conv = NodeAnnouncementInfo_clone(&o_conv);
19622 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
19623 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv);
19624 return tag_ptr(ret_conv, true);
19627 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19628 void* e_ptr = untag_ptr(e);
19629 CHECK_ACCESS(e_ptr);
19630 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19631 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19632 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
19633 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
19634 return tag_ptr(ret_conv, true);
19637 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19638 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(o);
19639 jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv);
19643 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19644 if (!ptr_is_owned(_res)) return;
19645 void* _res_ptr = untag_ptr(_res);
19646 CHECK_ACCESS(_res_ptr);
19647 LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
19648 FREE(untag_ptr(_res));
19649 CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
19652 static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) {
19653 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
19654 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg);
19655 return tag_ptr(ret_conv, true);
19657 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19658 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(arg);
19659 int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv);
19663 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19664 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(orig);
19665 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
19666 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv);
19667 return tag_ptr(ret_conv, true);
19670 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19671 LDKNodeAlias o_conv;
19672 o_conv.inner = untag_ptr(o);
19673 o_conv.is_owned = ptr_is_owned(o);
19674 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19675 o_conv = NodeAlias_clone(&o_conv);
19676 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
19677 *ret_conv = CResult_NodeAliasDecodeErrorZ_ok(o_conv);
19678 return tag_ptr(ret_conv, true);
19681 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19682 void* e_ptr = untag_ptr(e);
19683 CHECK_ACCESS(e_ptr);
19684 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19685 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19686 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
19687 *ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
19688 return tag_ptr(ret_conv, true);
19691 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19692 LDKCResult_NodeAliasDecodeErrorZ* o_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(o);
19693 jboolean ret_conv = CResult_NodeAliasDecodeErrorZ_is_ok(o_conv);
19697 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19698 if (!ptr_is_owned(_res)) return;
19699 void* _res_ptr = untag_ptr(_res);
19700 CHECK_ACCESS(_res_ptr);
19701 LDKCResult_NodeAliasDecodeErrorZ _res_conv = *(LDKCResult_NodeAliasDecodeErrorZ*)(_res_ptr);
19702 FREE(untag_ptr(_res));
19703 CResult_NodeAliasDecodeErrorZ_free(_res_conv);
19706 static inline uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg) {
19707 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
19708 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(arg);
19709 return tag_ptr(ret_conv, true);
19711 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19712 LDKCResult_NodeAliasDecodeErrorZ* arg_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(arg);
19713 int64_t ret_conv = CResult_NodeAliasDecodeErrorZ_clone_ptr(arg_conv);
19717 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19718 LDKCResult_NodeAliasDecodeErrorZ* orig_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(orig);
19719 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
19720 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(orig_conv);
19721 return tag_ptr(ret_conv, true);
19724 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19725 LDKNodeInfo o_conv;
19726 o_conv.inner = untag_ptr(o);
19727 o_conv.is_owned = ptr_is_owned(o);
19728 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19729 o_conv = NodeInfo_clone(&o_conv);
19730 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
19731 *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv);
19732 return tag_ptr(ret_conv, true);
19735 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19736 void* e_ptr = untag_ptr(e);
19737 CHECK_ACCESS(e_ptr);
19738 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19739 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19740 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
19741 *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
19742 return tag_ptr(ret_conv, true);
19745 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19746 LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(o);
19747 jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv);
19751 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19752 if (!ptr_is_owned(_res)) return;
19753 void* _res_ptr = untag_ptr(_res);
19754 CHECK_ACCESS(_res_ptr);
19755 LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
19756 FREE(untag_ptr(_res));
19757 CResult_NodeInfoDecodeErrorZ_free(_res_conv);
19760 static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) {
19761 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
19762 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg);
19763 return tag_ptr(ret_conv, true);
19765 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19766 LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(arg);
19767 int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv);
19771 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19772 LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(orig);
19773 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
19774 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv);
19775 return tag_ptr(ret_conv, true);
19778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19779 LDKNetworkGraph o_conv;
19780 o_conv.inner = untag_ptr(o);
19781 o_conv.is_owned = ptr_is_owned(o);
19782 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19783 // WARNING: we need a move here but no clone is available for LDKNetworkGraph
19785 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
19786 *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
19787 return tag_ptr(ret_conv, true);
19790 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19791 void* e_ptr = untag_ptr(e);
19792 CHECK_ACCESS(e_ptr);
19793 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19794 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19795 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
19796 *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
19797 return tag_ptr(ret_conv, true);
19800 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19801 LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(o);
19802 jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv);
19806 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19807 if (!ptr_is_owned(_res)) return;
19808 void* _res_ptr = untag_ptr(_res);
19809 CHECK_ACCESS(_res_ptr);
19810 LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
19811 FREE(untag_ptr(_res));
19812 CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
19815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1some(JNIEnv *env, jclass clz, int64_tArray o) {
19816 LDKCVec_NetAddressZ o_constr;
19817 o_constr.datalen = (*env)->GetArrayLength(env, o);
19818 if (o_constr.datalen > 0)
19819 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
19821 o_constr.data = NULL;
19822 int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
19823 for (size_t m = 0; m < o_constr.datalen; m++) {
19824 int64_t o_conv_12 = o_vals[m];
19825 void* o_conv_12_ptr = untag_ptr(o_conv_12);
19826 CHECK_ACCESS(o_conv_12_ptr);
19827 LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
19828 o_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o_conv_12));
19829 o_constr.data[m] = o_conv_12_conv;
19831 (*env)->ReleaseLongArrayElements(env, o, o_vals, 0);
19832 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
19833 *ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
19834 int64_t ret_ref = tag_ptr(ret_copy, true);
19838 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1none(JNIEnv *env, jclass clz) {
19839 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
19840 *ret_copy = COption_CVec_NetAddressZZ_none();
19841 int64_t ret_ref = tag_ptr(ret_copy, true);
19845 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19846 if (!ptr_is_owned(_res)) return;
19847 void* _res_ptr = untag_ptr(_res);
19848 CHECK_ACCESS(_res_ptr);
19849 LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
19850 FREE(untag_ptr(_res));
19851 COption_CVec_NetAddressZZ_free(_res_conv);
19854 static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) {
19855 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
19856 *ret_copy = COption_CVec_NetAddressZZ_clone(arg);
19857 int64_t ret_ref = tag_ptr(ret_copy, true);
19860 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19861 LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(arg);
19862 int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv);
19866 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19867 LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(orig);
19868 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
19869 *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv);
19870 int64_t ret_ref = tag_ptr(ret_copy, true);
19874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19875 LDKDelayedPaymentOutputDescriptor o_conv;
19876 o_conv.inner = untag_ptr(o);
19877 o_conv.is_owned = ptr_is_owned(o);
19878 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19879 o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv);
19880 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
19881 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
19882 return tag_ptr(ret_conv, true);
19885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19886 void* e_ptr = untag_ptr(e);
19887 CHECK_ACCESS(e_ptr);
19888 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19889 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19890 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
19891 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
19892 return tag_ptr(ret_conv, true);
19895 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19896 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
19897 jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
19901 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19902 if (!ptr_is_owned(_res)) return;
19903 void* _res_ptr = untag_ptr(_res);
19904 CHECK_ACCESS(_res_ptr);
19905 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
19906 FREE(untag_ptr(_res));
19907 CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
19910 static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
19911 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
19912 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg);
19913 return tag_ptr(ret_conv, true);
19915 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19916 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
19917 int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
19921 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19922 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
19923 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
19924 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
19925 return tag_ptr(ret_conv, true);
19928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19929 LDKStaticPaymentOutputDescriptor o_conv;
19930 o_conv.inner = untag_ptr(o);
19931 o_conv.is_owned = ptr_is_owned(o);
19932 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19933 o_conv = StaticPaymentOutputDescriptor_clone(&o_conv);
19934 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
19935 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
19936 return tag_ptr(ret_conv, true);
19939 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19940 void* e_ptr = untag_ptr(e);
19941 CHECK_ACCESS(e_ptr);
19942 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19943 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19944 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
19945 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
19946 return tag_ptr(ret_conv, true);
19949 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19950 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
19951 jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
19955 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19956 if (!ptr_is_owned(_res)) return;
19957 void* _res_ptr = untag_ptr(_res);
19958 CHECK_ACCESS(_res_ptr);
19959 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
19960 FREE(untag_ptr(_res));
19961 CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
19964 static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
19965 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
19966 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg);
19967 return tag_ptr(ret_conv, true);
19969 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19970 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
19971 int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
19975 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19976 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
19977 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
19978 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
19979 return tag_ptr(ret_conv, true);
19982 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19983 void* o_ptr = untag_ptr(o);
19984 CHECK_ACCESS(o_ptr);
19985 LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
19986 o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(o));
19987 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
19988 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
19989 return tag_ptr(ret_conv, true);
19992 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19993 void* e_ptr = untag_ptr(e);
19994 CHECK_ACCESS(e_ptr);
19995 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19996 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19997 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
19998 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
19999 return tag_ptr(ret_conv, true);
20002 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20003 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(o);
20004 jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv);
20008 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20009 if (!ptr_is_owned(_res)) return;
20010 void* _res_ptr = untag_ptr(_res);
20011 CHECK_ACCESS(_res_ptr);
20012 LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
20013 FREE(untag_ptr(_res));
20014 CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
20017 static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
20018 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
20019 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg);
20020 return tag_ptr(ret_conv, true);
20022 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20023 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
20024 int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
20028 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20029 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
20030 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
20031 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv);
20032 return tag_ptr(ret_conv, true);
20035 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentPreimageZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
20036 LDKCVec_PaymentPreimageZ _res_constr;
20037 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20038 if (_res_constr.datalen > 0)
20039 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
20041 _res_constr.data = NULL;
20042 for (size_t i = 0; i < _res_constr.datalen; i++) {
20043 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
20044 LDKThirtyTwoBytes _res_conv_8_ref;
20045 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
20046 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
20047 _res_constr.data[i] = _res_conv_8_ref;
20049 CVec_PaymentPreimageZ_free(_res_constr);
20052 static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) {
20053 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
20054 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg);
20055 return tag_ptr(ret_conv, true);
20057 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20058 LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(arg);
20059 int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv);
20063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20064 LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(orig);
20065 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
20066 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv);
20067 return tag_ptr(ret_conv, true);
20070 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, jobjectArray b) {
20071 LDKSignature a_ref;
20072 CHECK((*env)->GetArrayLength(env, a) == 64);
20073 (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form);
20074 LDKCVec_SignatureZ b_constr;
20075 b_constr.datalen = (*env)->GetArrayLength(env, b);
20076 if (b_constr.datalen > 0)
20077 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
20079 b_constr.data = NULL;
20080 for (size_t i = 0; i < b_constr.datalen; i++) {
20081 int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i);
20082 LDKSignature b_conv_8_ref;
20083 CHECK((*env)->GetArrayLength(env, b_conv_8) == 64);
20084 (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form);
20085 b_constr.data[i] = b_conv_8_ref;
20087 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
20088 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
20089 return tag_ptr(ret_conv, true);
20092 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20093 if (!ptr_is_owned(_res)) return;
20094 void* _res_ptr = untag_ptr(_res);
20095 CHECK_ACCESS(_res_ptr);
20096 LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
20097 FREE(untag_ptr(_res));
20098 C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
20101 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20102 void* o_ptr = untag_ptr(o);
20103 CHECK_ACCESS(o_ptr);
20104 LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
20105 o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(o));
20106 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
20107 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
20108 return tag_ptr(ret_conv, true);
20111 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv *env, jclass clz) {
20112 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
20113 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
20114 return tag_ptr(ret_conv, true);
20117 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20118 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(o);
20119 jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv);
20123 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20124 if (!ptr_is_owned(_res)) return;
20125 void* _res_ptr = untag_ptr(_res);
20126 CHECK_ACCESS(_res_ptr);
20127 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
20128 FREE(untag_ptr(_res));
20129 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
20132 static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) {
20133 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
20134 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg);
20135 return tag_ptr(ret_conv, true);
20137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20138 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(arg);
20139 int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv);
20143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20144 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(orig);
20145 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
20146 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv);
20147 return tag_ptr(ret_conv, true);
20150 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20151 LDKSignature o_ref;
20152 CHECK((*env)->GetArrayLength(env, o) == 64);
20153 (*env)->GetByteArrayRegion(env, o, 0, 64, o_ref.compact_form);
20154 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
20155 *ret_conv = CResult_SignatureNoneZ_ok(o_ref);
20156 return tag_ptr(ret_conv, true);
20159 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv *env, jclass clz) {
20160 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
20161 *ret_conv = CResult_SignatureNoneZ_err();
20162 return tag_ptr(ret_conv, true);
20165 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20166 LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(o);
20167 jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv);
20171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20172 if (!ptr_is_owned(_res)) return;
20173 void* _res_ptr = untag_ptr(_res);
20174 CHECK_ACCESS(_res_ptr);
20175 LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
20176 FREE(untag_ptr(_res));
20177 CResult_SignatureNoneZ_free(_res_conv);
20180 static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) {
20181 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
20182 *ret_conv = CResult_SignatureNoneZ_clone(arg);
20183 return tag_ptr(ret_conv, true);
20185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20186 LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(arg);
20187 int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv);
20191 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20192 LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(orig);
20193 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
20194 *ret_conv = CResult_SignatureNoneZ_clone(orig_conv);
20195 return tag_ptr(ret_conv, true);
20198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20199 LDKPublicKey o_ref;
20200 CHECK((*env)->GetArrayLength(env, o) == 33);
20201 (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
20202 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
20203 *ret_conv = CResult_PublicKeyNoneZ_ok(o_ref);
20204 return tag_ptr(ret_conv, true);
20207 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1err(JNIEnv *env, jclass clz) {
20208 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
20209 *ret_conv = CResult_PublicKeyNoneZ_err();
20210 return tag_ptr(ret_conv, true);
20213 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20214 LDKCResult_PublicKeyNoneZ* o_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(o);
20215 jboolean ret_conv = CResult_PublicKeyNoneZ_is_ok(o_conv);
20219 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20220 if (!ptr_is_owned(_res)) return;
20221 void* _res_ptr = untag_ptr(_res);
20222 CHECK_ACCESS(_res_ptr);
20223 LDKCResult_PublicKeyNoneZ _res_conv = *(LDKCResult_PublicKeyNoneZ*)(_res_ptr);
20224 FREE(untag_ptr(_res));
20225 CResult_PublicKeyNoneZ_free(_res_conv);
20228 static inline uint64_t CResult_PublicKeyNoneZ_clone_ptr(LDKCResult_PublicKeyNoneZ *NONNULL_PTR arg) {
20229 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
20230 *ret_conv = CResult_PublicKeyNoneZ_clone(arg);
20231 return tag_ptr(ret_conv, true);
20233 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20234 LDKCResult_PublicKeyNoneZ* arg_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(arg);
20235 int64_t ret_conv = CResult_PublicKeyNoneZ_clone_ptr(arg_conv);
20239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20240 LDKCResult_PublicKeyNoneZ* orig_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(orig);
20241 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
20242 *ret_conv = CResult_PublicKeyNoneZ_clone(orig_conv);
20243 return tag_ptr(ret_conv, true);
20246 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1some(JNIEnv *env, jclass clz, int64_t o) {
20247 void* o_ptr = untag_ptr(o);
20248 CHECK_ACCESS(o_ptr);
20249 LDKBigEndianScalar o_conv = *(LDKBigEndianScalar*)(o_ptr);
20250 // WARNING: we may need a move here but no clone is available for LDKBigEndianScalar
20251 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
20252 *ret_copy = COption_ScalarZ_some(o_conv);
20253 int64_t ret_ref = tag_ptr(ret_copy, true);
20257 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1none(JNIEnv *env, jclass clz) {
20258 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
20259 *ret_copy = COption_ScalarZ_none();
20260 int64_t ret_ref = tag_ptr(ret_copy, true);
20264 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20265 if (!ptr_is_owned(_res)) return;
20266 void* _res_ptr = untag_ptr(_res);
20267 CHECK_ACCESS(_res_ptr);
20268 LDKCOption_ScalarZ _res_conv = *(LDKCOption_ScalarZ*)(_res_ptr);
20269 FREE(untag_ptr(_res));
20270 COption_ScalarZ_free(_res_conv);
20273 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20274 LDKThirtyTwoBytes o_ref;
20275 CHECK((*env)->GetArrayLength(env, o) == 32);
20276 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
20277 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
20278 *ret_conv = CResult_SharedSecretNoneZ_ok(o_ref);
20279 return tag_ptr(ret_conv, true);
20282 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1err(JNIEnv *env, jclass clz) {
20283 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
20284 *ret_conv = CResult_SharedSecretNoneZ_err();
20285 return tag_ptr(ret_conv, true);
20288 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20289 LDKCResult_SharedSecretNoneZ* o_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(o);
20290 jboolean ret_conv = CResult_SharedSecretNoneZ_is_ok(o_conv);
20294 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20295 if (!ptr_is_owned(_res)) return;
20296 void* _res_ptr = untag_ptr(_res);
20297 CHECK_ACCESS(_res_ptr);
20298 LDKCResult_SharedSecretNoneZ _res_conv = *(LDKCResult_SharedSecretNoneZ*)(_res_ptr);
20299 FREE(untag_ptr(_res));
20300 CResult_SharedSecretNoneZ_free(_res_conv);
20303 static inline uint64_t CResult_SharedSecretNoneZ_clone_ptr(LDKCResult_SharedSecretNoneZ *NONNULL_PTR arg) {
20304 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
20305 *ret_conv = CResult_SharedSecretNoneZ_clone(arg);
20306 return tag_ptr(ret_conv, true);
20308 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20309 LDKCResult_SharedSecretNoneZ* arg_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(arg);
20310 int64_t ret_conv = CResult_SharedSecretNoneZ_clone_ptr(arg_conv);
20314 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20315 LDKCResult_SharedSecretNoneZ* orig_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(orig);
20316 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
20317 *ret_conv = CResult_SharedSecretNoneZ_clone(orig_conv);
20318 return tag_ptr(ret_conv, true);
20321 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1U5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
20322 LDKCVec_U5Z _res_constr;
20323 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20324 if (_res_constr.datalen > 0)
20325 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements");
20327 _res_constr.data = NULL;
20328 int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL);
20329 for (size_t h = 0; h < _res_constr.datalen; h++) {
20330 int8_t _res_conv_7 = _res_vals[h];
20332 _res_constr.data[h] = (LDKU5){ ._0 = _res_conv_7 };
20334 (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0);
20335 CVec_U5Z_free(_res_constr);
20338 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20339 LDKRecoverableSignature o_ref;
20340 CHECK((*env)->GetArrayLength(env, o) == 68);
20341 (*env)->GetByteArrayRegion(env, o, 0, 68, o_ref.serialized_form);
20342 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
20343 *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref);
20344 return tag_ptr(ret_conv, true);
20347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err(JNIEnv *env, jclass clz) {
20348 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
20349 *ret_conv = CResult_RecoverableSignatureNoneZ_err();
20350 return tag_ptr(ret_conv, true);
20353 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20354 LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(o);
20355 jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv);
20359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20360 if (!ptr_is_owned(_res)) return;
20361 void* _res_ptr = untag_ptr(_res);
20362 CHECK_ACCESS(_res_ptr);
20363 LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
20364 FREE(untag_ptr(_res));
20365 CResult_RecoverableSignatureNoneZ_free(_res_conv);
20368 static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) {
20369 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
20370 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg);
20371 return tag_ptr(ret_conv, true);
20373 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20374 LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(arg);
20375 int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv);
20379 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20380 LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(orig);
20381 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
20382 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv);
20383 return tag_ptr(ret_conv, true);
20386 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20387 void* o_ptr = untag_ptr(o);
20388 CHECK_ACCESS(o_ptr);
20389 LDKWriteableEcdsaChannelSigner o_conv = *(LDKWriteableEcdsaChannelSigner*)(o_ptr);
20390 if (o_conv.free == LDKWriteableEcdsaChannelSigner_JCalls_free) {
20391 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
20392 LDKWriteableEcdsaChannelSigner_JCalls_cloned(&o_conv);
20394 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
20395 *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o_conv);
20396 return tag_ptr(ret_conv, true);
20399 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20400 void* e_ptr = untag_ptr(e);
20401 CHECK_ACCESS(e_ptr);
20402 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20403 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20404 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
20405 *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(e_conv);
20406 return tag_ptr(ret_conv, true);
20409 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20410 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(o);
20411 jboolean ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(o_conv);
20415 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20416 if (!ptr_is_owned(_res)) return;
20417 void* _res_ptr = untag_ptr(_res);
20418 CHECK_ACCESS(_res_ptr);
20419 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(_res_ptr);
20420 FREE(untag_ptr(_res));
20421 CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(_res_conv);
20424 static inline uint64_t CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) {
20425 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
20426 *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(arg);
20427 return tag_ptr(ret_conv, true);
20429 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20430 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg);
20431 int64_t ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv);
20435 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20436 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig);
20437 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
20438 *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(orig_conv);
20439 return tag_ptr(ret_conv, true);
20442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
20443 LDKCVec_u8Z _res_ref;
20444 _res_ref.datalen = (*env)->GetArrayLength(env, _res);
20445 _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes");
20446 (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
20447 CVec_u8Z_free(_res_ref);
20450 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
20451 LDKCVec_CVec_u8ZZ _res_constr;
20452 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20453 if (_res_constr.datalen > 0)
20454 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
20456 _res_constr.data = NULL;
20457 for (size_t i = 0; i < _res_constr.datalen; i++) {
20458 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
20459 LDKCVec_u8Z _res_conv_8_ref;
20460 _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8);
20461 _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKCVec_u8Z Bytes");
20462 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data);
20463 _res_constr.data[i] = _res_conv_8_ref;
20465 CVec_CVec_u8ZZ_free(_res_constr);
20468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) {
20469 LDKCVec_CVec_u8ZZ o_constr;
20470 o_constr.datalen = (*env)->GetArrayLength(env, o);
20471 if (o_constr.datalen > 0)
20472 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
20474 o_constr.data = NULL;
20475 for (size_t i = 0; i < o_constr.datalen; i++) {
20476 int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
20477 LDKCVec_u8Z o_conv_8_ref;
20478 o_conv_8_ref.datalen = (*env)->GetArrayLength(env, o_conv_8);
20479 o_conv_8_ref.data = MALLOC(o_conv_8_ref.datalen, "LDKCVec_u8Z Bytes");
20480 (*env)->GetByteArrayRegion(env, o_conv_8, 0, o_conv_8_ref.datalen, o_conv_8_ref.data);
20481 o_constr.data[i] = o_conv_8_ref;
20483 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
20484 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
20485 return tag_ptr(ret_conv, true);
20488 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err(JNIEnv *env, jclass clz) {
20489 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
20490 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
20491 return tag_ptr(ret_conv, true);
20494 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20495 LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(o);
20496 jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv);
20500 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20501 if (!ptr_is_owned(_res)) return;
20502 void* _res_ptr = untag_ptr(_res);
20503 CHECK_ACCESS(_res_ptr);
20504 LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
20505 FREE(untag_ptr(_res));
20506 CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
20509 static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) {
20510 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
20511 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg);
20512 return tag_ptr(ret_conv, true);
20514 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20515 LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(arg);
20516 int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv);
20520 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20521 LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(orig);
20522 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
20523 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
20524 return tag_ptr(ret_conv, true);
20527 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20528 LDKInMemorySigner o_conv;
20529 o_conv.inner = untag_ptr(o);
20530 o_conv.is_owned = ptr_is_owned(o);
20531 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20532 o_conv = InMemorySigner_clone(&o_conv);
20533 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
20534 *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
20535 return tag_ptr(ret_conv, true);
20538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20539 void* e_ptr = untag_ptr(e);
20540 CHECK_ACCESS(e_ptr);
20541 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20542 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20543 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
20544 *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
20545 return tag_ptr(ret_conv, true);
20548 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20549 LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(o);
20550 jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv);
20554 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20555 if (!ptr_is_owned(_res)) return;
20556 void* _res_ptr = untag_ptr(_res);
20557 CHECK_ACCESS(_res_ptr);
20558 LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
20559 FREE(untag_ptr(_res));
20560 CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
20563 static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) {
20564 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
20565 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg);
20566 return tag_ptr(ret_conv, true);
20568 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20569 LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(arg);
20570 int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv);
20574 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20575 LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(orig);
20576 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
20577 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
20578 return tag_ptr(ret_conv, true);
20581 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20582 LDKCVec_TxOutZ _res_constr;
20583 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20584 if (_res_constr.datalen > 0)
20585 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
20587 _res_constr.data = NULL;
20588 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20589 for (size_t h = 0; h < _res_constr.datalen; h++) {
20590 int64_t _res_conv_7 = _res_vals[h];
20591 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
20592 CHECK_ACCESS(_res_conv_7_ptr);
20593 LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
20594 FREE(untag_ptr(_res_conv_7));
20595 _res_constr.data[h] = _res_conv_7_conv;
20597 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20598 CVec_TxOutZ_free(_res_constr);
20601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20602 LDKTransaction o_ref;
20603 o_ref.datalen = (*env)->GetArrayLength(env, o);
20604 o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
20605 (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data);
20606 o_ref.data_is_owned = true;
20607 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
20608 *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
20609 return tag_ptr(ret_conv, true);
20612 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err(JNIEnv *env, jclass clz) {
20613 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
20614 *ret_conv = CResult_TransactionNoneZ_err();
20615 return tag_ptr(ret_conv, true);
20618 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20619 LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o);
20620 jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv);
20624 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20625 if (!ptr_is_owned(_res)) return;
20626 void* _res_ptr = untag_ptr(_res);
20627 CHECK_ACCESS(_res_ptr);
20628 LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
20629 FREE(untag_ptr(_res));
20630 CResult_TransactionNoneZ_free(_res_conv);
20633 static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) {
20634 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
20635 *ret_conv = CResult_TransactionNoneZ_clone(arg);
20636 return tag_ptr(ret_conv, true);
20638 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20639 LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg);
20640 int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv);
20644 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20645 LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig);
20646 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
20647 *ret_conv = CResult_TransactionNoneZ_clone(orig_conv);
20648 return tag_ptr(ret_conv, true);
20651 static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) {
20652 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
20653 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg);
20654 return tag_ptr(ret_conv, true);
20656 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20657 LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(arg);
20658 int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv);
20662 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20663 LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(orig);
20664 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
20665 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv);
20666 return tag_ptr(ret_conv, true);
20669 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
20670 LDKThirtyTwoBytes a_ref;
20671 CHECK((*env)->GetArrayLength(env, a) == 32);
20672 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
20673 LDKChannelMonitor b_conv;
20674 b_conv.inner = untag_ptr(b);
20675 b_conv.is_owned = ptr_is_owned(b);
20676 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
20677 b_conv = ChannelMonitor_clone(&b_conv);
20678 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
20679 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv);
20680 return tag_ptr(ret_conv, true);
20683 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20684 if (!ptr_is_owned(_res)) return;
20685 void* _res_ptr = untag_ptr(_res);
20686 CHECK_ACCESS(_res_ptr);
20687 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
20688 FREE(untag_ptr(_res));
20689 C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
20692 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlockHashChannelMonitorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20693 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res_constr;
20694 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20695 if (_res_constr.datalen > 0)
20696 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements");
20698 _res_constr.data = NULL;
20699 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20700 for (size_t j = 0; j < _res_constr.datalen; j++) {
20701 int64_t _res_conv_35 = _res_vals[j];
20702 void* _res_conv_35_ptr = untag_ptr(_res_conv_35);
20703 CHECK_ACCESS(_res_conv_35_ptr);
20704 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr);
20705 FREE(untag_ptr(_res_conv_35));
20706 _res_constr.data[j] = _res_conv_35_conv;
20708 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20709 CVec_C2Tuple_BlockHashChannelMonitorZZ_free(_res_constr);
20712 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) {
20713 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o_constr;
20714 o_constr.datalen = (*env)->GetArrayLength(env, o);
20715 if (o_constr.datalen > 0)
20716 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements");
20718 o_constr.data = NULL;
20719 int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
20720 for (size_t j = 0; j < o_constr.datalen; j++) {
20721 int64_t o_conv_35 = o_vals[j];
20722 void* o_conv_35_ptr = untag_ptr(o_conv_35);
20723 CHECK_ACCESS(o_conv_35_ptr);
20724 LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr);
20725 o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o_conv_35));
20726 o_constr.data[j] = o_conv_35_conv;
20728 (*env)->ReleaseLongArrayElements(env, o, o_vals, 0);
20729 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
20730 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o_constr);
20731 return tag_ptr(ret_conv, true);
20734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
20735 LDKIOError e_conv = LDKIOError_from_java(env, e);
20736 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
20737 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e_conv);
20738 return tag_ptr(ret_conv, true);
20741 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20742 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(o);
20743 jboolean ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv);
20747 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20748 if (!ptr_is_owned(_res)) return;
20749 void* _res_ptr = untag_ptr(_res);
20750 CHECK_ACCESS(_res_ptr);
20751 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr);
20752 FREE(untag_ptr(_res));
20753 CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv);
20756 static inline uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) {
20757 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
20758 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg);
20759 return tag_ptr(ret_conv, true);
20761 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20762 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(arg);
20763 int64_t ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv);
20767 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20768 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(orig);
20769 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
20770 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig_conv);
20771 return tag_ptr(ret_conv, true);
20774 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) {
20775 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
20776 *ret_copy = COption_u16Z_some(o);
20777 int64_t ret_ref = tag_ptr(ret_copy, true);
20781 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none(JNIEnv *env, jclass clz) {
20782 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
20783 *ret_copy = COption_u16Z_none();
20784 int64_t ret_ref = tag_ptr(ret_copy, true);
20788 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
20789 if (!ptr_is_owned(_res)) return;
20790 void* _res_ptr = untag_ptr(_res);
20791 CHECK_ACCESS(_res_ptr);
20792 LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
20793 FREE(untag_ptr(_res));
20794 COption_u16Z_free(_res_conv);
20797 static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) {
20798 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
20799 *ret_copy = COption_u16Z_clone(arg);
20800 int64_t ret_ref = tag_ptr(ret_copy, true);
20803 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20804 LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)untag_ptr(arg);
20805 int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv);
20809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20810 LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)untag_ptr(orig);
20811 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
20812 *ret_copy = COption_u16Z_clone(orig_conv);
20813 int64_t ret_ref = tag_ptr(ret_copy, true);
20817 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20818 LDKThirtyTwoBytes o_ref;
20819 CHECK((*env)->GetArrayLength(env, o) == 32);
20820 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
20821 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
20822 *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
20823 return tag_ptr(ret_conv, true);
20826 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20827 void* e_ptr = untag_ptr(e);
20828 CHECK_ACCESS(e_ptr);
20829 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
20830 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
20831 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
20832 *ret_conv = CResult__u832APIErrorZ_err(e_conv);
20833 return tag_ptr(ret_conv, true);
20836 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20837 LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
20838 jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
20842 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20843 if (!ptr_is_owned(_res)) return;
20844 void* _res_ptr = untag_ptr(_res);
20845 CHECK_ACCESS(_res_ptr);
20846 LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
20847 FREE(untag_ptr(_res));
20848 CResult__u832APIErrorZ_free(_res_conv);
20851 static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
20852 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
20853 *ret_conv = CResult__u832APIErrorZ_clone(arg);
20854 return tag_ptr(ret_conv, true);
20856 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20857 LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
20858 int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
20862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20863 LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
20864 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
20865 *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
20866 return tag_ptr(ret_conv, true);
20869 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RecentPaymentDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20870 LDKCVec_RecentPaymentDetailsZ _res_constr;
20871 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20872 if (_res_constr.datalen > 0)
20873 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRecentPaymentDetails), "LDKCVec_RecentPaymentDetailsZ Elements");
20875 _res_constr.data = NULL;
20876 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20877 for (size_t w = 0; w < _res_constr.datalen; w++) {
20878 int64_t _res_conv_22 = _res_vals[w];
20879 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
20880 CHECK_ACCESS(_res_conv_22_ptr);
20881 LDKRecentPaymentDetails _res_conv_22_conv = *(LDKRecentPaymentDetails*)(_res_conv_22_ptr);
20882 FREE(untag_ptr(_res_conv_22));
20883 _res_constr.data[w] = _res_conv_22_conv;
20885 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20886 CVec_RecentPaymentDetailsZ_free(_res_constr);
20889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv *env, jclass clz) {
20890 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
20891 *ret_conv = CResult_NonePaymentSendFailureZ_ok();
20892 return tag_ptr(ret_conv, true);
20895 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20896 void* e_ptr = untag_ptr(e);
20897 CHECK_ACCESS(e_ptr);
20898 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
20899 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
20900 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
20901 *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
20902 return tag_ptr(ret_conv, true);
20905 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20906 LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
20907 jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
20911 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20912 if (!ptr_is_owned(_res)) return;
20913 void* _res_ptr = untag_ptr(_res);
20914 CHECK_ACCESS(_res_ptr);
20915 LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
20916 FREE(untag_ptr(_res));
20917 CResult_NonePaymentSendFailureZ_free(_res_conv);
20920 static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
20921 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
20922 *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
20923 return tag_ptr(ret_conv, true);
20925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20926 LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
20927 int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
20931 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20932 LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
20933 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
20934 *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
20935 return tag_ptr(ret_conv, true);
20938 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1ok(JNIEnv *env, jclass clz) {
20939 LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
20940 *ret_conv = CResult_NoneRetryableSendFailureZ_ok();
20941 return tag_ptr(ret_conv, true);
20944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1err(JNIEnv *env, jclass clz, jclass e) {
20945 LDKRetryableSendFailure e_conv = LDKRetryableSendFailure_from_java(env, e);
20946 LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
20947 *ret_conv = CResult_NoneRetryableSendFailureZ_err(e_conv);
20948 return tag_ptr(ret_conv, true);
20951 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20952 LDKCResult_NoneRetryableSendFailureZ* o_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(o);
20953 jboolean ret_conv = CResult_NoneRetryableSendFailureZ_is_ok(o_conv);
20957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20958 if (!ptr_is_owned(_res)) return;
20959 void* _res_ptr = untag_ptr(_res);
20960 CHECK_ACCESS(_res_ptr);
20961 LDKCResult_NoneRetryableSendFailureZ _res_conv = *(LDKCResult_NoneRetryableSendFailureZ*)(_res_ptr);
20962 FREE(untag_ptr(_res));
20963 CResult_NoneRetryableSendFailureZ_free(_res_conv);
20966 static inline uint64_t CResult_NoneRetryableSendFailureZ_clone_ptr(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR arg) {
20967 LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
20968 *ret_conv = CResult_NoneRetryableSendFailureZ_clone(arg);
20969 return tag_ptr(ret_conv, true);
20971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20972 LDKCResult_NoneRetryableSendFailureZ* arg_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(arg);
20973 int64_t ret_conv = CResult_NoneRetryableSendFailureZ_clone_ptr(arg_conv);
20977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20978 LDKCResult_NoneRetryableSendFailureZ* orig_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(orig);
20979 LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
20980 *ret_conv = CResult_NoneRetryableSendFailureZ_clone(orig_conv);
20981 return tag_ptr(ret_conv, true);
20984 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20985 LDKThirtyTwoBytes o_ref;
20986 CHECK((*env)->GetArrayLength(env, o) == 32);
20987 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
20988 LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
20989 *ret_conv = CResult_PaymentHashPaymentSendFailureZ_ok(o_ref);
20990 return tag_ptr(ret_conv, true);
20993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20994 void* e_ptr = untag_ptr(e);
20995 CHECK_ACCESS(e_ptr);
20996 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
20997 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
20998 LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
20999 *ret_conv = CResult_PaymentHashPaymentSendFailureZ_err(e_conv);
21000 return tag_ptr(ret_conv, true);
21003 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21004 LDKCResult_PaymentHashPaymentSendFailureZ* o_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(o);
21005 jboolean ret_conv = CResult_PaymentHashPaymentSendFailureZ_is_ok(o_conv);
21009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21010 if (!ptr_is_owned(_res)) return;
21011 void* _res_ptr = untag_ptr(_res);
21012 CHECK_ACCESS(_res_ptr);
21013 LDKCResult_PaymentHashPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentHashPaymentSendFailureZ*)(_res_ptr);
21014 FREE(untag_ptr(_res));
21015 CResult_PaymentHashPaymentSendFailureZ_free(_res_conv);
21018 static inline uint64_t CResult_PaymentHashPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR arg) {
21019 LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
21020 *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(arg);
21021 return tag_ptr(ret_conv, true);
21023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21024 LDKCResult_PaymentHashPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(arg);
21025 int64_t ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone_ptr(arg_conv);
21029 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21030 LDKCResult_PaymentHashPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(orig);
21031 LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
21032 *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(orig_conv);
21033 return tag_ptr(ret_conv, true);
21036 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
21037 LDKThirtyTwoBytes o_ref;
21038 CHECK((*env)->GetArrayLength(env, o) == 32);
21039 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
21040 LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
21041 *ret_conv = CResult_PaymentHashRetryableSendFailureZ_ok(o_ref);
21042 return tag_ptr(ret_conv, true);
21045 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1err(JNIEnv *env, jclass clz, jclass e) {
21046 LDKRetryableSendFailure e_conv = LDKRetryableSendFailure_from_java(env, e);
21047 LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
21048 *ret_conv = CResult_PaymentHashRetryableSendFailureZ_err(e_conv);
21049 return tag_ptr(ret_conv, true);
21052 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21053 LDKCResult_PaymentHashRetryableSendFailureZ* o_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(o);
21054 jboolean ret_conv = CResult_PaymentHashRetryableSendFailureZ_is_ok(o_conv);
21058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21059 if (!ptr_is_owned(_res)) return;
21060 void* _res_ptr = untag_ptr(_res);
21061 CHECK_ACCESS(_res_ptr);
21062 LDKCResult_PaymentHashRetryableSendFailureZ _res_conv = *(LDKCResult_PaymentHashRetryableSendFailureZ*)(_res_ptr);
21063 FREE(untag_ptr(_res));
21064 CResult_PaymentHashRetryableSendFailureZ_free(_res_conv);
21067 static inline uint64_t CResult_PaymentHashRetryableSendFailureZ_clone_ptr(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR arg) {
21068 LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
21069 *ret_conv = CResult_PaymentHashRetryableSendFailureZ_clone(arg);
21070 return tag_ptr(ret_conv, true);
21072 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21073 LDKCResult_PaymentHashRetryableSendFailureZ* arg_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(arg);
21074 int64_t ret_conv = CResult_PaymentHashRetryableSendFailureZ_clone_ptr(arg_conv);
21078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21079 LDKCResult_PaymentHashRetryableSendFailureZ* orig_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(orig);
21080 LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
21081 *ret_conv = CResult_PaymentHashRetryableSendFailureZ_clone(orig_conv);
21082 return tag_ptr(ret_conv, true);
21085 static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) {
21086 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
21087 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg);
21088 return tag_ptr(ret_conv, true);
21090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21091 LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(arg);
21092 int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv);
21096 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21097 LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(orig);
21098 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
21099 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv);
21100 return tag_ptr(ret_conv, true);
21103 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
21104 LDKThirtyTwoBytes a_ref;
21105 CHECK((*env)->GetArrayLength(env, a) == 32);
21106 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
21107 LDKThirtyTwoBytes b_ref;
21108 CHECK((*env)->GetArrayLength(env, b) == 32);
21109 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
21110 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
21111 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
21112 return tag_ptr(ret_conv, true);
21115 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21116 if (!ptr_is_owned(_res)) return;
21117 void* _res_ptr = untag_ptr(_res);
21118 CHECK_ACCESS(_res_ptr);
21119 LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
21120 FREE(untag_ptr(_res));
21121 C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
21124 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21125 void* o_ptr = untag_ptr(o);
21126 CHECK_ACCESS(o_ptr);
21127 LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
21128 o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(o));
21129 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
21130 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
21131 return tag_ptr(ret_conv, true);
21134 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21135 void* e_ptr = untag_ptr(e);
21136 CHECK_ACCESS(e_ptr);
21137 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
21138 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
21139 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
21140 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
21141 return tag_ptr(ret_conv, true);
21144 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21145 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(o);
21146 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv);
21150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21151 if (!ptr_is_owned(_res)) return;
21152 void* _res_ptr = untag_ptr(_res);
21153 CHECK_ACCESS(_res_ptr);
21154 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
21155 FREE(untag_ptr(_res));
21156 CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
21159 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) {
21160 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
21161 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg);
21162 return tag_ptr(ret_conv, true);
21164 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21165 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(arg);
21166 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv);
21170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21171 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(orig);
21172 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
21173 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv);
21174 return tag_ptr(ret_conv, true);
21177 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ThirtyTwoBytesZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
21178 LDKCVec_ThirtyTwoBytesZ _res_constr;
21179 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21180 if (_res_constr.datalen > 0)
21181 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
21183 _res_constr.data = NULL;
21184 for (size_t i = 0; i < _res_constr.datalen; i++) {
21185 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
21186 LDKThirtyTwoBytes _res_conv_8_ref;
21187 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
21188 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
21189 _res_constr.data[i] = _res_conv_8_ref;
21191 CVec_ThirtyTwoBytesZ_free(_res_constr);
21194 static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) {
21195 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
21196 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg);
21197 return tag_ptr(ret_conv, true);
21199 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21200 LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(arg);
21201 int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv);
21205 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21206 LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(orig);
21207 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
21208 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv);
21209 return tag_ptr(ret_conv, true);
21212 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
21213 LDKThirtyTwoBytes a_ref;
21214 CHECK((*env)->GetArrayLength(env, a) == 32);
21215 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
21216 LDKThirtyTwoBytes b_ref;
21217 CHECK((*env)->GetArrayLength(env, b) == 32);
21218 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
21219 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
21220 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref);
21221 return tag_ptr(ret_conv, true);
21224 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21225 if (!ptr_is_owned(_res)) return;
21226 void* _res_ptr = untag_ptr(_res);
21227 CHECK_ACCESS(_res_ptr);
21228 LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
21229 FREE(untag_ptr(_res));
21230 C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
21233 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21234 void* o_ptr = untag_ptr(o);
21235 CHECK_ACCESS(o_ptr);
21236 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
21237 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
21238 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
21239 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
21240 return tag_ptr(ret_conv, true);
21243 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err(JNIEnv *env, jclass clz) {
21244 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
21245 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
21246 return tag_ptr(ret_conv, true);
21249 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21250 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(o);
21251 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
21255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21256 if (!ptr_is_owned(_res)) return;
21257 void* _res_ptr = untag_ptr(_res);
21258 CHECK_ACCESS(_res_ptr);
21259 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
21260 FREE(untag_ptr(_res));
21261 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
21264 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
21265 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
21266 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
21267 return tag_ptr(ret_conv, true);
21269 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21270 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(arg);
21271 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
21275 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21276 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(orig);
21277 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
21278 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
21279 return tag_ptr(ret_conv, true);
21282 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21283 void* o_ptr = untag_ptr(o);
21284 CHECK_ACCESS(o_ptr);
21285 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
21286 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
21287 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
21288 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
21289 return tag_ptr(ret_conv, true);
21292 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21293 void* e_ptr = untag_ptr(e);
21294 CHECK_ACCESS(e_ptr);
21295 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
21296 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
21297 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
21298 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
21299 return tag_ptr(ret_conv, true);
21302 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21303 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(o);
21304 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
21308 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21309 if (!ptr_is_owned(_res)) return;
21310 void* _res_ptr = untag_ptr(_res);
21311 CHECK_ACCESS(_res_ptr);
21312 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
21313 FREE(untag_ptr(_res));
21314 CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
21317 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
21318 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
21319 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
21320 return tag_ptr(ret_conv, true);
21322 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21323 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(arg);
21324 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
21328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21329 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(orig);
21330 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
21331 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
21332 return tag_ptr(ret_conv, true);
21335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
21336 LDKThirtyTwoBytes o_ref;
21337 CHECK((*env)->GetArrayLength(env, o) == 32);
21338 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
21339 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
21340 *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
21341 return tag_ptr(ret_conv, true);
21344 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err(JNIEnv *env, jclass clz) {
21345 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
21346 *ret_conv = CResult_PaymentSecretNoneZ_err();
21347 return tag_ptr(ret_conv, true);
21350 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21351 LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(o);
21352 jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv);
21356 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21357 if (!ptr_is_owned(_res)) return;
21358 void* _res_ptr = untag_ptr(_res);
21359 CHECK_ACCESS(_res_ptr);
21360 LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
21361 FREE(untag_ptr(_res));
21362 CResult_PaymentSecretNoneZ_free(_res_conv);
21365 static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
21366 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
21367 *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
21368 return tag_ptr(ret_conv, true);
21370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21371 LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(arg);
21372 int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
21376 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21377 LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(orig);
21378 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
21379 *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
21380 return tag_ptr(ret_conv, true);
21383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
21384 LDKThirtyTwoBytes o_ref;
21385 CHECK((*env)->GetArrayLength(env, o) == 32);
21386 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
21387 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
21388 *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref);
21389 return tag_ptr(ret_conv, true);
21392 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21393 void* e_ptr = untag_ptr(e);
21394 CHECK_ACCESS(e_ptr);
21395 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
21396 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
21397 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
21398 *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
21399 return tag_ptr(ret_conv, true);
21402 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21403 LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(o);
21404 jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv);
21408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21409 if (!ptr_is_owned(_res)) return;
21410 void* _res_ptr = untag_ptr(_res);
21411 CHECK_ACCESS(_res_ptr);
21412 LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
21413 FREE(untag_ptr(_res));
21414 CResult_PaymentSecretAPIErrorZ_free(_res_conv);
21417 static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) {
21418 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
21419 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg);
21420 return tag_ptr(ret_conv, true);
21422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21423 LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(arg);
21424 int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv);
21428 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21429 LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(orig);
21430 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
21431 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv);
21432 return tag_ptr(ret_conv, true);
21435 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
21436 LDKThirtyTwoBytes o_ref;
21437 CHECK((*env)->GetArrayLength(env, o) == 32);
21438 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
21439 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
21440 *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
21441 return tag_ptr(ret_conv, true);
21444 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21445 void* e_ptr = untag_ptr(e);
21446 CHECK_ACCESS(e_ptr);
21447 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
21448 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
21449 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
21450 *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
21451 return tag_ptr(ret_conv, true);
21454 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21455 LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(o);
21456 jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
21460 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21461 if (!ptr_is_owned(_res)) return;
21462 void* _res_ptr = untag_ptr(_res);
21463 CHECK_ACCESS(_res_ptr);
21464 LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
21465 FREE(untag_ptr(_res));
21466 CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
21469 static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
21470 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
21471 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
21472 return tag_ptr(ret_conv, true);
21474 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21475 LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(arg);
21476 int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
21480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21481 LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(orig);
21482 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
21483 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
21484 return tag_ptr(ret_conv, true);
21487 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21488 LDKCounterpartyForwardingInfo o_conv;
21489 o_conv.inner = untag_ptr(o);
21490 o_conv.is_owned = ptr_is_owned(o);
21491 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21492 o_conv = CounterpartyForwardingInfo_clone(&o_conv);
21493 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
21494 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv);
21495 return tag_ptr(ret_conv, true);
21498 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21499 void* e_ptr = untag_ptr(e);
21500 CHECK_ACCESS(e_ptr);
21501 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21502 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21503 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
21504 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
21505 return tag_ptr(ret_conv, true);
21508 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21509 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o);
21510 jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv);
21514 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21515 if (!ptr_is_owned(_res)) return;
21516 void* _res_ptr = untag_ptr(_res);
21517 CHECK_ACCESS(_res_ptr);
21518 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr);
21519 FREE(untag_ptr(_res));
21520 CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv);
21523 static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) {
21524 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
21525 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg);
21526 return tag_ptr(ret_conv, true);
21528 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21529 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg);
21530 int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv);
21534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21535 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig);
21536 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
21537 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv);
21538 return tag_ptr(ret_conv, true);
21541 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21542 LDKChannelCounterparty o_conv;
21543 o_conv.inner = untag_ptr(o);
21544 o_conv.is_owned = ptr_is_owned(o);
21545 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21546 o_conv = ChannelCounterparty_clone(&o_conv);
21547 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
21548 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv);
21549 return tag_ptr(ret_conv, true);
21552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21553 void* e_ptr = untag_ptr(e);
21554 CHECK_ACCESS(e_ptr);
21555 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21556 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21557 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
21558 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
21559 return tag_ptr(ret_conv, true);
21562 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21563 LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o);
21564 jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv);
21568 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21569 if (!ptr_is_owned(_res)) return;
21570 void* _res_ptr = untag_ptr(_res);
21571 CHECK_ACCESS(_res_ptr);
21572 LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr);
21573 FREE(untag_ptr(_res));
21574 CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv);
21577 static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) {
21578 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
21579 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg);
21580 return tag_ptr(ret_conv, true);
21582 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21583 LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg);
21584 int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv);
21588 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21589 LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig);
21590 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
21591 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv);
21592 return tag_ptr(ret_conv, true);
21595 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21596 LDKChannelDetails o_conv;
21597 o_conv.inner = untag_ptr(o);
21598 o_conv.is_owned = ptr_is_owned(o);
21599 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21600 o_conv = ChannelDetails_clone(&o_conv);
21601 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
21602 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv);
21603 return tag_ptr(ret_conv, true);
21606 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21607 void* e_ptr = untag_ptr(e);
21608 CHECK_ACCESS(e_ptr);
21609 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21610 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21611 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
21612 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
21613 return tag_ptr(ret_conv, true);
21616 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21617 LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o);
21618 jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv);
21622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21623 if (!ptr_is_owned(_res)) return;
21624 void* _res_ptr = untag_ptr(_res);
21625 CHECK_ACCESS(_res_ptr);
21626 LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr);
21627 FREE(untag_ptr(_res));
21628 CResult_ChannelDetailsDecodeErrorZ_free(_res_conv);
21631 static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) {
21632 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
21633 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg);
21634 return tag_ptr(ret_conv, true);
21636 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21637 LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg);
21638 int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv);
21642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21643 LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig);
21644 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
21645 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv);
21646 return tag_ptr(ret_conv, true);
21649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21650 LDKPhantomRouteHints o_conv;
21651 o_conv.inner = untag_ptr(o);
21652 o_conv.is_owned = ptr_is_owned(o);
21653 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21654 o_conv = PhantomRouteHints_clone(&o_conv);
21655 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
21656 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv);
21657 return tag_ptr(ret_conv, true);
21660 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21661 void* e_ptr = untag_ptr(e);
21662 CHECK_ACCESS(e_ptr);
21663 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21664 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21665 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
21666 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
21667 return tag_ptr(ret_conv, true);
21670 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21671 LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o);
21672 jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv);
21676 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21677 if (!ptr_is_owned(_res)) return;
21678 void* _res_ptr = untag_ptr(_res);
21679 CHECK_ACCESS(_res_ptr);
21680 LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr);
21681 FREE(untag_ptr(_res));
21682 CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv);
21685 static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) {
21686 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
21687 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg);
21688 return tag_ptr(ret_conv, true);
21690 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21691 LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg);
21692 int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv);
21696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21697 LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig);
21698 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
21699 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv);
21700 return tag_ptr(ret_conv, true);
21703 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
21704 LDKCVec_ChannelMonitorZ _res_constr;
21705 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21706 if (_res_constr.datalen > 0)
21707 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
21709 _res_constr.data = NULL;
21710 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
21711 for (size_t q = 0; q < _res_constr.datalen; q++) {
21712 int64_t _res_conv_16 = _res_vals[q];
21713 LDKChannelMonitor _res_conv_16_conv;
21714 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
21715 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
21716 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
21717 _res_constr.data[q] = _res_conv_16_conv;
21719 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
21720 CVec_ChannelMonitorZ_free(_res_constr);
21723 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
21724 LDKThirtyTwoBytes a_ref;
21725 CHECK((*env)->GetArrayLength(env, a) == 32);
21726 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
21727 LDKChannelManager b_conv;
21728 b_conv.inner = untag_ptr(b);
21729 b_conv.is_owned = ptr_is_owned(b);
21730 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
21731 // WARNING: we need a move here but no clone is available for LDKChannelManager
21733 LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
21734 *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv);
21735 return tag_ptr(ret_conv, true);
21738 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21739 if (!ptr_is_owned(_res)) return;
21740 void* _res_ptr = untag_ptr(_res);
21741 CHECK_ACCESS(_res_ptr);
21742 LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
21743 FREE(untag_ptr(_res));
21744 C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
21747 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21748 void* o_ptr = untag_ptr(o);
21749 CHECK_ACCESS(o_ptr);
21750 LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
21751 // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
21752 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
21753 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
21754 return tag_ptr(ret_conv, true);
21757 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21758 void* e_ptr = untag_ptr(e);
21759 CHECK_ACCESS(e_ptr);
21760 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21761 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21762 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
21763 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
21764 return tag_ptr(ret_conv, true);
21767 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21768 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(o);
21769 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv);
21773 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21774 if (!ptr_is_owned(_res)) return;
21775 void* _res_ptr = untag_ptr(_res);
21776 CHECK_ACCESS(_res_ptr);
21777 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
21778 FREE(untag_ptr(_res));
21779 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
21782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21783 LDKChannelConfig o_conv;
21784 o_conv.inner = untag_ptr(o);
21785 o_conv.is_owned = ptr_is_owned(o);
21786 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21787 o_conv = ChannelConfig_clone(&o_conv);
21788 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21789 *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv);
21790 return tag_ptr(ret_conv, true);
21793 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21794 void* e_ptr = untag_ptr(e);
21795 CHECK_ACCESS(e_ptr);
21796 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21797 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21798 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21799 *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
21800 return tag_ptr(ret_conv, true);
21803 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21804 LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(o);
21805 jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv);
21809 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21810 if (!ptr_is_owned(_res)) return;
21811 void* _res_ptr = untag_ptr(_res);
21812 CHECK_ACCESS(_res_ptr);
21813 LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
21814 FREE(untag_ptr(_res));
21815 CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
21818 static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) {
21819 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21820 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg);
21821 return tag_ptr(ret_conv, true);
21823 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21824 LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(arg);
21825 int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv);
21829 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21830 LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(orig);
21831 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21832 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv);
21833 return tag_ptr(ret_conv, true);
21836 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1APIErrorZ_1some(JNIEnv *env, jclass clz, int64_t o) {
21837 void* o_ptr = untag_ptr(o);
21838 CHECK_ACCESS(o_ptr);
21839 LDKAPIError o_conv = *(LDKAPIError*)(o_ptr);
21840 o_conv = APIError_clone((LDKAPIError*)untag_ptr(o));
21841 LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
21842 *ret_copy = COption_APIErrorZ_some(o_conv);
21843 int64_t ret_ref = tag_ptr(ret_copy, true);
21847 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1APIErrorZ_1none(JNIEnv *env, jclass clz) {
21848 LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
21849 *ret_copy = COption_APIErrorZ_none();
21850 int64_t ret_ref = tag_ptr(ret_copy, true);
21854 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21855 if (!ptr_is_owned(_res)) return;
21856 void* _res_ptr = untag_ptr(_res);
21857 CHECK_ACCESS(_res_ptr);
21858 LDKCOption_APIErrorZ _res_conv = *(LDKCOption_APIErrorZ*)(_res_ptr);
21859 FREE(untag_ptr(_res));
21860 COption_APIErrorZ_free(_res_conv);
21863 static inline uint64_t COption_APIErrorZ_clone_ptr(LDKCOption_APIErrorZ *NONNULL_PTR arg) {
21864 LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
21865 *ret_copy = COption_APIErrorZ_clone(arg);
21866 int64_t ret_ref = tag_ptr(ret_copy, true);
21869 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21870 LDKCOption_APIErrorZ* arg_conv = (LDKCOption_APIErrorZ*)untag_ptr(arg);
21871 int64_t ret_conv = COption_APIErrorZ_clone_ptr(arg_conv);
21875 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21876 LDKCOption_APIErrorZ* orig_conv = (LDKCOption_APIErrorZ*)untag_ptr(orig);
21877 LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
21878 *ret_copy = COption_APIErrorZ_clone(orig_conv);
21879 int64_t ret_ref = tag_ptr(ret_copy, true);
21883 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21884 void* o_ptr = untag_ptr(o);
21885 CHECK_ACCESS(o_ptr);
21886 LDKCOption_APIErrorZ o_conv = *(LDKCOption_APIErrorZ*)(o_ptr);
21887 o_conv = COption_APIErrorZ_clone((LDKCOption_APIErrorZ*)untag_ptr(o));
21888 LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
21889 *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_ok(o_conv);
21890 return tag_ptr(ret_conv, true);
21893 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21894 void* e_ptr = untag_ptr(e);
21895 CHECK_ACCESS(e_ptr);
21896 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21897 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21898 LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
21899 *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_err(e_conv);
21900 return tag_ptr(ret_conv, true);
21903 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21904 LDKCResult_COption_APIErrorZDecodeErrorZ* o_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(o);
21905 jboolean ret_conv = CResult_COption_APIErrorZDecodeErrorZ_is_ok(o_conv);
21909 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21910 if (!ptr_is_owned(_res)) return;
21911 void* _res_ptr = untag_ptr(_res);
21912 CHECK_ACCESS(_res_ptr);
21913 LDKCResult_COption_APIErrorZDecodeErrorZ _res_conv = *(LDKCResult_COption_APIErrorZDecodeErrorZ*)(_res_ptr);
21914 FREE(untag_ptr(_res));
21915 CResult_COption_APIErrorZDecodeErrorZ_free(_res_conv);
21918 static inline uint64_t CResult_COption_APIErrorZDecodeErrorZ_clone_ptr(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR arg) {
21919 LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
21920 *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_clone(arg);
21921 return tag_ptr(ret_conv, true);
21923 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21924 LDKCResult_COption_APIErrorZDecodeErrorZ* arg_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(arg);
21925 int64_t ret_conv = CResult_COption_APIErrorZDecodeErrorZ_clone_ptr(arg_conv);
21929 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21930 LDKCResult_COption_APIErrorZDecodeErrorZ* orig_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(orig);
21931 LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
21932 *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_clone(orig_conv);
21933 return tag_ptr(ret_conv, true);
21936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21937 LDKOutPoint o_conv;
21938 o_conv.inner = untag_ptr(o);
21939 o_conv.is_owned = ptr_is_owned(o);
21940 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21941 o_conv = OutPoint_clone(&o_conv);
21942 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
21943 *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv);
21944 return tag_ptr(ret_conv, true);
21947 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21948 void* e_ptr = untag_ptr(e);
21949 CHECK_ACCESS(e_ptr);
21950 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21951 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21952 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
21953 *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
21954 return tag_ptr(ret_conv, true);
21957 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21958 LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o);
21959 jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv);
21963 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21964 if (!ptr_is_owned(_res)) return;
21965 void* _res_ptr = untag_ptr(_res);
21966 CHECK_ACCESS(_res_ptr);
21967 LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
21968 FREE(untag_ptr(_res));
21969 CResult_OutPointDecodeErrorZ_free(_res_conv);
21972 static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) {
21973 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
21974 *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg);
21975 return tag_ptr(ret_conv, true);
21977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21978 LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg);
21979 int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv);
21983 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21984 LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig);
21985 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
21986 *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv);
21987 return tag_ptr(ret_conv, true);
21990 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) {
21991 void* o_ptr = untag_ptr(o);
21992 CHECK_ACCESS(o_ptr);
21993 LDKType o_conv = *(LDKType*)(o_ptr);
21994 if (o_conv.free == LDKType_JCalls_free) {
21995 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
21996 LDKType_JCalls_cloned(&o_conv);
21998 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
21999 *ret_copy = COption_TypeZ_some(o_conv);
22000 int64_t ret_ref = tag_ptr(ret_copy, true);
22004 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none(JNIEnv *env, jclass clz) {
22005 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
22006 *ret_copy = COption_TypeZ_none();
22007 int64_t ret_ref = tag_ptr(ret_copy, true);
22011 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22012 if (!ptr_is_owned(_res)) return;
22013 void* _res_ptr = untag_ptr(_res);
22014 CHECK_ACCESS(_res_ptr);
22015 LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
22016 FREE(untag_ptr(_res));
22017 COption_TypeZ_free(_res_conv);
22020 static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) {
22021 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
22022 *ret_copy = COption_TypeZ_clone(arg);
22023 int64_t ret_ref = tag_ptr(ret_copy, true);
22026 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22027 LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)untag_ptr(arg);
22028 int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv);
22032 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22033 LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)untag_ptr(orig);
22034 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
22035 *ret_copy = COption_TypeZ_clone(orig_conv);
22036 int64_t ret_ref = tag_ptr(ret_copy, true);
22040 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22041 void* o_ptr = untag_ptr(o);
22042 CHECK_ACCESS(o_ptr);
22043 LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
22044 o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)untag_ptr(o));
22045 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
22046 *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
22047 return tag_ptr(ret_conv, true);
22050 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22051 void* e_ptr = untag_ptr(e);
22052 CHECK_ACCESS(e_ptr);
22053 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22054 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22055 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
22056 *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
22057 return tag_ptr(ret_conv, true);
22060 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22061 LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(o);
22062 jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv);
22066 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22067 if (!ptr_is_owned(_res)) return;
22068 void* _res_ptr = untag_ptr(_res);
22069 CHECK_ACCESS(_res_ptr);
22070 LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
22071 FREE(untag_ptr(_res));
22072 CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
22075 static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) {
22076 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
22077 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg);
22078 return tag_ptr(ret_conv, true);
22080 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22081 LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(arg);
22082 int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv);
22086 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22087 LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(orig);
22088 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
22089 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv);
22090 return tag_ptr(ret_conv, true);
22093 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
22094 LDKThirtyTwoBytes o_ref;
22095 CHECK((*env)->GetArrayLength(env, o) == 32);
22096 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
22097 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
22098 *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
22099 return tag_ptr(ret_conv, true);
22102 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22103 void* e_ptr = untag_ptr(e);
22104 CHECK_ACCESS(e_ptr);
22105 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
22106 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
22107 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
22108 *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
22109 return tag_ptr(ret_conv, true);
22112 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22113 LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(o);
22114 jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv);
22118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22119 if (!ptr_is_owned(_res)) return;
22120 void* _res_ptr = untag_ptr(_res);
22121 CHECK_ACCESS(_res_ptr);
22122 LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
22123 FREE(untag_ptr(_res));
22124 CResult_PaymentIdPaymentErrorZ_free(_res_conv);
22127 static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) {
22128 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
22129 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg);
22130 return tag_ptr(ret_conv, true);
22132 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22133 LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(arg);
22134 int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv);
22138 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22139 LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(orig);
22140 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
22141 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
22142 return tag_ptr(ret_conv, true);
22145 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1ok(JNIEnv *env, jclass clz) {
22146 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
22147 *ret_conv = CResult_NonePaymentErrorZ_ok();
22148 return tag_ptr(ret_conv, true);
22151 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22152 void* e_ptr = untag_ptr(e);
22153 CHECK_ACCESS(e_ptr);
22154 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
22155 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
22156 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
22157 *ret_conv = CResult_NonePaymentErrorZ_err(e_conv);
22158 return tag_ptr(ret_conv, true);
22161 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22162 LDKCResult_NonePaymentErrorZ* o_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(o);
22163 jboolean ret_conv = CResult_NonePaymentErrorZ_is_ok(o_conv);
22167 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22168 if (!ptr_is_owned(_res)) return;
22169 void* _res_ptr = untag_ptr(_res);
22170 CHECK_ACCESS(_res_ptr);
22171 LDKCResult_NonePaymentErrorZ _res_conv = *(LDKCResult_NonePaymentErrorZ*)(_res_ptr);
22172 FREE(untag_ptr(_res));
22173 CResult_NonePaymentErrorZ_free(_res_conv);
22176 static inline uint64_t CResult_NonePaymentErrorZ_clone_ptr(LDKCResult_NonePaymentErrorZ *NONNULL_PTR arg) {
22177 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
22178 *ret_conv = CResult_NonePaymentErrorZ_clone(arg);
22179 return tag_ptr(ret_conv, true);
22181 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22182 LDKCResult_NonePaymentErrorZ* arg_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(arg);
22183 int64_t ret_conv = CResult_NonePaymentErrorZ_clone_ptr(arg_conv);
22187 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22188 LDKCResult_NonePaymentErrorZ* orig_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(orig);
22189 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
22190 *ret_conv = CResult_NonePaymentErrorZ_clone(orig_conv);
22191 return tag_ptr(ret_conv, true);
22194 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok(JNIEnv *env, jclass clz, jstring o) {
22195 LDKStr o_conv = java_to_owned_str(env, o);
22196 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
22197 *ret_conv = CResult_StringErrorZ_ok(o_conv);
22198 return tag_ptr(ret_conv, true);
22201 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
22202 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
22203 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
22204 *ret_conv = CResult_StringErrorZ_err(e_conv);
22205 return tag_ptr(ret_conv, true);
22208 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22209 LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
22210 jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
22214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22215 if (!ptr_is_owned(_res)) return;
22216 void* _res_ptr = untag_ptr(_res);
22217 CHECK_ACCESS(_res_ptr);
22218 LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
22219 FREE(untag_ptr(_res));
22220 CResult_StringErrorZ_free(_res_conv);
22223 static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
22224 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
22225 *ret_conv = CResult_StringErrorZ_clone(arg);
22226 return tag_ptr(ret_conv, true);
22228 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22229 LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
22230 int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
22234 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22235 LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
22236 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
22237 *ret_conv = CResult_StringErrorZ_clone(orig_conv);
22238 return tag_ptr(ret_conv, true);
22241 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
22242 LDKPublicKey o_ref;
22243 CHECK((*env)->GetArrayLength(env, o) == 33);
22244 (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
22245 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
22246 *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
22247 return tag_ptr(ret_conv, true);
22250 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
22251 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
22252 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
22253 *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
22254 return tag_ptr(ret_conv, true);
22257 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22258 LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
22259 jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
22263 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22264 if (!ptr_is_owned(_res)) return;
22265 void* _res_ptr = untag_ptr(_res);
22266 CHECK_ACCESS(_res_ptr);
22267 LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
22268 FREE(untag_ptr(_res));
22269 CResult_PublicKeyErrorZ_free(_res_conv);
22272 static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
22273 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
22274 *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
22275 return tag_ptr(ret_conv, true);
22277 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22278 LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
22279 int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
22283 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22284 LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
22285 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
22286 *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
22287 return tag_ptr(ret_conv, true);
22290 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22291 LDKChannelMonitorUpdate o_conv;
22292 o_conv.inner = untag_ptr(o);
22293 o_conv.is_owned = ptr_is_owned(o);
22294 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22295 o_conv = ChannelMonitorUpdate_clone(&o_conv);
22296 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
22297 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
22298 return tag_ptr(ret_conv, true);
22301 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22302 void* e_ptr = untag_ptr(e);
22303 CHECK_ACCESS(e_ptr);
22304 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22305 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22306 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
22307 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
22308 return tag_ptr(ret_conv, true);
22311 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22312 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
22313 jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
22317 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22318 if (!ptr_is_owned(_res)) return;
22319 void* _res_ptr = untag_ptr(_res);
22320 CHECK_ACCESS(_res_ptr);
22321 LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
22322 FREE(untag_ptr(_res));
22323 CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
22326 static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
22327 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
22328 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
22329 return tag_ptr(ret_conv, true);
22331 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22332 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
22333 int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
22337 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22338 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
22339 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
22340 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
22341 return tag_ptr(ret_conv, true);
22344 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) {
22345 void* o_ptr = untag_ptr(o);
22346 CHECK_ACCESS(o_ptr);
22347 LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
22348 o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
22349 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
22350 *ret_copy = COption_MonitorEventZ_some(o_conv);
22351 int64_t ret_ref = tag_ptr(ret_copy, true);
22355 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) {
22356 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
22357 *ret_copy = COption_MonitorEventZ_none();
22358 int64_t ret_ref = tag_ptr(ret_copy, true);
22362 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22363 if (!ptr_is_owned(_res)) return;
22364 void* _res_ptr = untag_ptr(_res);
22365 CHECK_ACCESS(_res_ptr);
22366 LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
22367 FREE(untag_ptr(_res));
22368 COption_MonitorEventZ_free(_res_conv);
22371 static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
22372 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
22373 *ret_copy = COption_MonitorEventZ_clone(arg);
22374 int64_t ret_ref = tag_ptr(ret_copy, true);
22377 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22378 LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
22379 int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
22383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22384 LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
22385 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
22386 *ret_copy = COption_MonitorEventZ_clone(orig_conv);
22387 int64_t ret_ref = tag_ptr(ret_copy, true);
22391 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22392 void* o_ptr = untag_ptr(o);
22393 CHECK_ACCESS(o_ptr);
22394 LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
22395 o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
22396 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22397 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
22398 return tag_ptr(ret_conv, true);
22401 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22402 void* e_ptr = untag_ptr(e);
22403 CHECK_ACCESS(e_ptr);
22404 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22405 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22406 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22407 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
22408 return tag_ptr(ret_conv, true);
22411 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22412 LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
22413 jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
22417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22418 if (!ptr_is_owned(_res)) return;
22419 void* _res_ptr = untag_ptr(_res);
22420 CHECK_ACCESS(_res_ptr);
22421 LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
22422 FREE(untag_ptr(_res));
22423 CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
22426 static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
22427 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22428 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
22429 return tag_ptr(ret_conv, true);
22431 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22432 LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
22433 int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
22437 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22438 LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
22439 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22440 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
22441 return tag_ptr(ret_conv, true);
22444 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22445 LDKHTLCUpdate o_conv;
22446 o_conv.inner = untag_ptr(o);
22447 o_conv.is_owned = ptr_is_owned(o);
22448 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22449 o_conv = HTLCUpdate_clone(&o_conv);
22450 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22451 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
22452 return tag_ptr(ret_conv, true);
22455 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22456 void* e_ptr = untag_ptr(e);
22457 CHECK_ACCESS(e_ptr);
22458 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22459 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22460 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22461 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
22462 return tag_ptr(ret_conv, true);
22465 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22466 LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(o);
22467 jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv);
22471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22472 if (!ptr_is_owned(_res)) return;
22473 void* _res_ptr = untag_ptr(_res);
22474 CHECK_ACCESS(_res_ptr);
22475 LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
22476 FREE(untag_ptr(_res));
22477 CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
22480 static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) {
22481 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22482 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg);
22483 return tag_ptr(ret_conv, true);
22485 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22486 LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(arg);
22487 int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv);
22491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22492 LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(orig);
22493 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22494 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv);
22495 return tag_ptr(ret_conv, true);
22498 static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
22499 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
22500 *ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
22501 return tag_ptr(ret_conv, true);
22503 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22504 LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(arg);
22505 int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv);
22509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22510 LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(orig);
22511 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
22512 *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv);
22513 return tag_ptr(ret_conv, true);
22516 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
22517 LDKOutPoint a_conv;
22518 a_conv.inner = untag_ptr(a);
22519 a_conv.is_owned = ptr_is_owned(a);
22520 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22521 a_conv = OutPoint_clone(&a_conv);
22523 b_ref.datalen = (*env)->GetArrayLength(env, b);
22524 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
22525 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
22526 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
22527 *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref);
22528 return tag_ptr(ret_conv, true);
22531 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22532 if (!ptr_is_owned(_res)) return;
22533 void* _res_ptr = untag_ptr(_res);
22534 CHECK_ACCESS(_res_ptr);
22535 LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
22536 FREE(untag_ptr(_res));
22537 C2Tuple_OutPointScriptZ_free(_res_conv);
22540 static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) {
22541 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
22542 *ret_conv = C2Tuple_u32ScriptZ_clone(arg);
22543 return tag_ptr(ret_conv, true);
22545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22546 LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(arg);
22547 int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv);
22551 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22552 LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(orig);
22553 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
22554 *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv);
22555 return tag_ptr(ret_conv, true);
22558 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_t a, int8_tArray b) {
22560 b_ref.datalen = (*env)->GetArrayLength(env, b);
22561 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
22562 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
22563 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
22564 *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref);
22565 return tag_ptr(ret_conv, true);
22568 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22569 if (!ptr_is_owned(_res)) return;
22570 void* _res_ptr = untag_ptr(_res);
22571 CHECK_ACCESS(_res_ptr);
22572 LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
22573 FREE(untag_ptr(_res));
22574 C2Tuple_u32ScriptZ_free(_res_conv);
22577 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22578 LDKCVec_C2Tuple_u32ScriptZZ _res_constr;
22579 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22580 if (_res_constr.datalen > 0)
22581 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
22583 _res_constr.data = NULL;
22584 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22585 for (size_t v = 0; v < _res_constr.datalen; v++) {
22586 int64_t _res_conv_21 = _res_vals[v];
22587 void* _res_conv_21_ptr = untag_ptr(_res_conv_21);
22588 CHECK_ACCESS(_res_conv_21_ptr);
22589 LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
22590 FREE(untag_ptr(_res_conv_21));
22591 _res_constr.data[v] = _res_conv_21_conv;
22593 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22594 CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
22597 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) {
22598 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
22599 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg);
22600 return tag_ptr(ret_conv, true);
22602 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22603 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(arg);
22604 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv);
22608 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22609 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(orig);
22610 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
22611 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv);
22612 return tag_ptr(ret_conv, true);
22615 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
22616 LDKThirtyTwoBytes a_ref;
22617 CHECK((*env)->GetArrayLength(env, a) == 32);
22618 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
22619 LDKCVec_C2Tuple_u32ScriptZZ b_constr;
22620 b_constr.datalen = (*env)->GetArrayLength(env, b);
22621 if (b_constr.datalen > 0)
22622 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
22624 b_constr.data = NULL;
22625 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
22626 for (size_t v = 0; v < b_constr.datalen; v++) {
22627 int64_t b_conv_21 = b_vals[v];
22628 void* b_conv_21_ptr = untag_ptr(b_conv_21);
22629 CHECK_ACCESS(b_conv_21_ptr);
22630 LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
22631 b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)untag_ptr(b_conv_21));
22632 b_constr.data[v] = b_conv_21_conv;
22634 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
22635 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
22636 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
22637 return tag_ptr(ret_conv, true);
22640 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22641 if (!ptr_is_owned(_res)) return;
22642 void* _res_ptr = untag_ptr(_res);
22643 CHECK_ACCESS(_res_ptr);
22644 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
22645 FREE(untag_ptr(_res));
22646 C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
22649 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22650 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr;
22651 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22652 if (_res_constr.datalen > 0)
22653 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
22655 _res_constr.data = NULL;
22656 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22657 for (size_t o = 0; o < _res_constr.datalen; o++) {
22658 int64_t _res_conv_40 = _res_vals[o];
22659 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
22660 CHECK_ACCESS(_res_conv_40_ptr);
22661 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
22662 FREE(untag_ptr(_res_conv_40));
22663 _res_constr.data[o] = _res_conv_40_conv;
22665 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22666 CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
22669 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22670 LDKCVec_EventZ _res_constr;
22671 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22672 if (_res_constr.datalen > 0)
22673 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
22675 _res_constr.data = NULL;
22676 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22677 for (size_t h = 0; h < _res_constr.datalen; h++) {
22678 int64_t _res_conv_7 = _res_vals[h];
22679 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
22680 CHECK_ACCESS(_res_conv_7_ptr);
22681 LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
22682 FREE(untag_ptr(_res_conv_7));
22683 _res_constr.data[h] = _res_conv_7_conv;
22685 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22686 CVec_EventZ_free(_res_constr);
22689 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
22690 LDKCVec_TransactionZ _res_constr;
22691 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22692 if (_res_constr.datalen > 0)
22693 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
22695 _res_constr.data = NULL;
22696 for (size_t i = 0; i < _res_constr.datalen; i++) {
22697 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
22698 LDKTransaction _res_conv_8_ref;
22699 _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8);
22700 _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes");
22701 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data);
22702 _res_conv_8_ref.data_is_owned = true;
22703 _res_constr.data[i] = _res_conv_8_ref;
22705 CVec_TransactionZ_free(_res_constr);
22708 static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) {
22709 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
22710 *ret_conv = C2Tuple_u32TxOutZ_clone(arg);
22711 return tag_ptr(ret_conv, true);
22713 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22714 LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(arg);
22715 int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv);
22719 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22720 LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(orig);
22721 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
22722 *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv);
22723 return tag_ptr(ret_conv, true);
22726 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) {
22727 void* b_ptr = untag_ptr(b);
22728 CHECK_ACCESS(b_ptr);
22729 LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
22730 b_conv = TxOut_clone((LDKTxOut*)untag_ptr(b));
22731 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
22732 *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
22733 return tag_ptr(ret_conv, true);
22736 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22737 if (!ptr_is_owned(_res)) return;
22738 void* _res_ptr = untag_ptr(_res);
22739 CHECK_ACCESS(_res_ptr);
22740 LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
22741 FREE(untag_ptr(_res));
22742 C2Tuple_u32TxOutZ_free(_res_conv);
22745 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22746 LDKCVec_C2Tuple_u32TxOutZZ _res_constr;
22747 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22748 if (_res_constr.datalen > 0)
22749 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
22751 _res_constr.data = NULL;
22752 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22753 for (size_t u = 0; u < _res_constr.datalen; u++) {
22754 int64_t _res_conv_20 = _res_vals[u];
22755 void* _res_conv_20_ptr = untag_ptr(_res_conv_20);
22756 CHECK_ACCESS(_res_conv_20_ptr);
22757 LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
22758 FREE(untag_ptr(_res_conv_20));
22759 _res_constr.data[u] = _res_conv_20_conv;
22761 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22762 CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
22765 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) {
22766 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22767 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg);
22768 return tag_ptr(ret_conv, true);
22770 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22771 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(arg);
22772 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv);
22776 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22777 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(orig);
22778 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22779 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv);
22780 return tag_ptr(ret_conv, true);
22783 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
22784 LDKThirtyTwoBytes a_ref;
22785 CHECK((*env)->GetArrayLength(env, a) == 32);
22786 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
22787 LDKCVec_C2Tuple_u32TxOutZZ b_constr;
22788 b_constr.datalen = (*env)->GetArrayLength(env, b);
22789 if (b_constr.datalen > 0)
22790 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
22792 b_constr.data = NULL;
22793 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
22794 for (size_t u = 0; u < b_constr.datalen; u++) {
22795 int64_t b_conv_20 = b_vals[u];
22796 void* b_conv_20_ptr = untag_ptr(b_conv_20);
22797 CHECK_ACCESS(b_conv_20_ptr);
22798 LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
22799 b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)untag_ptr(b_conv_20));
22800 b_constr.data[u] = b_conv_20_conv;
22802 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
22803 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22804 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
22805 return tag_ptr(ret_conv, true);
22808 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22809 if (!ptr_is_owned(_res)) return;
22810 void* _res_ptr = untag_ptr(_res);
22811 CHECK_ACCESS(_res_ptr);
22812 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
22813 FREE(untag_ptr(_res));
22814 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
22817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22818 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr;
22819 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22820 if (_res_constr.datalen > 0)
22821 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
22823 _res_constr.data = NULL;
22824 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22825 for (size_t n = 0; n < _res_constr.datalen; n++) {
22826 int64_t _res_conv_39 = _res_vals[n];
22827 void* _res_conv_39_ptr = untag_ptr(_res_conv_39);
22828 CHECK_ACCESS(_res_conv_39_ptr);
22829 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
22830 FREE(untag_ptr(_res_conv_39));
22831 _res_constr.data[n] = _res_conv_39_conv;
22833 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22834 CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
22837 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BalanceZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22838 LDKCVec_BalanceZ _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(LDKBalance), "LDKCVec_BalanceZ Elements");
22843 _res_constr.data = NULL;
22844 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22845 for (size_t j = 0; j < _res_constr.datalen; j++) {
22846 int64_t _res_conv_9 = _res_vals[j];
22847 void* _res_conv_9_ptr = untag_ptr(_res_conv_9);
22848 CHECK_ACCESS(_res_conv_9_ptr);
22849 LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
22850 FREE(untag_ptr(_res_conv_9));
22851 _res_constr.data[j] = _res_conv_9_conv;
22853 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22854 CVec_BalanceZ_free(_res_constr);
22857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22858 void* o_ptr = untag_ptr(o);
22859 CHECK_ACCESS(o_ptr);
22860 LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
22861 o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o));
22862 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
22863 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
22864 return tag_ptr(ret_conv, true);
22867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22868 void* e_ptr = untag_ptr(e);
22869 CHECK_ACCESS(e_ptr);
22870 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22871 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22872 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
22873 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
22874 return tag_ptr(ret_conv, true);
22877 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22878 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(o);
22879 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv);
22883 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22884 if (!ptr_is_owned(_res)) return;
22885 void* _res_ptr = untag_ptr(_res);
22886 CHECK_ACCESS(_res_ptr);
22887 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
22888 FREE(untag_ptr(_res));
22889 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
22892 static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) {
22893 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
22894 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg);
22895 return tag_ptr(ret_conv, true);
22897 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22898 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(arg);
22899 int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv);
22903 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22904 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(orig);
22905 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
22906 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv);
22907 return tag_ptr(ret_conv, true);
22910 static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) {
22911 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
22912 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg);
22913 return tag_ptr(ret_conv, true);
22915 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22916 LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(arg);
22917 int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv);
22921 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22922 LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
22923 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
22924 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
22925 return tag_ptr(ret_conv, true);
22928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
22929 LDKPublicKey a_ref;
22930 CHECK((*env)->GetArrayLength(env, a) == 33);
22931 (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
22932 void* b_ptr = untag_ptr(b);
22933 CHECK_ACCESS(b_ptr);
22934 LDKType b_conv = *(LDKType*)(b_ptr);
22935 if (b_conv.free == LDKType_JCalls_free) {
22936 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22937 LDKType_JCalls_cloned(&b_conv);
22939 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
22940 *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
22941 return tag_ptr(ret_conv, true);
22944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22945 if (!ptr_is_owned(_res)) return;
22946 void* _res_ptr = untag_ptr(_res);
22947 CHECK_ACCESS(_res_ptr);
22948 LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
22949 FREE(untag_ptr(_res));
22950 C2Tuple_PublicKeyTypeZ_free(_res_conv);
22953 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22954 LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
22955 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22956 if (_res_constr.datalen > 0)
22957 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
22959 _res_constr.data = NULL;
22960 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22961 for (size_t z = 0; z < _res_constr.datalen; z++) {
22962 int64_t _res_conv_25 = _res_vals[z];
22963 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
22964 CHECK_ACCESS(_res_conv_25_ptr);
22965 LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
22966 FREE(untag_ptr(_res_conv_25));
22967 _res_constr.data[z] = _res_conv_25_conv;
22969 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22970 CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
22973 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1some(JNIEnv *env, jclass clz, int64_t o) {
22974 void* o_ptr = untag_ptr(o);
22975 CHECK_ACCESS(o_ptr);
22976 LDKCustomOnionMessageContents o_conv = *(LDKCustomOnionMessageContents*)(o_ptr);
22977 if (o_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
22978 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22979 LDKCustomOnionMessageContents_JCalls_cloned(&o_conv);
22981 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
22982 *ret_copy = COption_CustomOnionMessageContentsZ_some(o_conv);
22983 int64_t ret_ref = tag_ptr(ret_copy, true);
22987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none(JNIEnv *env, jclass clz) {
22988 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
22989 *ret_copy = COption_CustomOnionMessageContentsZ_none();
22990 int64_t ret_ref = tag_ptr(ret_copy, true);
22994 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22995 if (!ptr_is_owned(_res)) return;
22996 void* _res_ptr = untag_ptr(_res);
22997 CHECK_ACCESS(_res_ptr);
22998 LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr);
22999 FREE(untag_ptr(_res));
23000 COption_CustomOnionMessageContentsZ_free(_res_conv);
23003 static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) {
23004 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
23005 *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg);
23006 int64_t ret_ref = tag_ptr(ret_copy, true);
23009 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23010 LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg);
23011 int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv);
23015 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23016 LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig);
23017 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
23018 *ret_copy = COption_CustomOnionMessageContentsZ_clone(orig_conv);
23019 int64_t ret_ref = tag_ptr(ret_copy, true);
23023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23024 void* o_ptr = untag_ptr(o);
23025 CHECK_ACCESS(o_ptr);
23026 LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr);
23027 o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o));
23028 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
23029 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_conv);
23030 return tag_ptr(ret_conv, true);
23033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23034 void* e_ptr = untag_ptr(e);
23035 CHECK_ACCESS(e_ptr);
23036 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23037 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23038 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
23039 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_conv);
23040 return tag_ptr(ret_conv, true);
23043 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23044 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o);
23045 jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_conv);
23049 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23050 if (!ptr_is_owned(_res)) return;
23051 void* _res_ptr = untag_ptr(_res);
23052 CHECK_ACCESS(_res_ptr);
23053 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr);
23054 FREE(untag_ptr(_res));
23055 CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv);
23058 static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) {
23059 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
23060 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg);
23061 return tag_ptr(ret_conv, true);
23063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23064 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg);
23065 int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_conv);
23069 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23070 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig);
23071 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
23072 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_conv);
23073 return tag_ptr(ret_conv, true);
23076 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) {
23077 void* o_ptr = untag_ptr(o);
23078 CHECK_ACCESS(o_ptr);
23079 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
23080 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
23081 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
23082 *ret_copy = COption_NetAddressZ_some(o_conv);
23083 int64_t ret_ref = tag_ptr(ret_copy, true);
23087 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1none(JNIEnv *env, jclass clz) {
23088 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
23089 *ret_copy = COption_NetAddressZ_none();
23090 int64_t ret_ref = tag_ptr(ret_copy, true);
23094 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23095 if (!ptr_is_owned(_res)) return;
23096 void* _res_ptr = untag_ptr(_res);
23097 CHECK_ACCESS(_res_ptr);
23098 LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
23099 FREE(untag_ptr(_res));
23100 COption_NetAddressZ_free(_res_conv);
23103 static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
23104 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
23105 *ret_copy = COption_NetAddressZ_clone(arg);
23106 int64_t ret_ref = tag_ptr(ret_copy, true);
23109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23110 LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
23111 int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
23115 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23116 LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
23117 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
23118 *ret_copy = COption_NetAddressZ_clone(orig_conv);
23119 int64_t ret_ref = tag_ptr(ret_copy, true);
23123 static inline uint64_t C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR arg) {
23124 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
23125 *ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_clone(arg);
23126 return tag_ptr(ret_conv, true);
23128 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23129 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* arg_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(arg);
23130 int64_t ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr(arg_conv);
23134 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23135 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* orig_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(orig);
23136 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
23137 *ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_clone(orig_conv);
23138 return tag_ptr(ret_conv, true);
23141 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
23142 LDKPublicKey a_ref;
23143 CHECK((*env)->GetArrayLength(env, a) == 33);
23144 (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
23145 void* b_ptr = untag_ptr(b);
23146 CHECK_ACCESS(b_ptr);
23147 LDKCOption_NetAddressZ b_conv = *(LDKCOption_NetAddressZ*)(b_ptr);
23148 b_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(b));
23149 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
23150 *ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_new(a_ref, b_conv);
23151 return tag_ptr(ret_conv, true);
23154 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23155 if (!ptr_is_owned(_res)) return;
23156 void* _res_ptr = untag_ptr(_res);
23157 CHECK_ACCESS(_res_ptr);
23158 LDKC2Tuple_PublicKeyCOption_NetAddressZZ _res_conv = *(LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)(_res_ptr);
23159 FREE(untag_ptr(_res));
23160 C2Tuple_PublicKeyCOption_NetAddressZZ_free(_res_conv);
23163 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyCOption_1NetAddressZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23164 LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ _res_constr;
23165 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23166 if (_res_constr.datalen > 0)
23167 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ Elements");
23169 _res_constr.data = NULL;
23170 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23171 for (size_t o = 0; o < _res_constr.datalen; o++) {
23172 int64_t _res_conv_40 = _res_vals[o];
23173 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
23174 CHECK_ACCESS(_res_conv_40_ptr);
23175 LDKC2Tuple_PublicKeyCOption_NetAddressZZ _res_conv_40_conv = *(LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)(_res_conv_40_ptr);
23176 FREE(untag_ptr(_res_conv_40));
23177 _res_constr.data[o] = _res_conv_40_conv;
23179 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23180 CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free(_res_constr);
23183 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
23185 o_ref.datalen = (*env)->GetArrayLength(env, o);
23186 o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
23187 (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data);
23188 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
23189 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
23190 return tag_ptr(ret_conv, true);
23193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23194 LDKPeerHandleError e_conv;
23195 e_conv.inner = untag_ptr(e);
23196 e_conv.is_owned = ptr_is_owned(e);
23197 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
23198 e_conv = PeerHandleError_clone(&e_conv);
23199 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
23200 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
23201 return tag_ptr(ret_conv, true);
23204 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23205 LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
23206 jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
23210 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23211 if (!ptr_is_owned(_res)) return;
23212 void* _res_ptr = untag_ptr(_res);
23213 CHECK_ACCESS(_res_ptr);
23214 LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
23215 FREE(untag_ptr(_res));
23216 CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
23219 static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
23220 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
23221 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
23222 return tag_ptr(ret_conv, true);
23224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23225 LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
23226 int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
23230 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23231 LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
23232 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
23233 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
23234 return tag_ptr(ret_conv, true);
23237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv *env, jclass clz) {
23238 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
23239 *ret_conv = CResult_NonePeerHandleErrorZ_ok();
23240 return tag_ptr(ret_conv, true);
23243 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23244 LDKPeerHandleError e_conv;
23245 e_conv.inner = untag_ptr(e);
23246 e_conv.is_owned = ptr_is_owned(e);
23247 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
23248 e_conv = PeerHandleError_clone(&e_conv);
23249 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
23250 *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
23251 return tag_ptr(ret_conv, true);
23254 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23255 LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
23256 jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
23260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23261 if (!ptr_is_owned(_res)) return;
23262 void* _res_ptr = untag_ptr(_res);
23263 CHECK_ACCESS(_res_ptr);
23264 LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
23265 FREE(untag_ptr(_res));
23266 CResult_NonePeerHandleErrorZ_free(_res_conv);
23269 static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
23270 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
23271 *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
23272 return tag_ptr(ret_conv, true);
23274 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23275 LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
23276 int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
23280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23281 LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
23282 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
23283 *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
23284 return tag_ptr(ret_conv, true);
23287 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) {
23288 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
23289 *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
23290 return tag_ptr(ret_conv, true);
23293 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23294 LDKPeerHandleError e_conv;
23295 e_conv.inner = untag_ptr(e);
23296 e_conv.is_owned = ptr_is_owned(e);
23297 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
23298 e_conv = PeerHandleError_clone(&e_conv);
23299 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
23300 *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
23301 return tag_ptr(ret_conv, true);
23304 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23305 LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
23306 jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
23310 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23311 if (!ptr_is_owned(_res)) return;
23312 void* _res_ptr = untag_ptr(_res);
23313 CHECK_ACCESS(_res_ptr);
23314 LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
23315 FREE(untag_ptr(_res));
23316 CResult_boolPeerHandleErrorZ_free(_res_conv);
23319 static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
23320 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
23321 *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
23322 return tag_ptr(ret_conv, true);
23324 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23325 LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
23326 int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
23330 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23331 LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
23332 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
23333 *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
23334 return tag_ptr(ret_conv, true);
23337 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23338 void* o_ptr = untag_ptr(o);
23339 CHECK_ACCESS(o_ptr);
23340 LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
23341 o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
23342 LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
23343 *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv);
23344 return tag_ptr(ret_conv, true);
23347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
23348 LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_java(env, e);
23349 LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
23350 *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv);
23351 return tag_ptr(ret_conv, true);
23354 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23355 LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o);
23356 jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv);
23360 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23361 if (!ptr_is_owned(_res)) return;
23362 void* _res_ptr = untag_ptr(_res);
23363 CHECK_ACCESS(_res_ptr);
23364 LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr);
23365 FREE(untag_ptr(_res));
23366 CResult_TxOutUtxoLookupErrorZ_free(_res_conv);
23369 static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) {
23370 LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
23371 *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg);
23372 return tag_ptr(ret_conv, true);
23374 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23375 LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg);
23376 int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv);
23380 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23381 LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig);
23382 LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
23383 *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv);
23384 return tag_ptr(ret_conv, true);
23387 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok(JNIEnv *env, jclass clz) {
23388 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
23389 *ret_conv = CResult_NoneSendErrorZ_ok();
23390 return tag_ptr(ret_conv, true);
23393 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23394 void* e_ptr = untag_ptr(e);
23395 CHECK_ACCESS(e_ptr);
23396 LDKSendError e_conv = *(LDKSendError*)(e_ptr);
23397 e_conv = SendError_clone((LDKSendError*)untag_ptr(e));
23398 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
23399 *ret_conv = CResult_NoneSendErrorZ_err(e_conv);
23400 return tag_ptr(ret_conv, true);
23403 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23404 LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o);
23405 jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv);
23409 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23410 if (!ptr_is_owned(_res)) return;
23411 void* _res_ptr = untag_ptr(_res);
23412 CHECK_ACCESS(_res_ptr);
23413 LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr);
23414 FREE(untag_ptr(_res));
23415 CResult_NoneSendErrorZ_free(_res_conv);
23418 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) {
23419 LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o);
23420 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
23421 *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
23422 return tag_ptr(ret_conv, true);
23425 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23426 void* e_ptr = untag_ptr(e);
23427 CHECK_ACCESS(e_ptr);
23428 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
23429 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
23430 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
23431 *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
23432 return tag_ptr(ret_conv, true);
23435 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23436 LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
23437 jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
23441 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23442 if (!ptr_is_owned(_res)) return;
23443 void* _res_ptr = untag_ptr(_res);
23444 CHECK_ACCESS(_res_ptr);
23445 LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
23446 FREE(untag_ptr(_res));
23447 CResult_SiPrefixParseErrorZ_free(_res_conv);
23450 static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
23451 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
23452 *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
23453 return tag_ptr(ret_conv, true);
23455 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23456 LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
23457 int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
23461 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23462 LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
23463 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
23464 *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
23465 return tag_ptr(ret_conv, true);
23468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23470 o_conv.inner = untag_ptr(o);
23471 o_conv.is_owned = ptr_is_owned(o);
23472 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23473 o_conv = Invoice_clone(&o_conv);
23474 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
23475 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
23476 return tag_ptr(ret_conv, true);
23479 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23480 void* e_ptr = untag_ptr(e);
23481 CHECK_ACCESS(e_ptr);
23482 LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
23483 e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
23484 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
23485 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
23486 return tag_ptr(ret_conv, true);
23489 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23490 LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
23491 jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
23495 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23496 if (!ptr_is_owned(_res)) return;
23497 void* _res_ptr = untag_ptr(_res);
23498 CHECK_ACCESS(_res_ptr);
23499 LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
23500 FREE(untag_ptr(_res));
23501 CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
23504 static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
23505 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
23506 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
23507 return tag_ptr(ret_conv, true);
23509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23510 LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
23511 int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
23515 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23516 LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
23517 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
23518 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
23519 return tag_ptr(ret_conv, true);
23522 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23523 LDKSignedRawInvoice o_conv;
23524 o_conv.inner = untag_ptr(o);
23525 o_conv.is_owned = ptr_is_owned(o);
23526 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23527 o_conv = SignedRawInvoice_clone(&o_conv);
23528 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
23529 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
23530 return tag_ptr(ret_conv, true);
23533 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23534 void* e_ptr = untag_ptr(e);
23535 CHECK_ACCESS(e_ptr);
23536 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
23537 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
23538 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
23539 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
23540 return tag_ptr(ret_conv, true);
23543 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23544 LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
23545 jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
23549 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23550 if (!ptr_is_owned(_res)) return;
23551 void* _res_ptr = untag_ptr(_res);
23552 CHECK_ACCESS(_res_ptr);
23553 LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
23554 FREE(untag_ptr(_res));
23555 CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
23558 static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
23559 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
23560 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
23561 return tag_ptr(ret_conv, true);
23563 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23564 LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
23565 int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
23569 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23570 LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
23571 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
23572 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
23573 return tag_ptr(ret_conv, true);
23576 static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
23577 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
23578 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
23579 return tag_ptr(ret_conv, true);
23581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23582 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
23583 int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
23587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23588 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
23589 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
23590 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
23591 return tag_ptr(ret_conv, true);
23594 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) {
23595 LDKRawInvoice a_conv;
23596 a_conv.inner = untag_ptr(a);
23597 a_conv.is_owned = ptr_is_owned(a);
23598 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23599 a_conv = RawInvoice_clone(&a_conv);
23600 LDKThirtyTwoBytes b_ref;
23601 CHECK((*env)->GetArrayLength(env, b) == 32);
23602 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
23603 LDKInvoiceSignature c_conv;
23604 c_conv.inner = untag_ptr(c);
23605 c_conv.is_owned = ptr_is_owned(c);
23606 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
23607 c_conv = InvoiceSignature_clone(&c_conv);
23608 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
23609 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
23610 return tag_ptr(ret_conv, true);
23613 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23614 if (!ptr_is_owned(_res)) return;
23615 void* _res_ptr = untag_ptr(_res);
23616 CHECK_ACCESS(_res_ptr);
23617 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
23618 FREE(untag_ptr(_res));
23619 C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
23622 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23623 LDKPayeePubKey o_conv;
23624 o_conv.inner = untag_ptr(o);
23625 o_conv.is_owned = ptr_is_owned(o);
23626 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23627 o_conv = PayeePubKey_clone(&o_conv);
23628 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
23629 *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
23630 return tag_ptr(ret_conv, true);
23633 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
23634 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
23635 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
23636 *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
23637 return tag_ptr(ret_conv, true);
23640 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23641 LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
23642 jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
23646 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23647 if (!ptr_is_owned(_res)) return;
23648 void* _res_ptr = untag_ptr(_res);
23649 CHECK_ACCESS(_res_ptr);
23650 LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
23651 FREE(untag_ptr(_res));
23652 CResult_PayeePubKeyErrorZ_free(_res_conv);
23655 static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
23656 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
23657 *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
23658 return tag_ptr(ret_conv, true);
23660 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23661 LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
23662 int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
23666 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23667 LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
23668 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
23669 *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
23670 return tag_ptr(ret_conv, true);
23673 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23674 LDKCVec_PrivateRouteZ _res_constr;
23675 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23676 if (_res_constr.datalen > 0)
23677 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
23679 _res_constr.data = NULL;
23680 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23681 for (size_t o = 0; o < _res_constr.datalen; o++) {
23682 int64_t _res_conv_14 = _res_vals[o];
23683 LDKPrivateRoute _res_conv_14_conv;
23684 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
23685 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
23686 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
23687 _res_constr.data[o] = _res_conv_14_conv;
23689 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23690 CVec_PrivateRouteZ_free(_res_constr);
23693 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23694 LDKPositiveTimestamp o_conv;
23695 o_conv.inner = untag_ptr(o);
23696 o_conv.is_owned = ptr_is_owned(o);
23697 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23698 o_conv = PositiveTimestamp_clone(&o_conv);
23699 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
23700 *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
23701 return tag_ptr(ret_conv, true);
23704 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
23705 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
23706 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
23707 *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
23708 return tag_ptr(ret_conv, true);
23711 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23712 LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
23713 jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
23717 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23718 if (!ptr_is_owned(_res)) return;
23719 void* _res_ptr = untag_ptr(_res);
23720 CHECK_ACCESS(_res_ptr);
23721 LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
23722 FREE(untag_ptr(_res));
23723 CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
23726 static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
23727 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
23728 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
23729 return tag_ptr(ret_conv, true);
23731 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23732 LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
23733 int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
23737 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23738 LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
23739 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
23740 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
23741 return tag_ptr(ret_conv, true);
23744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok(JNIEnv *env, jclass clz) {
23745 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
23746 *ret_conv = CResult_NoneSemanticErrorZ_ok();
23747 return tag_ptr(ret_conv, true);
23750 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
23751 LDKSemanticError e_conv = LDKSemanticError_from_java(env, e);
23752 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
23753 *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
23754 return tag_ptr(ret_conv, true);
23757 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23758 LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
23759 jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
23763 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23764 if (!ptr_is_owned(_res)) return;
23765 void* _res_ptr = untag_ptr(_res);
23766 CHECK_ACCESS(_res_ptr);
23767 LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
23768 FREE(untag_ptr(_res));
23769 CResult_NoneSemanticErrorZ_free(_res_conv);
23772 static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
23773 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
23774 *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
23775 return tag_ptr(ret_conv, true);
23777 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23778 LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
23779 int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
23783 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23784 LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
23785 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
23786 *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
23787 return tag_ptr(ret_conv, true);
23790 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23792 o_conv.inner = untag_ptr(o);
23793 o_conv.is_owned = ptr_is_owned(o);
23794 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23795 o_conv = Invoice_clone(&o_conv);
23796 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
23797 *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
23798 return tag_ptr(ret_conv, true);
23801 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
23802 LDKSemanticError e_conv = LDKSemanticError_from_java(env, e);
23803 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
23804 *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
23805 return tag_ptr(ret_conv, true);
23808 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23809 LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
23810 jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
23814 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23815 if (!ptr_is_owned(_res)) return;
23816 void* _res_ptr = untag_ptr(_res);
23817 CHECK_ACCESS(_res_ptr);
23818 LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
23819 FREE(untag_ptr(_res));
23820 CResult_InvoiceSemanticErrorZ_free(_res_conv);
23823 static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
23824 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
23825 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
23826 return tag_ptr(ret_conv, true);
23828 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23829 LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
23830 int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
23834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23835 LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
23836 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
23837 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
23838 return tag_ptr(ret_conv, true);
23841 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23842 LDKDescription o_conv;
23843 o_conv.inner = untag_ptr(o);
23844 o_conv.is_owned = ptr_is_owned(o);
23845 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23846 o_conv = Description_clone(&o_conv);
23847 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
23848 *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
23849 return tag_ptr(ret_conv, true);
23852 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
23853 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
23854 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
23855 *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
23856 return tag_ptr(ret_conv, true);
23859 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23860 LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
23861 jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
23865 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23866 if (!ptr_is_owned(_res)) return;
23867 void* _res_ptr = untag_ptr(_res);
23868 CHECK_ACCESS(_res_ptr);
23869 LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
23870 FREE(untag_ptr(_res));
23871 CResult_DescriptionCreationErrorZ_free(_res_conv);
23874 static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
23875 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
23876 *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
23877 return tag_ptr(ret_conv, true);
23879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23880 LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
23881 int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
23885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23886 LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
23887 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
23888 *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
23889 return tag_ptr(ret_conv, true);
23892 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23893 LDKPrivateRoute o_conv;
23894 o_conv.inner = untag_ptr(o);
23895 o_conv.is_owned = ptr_is_owned(o);
23896 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23897 o_conv = PrivateRoute_clone(&o_conv);
23898 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
23899 *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
23900 return tag_ptr(ret_conv, true);
23903 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
23904 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
23905 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
23906 *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
23907 return tag_ptr(ret_conv, true);
23910 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23911 LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
23912 jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
23916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23917 if (!ptr_is_owned(_res)) return;
23918 void* _res_ptr = untag_ptr(_res);
23919 CHECK_ACCESS(_res_ptr);
23920 LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
23921 FREE(untag_ptr(_res));
23922 CResult_PrivateRouteCreationErrorZ_free(_res_conv);
23925 static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
23926 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
23927 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
23928 return tag_ptr(ret_conv, true);
23930 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23931 LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
23932 int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
23936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23937 LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
23938 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
23939 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
23940 return tag_ptr(ret_conv, true);
23943 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1ok(JNIEnv *env, jclass clz, int32_t o) {
23944 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
23945 *ret_conv = CResult_u32GraphSyncErrorZ_ok(o);
23946 return tag_ptr(ret_conv, true);
23949 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23950 void* e_ptr = untag_ptr(e);
23951 CHECK_ACCESS(e_ptr);
23952 LDKGraphSyncError e_conv = *(LDKGraphSyncError*)(e_ptr);
23953 e_conv = GraphSyncError_clone((LDKGraphSyncError*)untag_ptr(e));
23954 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
23955 *ret_conv = CResult_u32GraphSyncErrorZ_err(e_conv);
23956 return tag_ptr(ret_conv, true);
23959 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23960 LDKCResult_u32GraphSyncErrorZ* o_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(o);
23961 jboolean ret_conv = CResult_u32GraphSyncErrorZ_is_ok(o_conv);
23965 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23966 if (!ptr_is_owned(_res)) return;
23967 void* _res_ptr = untag_ptr(_res);
23968 CHECK_ACCESS(_res_ptr);
23969 LDKCResult_u32GraphSyncErrorZ _res_conv = *(LDKCResult_u32GraphSyncErrorZ*)(_res_ptr);
23970 FREE(untag_ptr(_res));
23971 CResult_u32GraphSyncErrorZ_free(_res_conv);
23974 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23975 void* o_ptr = untag_ptr(o);
23976 CHECK_ACCESS(o_ptr);
23977 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
23978 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
23979 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
23980 *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
23981 return tag_ptr(ret_conv, true);
23984 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23985 void* e_ptr = untag_ptr(e);
23986 CHECK_ACCESS(e_ptr);
23987 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23988 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23989 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
23990 *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
23991 return tag_ptr(ret_conv, true);
23994 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23995 LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o);
23996 jboolean ret_conv = CResult_NetAddressDecodeErrorZ_is_ok(o_conv);
24000 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24001 if (!ptr_is_owned(_res)) return;
24002 void* _res_ptr = untag_ptr(_res);
24003 CHECK_ACCESS(_res_ptr);
24004 LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
24005 FREE(untag_ptr(_res));
24006 CResult_NetAddressDecodeErrorZ_free(_res_conv);
24009 static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) {
24010 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
24011 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg);
24012 return tag_ptr(ret_conv, true);
24014 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24015 LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg);
24016 int64_t ret_conv = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv);
24020 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24021 LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig);
24022 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
24023 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
24024 return tag_ptr(ret_conv, true);
24027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
24028 LDKCVec_UpdateAddHTLCZ _res_constr;
24029 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24030 if (_res_constr.datalen > 0)
24031 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
24033 _res_constr.data = NULL;
24034 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
24035 for (size_t p = 0; p < _res_constr.datalen; p++) {
24036 int64_t _res_conv_15 = _res_vals[p];
24037 LDKUpdateAddHTLC _res_conv_15_conv;
24038 _res_conv_15_conv.inner = untag_ptr(_res_conv_15);
24039 _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15);
24040 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
24041 _res_constr.data[p] = _res_conv_15_conv;
24043 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
24044 CVec_UpdateAddHTLCZ_free(_res_constr);
24047 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
24048 LDKCVec_UpdateFulfillHTLCZ _res_constr;
24049 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24050 if (_res_constr.datalen > 0)
24051 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
24053 _res_constr.data = NULL;
24054 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
24055 for (size_t t = 0; t < _res_constr.datalen; t++) {
24056 int64_t _res_conv_19 = _res_vals[t];
24057 LDKUpdateFulfillHTLC _res_conv_19_conv;
24058 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
24059 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
24060 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
24061 _res_constr.data[t] = _res_conv_19_conv;
24063 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
24064 CVec_UpdateFulfillHTLCZ_free(_res_constr);
24067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
24068 LDKCVec_UpdateFailHTLCZ _res_constr;
24069 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24070 if (_res_constr.datalen > 0)
24071 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
24073 _res_constr.data = NULL;
24074 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
24075 for (size_t q = 0; q < _res_constr.datalen; q++) {
24076 int64_t _res_conv_16 = _res_vals[q];
24077 LDKUpdateFailHTLC _res_conv_16_conv;
24078 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
24079 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
24080 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
24081 _res_constr.data[q] = _res_conv_16_conv;
24083 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
24084 CVec_UpdateFailHTLCZ_free(_res_constr);
24087 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
24088 LDKCVec_UpdateFailMalformedHTLCZ _res_constr;
24089 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24090 if (_res_constr.datalen > 0)
24091 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
24093 _res_constr.data = NULL;
24094 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
24095 for (size_t z = 0; z < _res_constr.datalen; z++) {
24096 int64_t _res_conv_25 = _res_vals[z];
24097 LDKUpdateFailMalformedHTLC _res_conv_25_conv;
24098 _res_conv_25_conv.inner = untag_ptr(_res_conv_25);
24099 _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25);
24100 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
24101 _res_constr.data[z] = _res_conv_25_conv;
24103 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
24104 CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
24107 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24108 LDKAcceptChannel o_conv;
24109 o_conv.inner = untag_ptr(o);
24110 o_conv.is_owned = ptr_is_owned(o);
24111 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24112 o_conv = AcceptChannel_clone(&o_conv);
24113 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
24114 *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv);
24115 return tag_ptr(ret_conv, true);
24118 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24119 void* e_ptr = untag_ptr(e);
24120 CHECK_ACCESS(e_ptr);
24121 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24122 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24123 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
24124 *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
24125 return tag_ptr(ret_conv, true);
24128 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24129 LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o);
24130 jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv);
24134 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24135 if (!ptr_is_owned(_res)) return;
24136 void* _res_ptr = untag_ptr(_res);
24137 CHECK_ACCESS(_res_ptr);
24138 LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
24139 FREE(untag_ptr(_res));
24140 CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
24143 static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) {
24144 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
24145 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg);
24146 return tag_ptr(ret_conv, true);
24148 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24149 LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg);
24150 int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv);
24154 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24155 LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig);
24156 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
24157 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv);
24158 return tag_ptr(ret_conv, true);
24161 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24162 LDKAnnouncementSignatures o_conv;
24163 o_conv.inner = untag_ptr(o);
24164 o_conv.is_owned = ptr_is_owned(o);
24165 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24166 o_conv = AnnouncementSignatures_clone(&o_conv);
24167 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
24168 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv);
24169 return tag_ptr(ret_conv, true);
24172 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24173 void* e_ptr = untag_ptr(e);
24174 CHECK_ACCESS(e_ptr);
24175 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24176 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24177 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
24178 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
24179 return tag_ptr(ret_conv, true);
24182 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24183 LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o);
24184 jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv);
24188 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24189 if (!ptr_is_owned(_res)) return;
24190 void* _res_ptr = untag_ptr(_res);
24191 CHECK_ACCESS(_res_ptr);
24192 LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
24193 FREE(untag_ptr(_res));
24194 CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
24197 static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) {
24198 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
24199 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg);
24200 return tag_ptr(ret_conv, true);
24202 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24203 LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg);
24204 int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv);
24208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24209 LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig);
24210 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
24211 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv);
24212 return tag_ptr(ret_conv, true);
24215 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24216 LDKChannelReestablish o_conv;
24217 o_conv.inner = untag_ptr(o);
24218 o_conv.is_owned = ptr_is_owned(o);
24219 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24220 o_conv = ChannelReestablish_clone(&o_conv);
24221 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
24222 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv);
24223 return tag_ptr(ret_conv, true);
24226 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24227 void* e_ptr = untag_ptr(e);
24228 CHECK_ACCESS(e_ptr);
24229 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24230 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24231 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
24232 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
24233 return tag_ptr(ret_conv, true);
24236 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24237 LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o);
24238 jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv);
24242 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24243 if (!ptr_is_owned(_res)) return;
24244 void* _res_ptr = untag_ptr(_res);
24245 CHECK_ACCESS(_res_ptr);
24246 LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
24247 FREE(untag_ptr(_res));
24248 CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
24251 static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) {
24252 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
24253 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg);
24254 return tag_ptr(ret_conv, true);
24256 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24257 LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg);
24258 int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv);
24262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24263 LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig);
24264 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
24265 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv);
24266 return tag_ptr(ret_conv, true);
24269 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24270 LDKClosingSigned o_conv;
24271 o_conv.inner = untag_ptr(o);
24272 o_conv.is_owned = ptr_is_owned(o);
24273 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24274 o_conv = ClosingSigned_clone(&o_conv);
24275 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
24276 *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv);
24277 return tag_ptr(ret_conv, true);
24280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24281 void* e_ptr = untag_ptr(e);
24282 CHECK_ACCESS(e_ptr);
24283 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24284 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24285 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
24286 *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
24287 return tag_ptr(ret_conv, true);
24290 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24291 LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o);
24292 jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv);
24296 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24297 if (!ptr_is_owned(_res)) return;
24298 void* _res_ptr = untag_ptr(_res);
24299 CHECK_ACCESS(_res_ptr);
24300 LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
24301 FREE(untag_ptr(_res));
24302 CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
24305 static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) {
24306 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
24307 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg);
24308 return tag_ptr(ret_conv, true);
24310 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24311 LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg);
24312 int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv);
24316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24317 LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig);
24318 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
24319 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv);
24320 return tag_ptr(ret_conv, true);
24323 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24324 LDKClosingSignedFeeRange o_conv;
24325 o_conv.inner = untag_ptr(o);
24326 o_conv.is_owned = ptr_is_owned(o);
24327 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24328 o_conv = ClosingSignedFeeRange_clone(&o_conv);
24329 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
24330 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv);
24331 return tag_ptr(ret_conv, true);
24334 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24335 void* e_ptr = untag_ptr(e);
24336 CHECK_ACCESS(e_ptr);
24337 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24338 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24339 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
24340 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
24341 return tag_ptr(ret_conv, true);
24344 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24345 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o);
24346 jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv);
24350 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24351 if (!ptr_is_owned(_res)) return;
24352 void* _res_ptr = untag_ptr(_res);
24353 CHECK_ACCESS(_res_ptr);
24354 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
24355 FREE(untag_ptr(_res));
24356 CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
24359 static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) {
24360 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
24361 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg);
24362 return tag_ptr(ret_conv, true);
24364 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24365 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg);
24366 int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv);
24370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24371 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig);
24372 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
24373 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv);
24374 return tag_ptr(ret_conv, true);
24377 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24378 LDKCommitmentSigned o_conv;
24379 o_conv.inner = untag_ptr(o);
24380 o_conv.is_owned = ptr_is_owned(o);
24381 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24382 o_conv = CommitmentSigned_clone(&o_conv);
24383 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
24384 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv);
24385 return tag_ptr(ret_conv, true);
24388 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24389 void* e_ptr = untag_ptr(e);
24390 CHECK_ACCESS(e_ptr);
24391 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24392 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24393 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
24394 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
24395 return tag_ptr(ret_conv, true);
24398 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24399 LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o);
24400 jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv);
24404 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24405 if (!ptr_is_owned(_res)) return;
24406 void* _res_ptr = untag_ptr(_res);
24407 CHECK_ACCESS(_res_ptr);
24408 LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
24409 FREE(untag_ptr(_res));
24410 CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
24413 static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) {
24414 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
24415 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg);
24416 return tag_ptr(ret_conv, true);
24418 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24419 LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg);
24420 int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv);
24424 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24425 LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig);
24426 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
24427 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv);
24428 return tag_ptr(ret_conv, true);
24431 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24432 LDKFundingCreated o_conv;
24433 o_conv.inner = untag_ptr(o);
24434 o_conv.is_owned = ptr_is_owned(o);
24435 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24436 o_conv = FundingCreated_clone(&o_conv);
24437 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
24438 *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv);
24439 return tag_ptr(ret_conv, true);
24442 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24443 void* e_ptr = untag_ptr(e);
24444 CHECK_ACCESS(e_ptr);
24445 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24446 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24447 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
24448 *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
24449 return tag_ptr(ret_conv, true);
24452 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24453 LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o);
24454 jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv);
24458 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24459 if (!ptr_is_owned(_res)) return;
24460 void* _res_ptr = untag_ptr(_res);
24461 CHECK_ACCESS(_res_ptr);
24462 LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
24463 FREE(untag_ptr(_res));
24464 CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
24467 static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) {
24468 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
24469 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg);
24470 return tag_ptr(ret_conv, true);
24472 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24473 LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg);
24474 int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv);
24478 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24479 LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig);
24480 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
24481 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv);
24482 return tag_ptr(ret_conv, true);
24485 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24486 LDKFundingSigned o_conv;
24487 o_conv.inner = untag_ptr(o);
24488 o_conv.is_owned = ptr_is_owned(o);
24489 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24490 o_conv = FundingSigned_clone(&o_conv);
24491 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
24492 *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv);
24493 return tag_ptr(ret_conv, true);
24496 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24497 void* e_ptr = untag_ptr(e);
24498 CHECK_ACCESS(e_ptr);
24499 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24500 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24501 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
24502 *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
24503 return tag_ptr(ret_conv, true);
24506 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24507 LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o);
24508 jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv);
24512 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24513 if (!ptr_is_owned(_res)) return;
24514 void* _res_ptr = untag_ptr(_res);
24515 CHECK_ACCESS(_res_ptr);
24516 LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
24517 FREE(untag_ptr(_res));
24518 CResult_FundingSignedDecodeErrorZ_free(_res_conv);
24521 static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) {
24522 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
24523 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg);
24524 return tag_ptr(ret_conv, true);
24526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24527 LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg);
24528 int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv);
24532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24533 LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig);
24534 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
24535 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv);
24536 return tag_ptr(ret_conv, true);
24539 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24540 LDKChannelReady o_conv;
24541 o_conv.inner = untag_ptr(o);
24542 o_conv.is_owned = ptr_is_owned(o);
24543 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24544 o_conv = ChannelReady_clone(&o_conv);
24545 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
24546 *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv);
24547 return tag_ptr(ret_conv, true);
24550 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24551 void* e_ptr = untag_ptr(e);
24552 CHECK_ACCESS(e_ptr);
24553 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24554 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24555 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
24556 *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
24557 return tag_ptr(ret_conv, true);
24560 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24561 LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o);
24562 jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv);
24566 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24567 if (!ptr_is_owned(_res)) return;
24568 void* _res_ptr = untag_ptr(_res);
24569 CHECK_ACCESS(_res_ptr);
24570 LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr);
24571 FREE(untag_ptr(_res));
24572 CResult_ChannelReadyDecodeErrorZ_free(_res_conv);
24575 static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) {
24576 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
24577 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg);
24578 return tag_ptr(ret_conv, true);
24580 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24581 LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg);
24582 int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv);
24586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24587 LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig);
24588 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
24589 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv);
24590 return tag_ptr(ret_conv, true);
24593 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24595 o_conv.inner = untag_ptr(o);
24596 o_conv.is_owned = ptr_is_owned(o);
24597 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24598 o_conv = Init_clone(&o_conv);
24599 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
24600 *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv);
24601 return tag_ptr(ret_conv, true);
24604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24605 void* e_ptr = untag_ptr(e);
24606 CHECK_ACCESS(e_ptr);
24607 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24608 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24609 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
24610 *ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
24611 return tag_ptr(ret_conv, true);
24614 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24615 LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o);
24616 jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv);
24620 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24621 if (!ptr_is_owned(_res)) return;
24622 void* _res_ptr = untag_ptr(_res);
24623 CHECK_ACCESS(_res_ptr);
24624 LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
24625 FREE(untag_ptr(_res));
24626 CResult_InitDecodeErrorZ_free(_res_conv);
24629 static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) {
24630 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
24631 *ret_conv = CResult_InitDecodeErrorZ_clone(arg);
24632 return tag_ptr(ret_conv, true);
24634 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24635 LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg);
24636 int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv);
24640 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24641 LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig);
24642 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
24643 *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv);
24644 return tag_ptr(ret_conv, true);
24647 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24648 LDKOpenChannel o_conv;
24649 o_conv.inner = untag_ptr(o);
24650 o_conv.is_owned = ptr_is_owned(o);
24651 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24652 o_conv = OpenChannel_clone(&o_conv);
24653 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
24654 *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv);
24655 return tag_ptr(ret_conv, true);
24658 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24659 void* e_ptr = untag_ptr(e);
24660 CHECK_ACCESS(e_ptr);
24661 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24662 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24663 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
24664 *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
24665 return tag_ptr(ret_conv, true);
24668 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24669 LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o);
24670 jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv);
24674 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24675 if (!ptr_is_owned(_res)) return;
24676 void* _res_ptr = untag_ptr(_res);
24677 CHECK_ACCESS(_res_ptr);
24678 LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
24679 FREE(untag_ptr(_res));
24680 CResult_OpenChannelDecodeErrorZ_free(_res_conv);
24683 static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) {
24684 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
24685 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg);
24686 return tag_ptr(ret_conv, true);
24688 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24689 LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg);
24690 int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv);
24694 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24695 LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig);
24696 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
24697 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv);
24698 return tag_ptr(ret_conv, true);
24701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24702 LDKRevokeAndACK o_conv;
24703 o_conv.inner = untag_ptr(o);
24704 o_conv.is_owned = ptr_is_owned(o);
24705 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24706 o_conv = RevokeAndACK_clone(&o_conv);
24707 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
24708 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv);
24709 return tag_ptr(ret_conv, true);
24712 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24713 void* e_ptr = untag_ptr(e);
24714 CHECK_ACCESS(e_ptr);
24715 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24716 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24717 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
24718 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
24719 return tag_ptr(ret_conv, true);
24722 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24723 LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o);
24724 jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv);
24728 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24729 if (!ptr_is_owned(_res)) return;
24730 void* _res_ptr = untag_ptr(_res);
24731 CHECK_ACCESS(_res_ptr);
24732 LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
24733 FREE(untag_ptr(_res));
24734 CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
24737 static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) {
24738 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
24739 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg);
24740 return tag_ptr(ret_conv, true);
24742 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24743 LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg);
24744 int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv);
24748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24749 LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig);
24750 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
24751 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv);
24752 return tag_ptr(ret_conv, true);
24755 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24756 LDKShutdown o_conv;
24757 o_conv.inner = untag_ptr(o);
24758 o_conv.is_owned = ptr_is_owned(o);
24759 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24760 o_conv = Shutdown_clone(&o_conv);
24761 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
24762 *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv);
24763 return tag_ptr(ret_conv, true);
24766 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24767 void* e_ptr = untag_ptr(e);
24768 CHECK_ACCESS(e_ptr);
24769 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24770 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24771 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
24772 *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
24773 return tag_ptr(ret_conv, true);
24776 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24777 LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o);
24778 jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv);
24782 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24783 if (!ptr_is_owned(_res)) return;
24784 void* _res_ptr = untag_ptr(_res);
24785 CHECK_ACCESS(_res_ptr);
24786 LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
24787 FREE(untag_ptr(_res));
24788 CResult_ShutdownDecodeErrorZ_free(_res_conv);
24791 static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) {
24792 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
24793 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg);
24794 return tag_ptr(ret_conv, true);
24796 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24797 LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg);
24798 int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv);
24802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24803 LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig);
24804 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
24805 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv);
24806 return tag_ptr(ret_conv, true);
24809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24810 LDKUpdateFailHTLC o_conv;
24811 o_conv.inner = untag_ptr(o);
24812 o_conv.is_owned = ptr_is_owned(o);
24813 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24814 o_conv = UpdateFailHTLC_clone(&o_conv);
24815 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
24816 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv);
24817 return tag_ptr(ret_conv, true);
24820 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24821 void* e_ptr = untag_ptr(e);
24822 CHECK_ACCESS(e_ptr);
24823 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24824 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24825 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
24826 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
24827 return tag_ptr(ret_conv, true);
24830 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24831 LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(o);
24832 jboolean ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv);
24836 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24837 if (!ptr_is_owned(_res)) return;
24838 void* _res_ptr = untag_ptr(_res);
24839 CHECK_ACCESS(_res_ptr);
24840 LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
24841 FREE(untag_ptr(_res));
24842 CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
24845 static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) {
24846 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
24847 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg);
24848 return tag_ptr(ret_conv, true);
24850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24851 LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(arg);
24852 int64_t ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv);
24856 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24857 LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(orig);
24858 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
24859 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv);
24860 return tag_ptr(ret_conv, true);
24863 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24864 LDKUpdateFailMalformedHTLC o_conv;
24865 o_conv.inner = untag_ptr(o);
24866 o_conv.is_owned = ptr_is_owned(o);
24867 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24868 o_conv = UpdateFailMalformedHTLC_clone(&o_conv);
24869 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
24870 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv);
24871 return tag_ptr(ret_conv, true);
24874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24875 void* e_ptr = untag_ptr(e);
24876 CHECK_ACCESS(e_ptr);
24877 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24878 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24879 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
24880 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
24881 return tag_ptr(ret_conv, true);
24884 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24885 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(o);
24886 jboolean ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv);
24890 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24891 if (!ptr_is_owned(_res)) return;
24892 void* _res_ptr = untag_ptr(_res);
24893 CHECK_ACCESS(_res_ptr);
24894 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
24895 FREE(untag_ptr(_res));
24896 CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
24899 static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) {
24900 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
24901 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg);
24902 return tag_ptr(ret_conv, true);
24904 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24905 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(arg);
24906 int64_t ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv);
24910 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24911 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(orig);
24912 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
24913 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv);
24914 return tag_ptr(ret_conv, true);
24917 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24918 LDKUpdateFee o_conv;
24919 o_conv.inner = untag_ptr(o);
24920 o_conv.is_owned = ptr_is_owned(o);
24921 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24922 o_conv = UpdateFee_clone(&o_conv);
24923 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
24924 *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv);
24925 return tag_ptr(ret_conv, true);
24928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24929 void* e_ptr = untag_ptr(e);
24930 CHECK_ACCESS(e_ptr);
24931 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24932 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24933 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
24934 *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
24935 return tag_ptr(ret_conv, true);
24938 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24939 LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(o);
24940 jboolean ret_conv = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv);
24944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24945 if (!ptr_is_owned(_res)) return;
24946 void* _res_ptr = untag_ptr(_res);
24947 CHECK_ACCESS(_res_ptr);
24948 LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
24949 FREE(untag_ptr(_res));
24950 CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
24953 static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) {
24954 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
24955 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg);
24956 return tag_ptr(ret_conv, true);
24958 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24959 LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(arg);
24960 int64_t ret_conv = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv);
24964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24965 LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(orig);
24966 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
24967 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv);
24968 return tag_ptr(ret_conv, true);
24971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24972 LDKUpdateFulfillHTLC o_conv;
24973 o_conv.inner = untag_ptr(o);
24974 o_conv.is_owned = ptr_is_owned(o);
24975 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24976 o_conv = UpdateFulfillHTLC_clone(&o_conv);
24977 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
24978 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv);
24979 return tag_ptr(ret_conv, true);
24982 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24983 void* e_ptr = untag_ptr(e);
24984 CHECK_ACCESS(e_ptr);
24985 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24986 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24987 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
24988 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
24989 return tag_ptr(ret_conv, true);
24992 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24993 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(o);
24994 jboolean ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv);
24998 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24999 if (!ptr_is_owned(_res)) return;
25000 void* _res_ptr = untag_ptr(_res);
25001 CHECK_ACCESS(_res_ptr);
25002 LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
25003 FREE(untag_ptr(_res));
25004 CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
25007 static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) {
25008 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
25009 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg);
25010 return tag_ptr(ret_conv, true);
25012 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25013 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(arg);
25014 int64_t ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv);
25018 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25019 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(orig);
25020 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
25021 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv);
25022 return tag_ptr(ret_conv, true);
25025 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25026 LDKUpdateAddHTLC o_conv;
25027 o_conv.inner = untag_ptr(o);
25028 o_conv.is_owned = ptr_is_owned(o);
25029 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25030 o_conv = UpdateAddHTLC_clone(&o_conv);
25031 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
25032 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv);
25033 return tag_ptr(ret_conv, true);
25036 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25037 void* e_ptr = untag_ptr(e);
25038 CHECK_ACCESS(e_ptr);
25039 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25040 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25041 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
25042 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
25043 return tag_ptr(ret_conv, true);
25046 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25047 LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(o);
25048 jboolean ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv);
25052 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25053 if (!ptr_is_owned(_res)) return;
25054 void* _res_ptr = untag_ptr(_res);
25055 CHECK_ACCESS(_res_ptr);
25056 LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
25057 FREE(untag_ptr(_res));
25058 CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
25061 static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) {
25062 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
25063 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg);
25064 return tag_ptr(ret_conv, true);
25066 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25067 LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(arg);
25068 int64_t ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv);
25072 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25073 LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(orig);
25074 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
25075 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv);
25076 return tag_ptr(ret_conv, true);
25079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25080 LDKOnionMessage o_conv;
25081 o_conv.inner = untag_ptr(o);
25082 o_conv.is_owned = ptr_is_owned(o);
25083 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25084 o_conv = OnionMessage_clone(&o_conv);
25085 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
25086 *ret_conv = CResult_OnionMessageDecodeErrorZ_ok(o_conv);
25087 return tag_ptr(ret_conv, true);
25090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25091 void* e_ptr = untag_ptr(e);
25092 CHECK_ACCESS(e_ptr);
25093 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25094 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25095 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
25096 *ret_conv = CResult_OnionMessageDecodeErrorZ_err(e_conv);
25097 return tag_ptr(ret_conv, true);
25100 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25101 LDKCResult_OnionMessageDecodeErrorZ* o_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(o);
25102 jboolean ret_conv = CResult_OnionMessageDecodeErrorZ_is_ok(o_conv);
25106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25107 if (!ptr_is_owned(_res)) return;
25108 void* _res_ptr = untag_ptr(_res);
25109 CHECK_ACCESS(_res_ptr);
25110 LDKCResult_OnionMessageDecodeErrorZ _res_conv = *(LDKCResult_OnionMessageDecodeErrorZ*)(_res_ptr);
25111 FREE(untag_ptr(_res));
25112 CResult_OnionMessageDecodeErrorZ_free(_res_conv);
25115 static inline uint64_t CResult_OnionMessageDecodeErrorZ_clone_ptr(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR arg) {
25116 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
25117 *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(arg);
25118 return tag_ptr(ret_conv, true);
25120 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25121 LDKCResult_OnionMessageDecodeErrorZ* arg_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(arg);
25122 int64_t ret_conv = CResult_OnionMessageDecodeErrorZ_clone_ptr(arg_conv);
25126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25127 LDKCResult_OnionMessageDecodeErrorZ* orig_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(orig);
25128 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
25129 *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(orig_conv);
25130 return tag_ptr(ret_conv, true);
25133 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25135 o_conv.inner = untag_ptr(o);
25136 o_conv.is_owned = ptr_is_owned(o);
25137 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25138 o_conv = Ping_clone(&o_conv);
25139 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
25140 *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv);
25141 return tag_ptr(ret_conv, true);
25144 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25145 void* e_ptr = untag_ptr(e);
25146 CHECK_ACCESS(e_ptr);
25147 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25148 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25149 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
25150 *ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
25151 return tag_ptr(ret_conv, true);
25154 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25155 LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(o);
25156 jboolean ret_conv = CResult_PingDecodeErrorZ_is_ok(o_conv);
25160 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25161 if (!ptr_is_owned(_res)) return;
25162 void* _res_ptr = untag_ptr(_res);
25163 CHECK_ACCESS(_res_ptr);
25164 LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
25165 FREE(untag_ptr(_res));
25166 CResult_PingDecodeErrorZ_free(_res_conv);
25169 static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) {
25170 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
25171 *ret_conv = CResult_PingDecodeErrorZ_clone(arg);
25172 return tag_ptr(ret_conv, true);
25174 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25175 LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(arg);
25176 int64_t ret_conv = CResult_PingDecodeErrorZ_clone_ptr(arg_conv);
25180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25181 LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(orig);
25182 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
25183 *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv);
25184 return tag_ptr(ret_conv, true);
25187 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25189 o_conv.inner = untag_ptr(o);
25190 o_conv.is_owned = ptr_is_owned(o);
25191 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25192 o_conv = Pong_clone(&o_conv);
25193 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
25194 *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv);
25195 return tag_ptr(ret_conv, true);
25198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25199 void* e_ptr = untag_ptr(e);
25200 CHECK_ACCESS(e_ptr);
25201 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25202 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25203 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
25204 *ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
25205 return tag_ptr(ret_conv, true);
25208 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25209 LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(o);
25210 jboolean ret_conv = CResult_PongDecodeErrorZ_is_ok(o_conv);
25214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25215 if (!ptr_is_owned(_res)) return;
25216 void* _res_ptr = untag_ptr(_res);
25217 CHECK_ACCESS(_res_ptr);
25218 LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
25219 FREE(untag_ptr(_res));
25220 CResult_PongDecodeErrorZ_free(_res_conv);
25223 static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) {
25224 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
25225 *ret_conv = CResult_PongDecodeErrorZ_clone(arg);
25226 return tag_ptr(ret_conv, true);
25228 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25229 LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(arg);
25230 int64_t ret_conv = CResult_PongDecodeErrorZ_clone_ptr(arg_conv);
25234 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25235 LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(orig);
25236 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
25237 *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv);
25238 return tag_ptr(ret_conv, true);
25241 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25242 LDKUnsignedChannelAnnouncement o_conv;
25243 o_conv.inner = untag_ptr(o);
25244 o_conv.is_owned = ptr_is_owned(o);
25245 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25246 o_conv = UnsignedChannelAnnouncement_clone(&o_conv);
25247 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
25248 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv);
25249 return tag_ptr(ret_conv, true);
25252 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25253 void* e_ptr = untag_ptr(e);
25254 CHECK_ACCESS(e_ptr);
25255 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25256 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25257 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
25258 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
25259 return tag_ptr(ret_conv, true);
25262 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25263 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
25264 jboolean ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
25268 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25269 if (!ptr_is_owned(_res)) return;
25270 void* _res_ptr = untag_ptr(_res);
25271 CHECK_ACCESS(_res_ptr);
25272 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
25273 FREE(untag_ptr(_res));
25274 CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
25277 static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
25278 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
25279 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg);
25280 return tag_ptr(ret_conv, true);
25282 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25283 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
25284 int64_t ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
25288 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25289 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
25290 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
25291 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv);
25292 return tag_ptr(ret_conv, true);
25295 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25296 LDKChannelAnnouncement o_conv;
25297 o_conv.inner = untag_ptr(o);
25298 o_conv.is_owned = ptr_is_owned(o);
25299 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25300 o_conv = ChannelAnnouncement_clone(&o_conv);
25301 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
25302 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv);
25303 return tag_ptr(ret_conv, true);
25306 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25307 void* e_ptr = untag_ptr(e);
25308 CHECK_ACCESS(e_ptr);
25309 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25310 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25311 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
25312 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
25313 return tag_ptr(ret_conv, true);
25316 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25317 LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
25318 jboolean ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
25322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25323 if (!ptr_is_owned(_res)) return;
25324 void* _res_ptr = untag_ptr(_res);
25325 CHECK_ACCESS(_res_ptr);
25326 LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
25327 FREE(untag_ptr(_res));
25328 CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
25331 static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
25332 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
25333 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg);
25334 return tag_ptr(ret_conv, true);
25336 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25337 LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
25338 int64_t ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
25342 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25343 LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
25344 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
25345 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv);
25346 return tag_ptr(ret_conv, true);
25349 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25350 LDKUnsignedChannelUpdate o_conv;
25351 o_conv.inner = untag_ptr(o);
25352 o_conv.is_owned = ptr_is_owned(o);
25353 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25354 o_conv = UnsignedChannelUpdate_clone(&o_conv);
25355 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
25356 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv);
25357 return tag_ptr(ret_conv, true);
25360 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25361 void* e_ptr = untag_ptr(e);
25362 CHECK_ACCESS(e_ptr);
25363 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25364 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25365 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
25366 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
25367 return tag_ptr(ret_conv, true);
25370 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25371 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(o);
25372 jboolean ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv);
25376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25377 if (!ptr_is_owned(_res)) return;
25378 void* _res_ptr = untag_ptr(_res);
25379 CHECK_ACCESS(_res_ptr);
25380 LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
25381 FREE(untag_ptr(_res));
25382 CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
25385 static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
25386 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
25387 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg);
25388 return tag_ptr(ret_conv, true);
25390 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25391 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(arg);
25392 int64_t ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
25396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25397 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(orig);
25398 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
25399 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv);
25400 return tag_ptr(ret_conv, true);
25403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25404 LDKChannelUpdate o_conv;
25405 o_conv.inner = untag_ptr(o);
25406 o_conv.is_owned = ptr_is_owned(o);
25407 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25408 o_conv = ChannelUpdate_clone(&o_conv);
25409 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
25410 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv);
25411 return tag_ptr(ret_conv, true);
25414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25415 void* e_ptr = untag_ptr(e);
25416 CHECK_ACCESS(e_ptr);
25417 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25418 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25419 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
25420 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
25421 return tag_ptr(ret_conv, true);
25424 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25425 LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(o);
25426 jboolean ret_conv = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv);
25430 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25431 if (!ptr_is_owned(_res)) return;
25432 void* _res_ptr = untag_ptr(_res);
25433 CHECK_ACCESS(_res_ptr);
25434 LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
25435 FREE(untag_ptr(_res));
25436 CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
25439 static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
25440 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
25441 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg);
25442 return tag_ptr(ret_conv, true);
25444 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25445 LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(arg);
25446 int64_t ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
25450 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25451 LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(orig);
25452 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
25453 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv);
25454 return tag_ptr(ret_conv, true);
25457 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25458 LDKErrorMessage o_conv;
25459 o_conv.inner = untag_ptr(o);
25460 o_conv.is_owned = ptr_is_owned(o);
25461 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25462 o_conv = ErrorMessage_clone(&o_conv);
25463 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
25464 *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv);
25465 return tag_ptr(ret_conv, true);
25468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25469 void* e_ptr = untag_ptr(e);
25470 CHECK_ACCESS(e_ptr);
25471 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25472 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25473 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
25474 *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
25475 return tag_ptr(ret_conv, true);
25478 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25479 LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(o);
25480 jboolean ret_conv = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv);
25484 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25485 if (!ptr_is_owned(_res)) return;
25486 void* _res_ptr = untag_ptr(_res);
25487 CHECK_ACCESS(_res_ptr);
25488 LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
25489 FREE(untag_ptr(_res));
25490 CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
25493 static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) {
25494 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
25495 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg);
25496 return tag_ptr(ret_conv, true);
25498 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25499 LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(arg);
25500 int64_t ret_conv = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv);
25504 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25505 LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(orig);
25506 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
25507 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv);
25508 return tag_ptr(ret_conv, true);
25511 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25512 LDKWarningMessage 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 = WarningMessage_clone(&o_conv);
25517 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
25518 *ret_conv = CResult_WarningMessageDecodeErrorZ_ok(o_conv);
25519 return tag_ptr(ret_conv, true);
25522 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25523 void* e_ptr = untag_ptr(e);
25524 CHECK_ACCESS(e_ptr);
25525 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25526 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25527 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
25528 *ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
25529 return tag_ptr(ret_conv, true);
25532 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25533 LDKCResult_WarningMessageDecodeErrorZ* o_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(o);
25534 jboolean ret_conv = CResult_WarningMessageDecodeErrorZ_is_ok(o_conv);
25538 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25539 if (!ptr_is_owned(_res)) return;
25540 void* _res_ptr = untag_ptr(_res);
25541 CHECK_ACCESS(_res_ptr);
25542 LDKCResult_WarningMessageDecodeErrorZ _res_conv = *(LDKCResult_WarningMessageDecodeErrorZ*)(_res_ptr);
25543 FREE(untag_ptr(_res));
25544 CResult_WarningMessageDecodeErrorZ_free(_res_conv);
25547 static inline uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg) {
25548 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
25549 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(arg);
25550 return tag_ptr(ret_conv, true);
25552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25553 LDKCResult_WarningMessageDecodeErrorZ* arg_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(arg);
25554 int64_t ret_conv = CResult_WarningMessageDecodeErrorZ_clone_ptr(arg_conv);
25558 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25559 LDKCResult_WarningMessageDecodeErrorZ* orig_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(orig);
25560 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
25561 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(orig_conv);
25562 return tag_ptr(ret_conv, true);
25565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25566 LDKUnsignedNodeAnnouncement o_conv;
25567 o_conv.inner = untag_ptr(o);
25568 o_conv.is_owned = ptr_is_owned(o);
25569 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25570 o_conv = UnsignedNodeAnnouncement_clone(&o_conv);
25571 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
25572 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv);
25573 return tag_ptr(ret_conv, true);
25576 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25577 void* e_ptr = untag_ptr(e);
25578 CHECK_ACCESS(e_ptr);
25579 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25580 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25581 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
25582 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
25583 return tag_ptr(ret_conv, true);
25586 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25587 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(o);
25588 jboolean ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv);
25592 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25593 if (!ptr_is_owned(_res)) return;
25594 void* _res_ptr = untag_ptr(_res);
25595 CHECK_ACCESS(_res_ptr);
25596 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
25597 FREE(untag_ptr(_res));
25598 CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
25601 static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
25602 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
25603 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg);
25604 return tag_ptr(ret_conv, true);
25606 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25607 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
25608 int64_t ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
25612 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25613 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
25614 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
25615 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv);
25616 return tag_ptr(ret_conv, true);
25619 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25620 LDKNodeAnnouncement o_conv;
25621 o_conv.inner = untag_ptr(o);
25622 o_conv.is_owned = ptr_is_owned(o);
25623 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25624 o_conv = NodeAnnouncement_clone(&o_conv);
25625 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
25626 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv);
25627 return tag_ptr(ret_conv, true);
25630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25631 void* e_ptr = untag_ptr(e);
25632 CHECK_ACCESS(e_ptr);
25633 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25634 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25635 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
25636 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
25637 return tag_ptr(ret_conv, true);
25640 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25641 LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(o);
25642 jboolean ret_conv = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv);
25646 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25647 if (!ptr_is_owned(_res)) return;
25648 void* _res_ptr = untag_ptr(_res);
25649 CHECK_ACCESS(_res_ptr);
25650 LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
25651 FREE(untag_ptr(_res));
25652 CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
25655 static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
25656 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
25657 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg);
25658 return tag_ptr(ret_conv, true);
25660 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25661 LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
25662 int64_t ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
25666 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25667 LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
25668 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
25669 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv);
25670 return tag_ptr(ret_conv, true);
25673 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25674 LDKQueryShortChannelIds o_conv;
25675 o_conv.inner = untag_ptr(o);
25676 o_conv.is_owned = ptr_is_owned(o);
25677 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25678 o_conv = QueryShortChannelIds_clone(&o_conv);
25679 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
25680 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv);
25681 return tag_ptr(ret_conv, true);
25684 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25685 void* e_ptr = untag_ptr(e);
25686 CHECK_ACCESS(e_ptr);
25687 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25688 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25689 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
25690 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
25691 return tag_ptr(ret_conv, true);
25694 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25695 LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(o);
25696 jboolean ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv);
25700 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25701 if (!ptr_is_owned(_res)) return;
25702 void* _res_ptr = untag_ptr(_res);
25703 CHECK_ACCESS(_res_ptr);
25704 LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
25705 FREE(untag_ptr(_res));
25706 CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
25709 static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) {
25710 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
25711 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg);
25712 return tag_ptr(ret_conv, true);
25714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25715 LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(arg);
25716 int64_t ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv);
25720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25721 LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(orig);
25722 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
25723 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv);
25724 return tag_ptr(ret_conv, true);
25727 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25728 LDKReplyShortChannelIdsEnd o_conv;
25729 o_conv.inner = untag_ptr(o);
25730 o_conv.is_owned = ptr_is_owned(o);
25731 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25732 o_conv = ReplyShortChannelIdsEnd_clone(&o_conv);
25733 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
25734 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv);
25735 return tag_ptr(ret_conv, true);
25738 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25739 void* e_ptr = untag_ptr(e);
25740 CHECK_ACCESS(e_ptr);
25741 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25742 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25743 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
25744 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
25745 return tag_ptr(ret_conv, true);
25748 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25749 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(o);
25750 jboolean ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv);
25754 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25755 if (!ptr_is_owned(_res)) return;
25756 void* _res_ptr = untag_ptr(_res);
25757 CHECK_ACCESS(_res_ptr);
25758 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
25759 FREE(untag_ptr(_res));
25760 CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
25763 static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) {
25764 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
25765 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg);
25766 return tag_ptr(ret_conv, true);
25768 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25769 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(arg);
25770 int64_t ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv);
25774 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25775 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(orig);
25776 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
25777 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv);
25778 return tag_ptr(ret_conv, true);
25781 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25782 LDKQueryChannelRange o_conv;
25783 o_conv.inner = untag_ptr(o);
25784 o_conv.is_owned = ptr_is_owned(o);
25785 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25786 o_conv = QueryChannelRange_clone(&o_conv);
25787 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
25788 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv);
25789 return tag_ptr(ret_conv, true);
25792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25793 void* e_ptr = untag_ptr(e);
25794 CHECK_ACCESS(e_ptr);
25795 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25796 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25797 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
25798 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
25799 return tag_ptr(ret_conv, true);
25802 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25803 LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(o);
25804 jboolean ret_conv = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv);
25808 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25809 if (!ptr_is_owned(_res)) return;
25810 void* _res_ptr = untag_ptr(_res);
25811 CHECK_ACCESS(_res_ptr);
25812 LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
25813 FREE(untag_ptr(_res));
25814 CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
25817 static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
25818 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
25819 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg);
25820 return tag_ptr(ret_conv, true);
25822 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25823 LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(arg);
25824 int64_t ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
25828 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25829 LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(orig);
25830 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
25831 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv);
25832 return tag_ptr(ret_conv, true);
25835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25836 LDKReplyChannelRange o_conv;
25837 o_conv.inner = untag_ptr(o);
25838 o_conv.is_owned = ptr_is_owned(o);
25839 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25840 o_conv = ReplyChannelRange_clone(&o_conv);
25841 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
25842 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv);
25843 return tag_ptr(ret_conv, true);
25846 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25847 void* e_ptr = untag_ptr(e);
25848 CHECK_ACCESS(e_ptr);
25849 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25850 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25851 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
25852 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
25853 return tag_ptr(ret_conv, true);
25856 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25857 LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(o);
25858 jboolean ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv);
25862 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25863 if (!ptr_is_owned(_res)) return;
25864 void* _res_ptr = untag_ptr(_res);
25865 CHECK_ACCESS(_res_ptr);
25866 LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
25867 FREE(untag_ptr(_res));
25868 CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
25871 static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
25872 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
25873 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg);
25874 return tag_ptr(ret_conv, true);
25876 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25877 LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(arg);
25878 int64_t ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
25882 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25883 LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(orig);
25884 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
25885 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv);
25886 return tag_ptr(ret_conv, true);
25889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25890 LDKGossipTimestampFilter o_conv;
25891 o_conv.inner = untag_ptr(o);
25892 o_conv.is_owned = ptr_is_owned(o);
25893 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25894 o_conv = GossipTimestampFilter_clone(&o_conv);
25895 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
25896 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv);
25897 return tag_ptr(ret_conv, true);
25900 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25901 void* e_ptr = untag_ptr(e);
25902 CHECK_ACCESS(e_ptr);
25903 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25904 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25905 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
25906 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
25907 return tag_ptr(ret_conv, true);
25910 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25911 LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(o);
25912 jboolean ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv);
25916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25917 if (!ptr_is_owned(_res)) return;
25918 void* _res_ptr = untag_ptr(_res);
25919 CHECK_ACCESS(_res_ptr);
25920 LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
25921 FREE(untag_ptr(_res));
25922 CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
25925 static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) {
25926 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
25927 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg);
25928 return tag_ptr(ret_conv, true);
25930 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25931 LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(arg);
25932 int64_t ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv);
25936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25937 LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(orig);
25938 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
25939 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv);
25940 return tag_ptr(ret_conv, true);
25943 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
25944 LDKCVec_PhantomRouteHintsZ _res_constr;
25945 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
25946 if (_res_constr.datalen > 0)
25947 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
25949 _res_constr.data = NULL;
25950 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
25951 for (size_t t = 0; t < _res_constr.datalen; t++) {
25952 int64_t _res_conv_19 = _res_vals[t];
25953 LDKPhantomRouteHints _res_conv_19_conv;
25954 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
25955 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
25956 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
25957 _res_constr.data[t] = _res_conv_19_conv;
25959 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
25960 CVec_PhantomRouteHintsZ_free(_res_constr);
25963 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25965 o_conv.inner = untag_ptr(o);
25966 o_conv.is_owned = ptr_is_owned(o);
25967 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25968 o_conv = Invoice_clone(&o_conv);
25969 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
25970 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv);
25971 return tag_ptr(ret_conv, true);
25974 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25975 void* e_ptr = untag_ptr(e);
25976 CHECK_ACCESS(e_ptr);
25977 LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
25978 e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e));
25979 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
25980 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
25981 return tag_ptr(ret_conv, true);
25984 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25985 LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o);
25986 jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv);
25990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25991 if (!ptr_is_owned(_res)) return;
25992 void* _res_ptr = untag_ptr(_res);
25993 CHECK_ACCESS(_res_ptr);
25994 LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
25995 FREE(untag_ptr(_res));
25996 CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
25999 static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) {
26000 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
26001 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg);
26002 return tag_ptr(ret_conv, true);
26004 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26005 LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg);
26006 int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv);
26010 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26011 LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig);
26012 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
26013 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv);
26014 return tag_ptr(ret_conv, true);
26017 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1some(JNIEnv *env, jclass clz, int64_t o) {
26018 void* o_ptr = untag_ptr(o);
26019 CHECK_ACCESS(o_ptr);
26020 LDKFilter o_conv = *(LDKFilter*)(o_ptr);
26021 if (o_conv.free == LDKFilter_JCalls_free) {
26022 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26023 LDKFilter_JCalls_cloned(&o_conv);
26025 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
26026 *ret_copy = COption_FilterZ_some(o_conv);
26027 int64_t ret_ref = tag_ptr(ret_copy, true);
26031 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1none(JNIEnv *env, jclass clz) {
26032 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
26033 *ret_copy = COption_FilterZ_none();
26034 int64_t ret_ref = tag_ptr(ret_copy, true);
26038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26039 if (!ptr_is_owned(_res)) return;
26040 void* _res_ptr = untag_ptr(_res);
26041 CHECK_ACCESS(_res_ptr);
26042 LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
26043 FREE(untag_ptr(_res));
26044 COption_FilterZ_free(_res_conv);
26047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26048 LDKLockedChannelMonitor o_conv;
26049 o_conv.inner = untag_ptr(o);
26050 o_conv.is_owned = ptr_is_owned(o);
26051 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26052 // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor
26054 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
26055 *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv);
26056 return tag_ptr(ret_conv, true);
26059 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1err(JNIEnv *env, jclass clz) {
26060 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
26061 *ret_conv = CResult_LockedChannelMonitorNoneZ_err();
26062 return tag_ptr(ret_conv, true);
26065 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26066 LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o);
26067 jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv);
26071 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26072 if (!ptr_is_owned(_res)) return;
26073 void* _res_ptr = untag_ptr(_res);
26074 CHECK_ACCESS(_res_ptr);
26075 LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
26076 FREE(untag_ptr(_res));
26077 CResult_LockedChannelMonitorNoneZ_free(_res_conv);
26080 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
26081 LDKCVec_OutPointZ _res_constr;
26082 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
26083 if (_res_constr.datalen > 0)
26084 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
26086 _res_constr.data = NULL;
26087 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
26088 for (size_t k = 0; k < _res_constr.datalen; k++) {
26089 int64_t _res_conv_10 = _res_vals[k];
26090 LDKOutPoint _res_conv_10_conv;
26091 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
26092 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
26093 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
26094 _res_constr.data[k] = _res_conv_10_conv;
26096 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
26097 CVec_OutPointZ_free(_res_constr);
26100 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorUpdateIdZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
26101 LDKCVec_MonitorUpdateIdZ _res_constr;
26102 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
26103 if (_res_constr.datalen > 0)
26104 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements");
26106 _res_constr.data = NULL;
26107 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
26108 for (size_t r = 0; r < _res_constr.datalen; r++) {
26109 int64_t _res_conv_17 = _res_vals[r];
26110 LDKMonitorUpdateId _res_conv_17_conv;
26111 _res_conv_17_conv.inner = untag_ptr(_res_conv_17);
26112 _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17);
26113 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv);
26114 _res_constr.data[r] = _res_conv_17_conv;
26116 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
26117 CVec_MonitorUpdateIdZ_free(_res_constr);
26120 static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) {
26121 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
26122 *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg);
26123 return tag_ptr(ret_conv, true);
26125 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26126 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg);
26127 int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv);
26131 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26132 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig);
26133 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
26134 *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv);
26135 return tag_ptr(ret_conv, true);
26138 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b) {
26139 LDKOutPoint a_conv;
26140 a_conv.inner = untag_ptr(a);
26141 a_conv.is_owned = ptr_is_owned(a);
26142 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
26143 a_conv = OutPoint_clone(&a_conv);
26144 LDKCVec_MonitorUpdateIdZ b_constr;
26145 b_constr.datalen = (*env)->GetArrayLength(env, b);
26146 if (b_constr.datalen > 0)
26147 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements");
26149 b_constr.data = NULL;
26150 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
26151 for (size_t r = 0; r < b_constr.datalen; r++) {
26152 int64_t b_conv_17 = b_vals[r];
26153 LDKMonitorUpdateId b_conv_17_conv;
26154 b_conv_17_conv.inner = untag_ptr(b_conv_17);
26155 b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17);
26156 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv);
26157 b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv);
26158 b_constr.data[r] = b_conv_17_conv;
26160 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
26161 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
26162 *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr);
26163 return tag_ptr(ret_conv, true);
26166 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26167 if (!ptr_is_owned(_res)) return;
26168 void* _res_ptr = untag_ptr(_res);
26169 CHECK_ACCESS(_res_ptr);
26170 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr);
26171 FREE(untag_ptr(_res));
26172 C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv);
26175 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorUpdateIdZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
26176 LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr;
26177 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
26178 if (_res_constr.datalen > 0)
26179 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements");
26181 _res_constr.data = NULL;
26182 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
26183 for (size_t p = 0; p < _res_constr.datalen; p++) {
26184 int64_t _res_conv_41 = _res_vals[p];
26185 void* _res_conv_41_ptr = untag_ptr(_res_conv_41);
26186 CHECK_ACCESS(_res_conv_41_ptr);
26187 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr);
26188 FREE(untag_ptr(_res_conv_41));
26189 _res_constr.data[p] = _res_conv_41_conv;
26191 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
26192 CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr);
26195 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26196 if (!ptr_is_owned(this_ptr)) return;
26197 void* this_ptr_ptr = untag_ptr(this_ptr);
26198 CHECK_ACCESS(this_ptr_ptr);
26199 LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
26200 FREE(untag_ptr(this_ptr));
26201 PaymentPurpose_free(this_ptr_conv);
26204 static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) {
26205 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
26206 *ret_copy = PaymentPurpose_clone(arg);
26207 int64_t ret_ref = tag_ptr(ret_copy, true);
26210 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26211 LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg);
26212 int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv);
26216 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26217 LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig);
26218 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
26219 *ret_copy = PaymentPurpose_clone(orig_conv);
26220 int64_t ret_ref = tag_ptr(ret_copy, true);
26224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1invoice_1payment(JNIEnv *env, jclass clz, int8_tArray payment_preimage, int8_tArray payment_secret) {
26225 LDKThirtyTwoBytes payment_preimage_ref;
26226 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
26227 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
26228 LDKThirtyTwoBytes payment_secret_ref;
26229 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
26230 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
26231 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
26232 *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
26233 int64_t ret_ref = tag_ptr(ret_copy, true);
26237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment(JNIEnv *env, jclass clz, int8_tArray a) {
26238 LDKThirtyTwoBytes a_ref;
26239 CHECK((*env)->GetArrayLength(env, a) == 32);
26240 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
26241 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
26242 *ret_copy = PaymentPurpose_spontaneous_payment(a_ref);
26243 int64_t ret_ref = tag_ptr(ret_copy, true);
26247 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
26248 LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a);
26249 LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b);
26250 jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv);
26254 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write(JNIEnv *env, jclass clz, int64_t obj) {
26255 LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj);
26256 LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv);
26257 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
26258 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
26259 CVec_u8Z_free(ret_var);
26263 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
26264 LDKu8slice ser_ref;
26265 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
26266 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
26267 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
26268 *ret_conv = PaymentPurpose_read(ser_ref);
26269 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
26270 return tag_ptr(ret_conv, true);
26273 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PathFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26274 if (!ptr_is_owned(this_ptr)) return;
26275 void* this_ptr_ptr = untag_ptr(this_ptr);
26276 CHECK_ACCESS(this_ptr_ptr);
26277 LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr);
26278 FREE(untag_ptr(this_ptr));
26279 PathFailure_free(this_ptr_conv);
26282 static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) {
26283 LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
26284 *ret_copy = PathFailure_clone(arg);
26285 int64_t ret_ref = tag_ptr(ret_copy, true);
26288 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26289 LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg);
26290 int64_t ret_conv = PathFailure_clone_ptr(arg_conv);
26294 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26295 LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig);
26296 LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
26297 *ret_copy = PathFailure_clone(orig_conv);
26298 int64_t ret_ref = tag_ptr(ret_copy, true);
26302 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1initial_1send(JNIEnv *env, jclass clz, int64_t err) {
26303 void* err_ptr = untag_ptr(err);
26304 CHECK_ACCESS(err_ptr);
26305 LDKAPIError err_conv = *(LDKAPIError*)(err_ptr);
26306 err_conv = APIError_clone((LDKAPIError*)untag_ptr(err));
26307 LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
26308 *ret_copy = PathFailure_initial_send(err_conv);
26309 int64_t ret_ref = tag_ptr(ret_copy, true);
26313 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1on_1path(JNIEnv *env, jclass clz, int64_t network_update) {
26314 void* network_update_ptr = untag_ptr(network_update);
26315 CHECK_ACCESS(network_update_ptr);
26316 LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
26317 network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
26318 LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
26319 *ret_copy = PathFailure_on_path(network_update_conv);
26320 int64_t ret_ref = tag_ptr(ret_copy, true);
26324 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PathFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
26325 LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a);
26326 LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b);
26327 jboolean ret_conv = PathFailure_eq(a_conv, b_conv);
26331 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PathFailure_1write(JNIEnv *env, jclass clz, int64_t obj) {
26332 LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj);
26333 LDKCVec_u8Z ret_var = PathFailure_write(obj_conv);
26334 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
26335 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
26336 CVec_u8Z_free(ret_var);
26340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
26341 LDKu8slice ser_ref;
26342 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
26343 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
26344 LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
26345 *ret_conv = PathFailure_read(ser_ref);
26346 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
26347 return tag_ptr(ret_conv, true);
26350 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26351 if (!ptr_is_owned(this_ptr)) return;
26352 void* this_ptr_ptr = untag_ptr(this_ptr);
26353 CHECK_ACCESS(this_ptr_ptr);
26354 LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
26355 FREE(untag_ptr(this_ptr));
26356 ClosureReason_free(this_ptr_conv);
26359 static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) {
26360 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
26361 *ret_copy = ClosureReason_clone(arg);
26362 int64_t ret_ref = tag_ptr(ret_copy, true);
26365 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26366 LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg);
26367 int64_t ret_conv = ClosureReason_clone_ptr(arg_conv);
26371 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26372 LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig);
26373 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
26374 *ret_copy = ClosureReason_clone(orig_conv);
26375 int64_t ret_ref = tag_ptr(ret_copy, true);
26379 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1force_1closed(JNIEnv *env, jclass clz, jstring peer_msg) {
26380 LDKStr peer_msg_conv = java_to_owned_str(env, peer_msg);
26381 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
26382 *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv);
26383 int64_t ret_ref = tag_ptr(ret_copy, true);
26387 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1holder_1force_1closed(JNIEnv *env, jclass clz) {
26388 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
26389 *ret_copy = ClosureReason_holder_force_closed();
26390 int64_t ret_ref = tag_ptr(ret_copy, true);
26394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1cooperative_1closure(JNIEnv *env, jclass clz) {
26395 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
26396 *ret_copy = ClosureReason_cooperative_closure();
26397 int64_t ret_ref = tag_ptr(ret_copy, true);
26401 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz) {
26402 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
26403 *ret_copy = ClosureReason_commitment_tx_confirmed();
26404 int64_t ret_ref = tag_ptr(ret_copy, true);
26408 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out(JNIEnv *env, jclass clz) {
26409 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
26410 *ret_copy = ClosureReason_funding_timed_out();
26411 int64_t ret_ref = tag_ptr(ret_copy, true);
26415 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error(JNIEnv *env, jclass clz, jstring err) {
26416 LDKStr err_conv = java_to_owned_str(env, err);
26417 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
26418 *ret_copy = ClosureReason_processing_error(err_conv);
26419 int64_t ret_ref = tag_ptr(ret_copy, true);
26423 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1disconnected_1peer(JNIEnv *env, jclass clz) {
26424 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
26425 *ret_copy = ClosureReason_disconnected_peer();
26426 int64_t ret_ref = tag_ptr(ret_copy, true);
26430 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager(JNIEnv *env, jclass clz) {
26431 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
26432 *ret_copy = ClosureReason_outdated_channel_manager();
26433 int64_t ret_ref = tag_ptr(ret_copy, true);
26437 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
26438 LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a);
26439 LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b);
26440 jboolean ret_conv = ClosureReason_eq(a_conv, b_conv);
26444 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JNIEnv *env, jclass clz, int64_t obj) {
26445 LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
26446 LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
26447 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
26448 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
26449 CVec_u8Z_free(ret_var);
26453 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
26454 LDKu8slice ser_ref;
26455 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
26456 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
26457 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
26458 *ret_conv = ClosureReason_read(ser_ref);
26459 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
26460 return tag_ptr(ret_conv, true);
26463 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26464 if (!ptr_is_owned(this_ptr)) return;
26465 void* this_ptr_ptr = untag_ptr(this_ptr);
26466 CHECK_ACCESS(this_ptr_ptr);
26467 LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr);
26468 FREE(untag_ptr(this_ptr));
26469 HTLCDestination_free(this_ptr_conv);
26472 static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) {
26473 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
26474 *ret_copy = HTLCDestination_clone(arg);
26475 int64_t ret_ref = tag_ptr(ret_copy, true);
26478 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26479 LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg);
26480 int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv);
26484 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26485 LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig);
26486 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
26487 *ret_copy = HTLCDestination_clone(orig_conv);
26488 int64_t ret_ref = tag_ptr(ret_copy, true);
26492 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) {
26493 LDKPublicKey node_id_ref;
26494 CHECK((*env)->GetArrayLength(env, node_id) == 33);
26495 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
26496 LDKThirtyTwoBytes channel_id_ref;
26497 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
26498 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
26499 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
26500 *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref);
26501 int64_t ret_ref = tag_ptr(ret_copy, true);
26505 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop(JNIEnv *env, jclass clz, int64_t requested_forward_scid) {
26506 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
26507 *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid);
26508 int64_t ret_ref = tag_ptr(ret_copy, true);
26512 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward(JNIEnv *env, jclass clz, int64_t requested_forward_scid) {
26513 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
26514 *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid);
26515 int64_t ret_ref = tag_ptr(ret_copy, true);
26519 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) {
26520 LDKThirtyTwoBytes payment_hash_ref;
26521 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
26522 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
26523 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
26524 *ret_copy = HTLCDestination_failed_payment(payment_hash_ref);
26525 int64_t ret_ref = tag_ptr(ret_copy, true);
26529 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
26530 LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a);
26531 LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b);
26532 jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv);
26536 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write(JNIEnv *env, jclass clz, int64_t obj) {
26537 LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
26538 LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
26539 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
26540 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
26541 CVec_u8Z_free(ret_var);
26545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
26546 LDKu8slice ser_ref;
26547 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
26548 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
26549 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
26550 *ret_conv = HTLCDestination_read(ser_ref);
26551 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
26552 return tag_ptr(ret_conv, true);
26555 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26556 if (!ptr_is_owned(this_ptr)) return;
26557 void* this_ptr_ptr = untag_ptr(this_ptr);
26558 CHECK_ACCESS(this_ptr_ptr);
26559 LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
26560 FREE(untag_ptr(this_ptr));
26561 Event_free(this_ptr_conv);
26564 static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) {
26565 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26566 *ret_copy = Event_clone(arg);
26567 int64_t ret_ref = tag_ptr(ret_copy, true);
26570 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26571 LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg);
26572 int64_t ret_conv = Event_clone_ptr(arg_conv);
26576 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26577 LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig);
26578 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26579 *ret_copy = Event_clone(orig_conv);
26580 int64_t ret_ref = tag_ptr(ret_copy, true);
26584 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, int8_tArray user_channel_id) {
26585 LDKThirtyTwoBytes temporary_channel_id_ref;
26586 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
26587 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data);
26588 LDKPublicKey counterparty_node_id_ref;
26589 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
26590 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
26591 LDKCVec_u8Z output_script_ref;
26592 output_script_ref.datalen = (*env)->GetArrayLength(env, output_script);
26593 output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
26594 (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data);
26595 LDKU128 user_channel_id_ref;
26596 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
26597 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
26598 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26599 *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id_ref);
26600 int64_t ret_ref = tag_ptr(ret_copy, true);
26604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int8_tArray via_channel_id, int64_t via_user_channel_id) {
26605 LDKPublicKey receiver_node_id_ref;
26606 CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33);
26607 (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form);
26608 LDKThirtyTwoBytes payment_hash_ref;
26609 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
26610 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
26611 void* purpose_ptr = untag_ptr(purpose);
26612 CHECK_ACCESS(purpose_ptr);
26613 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
26614 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
26615 LDKThirtyTwoBytes via_channel_id_ref;
26616 CHECK((*env)->GetArrayLength(env, via_channel_id) == 32);
26617 (*env)->GetByteArrayRegion(env, via_channel_id, 0, 32, via_channel_id_ref.data);
26618 void* via_user_channel_id_ptr = untag_ptr(via_user_channel_id);
26619 CHECK_ACCESS(via_user_channel_id_ptr);
26620 LDKCOption_u128Z via_user_channel_id_conv = *(LDKCOption_u128Z*)(via_user_channel_id_ptr);
26621 via_user_channel_id_conv = COption_u128Z_clone((LDKCOption_u128Z*)untag_ptr(via_user_channel_id));
26622 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26623 *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, via_channel_id_ref, via_user_channel_id_conv);
26624 int64_t ret_ref = tag_ptr(ret_copy, true);
26628 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) {
26629 LDKPublicKey receiver_node_id_ref;
26630 CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33);
26631 (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form);
26632 LDKThirtyTwoBytes payment_hash_ref;
26633 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
26634 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
26635 void* purpose_ptr = untag_ptr(purpose);
26636 CHECK_ACCESS(purpose_ptr);
26637 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
26638 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
26639 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26640 *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv);
26641 int64_t ret_ref = tag_ptr(ret_copy, true);
26645 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) {
26646 LDKThirtyTwoBytes payment_id_ref;
26647 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
26648 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
26649 LDKThirtyTwoBytes payment_preimage_ref;
26650 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
26651 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
26652 LDKThirtyTwoBytes payment_hash_ref;
26653 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
26654 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
26655 void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat);
26656 CHECK_ACCESS(fee_paid_msat_ptr);
26657 LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
26658 fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat));
26659 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26660 *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
26661 int64_t ret_ref = tag_ptr(ret_copy, true);
26665 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash) {
26666 LDKThirtyTwoBytes payment_id_ref;
26667 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
26668 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
26669 LDKThirtyTwoBytes payment_hash_ref;
26670 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
26671 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
26672 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26673 *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
26674 int64_t ret_ref = tag_ptr(ret_copy, true);
26678 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) {
26679 LDKThirtyTwoBytes payment_id_ref;
26680 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
26681 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
26682 LDKThirtyTwoBytes payment_hash_ref;
26683 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
26684 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
26685 LDKCVec_RouteHopZ path_constr;
26686 path_constr.datalen = (*env)->GetArrayLength(env, path);
26687 if (path_constr.datalen > 0)
26688 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
26690 path_constr.data = NULL;
26691 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
26692 for (size_t k = 0; k < path_constr.datalen; k++) {
26693 int64_t path_conv_10 = path_vals[k];
26694 LDKRouteHop path_conv_10_conv;
26695 path_conv_10_conv.inner = untag_ptr(path_conv_10);
26696 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
26697 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
26698 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
26699 path_constr.data[k] = path_conv_10_conv;
26701 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
26702 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26703 *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
26704 int64_t ret_ref = tag_ptr(ret_copy, true);
26708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, int64_t failure, int64_tArray path, int64_t short_channel_id, int64_t retry) {
26709 LDKThirtyTwoBytes payment_id_ref;
26710 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
26711 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
26712 LDKThirtyTwoBytes payment_hash_ref;
26713 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
26714 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
26715 void* failure_ptr = untag_ptr(failure);
26716 CHECK_ACCESS(failure_ptr);
26717 LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr);
26718 failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure));
26719 LDKCVec_RouteHopZ path_constr;
26720 path_constr.datalen = (*env)->GetArrayLength(env, path);
26721 if (path_constr.datalen > 0)
26722 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
26724 path_constr.data = NULL;
26725 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
26726 for (size_t k = 0; k < path_constr.datalen; k++) {
26727 int64_t path_conv_10 = path_vals[k];
26728 LDKRouteHop path_conv_10_conv;
26729 path_conv_10_conv.inner = untag_ptr(path_conv_10);
26730 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
26731 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
26732 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
26733 path_constr.data[k] = path_conv_10_conv;
26735 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
26736 void* short_channel_id_ptr = untag_ptr(short_channel_id);
26737 CHECK_ACCESS(short_channel_id_ptr);
26738 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
26739 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
26740 LDKRouteParameters retry_conv;
26741 retry_conv.inner = untag_ptr(retry);
26742 retry_conv.is_owned = ptr_is_owned(retry);
26743 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv);
26744 retry_conv = RouteParameters_clone(&retry_conv);
26745 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26746 *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, payment_failed_permanently, failure_conv, path_constr, short_channel_id_conv, retry_conv);
26747 int64_t ret_ref = tag_ptr(ret_copy, true);
26751 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) {
26752 LDKThirtyTwoBytes payment_id_ref;
26753 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
26754 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
26755 LDKThirtyTwoBytes payment_hash_ref;
26756 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
26757 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
26758 LDKCVec_RouteHopZ path_constr;
26759 path_constr.datalen = (*env)->GetArrayLength(env, path);
26760 if (path_constr.datalen > 0)
26761 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
26763 path_constr.data = NULL;
26764 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
26765 for (size_t k = 0; k < path_constr.datalen; k++) {
26766 int64_t path_conv_10 = path_vals[k];
26767 LDKRouteHop path_conv_10_conv;
26768 path_conv_10_conv.inner = untag_ptr(path_conv_10);
26769 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
26770 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
26771 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
26772 path_constr.data[k] = path_conv_10_conv;
26774 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
26775 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26776 *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_constr);
26777 int64_t ret_ref = tag_ptr(ret_copy, true);
26781 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) {
26782 LDKThirtyTwoBytes payment_id_ref;
26783 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
26784 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
26785 LDKThirtyTwoBytes payment_hash_ref;
26786 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
26787 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
26788 LDKCVec_RouteHopZ path_constr;
26789 path_constr.datalen = (*env)->GetArrayLength(env, path);
26790 if (path_constr.datalen > 0)
26791 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
26793 path_constr.data = NULL;
26794 int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
26795 for (size_t k = 0; k < path_constr.datalen; k++) {
26796 int64_t path_conv_10 = path_vals[k];
26797 LDKRouteHop path_conv_10_conv;
26798 path_conv_10_conv.inner = untag_ptr(path_conv_10);
26799 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
26800 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
26801 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
26802 path_constr.data[k] = path_conv_10_conv;
26804 (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
26805 void* short_channel_id_ptr = untag_ptr(short_channel_id);
26806 CHECK_ACCESS(short_channel_id_ptr);
26807 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
26808 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
26809 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26810 *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_constr, short_channel_id_conv);
26811 int64_t ret_ref = tag_ptr(ret_copy, true);
26815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) {
26816 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26817 *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
26818 int64_t ret_ref = tag_ptr(ret_copy, true);
26822 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlcintercepted(JNIEnv *env, jclass clz, int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) {
26823 LDKThirtyTwoBytes intercept_id_ref;
26824 CHECK((*env)->GetArrayLength(env, intercept_id) == 32);
26825 (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data);
26826 LDKThirtyTwoBytes payment_hash_ref;
26827 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
26828 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
26829 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26830 *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat);
26831 int64_t ret_ref = tag_ptr(ret_copy, true);
26835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs) {
26836 LDKCVec_SpendableOutputDescriptorZ outputs_constr;
26837 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
26838 if (outputs_constr.datalen > 0)
26839 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
26841 outputs_constr.data = NULL;
26842 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
26843 for (size_t b = 0; b < outputs_constr.datalen; b++) {
26844 int64_t outputs_conv_27 = outputs_vals[b];
26845 void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27);
26846 CHECK_ACCESS(outputs_conv_27_ptr);
26847 LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
26848 outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27));
26849 outputs_constr.data[b] = outputs_conv_27_conv;
26851 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
26852 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26853 *ret_copy = Event_spendable_outputs(outputs_constr);
26854 int64_t ret_ref = tag_ptr(ret_copy, true);
26858 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) {
26859 LDKThirtyTwoBytes prev_channel_id_ref;
26860 CHECK((*env)->GetArrayLength(env, prev_channel_id) == 32);
26861 (*env)->GetByteArrayRegion(env, prev_channel_id, 0, 32, prev_channel_id_ref.data);
26862 LDKThirtyTwoBytes next_channel_id_ref;
26863 CHECK((*env)->GetArrayLength(env, next_channel_id) == 32);
26864 (*env)->GetByteArrayRegion(env, next_channel_id, 0, 32, next_channel_id_ref.data);
26865 void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat);
26866 CHECK_ACCESS(fee_earned_msat_ptr);
26867 LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
26868 fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat));
26869 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26870 *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx);
26871 int64_t ret_ref = tag_ptr(ret_copy, true);
26875 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_t channel_type) {
26876 LDKThirtyTwoBytes channel_id_ref;
26877 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
26878 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
26879 LDKU128 user_channel_id_ref;
26880 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
26881 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
26882 LDKPublicKey counterparty_node_id_ref;
26883 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
26884 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
26885 LDKChannelTypeFeatures channel_type_conv;
26886 channel_type_conv.inner = untag_ptr(channel_type);
26887 channel_type_conv.is_owned = ptr_is_owned(channel_type);
26888 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
26889 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
26890 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26891 *ret_copy = Event_channel_ready(channel_id_ref, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv);
26892 int64_t ret_ref = tag_ptr(ret_copy, true);
26896 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray user_channel_id, int64_t reason) {
26897 LDKThirtyTwoBytes channel_id_ref;
26898 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
26899 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
26900 LDKU128 user_channel_id_ref;
26901 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
26902 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
26903 void* reason_ptr = untag_ptr(reason);
26904 CHECK_ACCESS(reason_ptr);
26905 LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
26906 reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason));
26907 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26908 *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id_ref, reason_conv);
26909 int64_t ret_ref = tag_ptr(ret_copy, true);
26913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray transaction) {
26914 LDKThirtyTwoBytes channel_id_ref;
26915 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
26916 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
26917 LDKTransaction transaction_ref;
26918 transaction_ref.datalen = (*env)->GetArrayLength(env, transaction);
26919 transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes");
26920 (*env)->GetByteArrayRegion(env, transaction, 0, transaction_ref.datalen, transaction_ref.data);
26921 transaction_ref.data_is_owned = true;
26922 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26923 *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref);
26924 int64_t ret_ref = tag_ptr(ret_copy, true);
26928 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) {
26929 LDKThirtyTwoBytes temporary_channel_id_ref;
26930 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
26931 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data);
26932 LDKPublicKey counterparty_node_id_ref;
26933 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
26934 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
26935 LDKChannelTypeFeatures channel_type_conv;
26936 channel_type_conv.inner = untag_ptr(channel_type);
26937 channel_type_conv.is_owned = ptr_is_owned(channel_type);
26938 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
26939 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
26940 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26941 *ret_copy = Event_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv);
26942 int64_t ret_ref = tag_ptr(ret_copy, true);
26946 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) {
26947 LDKThirtyTwoBytes prev_channel_id_ref;
26948 CHECK((*env)->GetArrayLength(env, prev_channel_id) == 32);
26949 (*env)->GetByteArrayRegion(env, prev_channel_id, 0, 32, prev_channel_id_ref.data);
26950 void* failed_next_destination_ptr = untag_ptr(failed_next_destination);
26951 CHECK_ACCESS(failed_next_destination_ptr);
26952 LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr);
26953 failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination));
26954 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
26955 *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv);
26956 int64_t ret_ref = tag_ptr(ret_copy, true);
26960 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Event_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
26961 LDKEvent* a_conv = (LDKEvent*)untag_ptr(a);
26962 LDKEvent* b_conv = (LDKEvent*)untag_ptr(b);
26963 jboolean ret_conv = Event_eq(a_conv, b_conv);
26967 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) {
26968 LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj);
26969 LDKCVec_u8Z ret_var = Event_write(obj_conv);
26970 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
26971 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
26972 CVec_u8Z_free(ret_var);
26976 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
26977 LDKu8slice ser_ref;
26978 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
26979 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
26980 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
26981 *ret_conv = Event_read(ser_ref);
26982 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
26983 return tag_ptr(ret_conv, true);
26986 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
26987 if (!ptr_is_owned(this_ptr)) return;
26988 void* this_ptr_ptr = untag_ptr(this_ptr);
26989 CHECK_ACCESS(this_ptr_ptr);
26990 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
26991 FREE(untag_ptr(this_ptr));
26992 MessageSendEvent_free(this_ptr_conv);
26995 static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) {
26996 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
26997 *ret_copy = MessageSendEvent_clone(arg);
26998 int64_t ret_ref = tag_ptr(ret_copy, true);
27001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27002 LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg);
27003 int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv);
27007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27008 LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig);
27009 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27010 *ret_copy = MessageSendEvent_clone(orig_conv);
27011 int64_t ret_ref = tag_ptr(ret_copy, true);
27015 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
27016 LDKPublicKey node_id_ref;
27017 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27018 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27019 LDKAcceptChannel msg_conv;
27020 msg_conv.inner = untag_ptr(msg);
27021 msg_conv.is_owned = ptr_is_owned(msg);
27022 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27023 msg_conv = AcceptChannel_clone(&msg_conv);
27024 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27025 *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
27026 int64_t ret_ref = tag_ptr(ret_copy, true);
27030 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
27031 LDKPublicKey node_id_ref;
27032 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27033 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27034 LDKOpenChannel msg_conv;
27035 msg_conv.inner = untag_ptr(msg);
27036 msg_conv.is_owned = ptr_is_owned(msg);
27037 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27038 msg_conv = OpenChannel_clone(&msg_conv);
27039 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27040 *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
27041 int64_t ret_ref = tag_ptr(ret_copy, true);
27045 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
27046 LDKPublicKey node_id_ref;
27047 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27048 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27049 LDKFundingCreated msg_conv;
27050 msg_conv.inner = untag_ptr(msg);
27051 msg_conv.is_owned = ptr_is_owned(msg);
27052 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27053 msg_conv = FundingCreated_clone(&msg_conv);
27054 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27055 *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
27056 int64_t ret_ref = tag_ptr(ret_copy, true);
27060 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
27061 LDKPublicKey node_id_ref;
27062 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27063 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27064 LDKFundingSigned msg_conv;
27065 msg_conv.inner = untag_ptr(msg);
27066 msg_conv.is_owned = ptr_is_owned(msg);
27067 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27068 msg_conv = FundingSigned_clone(&msg_conv);
27069 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27070 *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
27071 int64_t ret_ref = tag_ptr(ret_copy, true);
27075 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
27076 LDKPublicKey node_id_ref;
27077 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27078 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27079 LDKChannelReady msg_conv;
27080 msg_conv.inner = untag_ptr(msg);
27081 msg_conv.is_owned = ptr_is_owned(msg);
27082 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27083 msg_conv = ChannelReady_clone(&msg_conv);
27084 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27085 *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv);
27086 int64_t ret_ref = tag_ptr(ret_copy, true);
27090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
27091 LDKPublicKey node_id_ref;
27092 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27093 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27094 LDKAnnouncementSignatures msg_conv;
27095 msg_conv.inner = untag_ptr(msg);
27096 msg_conv.is_owned = ptr_is_owned(msg);
27097 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27098 msg_conv = AnnouncementSignatures_clone(&msg_conv);
27099 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27100 *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
27101 int64_t ret_ref = tag_ptr(ret_copy, true);
27105 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t updates) {
27106 LDKPublicKey node_id_ref;
27107 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27108 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27109 LDKCommitmentUpdate updates_conv;
27110 updates_conv.inner = untag_ptr(updates);
27111 updates_conv.is_owned = ptr_is_owned(updates);
27112 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
27113 updates_conv = CommitmentUpdate_clone(&updates_conv);
27114 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27115 *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
27116 int64_t ret_ref = tag_ptr(ret_copy, true);
27120 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) {
27121 LDKPublicKey node_id_ref;
27122 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27123 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27124 LDKRevokeAndACK msg_conv;
27125 msg_conv.inner = untag_ptr(msg);
27126 msg_conv.is_owned = ptr_is_owned(msg);
27127 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27128 msg_conv = RevokeAndACK_clone(&msg_conv);
27129 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27130 *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
27131 int64_t ret_ref = tag_ptr(ret_copy, true);
27135 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
27136 LDKPublicKey node_id_ref;
27137 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27138 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27139 LDKClosingSigned msg_conv;
27140 msg_conv.inner = untag_ptr(msg);
27141 msg_conv.is_owned = ptr_is_owned(msg);
27142 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27143 msg_conv = ClosingSigned_clone(&msg_conv);
27144 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27145 *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
27146 int64_t ret_ref = tag_ptr(ret_copy, true);
27150 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
27151 LDKPublicKey node_id_ref;
27152 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27153 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27154 LDKShutdown msg_conv;
27155 msg_conv.inner = untag_ptr(msg);
27156 msg_conv.is_owned = ptr_is_owned(msg);
27157 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27158 msg_conv = Shutdown_clone(&msg_conv);
27159 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27160 *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
27161 int64_t ret_ref = tag_ptr(ret_copy, true);
27165 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
27166 LDKPublicKey node_id_ref;
27167 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27168 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27169 LDKChannelReestablish msg_conv;
27170 msg_conv.inner = untag_ptr(msg);
27171 msg_conv.is_owned = ptr_is_owned(msg);
27172 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27173 msg_conv = ChannelReestablish_clone(&msg_conv);
27174 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27175 *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
27176 int64_t ret_ref = tag_ptr(ret_copy, true);
27180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1announcement(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg, int64_t update_msg) {
27181 LDKPublicKey node_id_ref;
27182 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27183 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27184 LDKChannelAnnouncement msg_conv;
27185 msg_conv.inner = untag_ptr(msg);
27186 msg_conv.is_owned = ptr_is_owned(msg);
27187 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27188 msg_conv = ChannelAnnouncement_clone(&msg_conv);
27189 LDKChannelUpdate update_msg_conv;
27190 update_msg_conv.inner = untag_ptr(update_msg);
27191 update_msg_conv.is_owned = ptr_is_owned(update_msg);
27192 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
27193 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
27194 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27195 *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv);
27196 int64_t ret_ref = tag_ptr(ret_copy, true);
27200 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg, int64_t update_msg) {
27201 LDKChannelAnnouncement msg_conv;
27202 msg_conv.inner = untag_ptr(msg);
27203 msg_conv.is_owned = ptr_is_owned(msg);
27204 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27205 msg_conv = ChannelAnnouncement_clone(&msg_conv);
27206 LDKChannelUpdate update_msg_conv;
27207 update_msg_conv.inner = untag_ptr(update_msg);
27208 update_msg_conv.is_owned = ptr_is_owned(update_msg);
27209 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
27210 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
27211 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27212 *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
27213 int64_t ret_ref = tag_ptr(ret_copy, true);
27217 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update(JNIEnv *env, jclass clz, int64_t msg) {
27218 LDKChannelUpdate msg_conv;
27219 msg_conv.inner = untag_ptr(msg);
27220 msg_conv.is_owned = ptr_is_owned(msg);
27221 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27222 msg_conv = ChannelUpdate_clone(&msg_conv);
27223 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27224 *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
27225 int64_t ret_ref = tag_ptr(ret_copy, true);
27229 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) {
27230 LDKNodeAnnouncement msg_conv;
27231 msg_conv.inner = untag_ptr(msg);
27232 msg_conv.is_owned = ptr_is_owned(msg);
27233 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27234 msg_conv = NodeAnnouncement_clone(&msg_conv);
27235 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27236 *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
27237 int64_t ret_ref = tag_ptr(ret_copy, true);
27241 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
27242 LDKPublicKey node_id_ref;
27243 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27244 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27245 LDKChannelUpdate msg_conv;
27246 msg_conv.inner = untag_ptr(msg);
27247 msg_conv.is_owned = ptr_is_owned(msg);
27248 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27249 msg_conv = ChannelUpdate_clone(&msg_conv);
27250 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27251 *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
27252 int64_t ret_ref = tag_ptr(ret_copy, true);
27256 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t action) {
27257 LDKPublicKey node_id_ref;
27258 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27259 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27260 void* action_ptr = untag_ptr(action);
27261 CHECK_ACCESS(action_ptr);
27262 LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
27263 action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action));
27264 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27265 *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
27266 int64_t ret_ref = tag_ptr(ret_copy, true);
27270 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) {
27271 LDKPublicKey node_id_ref;
27272 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27273 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27274 LDKQueryChannelRange msg_conv;
27275 msg_conv.inner = untag_ptr(msg);
27276 msg_conv.is_owned = ptr_is_owned(msg);
27277 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27278 msg_conv = QueryChannelRange_clone(&msg_conv);
27279 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27280 *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
27281 int64_t ret_ref = tag_ptr(ret_copy, true);
27285 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) {
27286 LDKPublicKey node_id_ref;
27287 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27288 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27289 LDKQueryShortChannelIds msg_conv;
27290 msg_conv.inner = untag_ptr(msg);
27291 msg_conv.is_owned = ptr_is_owned(msg);
27292 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27293 msg_conv = QueryShortChannelIds_clone(&msg_conv);
27294 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27295 *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
27296 int64_t ret_ref = tag_ptr(ret_copy, true);
27300 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) {
27301 LDKPublicKey node_id_ref;
27302 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27303 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27304 LDKReplyChannelRange msg_conv;
27305 msg_conv.inner = untag_ptr(msg);
27306 msg_conv.is_owned = ptr_is_owned(msg);
27307 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27308 msg_conv = ReplyChannelRange_clone(&msg_conv);
27309 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27310 *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
27311 int64_t ret_ref = tag_ptr(ret_copy, true);
27315 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) {
27316 LDKPublicKey node_id_ref;
27317 CHECK((*env)->GetArrayLength(env, node_id) == 33);
27318 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
27319 LDKGossipTimestampFilter msg_conv;
27320 msg_conv.inner = untag_ptr(msg);
27321 msg_conv.is_owned = ptr_is_owned(msg);
27322 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
27323 msg_conv = GossipTimestampFilter_clone(&msg_conv);
27324 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
27325 *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv);
27326 int64_t ret_ref = tag_ptr(ret_copy, true);
27330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27331 if (!ptr_is_owned(this_ptr)) return;
27332 void* this_ptr_ptr = untag_ptr(this_ptr);
27333 CHECK_ACCESS(this_ptr_ptr);
27334 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
27335 FREE(untag_ptr(this_ptr));
27336 MessageSendEventsProvider_free(this_ptr_conv);
27339 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27340 if (!ptr_is_owned(this_ptr)) return;
27341 void* this_ptr_ptr = untag_ptr(this_ptr);
27342 CHECK_ACCESS(this_ptr_ptr);
27343 LDKOnionMessageProvider this_ptr_conv = *(LDKOnionMessageProvider*)(this_ptr_ptr);
27344 FREE(untag_ptr(this_ptr));
27345 OnionMessageProvider_free(this_ptr_conv);
27348 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27349 if (!ptr_is_owned(this_ptr)) return;
27350 void* this_ptr_ptr = untag_ptr(this_ptr);
27351 CHECK_ACCESS(this_ptr_ptr);
27352 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
27353 FREE(untag_ptr(this_ptr));
27354 EventsProvider_free(this_ptr_conv);
27357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27358 if (!ptr_is_owned(this_ptr)) return;
27359 void* this_ptr_ptr = untag_ptr(this_ptr);
27360 CHECK_ACCESS(this_ptr_ptr);
27361 LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
27362 FREE(untag_ptr(this_ptr));
27363 EventHandler_free(this_ptr_conv);
27366 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27367 if (!ptr_is_owned(this_ptr)) return;
27368 void* this_ptr_ptr = untag_ptr(this_ptr);
27369 CHECK_ACCESS(this_ptr_ptr);
27370 LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
27371 FREE(untag_ptr(this_ptr));
27372 APIError_free(this_ptr_conv);
27375 static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) {
27376 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27377 *ret_copy = APIError_clone(arg);
27378 int64_t ret_ref = tag_ptr(ret_copy, true);
27381 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27382 LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg);
27383 int64_t ret_conv = APIError_clone_ptr(arg_conv);
27387 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27388 LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig);
27389 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27390 *ret_copy = APIError_clone(orig_conv);
27391 int64_t ret_ref = tag_ptr(ret_copy, true);
27395 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error(JNIEnv *env, jclass clz, jstring err) {
27396 LDKStr err_conv = java_to_owned_str(env, err);
27397 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27398 *ret_copy = APIError_apimisuse_error(err_conv);
27399 int64_t ret_ref = tag_ptr(ret_copy, true);
27403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high(JNIEnv *env, jclass clz, jstring err, int32_t feerate) {
27404 LDKStr err_conv = java_to_owned_str(env, err);
27405 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27406 *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
27407 int64_t ret_ref = tag_ptr(ret_copy, true);
27411 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1invalid_1route(JNIEnv *env, jclass clz, jstring err) {
27412 LDKStr err_conv = java_to_owned_str(env, err);
27413 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27414 *ret_copy = APIError_invalid_route(err_conv);
27415 int64_t ret_ref = tag_ptr(ret_copy, true);
27419 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable(JNIEnv *env, jclass clz, jstring err) {
27420 LDKStr err_conv = java_to_owned_str(env, err);
27421 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27422 *ret_copy = APIError_channel_unavailable(err_conv);
27423 int64_t ret_ref = tag_ptr(ret_copy, true);
27427 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1in_1progress(JNIEnv *env, jclass clz) {
27428 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27429 *ret_copy = APIError_monitor_update_in_progress();
27430 int64_t ret_ref = tag_ptr(ret_copy, true);
27434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shutdown_1script(JNIEnv *env, jclass clz, int64_t script) {
27435 LDKShutdownScript script_conv;
27436 script_conv.inner = untag_ptr(script);
27437 script_conv.is_owned = ptr_is_owned(script);
27438 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv);
27439 script_conv = ShutdownScript_clone(&script_conv);
27440 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27441 *ret_copy = APIError_incompatible_shutdown_script(script_conv);
27442 int64_t ret_ref = tag_ptr(ret_copy, true);
27446 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_APIError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27447 LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a);
27448 LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b);
27449 jboolean ret_conv = APIError_eq(a_conv, b_conv);
27453 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_APIError_1write(JNIEnv *env, jclass clz, int64_t obj) {
27454 LDKAPIError* obj_conv = (LDKAPIError*)untag_ptr(obj);
27455 LDKCVec_u8Z ret_var = APIError_write(obj_conv);
27456 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27457 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27458 CVec_u8Z_free(ret_var);
27462 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
27463 LDKu8slice ser_ref;
27464 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
27465 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
27466 LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
27467 *ret_conv = APIError_read(ser_ref);
27468 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
27469 return tag_ptr(ret_conv, true);
27472 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27473 LDKBigSize this_obj_conv;
27474 this_obj_conv.inner = untag_ptr(this_obj);
27475 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27476 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27477 BigSize_free(this_obj_conv);
27480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
27481 LDKBigSize this_ptr_conv;
27482 this_ptr_conv.inner = untag_ptr(this_ptr);
27483 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27485 this_ptr_conv.is_owned = false;
27486 int64_t ret_conv = BigSize_get_a(&this_ptr_conv);
27490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27491 LDKBigSize 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 BigSize_set_a(&this_ptr_conv, val);
27499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
27500 LDKBigSize ret_var = BigSize_new(a_arg);
27501 int64_t ret_ref = 0;
27502 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27503 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27507 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Hostname_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27508 LDKHostname this_obj_conv;
27509 this_obj_conv.inner = untag_ptr(this_obj);
27510 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27511 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27512 Hostname_free(this_obj_conv);
27515 static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) {
27516 LDKHostname ret_var = Hostname_clone(arg);
27517 int64_t ret_ref = 0;
27518 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27519 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27522 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hostname_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27523 LDKHostname arg_conv;
27524 arg_conv.inner = untag_ptr(arg);
27525 arg_conv.is_owned = ptr_is_owned(arg);
27526 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27527 arg_conv.is_owned = false;
27528 int64_t ret_conv = Hostname_clone_ptr(&arg_conv);
27532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hostname_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27533 LDKHostname orig_conv;
27534 orig_conv.inner = untag_ptr(orig);
27535 orig_conv.is_owned = ptr_is_owned(orig);
27536 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27537 orig_conv.is_owned = false;
27538 LDKHostname ret_var = Hostname_clone(&orig_conv);
27539 int64_t ret_ref = 0;
27540 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27541 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27545 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Hostname_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27546 LDKHostname a_conv;
27547 a_conv.inner = untag_ptr(a);
27548 a_conv.is_owned = ptr_is_owned(a);
27549 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
27550 a_conv.is_owned = false;
27551 LDKHostname b_conv;
27552 b_conv.inner = untag_ptr(b);
27553 b_conv.is_owned = ptr_is_owned(b);
27554 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
27555 b_conv.is_owned = false;
27556 jboolean ret_conv = Hostname_eq(&a_conv, &b_conv);
27560 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_Hostname_1len(JNIEnv *env, jclass clz, int64_t this_arg) {
27561 LDKHostname this_arg_conv;
27562 this_arg_conv.inner = untag_ptr(this_arg);
27563 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27564 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27565 this_arg_conv.is_owned = false;
27566 int8_t ret_conv = Hostname_len(&this_arg_conv);
27570 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) {
27571 LDKu8slice msg_ref;
27572 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
27573 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
27574 uint8_t sk_arr[32];
27575 CHECK((*env)->GetArrayLength(env, sk) == 32);
27576 (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr);
27577 uint8_t (*sk_ref)[32] = &sk_arr;
27578 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
27579 *ret_conv = sign(msg_ref, sk_ref);
27580 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
27581 return tag_ptr(ret_conv, true);
27584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_recover_1pk(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig) {
27585 LDKu8slice msg_ref;
27586 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
27587 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
27588 LDKStr sig_conv = java_to_owned_str(env, sig);
27589 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
27590 *ret_conv = recover_pk(msg_ref, sig_conv);
27591 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
27592 return tag_ptr(ret_conv, true);
27595 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig, int8_tArray pk) {
27596 LDKu8slice msg_ref;
27597 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
27598 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
27599 LDKStr sig_conv = java_to_owned_str(env, sig);
27600 LDKPublicKey pk_ref;
27601 CHECK((*env)->GetArrayLength(env, pk) == 33);
27602 (*env)->GetByteArrayRegion(env, pk, 0, 33, pk_ref.compressed_form);
27603 jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
27604 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
27608 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage(JNIEnv *env, jclass clz, int8_tArray hrp_bytes, jobjectArray data_without_signature) {
27609 LDKu8slice hrp_bytes_ref;
27610 hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes);
27611 hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL);
27612 LDKCVec_U5Z data_without_signature_constr;
27613 data_without_signature_constr.datalen = (*env)->GetArrayLength(env, data_without_signature);
27614 if (data_without_signature_constr.datalen > 0)
27615 data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements");
27617 data_without_signature_constr.data = NULL;
27618 int8_t* data_without_signature_vals = (*env)->GetByteArrayElements (env, data_without_signature, NULL);
27619 for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
27620 int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
27622 data_without_signature_constr.data[h] = (LDKU5){ ._0 = data_without_signature_conv_7 };
27624 (*env)->ReleaseByteArrayElements(env, data_without_signature, data_without_signature_vals, 0);
27625 LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
27626 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27627 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27628 CVec_u8Z_free(ret_var);
27629 (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0);
27633 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27634 if (!ptr_is_owned(this_ptr)) return;
27635 void* this_ptr_ptr = untag_ptr(this_ptr);
27636 CHECK_ACCESS(this_ptr_ptr);
27637 LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr);
27638 FREE(untag_ptr(this_ptr));
27639 Persister_free(this_ptr_conv);
27642 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27643 LDKPrintableString this_obj_conv;
27644 this_obj_conv.inner = untag_ptr(this_obj);
27645 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27646 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27647 PrintableString_free(this_obj_conv);
27650 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
27651 LDKPrintableString this_ptr_conv;
27652 this_ptr_conv.inner = untag_ptr(this_ptr);
27653 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27655 this_ptr_conv.is_owned = false;
27656 LDKStr ret_str = PrintableString_get_a(&this_ptr_conv);
27657 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
27662 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
27663 LDKPrintableString this_ptr_conv;
27664 this_ptr_conv.inner = untag_ptr(this_ptr);
27665 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27667 this_ptr_conv.is_owned = false;
27668 LDKStr val_conv = java_to_owned_str(env, val);
27669 PrintableString_set_a(&this_ptr_conv, val_conv);
27672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrintableString_1new(JNIEnv *env, jclass clz, jstring a_arg) {
27673 LDKStr a_arg_conv = java_to_owned_str(env, a_arg);
27674 LDKPrintableString ret_var = PrintableString_new(a_arg_conv);
27675 int64_t ret_ref = 0;
27676 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27677 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27681 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FutureCallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27682 if (!ptr_is_owned(this_ptr)) return;
27683 void* this_ptr_ptr = untag_ptr(this_ptr);
27684 CHECK_ACCESS(this_ptr_ptr);
27685 LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr);
27686 FREE(untag_ptr(this_ptr));
27687 FutureCallback_free(this_ptr_conv);
27690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Future_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27691 LDKFuture this_obj_conv;
27692 this_obj_conv.inner = untag_ptr(this_obj);
27693 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27695 Future_free(this_obj_conv);
27698 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Future_1register_1callback_1fn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t callback) {
27699 LDKFuture this_arg_conv;
27700 this_arg_conv.inner = untag_ptr(this_arg);
27701 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27703 this_arg_conv.is_owned = false;
27704 void* callback_ptr = untag_ptr(callback);
27705 CHECK_ACCESS(callback_ptr);
27706 LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr);
27707 if (callback_conv.free == LDKFutureCallback_JCalls_free) {
27708 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27709 LDKFutureCallback_JCalls_cloned(&callback_conv);
27711 Future_register_callback_fn(&this_arg_conv, callback_conv);
27714 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27715 LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig);
27716 jclass ret_conv = LDKLevel_to_java(env, Level_clone(orig_conv));
27720 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1gossip(JNIEnv *env, jclass clz) {
27721 jclass ret_conv = LDKLevel_to_java(env, Level_gossip());
27725 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) {
27726 jclass ret_conv = LDKLevel_to_java(env, Level_trace());
27730 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1debug(JNIEnv *env, jclass clz) {
27731 jclass ret_conv = LDKLevel_to_java(env, Level_debug());
27735 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1info(JNIEnv *env, jclass clz) {
27736 jclass ret_conv = LDKLevel_to_java(env, Level_info());
27740 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1warn(JNIEnv *env, jclass clz) {
27741 jclass ret_conv = LDKLevel_to_java(env, Level_warn());
27745 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1error(JNIEnv *env, jclass clz) {
27746 jclass ret_conv = LDKLevel_to_java(env, Level_error());
27750 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Level_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27751 LDKLevel* a_conv = (LDKLevel*)untag_ptr(a);
27752 LDKLevel* b_conv = (LDKLevel*)untag_ptr(b);
27753 jboolean ret_conv = Level_eq(a_conv, b_conv);
27757 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Level_1hash(JNIEnv *env, jclass clz, int64_t o) {
27758 LDKLevel* o_conv = (LDKLevel*)untag_ptr(o);
27759 int64_t ret_conv = Level_hash(o_conv);
27763 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jclass clz) {
27764 jclass ret_conv = LDKLevel_to_java(env, Level_max());
27768 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27769 LDKRecord this_obj_conv;
27770 this_obj_conv.inner = untag_ptr(this_obj);
27771 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27773 Record_free(this_obj_conv);
27776 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) {
27777 LDKRecord this_ptr_conv;
27778 this_ptr_conv.inner = untag_ptr(this_ptr);
27779 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27781 this_ptr_conv.is_owned = false;
27782 jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv));
27786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
27787 LDKRecord this_ptr_conv;
27788 this_ptr_conv.inner = untag_ptr(this_ptr);
27789 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27790 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27791 this_ptr_conv.is_owned = false;
27792 LDKLevel val_conv = LDKLevel_from_java(env, val);
27793 Record_set_level(&this_ptr_conv, val_conv);
27796 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) {
27797 LDKRecord this_ptr_conv;
27798 this_ptr_conv.inner = untag_ptr(this_ptr);
27799 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27800 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27801 this_ptr_conv.is_owned = false;
27802 LDKStr ret_str = Record_get_args(&this_ptr_conv);
27803 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
27808 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
27809 LDKRecord this_ptr_conv;
27810 this_ptr_conv.inner = untag_ptr(this_ptr);
27811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27813 this_ptr_conv.is_owned = false;
27814 LDKStr val_conv = java_to_owned_str(env, val);
27815 Record_set_args(&this_ptr_conv, val_conv);
27818 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) {
27819 LDKRecord this_ptr_conv;
27820 this_ptr_conv.inner = untag_ptr(this_ptr);
27821 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27822 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27823 this_ptr_conv.is_owned = false;
27824 LDKStr ret_str = Record_get_module_path(&this_ptr_conv);
27825 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
27830 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
27831 LDKRecord this_ptr_conv;
27832 this_ptr_conv.inner = untag_ptr(this_ptr);
27833 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27834 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27835 this_ptr_conv.is_owned = false;
27836 LDKStr val_conv = java_to_owned_str(env, val);
27837 Record_set_module_path(&this_ptr_conv, val_conv);
27840 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) {
27841 LDKRecord this_ptr_conv;
27842 this_ptr_conv.inner = untag_ptr(this_ptr);
27843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27845 this_ptr_conv.is_owned = false;
27846 LDKStr ret_str = Record_get_file(&this_ptr_conv);
27847 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
27852 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
27853 LDKRecord this_ptr_conv;
27854 this_ptr_conv.inner = untag_ptr(this_ptr);
27855 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27856 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27857 this_ptr_conv.is_owned = false;
27858 LDKStr val_conv = java_to_owned_str(env, val);
27859 Record_set_file(&this_ptr_conv, val_conv);
27862 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) {
27863 LDKRecord this_ptr_conv;
27864 this_ptr_conv.inner = untag_ptr(this_ptr);
27865 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27867 this_ptr_conv.is_owned = false;
27868 int32_t ret_conv = Record_get_line(&this_ptr_conv);
27872 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
27873 LDKRecord this_ptr_conv;
27874 this_ptr_conv.inner = untag_ptr(this_ptr);
27875 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27876 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27877 this_ptr_conv.is_owned = false;
27878 Record_set_line(&this_ptr_conv, val);
27881 static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) {
27882 LDKRecord ret_var = Record_clone(arg);
27883 int64_t ret_ref = 0;
27884 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27885 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27888 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27889 LDKRecord arg_conv;
27890 arg_conv.inner = untag_ptr(arg);
27891 arg_conv.is_owned = ptr_is_owned(arg);
27892 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27893 arg_conv.is_owned = false;
27894 int64_t ret_conv = Record_clone_ptr(&arg_conv);
27898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27899 LDKRecord orig_conv;
27900 orig_conv.inner = untag_ptr(orig);
27901 orig_conv.is_owned = ptr_is_owned(orig);
27902 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27903 orig_conv.is_owned = false;
27904 LDKRecord ret_var = Record_clone(&orig_conv);
27905 int64_t ret_ref = 0;
27906 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27907 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27911 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27912 if (!ptr_is_owned(this_ptr)) return;
27913 void* this_ptr_ptr = untag_ptr(this_ptr);
27914 CHECK_ACCESS(this_ptr_ptr);
27915 LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
27916 FREE(untag_ptr(this_ptr));
27917 Logger_free(this_ptr_conv);
27920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27921 LDKChannelHandshakeConfig this_obj_conv;
27922 this_obj_conv.inner = untag_ptr(this_obj);
27923 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27925 ChannelHandshakeConfig_free(this_obj_conv);
27928 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
27929 LDKChannelHandshakeConfig this_ptr_conv;
27930 this_ptr_conv.inner = untag_ptr(this_ptr);
27931 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27932 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27933 this_ptr_conv.is_owned = false;
27934 int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
27938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
27939 LDKChannelHandshakeConfig this_ptr_conv;
27940 this_ptr_conv.inner = untag_ptr(this_ptr);
27941 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27943 this_ptr_conv.is_owned = false;
27944 ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
27947 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
27948 LDKChannelHandshakeConfig this_ptr_conv;
27949 this_ptr_conv.inner = untag_ptr(this_ptr);
27950 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27952 this_ptr_conv.is_owned = false;
27953 int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
27957 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) {
27958 LDKChannelHandshakeConfig this_ptr_conv;
27959 this_ptr_conv.inner = untag_ptr(this_ptr);
27960 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27962 this_ptr_conv.is_owned = false;
27963 ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
27966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
27967 LDKChannelHandshakeConfig 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 int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
27976 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) {
27977 LDKChannelHandshakeConfig 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 ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
27985 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) {
27986 LDKChannelHandshakeConfig this_ptr_conv;
27987 this_ptr_conv.inner = untag_ptr(this_ptr);
27988 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27990 this_ptr_conv.is_owned = false;
27991 int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv);
27995 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) {
27996 LDKChannelHandshakeConfig this_ptr_conv;
27997 this_ptr_conv.inner = untag_ptr(this_ptr);
27998 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27999 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28000 this_ptr_conv.is_owned = false;
28001 ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val);
28004 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr) {
28005 LDKChannelHandshakeConfig this_ptr_conv;
28006 this_ptr_conv.inner = untag_ptr(this_ptr);
28007 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28009 this_ptr_conv.is_owned = false;
28010 jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv);
28014 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28015 LDKChannelHandshakeConfig this_ptr_conv;
28016 this_ptr_conv.inner = untag_ptr(this_ptr);
28017 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28019 this_ptr_conv.is_owned = false;
28020 ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val);
28023 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) {
28024 LDKChannelHandshakeConfig this_ptr_conv;
28025 this_ptr_conv.inner = untag_ptr(this_ptr);
28026 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28027 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28028 this_ptr_conv.is_owned = false;
28029 jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv);
28033 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28034 LDKChannelHandshakeConfig this_ptr_conv;
28035 this_ptr_conv.inner = untag_ptr(this_ptr);
28036 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28038 this_ptr_conv.is_owned = false;
28039 ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val);
28042 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
28043 LDKChannelHandshakeConfig this_ptr_conv;
28044 this_ptr_conv.inner = untag_ptr(this_ptr);
28045 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28046 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28047 this_ptr_conv.is_owned = false;
28048 jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
28052 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28053 LDKChannelHandshakeConfig this_ptr_conv;
28054 this_ptr_conv.inner = untag_ptr(this_ptr);
28055 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28057 this_ptr_conv.is_owned = false;
28058 ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
28061 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1their_1channel_1reserve_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
28062 LDKChannelHandshakeConfig this_ptr_conv;
28063 this_ptr_conv.inner = untag_ptr(this_ptr);
28064 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28065 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28066 this_ptr_conv.is_owned = false;
28067 int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv);
28071 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1their_1channel_1reserve_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
28072 LDKChannelHandshakeConfig this_ptr_conv;
28073 this_ptr_conv.inner = untag_ptr(this_ptr);
28074 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28075 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28076 this_ptr_conv.is_owned = false;
28077 ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val);
28080 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg) {
28081 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg);
28082 int64_t ret_ref = 0;
28083 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28084 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28088 static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) {
28089 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg);
28090 int64_t ret_ref = 0;
28091 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28092 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28096 LDKChannelHandshakeConfig arg_conv;
28097 arg_conv.inner = untag_ptr(arg);
28098 arg_conv.is_owned = ptr_is_owned(arg);
28099 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28100 arg_conv.is_owned = false;
28101 int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv);
28105 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28106 LDKChannelHandshakeConfig orig_conv;
28107 orig_conv.inner = untag_ptr(orig);
28108 orig_conv.is_owned = ptr_is_owned(orig);
28109 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28110 orig_conv.is_owned = false;
28111 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
28112 int64_t ret_ref = 0;
28113 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28114 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28118 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv *env, jclass clz) {
28119 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
28120 int64_t ret_ref = 0;
28121 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28122 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28126 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28127 LDKChannelHandshakeLimits this_obj_conv;
28128 this_obj_conv.inner = untag_ptr(this_obj);
28129 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28130 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28131 ChannelHandshakeLimits_free(this_obj_conv);
28134 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
28135 LDKChannelHandshakeLimits this_ptr_conv;
28136 this_ptr_conv.inner = untag_ptr(this_ptr);
28137 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28138 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28139 this_ptr_conv.is_owned = false;
28140 int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
28144 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28145 LDKChannelHandshakeLimits this_ptr_conv;
28146 this_ptr_conv.inner = untag_ptr(this_ptr);
28147 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28149 this_ptr_conv.is_owned = false;
28150 ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
28153 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
28154 LDKChannelHandshakeLimits this_ptr_conv;
28155 this_ptr_conv.inner = untag_ptr(this_ptr);
28156 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28157 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28158 this_ptr_conv.is_owned = false;
28159 int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv);
28163 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28164 LDKChannelHandshakeLimits this_ptr_conv;
28165 this_ptr_conv.inner = untag_ptr(this_ptr);
28166 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28168 this_ptr_conv.is_owned = false;
28169 ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val);
28172 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28173 LDKChannelHandshakeLimits this_ptr_conv;
28174 this_ptr_conv.inner = untag_ptr(this_ptr);
28175 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28176 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28177 this_ptr_conv.is_owned = false;
28178 int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
28182 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) {
28183 LDKChannelHandshakeLimits this_ptr_conv;
28184 this_ptr_conv.inner = untag_ptr(this_ptr);
28185 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28186 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28187 this_ptr_conv.is_owned = false;
28188 ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
28191 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) {
28192 LDKChannelHandshakeLimits 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 int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
28201 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) {
28202 LDKChannelHandshakeLimits this_ptr_conv;
28203 this_ptr_conv.inner = untag_ptr(this_ptr);
28204 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28206 this_ptr_conv.is_owned = false;
28207 ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
28210 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
28211 LDKChannelHandshakeLimits this_ptr_conv;
28212 this_ptr_conv.inner = untag_ptr(this_ptr);
28213 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28215 this_ptr_conv.is_owned = false;
28216 int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
28220 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) {
28221 LDKChannelHandshakeLimits this_ptr_conv;
28222 this_ptr_conv.inner = untag_ptr(this_ptr);
28223 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28224 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28225 this_ptr_conv.is_owned = false;
28226 ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
28229 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
28230 LDKChannelHandshakeLimits this_ptr_conv;
28231 this_ptr_conv.inner = untag_ptr(this_ptr);
28232 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28233 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28234 this_ptr_conv.is_owned = false;
28235 int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
28239 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) {
28240 LDKChannelHandshakeLimits this_ptr_conv;
28241 this_ptr_conv.inner = untag_ptr(this_ptr);
28242 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28244 this_ptr_conv.is_owned = false;
28245 ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
28248 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
28249 LDKChannelHandshakeLimits this_ptr_conv;
28250 this_ptr_conv.inner = untag_ptr(this_ptr);
28251 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28253 this_ptr_conv.is_owned = false;
28254 int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
28258 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
28259 LDKChannelHandshakeLimits this_ptr_conv;
28260 this_ptr_conv.inner = untag_ptr(this_ptr);
28261 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28262 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28263 this_ptr_conv.is_owned = false;
28264 ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
28267 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr) {
28268 LDKChannelHandshakeLimits this_ptr_conv;
28269 this_ptr_conv.inner = untag_ptr(this_ptr);
28270 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28272 this_ptr_conv.is_owned = false;
28273 jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv);
28277 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28278 LDKChannelHandshakeLimits this_ptr_conv;
28279 this_ptr_conv.inner = untag_ptr(this_ptr);
28280 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28281 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28282 this_ptr_conv.is_owned = false;
28283 ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val);
28286 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr) {
28287 LDKChannelHandshakeLimits this_ptr_conv;
28288 this_ptr_conv.inner = untag_ptr(this_ptr);
28289 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28290 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28291 this_ptr_conv.is_owned = false;
28292 jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
28296 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28297 LDKChannelHandshakeLimits this_ptr_conv;
28298 this_ptr_conv.inner = untag_ptr(this_ptr);
28299 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28301 this_ptr_conv.is_owned = false;
28302 ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
28305 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
28306 LDKChannelHandshakeLimits this_ptr_conv;
28307 this_ptr_conv.inner = untag_ptr(this_ptr);
28308 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28309 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28310 this_ptr_conv.is_owned = false;
28311 int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
28315 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) {
28316 LDKChannelHandshakeLimits this_ptr_conv;
28317 this_ptr_conv.inner = untag_ptr(this_ptr);
28318 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28319 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28320 this_ptr_conv.is_owned = false;
28321 ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
28324 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) {
28325 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);
28326 int64_t ret_ref = 0;
28327 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28328 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28332 static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) {
28333 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg);
28334 int64_t ret_ref = 0;
28335 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28336 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28340 LDKChannelHandshakeLimits arg_conv;
28341 arg_conv.inner = untag_ptr(arg);
28342 arg_conv.is_owned = ptr_is_owned(arg);
28343 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28344 arg_conv.is_owned = false;
28345 int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv);
28349 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28350 LDKChannelHandshakeLimits orig_conv;
28351 orig_conv.inner = untag_ptr(orig);
28352 orig_conv.is_owned = ptr_is_owned(orig);
28353 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28354 orig_conv.is_owned = false;
28355 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
28356 int64_t ret_ref = 0;
28357 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28358 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28362 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv *env, jclass clz) {
28363 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
28364 int64_t ret_ref = 0;
28365 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28366 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28370 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28371 LDKChannelConfig this_obj_conv;
28372 this_obj_conv.inner = untag_ptr(this_obj);
28373 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28375 ChannelConfig_free(this_obj_conv);
28378 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
28379 LDKChannelConfig this_ptr_conv;
28380 this_ptr_conv.inner = untag_ptr(this_ptr);
28381 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28382 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28383 this_ptr_conv.is_owned = false;
28384 int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
28388 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) {
28389 LDKChannelConfig this_ptr_conv;
28390 this_ptr_conv.inner = untag_ptr(this_ptr);
28391 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28392 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28393 this_ptr_conv.is_owned = false;
28394 ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
28397 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28398 LDKChannelConfig this_ptr_conv;
28399 this_ptr_conv.inner = untag_ptr(this_ptr);
28400 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28402 this_ptr_conv.is_owned = false;
28403 int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
28407 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) {
28408 LDKChannelConfig this_ptr_conv;
28409 this_ptr_conv.inner = untag_ptr(this_ptr);
28410 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28412 this_ptr_conv.is_owned = false;
28413 ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
28416 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
28417 LDKChannelConfig this_ptr_conv;
28418 this_ptr_conv.inner = untag_ptr(this_ptr);
28419 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28421 this_ptr_conv.is_owned = false;
28422 int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
28426 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
28427 LDKChannelConfig this_ptr_conv;
28428 this_ptr_conv.inner = untag_ptr(this_ptr);
28429 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28430 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28431 this_ptr_conv.is_owned = false;
28432 ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
28435 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28436 LDKChannelConfig this_ptr_conv;
28437 this_ptr_conv.inner = untag_ptr(this_ptr);
28438 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28440 this_ptr_conv.is_owned = false;
28441 int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
28445 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) {
28446 LDKChannelConfig this_ptr_conv;
28447 this_ptr_conv.inner = untag_ptr(this_ptr);
28448 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28450 this_ptr_conv.is_owned = false;
28451 ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
28454 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) {
28455 LDKChannelConfig this_ptr_conv;
28456 this_ptr_conv.inner = untag_ptr(this_ptr);
28457 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28458 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28459 this_ptr_conv.is_owned = false;
28460 int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
28464 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) {
28465 LDKChannelConfig this_ptr_conv;
28466 this_ptr_conv.inner = untag_ptr(this_ptr);
28467 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28469 this_ptr_conv.is_owned = false;
28470 ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
28473 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) {
28474 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);
28475 int64_t ret_ref = 0;
28476 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28477 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28481 static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) {
28482 LDKChannelConfig ret_var = ChannelConfig_clone(arg);
28483 int64_t ret_ref = 0;
28484 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28485 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28488 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28489 LDKChannelConfig arg_conv;
28490 arg_conv.inner = untag_ptr(arg);
28491 arg_conv.is_owned = ptr_is_owned(arg);
28492 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28493 arg_conv.is_owned = false;
28494 int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv);
28498 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28499 LDKChannelConfig orig_conv;
28500 orig_conv.inner = untag_ptr(orig);
28501 orig_conv.is_owned = ptr_is_owned(orig);
28502 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28503 orig_conv.is_owned = false;
28504 LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
28505 int64_t ret_ref = 0;
28506 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28507 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28511 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
28512 LDKChannelConfig a_conv;
28513 a_conv.inner = untag_ptr(a);
28514 a_conv.is_owned = ptr_is_owned(a);
28515 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28516 a_conv.is_owned = false;
28517 LDKChannelConfig b_conv;
28518 b_conv.inner = untag_ptr(b);
28519 b_conv.is_owned = ptr_is_owned(b);
28520 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
28521 b_conv.is_owned = false;
28522 jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv);
28526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) {
28527 LDKChannelConfig ret_var = ChannelConfig_default();
28528 int64_t ret_ref = 0;
28529 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28530 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28534 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv *env, jclass clz, int64_t obj) {
28535 LDKChannelConfig obj_conv;
28536 obj_conv.inner = untag_ptr(obj);
28537 obj_conv.is_owned = ptr_is_owned(obj);
28538 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
28539 obj_conv.is_owned = false;
28540 LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
28541 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
28542 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
28543 CVec_u8Z_free(ret_var);
28547 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
28548 LDKu8slice ser_ref;
28549 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
28550 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
28551 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
28552 *ret_conv = ChannelConfig_read(ser_ref);
28553 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
28554 return tag_ptr(ret_conv, true);
28557 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28558 LDKUserConfig this_obj_conv;
28559 this_obj_conv.inner = untag_ptr(this_obj);
28560 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28562 UserConfig_free(this_obj_conv);
28565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1handshake_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
28566 LDKUserConfig this_ptr_conv;
28567 this_ptr_conv.inner = untag_ptr(this_ptr);
28568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28570 this_ptr_conv.is_owned = false;
28571 LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&this_ptr_conv);
28572 int64_t ret_ref = 0;
28573 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28574 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28578 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1handshake_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28579 LDKUserConfig this_ptr_conv;
28580 this_ptr_conv.inner = untag_ptr(this_ptr);
28581 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28582 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28583 this_ptr_conv.is_owned = false;
28584 LDKChannelHandshakeConfig val_conv;
28585 val_conv.inner = untag_ptr(val);
28586 val_conv.is_owned = ptr_is_owned(val);
28587 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28588 val_conv = ChannelHandshakeConfig_clone(&val_conv);
28589 UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv);
28592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1handshake_1limits(JNIEnv *env, jclass clz, int64_t this_ptr) {
28593 LDKUserConfig this_ptr_conv;
28594 this_ptr_conv.inner = untag_ptr(this_ptr);
28595 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28596 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28597 this_ptr_conv.is_owned = false;
28598 LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&this_ptr_conv);
28599 int64_t ret_ref = 0;
28600 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28601 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1handshake_1limits(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28606 LDKUserConfig this_ptr_conv;
28607 this_ptr_conv.inner = untag_ptr(this_ptr);
28608 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28609 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28610 this_ptr_conv.is_owned = false;
28611 LDKChannelHandshakeLimits val_conv;
28612 val_conv.inner = untag_ptr(val);
28613 val_conv.is_owned = ptr_is_owned(val);
28614 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28615 val_conv = ChannelHandshakeLimits_clone(&val_conv);
28616 UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv);
28619 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
28620 LDKUserConfig this_ptr_conv;
28621 this_ptr_conv.inner = untag_ptr(this_ptr);
28622 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28624 this_ptr_conv.is_owned = false;
28625 LDKChannelConfig ret_var = UserConfig_get_channel_config(&this_ptr_conv);
28626 int64_t ret_ref = 0;
28627 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28628 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28632 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28633 LDKUserConfig this_ptr_conv;
28634 this_ptr_conv.inner = untag_ptr(this_ptr);
28635 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28637 this_ptr_conv.is_owned = false;
28638 LDKChannelConfig val_conv;
28639 val_conv.inner = untag_ptr(val);
28640 val_conv.is_owned = ptr_is_owned(val);
28641 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28642 val_conv = ChannelConfig_clone(&val_conv);
28643 UserConfig_set_channel_config(&this_ptr_conv, val_conv);
28646 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
28647 LDKUserConfig this_ptr_conv;
28648 this_ptr_conv.inner = untag_ptr(this_ptr);
28649 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28650 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28651 this_ptr_conv.is_owned = false;
28652 jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
28656 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) {
28657 LDKUserConfig this_ptr_conv;
28658 this_ptr_conv.inner = untag_ptr(this_ptr);
28659 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28661 this_ptr_conv.is_owned = false;
28662 UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
28665 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
28666 LDKUserConfig this_ptr_conv;
28667 this_ptr_conv.inner = untag_ptr(this_ptr);
28668 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28670 this_ptr_conv.is_owned = false;
28671 jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
28675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28676 LDKUserConfig this_ptr_conv;
28677 this_ptr_conv.inner = untag_ptr(this_ptr);
28678 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28680 this_ptr_conv.is_owned = false;
28681 UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
28684 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
28685 LDKUserConfig this_ptr_conv;
28686 this_ptr_conv.inner = untag_ptr(this_ptr);
28687 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28689 this_ptr_conv.is_owned = false;
28690 jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv);
28694 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28695 LDKUserConfig this_ptr_conv;
28696 this_ptr_conv.inner = untag_ptr(this_ptr);
28697 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28699 this_ptr_conv.is_owned = false;
28700 UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val);
28703 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1intercept_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
28704 LDKUserConfig this_ptr_conv;
28705 this_ptr_conv.inner = untag_ptr(this_ptr);
28706 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28708 this_ptr_conv.is_owned = false;
28709 jboolean ret_conv = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv);
28713 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1intercept_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28714 LDKUserConfig this_ptr_conv;
28715 this_ptr_conv.inner = untag_ptr(this_ptr);
28716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28718 this_ptr_conv.is_owned = false;
28719 UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val);
28722 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, jboolean accept_intercept_htlcs_arg) {
28723 LDKChannelHandshakeConfig channel_handshake_config_arg_conv;
28724 channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg);
28725 channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg);
28726 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv);
28727 channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv);
28728 LDKChannelHandshakeLimits channel_handshake_limits_arg_conv;
28729 channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg);
28730 channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg);
28731 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv);
28732 channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv);
28733 LDKChannelConfig channel_config_arg_conv;
28734 channel_config_arg_conv.inner = untag_ptr(channel_config_arg);
28735 channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg);
28736 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv);
28737 channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv);
28738 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, accept_intercept_htlcs_arg);
28739 int64_t ret_ref = 0;
28740 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28741 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28745 static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) {
28746 LDKUserConfig ret_var = UserConfig_clone(arg);
28747 int64_t ret_ref = 0;
28748 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28749 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28752 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28753 LDKUserConfig arg_conv;
28754 arg_conv.inner = untag_ptr(arg);
28755 arg_conv.is_owned = ptr_is_owned(arg);
28756 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28757 arg_conv.is_owned = false;
28758 int64_t ret_conv = UserConfig_clone_ptr(&arg_conv);
28762 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28763 LDKUserConfig orig_conv;
28764 orig_conv.inner = untag_ptr(orig);
28765 orig_conv.is_owned = ptr_is_owned(orig);
28766 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28767 orig_conv.is_owned = false;
28768 LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
28769 int64_t ret_ref = 0;
28770 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28771 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28775 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv *env, jclass clz) {
28776 LDKUserConfig ret_var = UserConfig_default();
28777 int64_t ret_ref = 0;
28778 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28779 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28783 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28784 LDKBestBlock this_obj_conv;
28785 this_obj_conv.inner = untag_ptr(this_obj);
28786 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28787 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28788 BestBlock_free(this_obj_conv);
28791 static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) {
28792 LDKBestBlock ret_var = BestBlock_clone(arg);
28793 int64_t ret_ref = 0;
28794 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28795 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28798 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28799 LDKBestBlock arg_conv;
28800 arg_conv.inner = untag_ptr(arg);
28801 arg_conv.is_owned = ptr_is_owned(arg);
28802 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28803 arg_conv.is_owned = false;
28804 int64_t ret_conv = BestBlock_clone_ptr(&arg_conv);
28808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28809 LDKBestBlock orig_conv;
28810 orig_conv.inner = untag_ptr(orig);
28811 orig_conv.is_owned = ptr_is_owned(orig);
28812 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28813 orig_conv.is_owned = false;
28814 LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
28815 int64_t ret_ref = 0;
28816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28821 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BestBlock_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
28822 LDKBestBlock a_conv;
28823 a_conv.inner = untag_ptr(a);
28824 a_conv.is_owned = ptr_is_owned(a);
28825 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28826 a_conv.is_owned = false;
28827 LDKBestBlock b_conv;
28828 b_conv.inner = untag_ptr(b);
28829 b_conv.is_owned = ptr_is_owned(b);
28830 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
28831 b_conv.is_owned = false;
28832 jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv);
28836 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1network(JNIEnv *env, jclass clz, jclass network) {
28837 LDKNetwork network_conv = LDKNetwork_from_java(env, network);
28838 LDKBestBlock ret_var = BestBlock_from_network(network_conv);
28839 int64_t ret_ref = 0;
28840 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28841 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28845 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, jclass clz, int8_tArray block_hash, int32_t height) {
28846 LDKThirtyTwoBytes block_hash_ref;
28847 CHECK((*env)->GetArrayLength(env, block_hash) == 32);
28848 (*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data);
28849 LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
28850 int64_t ret_ref = 0;
28851 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28852 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28856 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
28857 LDKBestBlock this_arg_conv;
28858 this_arg_conv.inner = untag_ptr(this_arg);
28859 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28861 this_arg_conv.is_owned = false;
28862 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
28863 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data);
28867 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *env, jclass clz, int64_t this_arg) {
28868 LDKBestBlock this_arg_conv;
28869 this_arg_conv.inner = untag_ptr(this_arg);
28870 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28872 this_arg_conv.is_owned = false;
28873 int32_t ret_conv = BestBlock_height(&this_arg_conv);
28877 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
28878 if (!ptr_is_owned(this_ptr)) return;
28879 void* this_ptr_ptr = untag_ptr(this_ptr);
28880 CHECK_ACCESS(this_ptr_ptr);
28881 LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
28882 FREE(untag_ptr(this_ptr));
28883 Listen_free(this_ptr_conv);
28886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
28887 if (!ptr_is_owned(this_ptr)) return;
28888 void* this_ptr_ptr = untag_ptr(this_ptr);
28889 CHECK_ACCESS(this_ptr_ptr);
28890 LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
28891 FREE(untag_ptr(this_ptr));
28892 Confirm_free(this_ptr_conv);
28895 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28896 LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig);
28897 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_clone(orig_conv));
28901 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1completed(JNIEnv *env, jclass clz) {
28902 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_completed());
28906 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1in_1progress(JNIEnv *env, jclass clz) {
28907 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_in_progress());
28911 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1permanent_1failure(JNIEnv *env, jclass clz) {
28912 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_permanent_failure());
28916 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
28917 LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a);
28918 LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b);
28919 jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv);
28923 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
28924 if (!ptr_is_owned(this_ptr)) return;
28925 void* this_ptr_ptr = untag_ptr(this_ptr);
28926 CHECK_ACCESS(this_ptr_ptr);
28927 LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
28928 FREE(untag_ptr(this_ptr));
28929 Watch_free(this_ptr_conv);
28932 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
28933 if (!ptr_is_owned(this_ptr)) return;
28934 void* this_ptr_ptr = untag_ptr(this_ptr);
28935 CHECK_ACCESS(this_ptr_ptr);
28936 LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
28937 FREE(untag_ptr(this_ptr));
28938 Filter_free(this_ptr_conv);
28941 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28942 LDKWatchedOutput this_obj_conv;
28943 this_obj_conv.inner = untag_ptr(this_obj);
28944 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28945 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28946 WatchedOutput_free(this_obj_conv);
28949 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
28950 LDKWatchedOutput this_ptr_conv;
28951 this_ptr_conv.inner = untag_ptr(this_ptr);
28952 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28954 this_ptr_conv.is_owned = false;
28955 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
28956 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data);
28960 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
28961 LDKWatchedOutput this_ptr_conv;
28962 this_ptr_conv.inner = untag_ptr(this_ptr);
28963 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28964 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28965 this_ptr_conv.is_owned = false;
28966 LDKThirtyTwoBytes val_ref;
28967 CHECK((*env)->GetArrayLength(env, val) == 32);
28968 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
28969 WatchedOutput_set_block_hash(&this_ptr_conv, val_ref);
28972 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
28973 LDKWatchedOutput this_ptr_conv;
28974 this_ptr_conv.inner = untag_ptr(this_ptr);
28975 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28976 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28977 this_ptr_conv.is_owned = false;
28978 LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv);
28979 int64_t ret_ref = 0;
28980 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28981 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28985 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28986 LDKWatchedOutput this_ptr_conv;
28987 this_ptr_conv.inner = untag_ptr(this_ptr);
28988 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28990 this_ptr_conv.is_owned = false;
28991 LDKOutPoint val_conv;
28992 val_conv.inner = untag_ptr(val);
28993 val_conv.is_owned = ptr_is_owned(val);
28994 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28995 val_conv = OutPoint_clone(&val_conv);
28996 WatchedOutput_set_outpoint(&this_ptr_conv, val_conv);
28999 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
29000 LDKWatchedOutput this_ptr_conv;
29001 this_ptr_conv.inner = untag_ptr(this_ptr);
29002 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29004 this_ptr_conv.is_owned = false;
29005 LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv);
29006 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29007 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29011 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
29012 LDKWatchedOutput this_ptr_conv;
29013 this_ptr_conv.inner = untag_ptr(this_ptr);
29014 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29016 this_ptr_conv.is_owned = false;
29017 LDKCVec_u8Z val_ref;
29018 val_ref.datalen = (*env)->GetArrayLength(env, val);
29019 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
29020 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
29021 WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref);
29024 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) {
29025 LDKThirtyTwoBytes block_hash_arg_ref;
29026 CHECK((*env)->GetArrayLength(env, block_hash_arg) == 32);
29027 (*env)->GetByteArrayRegion(env, block_hash_arg, 0, 32, block_hash_arg_ref.data);
29028 LDKOutPoint outpoint_arg_conv;
29029 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
29030 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
29031 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
29032 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
29033 LDKCVec_u8Z script_pubkey_arg_ref;
29034 script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg);
29035 script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
29036 (*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data);
29037 LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
29038 int64_t ret_ref = 0;
29039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29044 static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) {
29045 LDKWatchedOutput ret_var = WatchedOutput_clone(arg);
29046 int64_t ret_ref = 0;
29047 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29048 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29051 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29052 LDKWatchedOutput arg_conv;
29053 arg_conv.inner = untag_ptr(arg);
29054 arg_conv.is_owned = ptr_is_owned(arg);
29055 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29056 arg_conv.is_owned = false;
29057 int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv);
29061 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29062 LDKWatchedOutput orig_conv;
29063 orig_conv.inner = untag_ptr(orig);
29064 orig_conv.is_owned = ptr_is_owned(orig);
29065 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29066 orig_conv.is_owned = false;
29067 LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv);
29068 int64_t ret_ref = 0;
29069 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29070 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29074 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29075 LDKWatchedOutput a_conv;
29076 a_conv.inner = untag_ptr(a);
29077 a_conv.is_owned = ptr_is_owned(a);
29078 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29079 a_conv.is_owned = false;
29080 LDKWatchedOutput b_conv;
29081 b_conv.inner = untag_ptr(b);
29082 b_conv.is_owned = ptr_is_owned(b);
29083 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29084 b_conv.is_owned = false;
29085 jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv);
29089 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv *env, jclass clz, int64_t o) {
29090 LDKWatchedOutput o_conv;
29091 o_conv.inner = untag_ptr(o);
29092 o_conv.is_owned = ptr_is_owned(o);
29093 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
29094 o_conv.is_owned = false;
29095 int64_t ret_conv = WatchedOutput_hash(&o_conv);
29099 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29100 if (!ptr_is_owned(this_ptr)) return;
29101 void* this_ptr_ptr = untag_ptr(this_ptr);
29102 CHECK_ACCESS(this_ptr_ptr);
29103 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
29104 FREE(untag_ptr(this_ptr));
29105 BroadcasterInterface_free(this_ptr_conv);
29108 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29109 LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig);
29110 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_clone(orig_conv));
29114 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background(JNIEnv *env, jclass clz) {
29115 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_background());
29119 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal(JNIEnv *env, jclass clz) {
29120 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_normal());
29124 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority(JNIEnv *env, jclass clz) {
29125 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_high_priority());
29129 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1hash(JNIEnv *env, jclass clz, int64_t o) {
29130 LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o);
29131 int64_t ret_conv = ConfirmationTarget_hash(o_conv);
29135 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29136 LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a);
29137 LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b);
29138 jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv);
29142 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29143 if (!ptr_is_owned(this_ptr)) return;
29144 void* this_ptr_ptr = untag_ptr(this_ptr);
29145 CHECK_ACCESS(this_ptr_ptr);
29146 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
29147 FREE(untag_ptr(this_ptr));
29148 FeeEstimator_free(this_ptr_conv);
29151 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29152 LDKMonitorUpdateId this_obj_conv;
29153 this_obj_conv.inner = untag_ptr(this_obj);
29154 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29155 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29156 MonitorUpdateId_free(this_obj_conv);
29159 static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) {
29160 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg);
29161 int64_t ret_ref = 0;
29162 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29163 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29166 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29167 LDKMonitorUpdateId arg_conv;
29168 arg_conv.inner = untag_ptr(arg);
29169 arg_conv.is_owned = ptr_is_owned(arg);
29170 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29171 arg_conv.is_owned = false;
29172 int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv);
29176 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29177 LDKMonitorUpdateId orig_conv;
29178 orig_conv.inner = untag_ptr(orig);
29179 orig_conv.is_owned = ptr_is_owned(orig);
29180 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29181 orig_conv.is_owned = false;
29182 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv);
29183 int64_t ret_ref = 0;
29184 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29185 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29189 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) {
29190 LDKMonitorUpdateId o_conv;
29191 o_conv.inner = untag_ptr(o);
29192 o_conv.is_owned = ptr_is_owned(o);
29193 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
29194 o_conv.is_owned = false;
29195 int64_t ret_conv = MonitorUpdateId_hash(&o_conv);
29199 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29200 LDKMonitorUpdateId a_conv;
29201 a_conv.inner = untag_ptr(a);
29202 a_conv.is_owned = ptr_is_owned(a);
29203 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29204 a_conv.is_owned = false;
29205 LDKMonitorUpdateId b_conv;
29206 b_conv.inner = untag_ptr(b);
29207 b_conv.is_owned = ptr_is_owned(b);
29208 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29209 b_conv.is_owned = false;
29210 jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv);
29214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29215 if (!ptr_is_owned(this_ptr)) return;
29216 void* this_ptr_ptr = untag_ptr(this_ptr);
29217 CHECK_ACCESS(this_ptr_ptr);
29218 LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
29219 FREE(untag_ptr(this_ptr));
29220 Persist_free(this_ptr_conv);
29223 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29224 LDKLockedChannelMonitor this_obj_conv;
29225 this_obj_conv.inner = untag_ptr(this_obj);
29226 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29228 LockedChannelMonitor_free(this_obj_conv);
29231 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29232 LDKChainMonitor this_obj_conv;
29233 this_obj_conv.inner = untag_ptr(this_obj);
29234 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29236 ChainMonitor_free(this_obj_conv);
29239 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) {
29240 void* chain_source_ptr = untag_ptr(chain_source);
29241 CHECK_ACCESS(chain_source_ptr);
29242 LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
29243 // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ
29244 if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
29245 // Manually implement clone for Java trait instances
29246 if (chain_source_conv.some.free == LDKFilter_JCalls_free) {
29247 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29248 LDKFilter_JCalls_cloned(&chain_source_conv.some);
29251 void* broadcaster_ptr = untag_ptr(broadcaster);
29252 CHECK_ACCESS(broadcaster_ptr);
29253 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
29254 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
29255 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29256 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
29258 void* logger_ptr = untag_ptr(logger);
29259 CHECK_ACCESS(logger_ptr);
29260 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
29261 if (logger_conv.free == LDKLogger_JCalls_free) {
29262 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29263 LDKLogger_JCalls_cloned(&logger_conv);
29265 void* feeest_ptr = untag_ptr(feeest);
29266 CHECK_ACCESS(feeest_ptr);
29267 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
29268 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
29269 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29270 LDKFeeEstimator_JCalls_cloned(&feeest_conv);
29272 void* persister_ptr = untag_ptr(persister);
29273 CHECK_ACCESS(persister_ptr);
29274 LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
29275 if (persister_conv.free == LDKPersist_JCalls_free) {
29276 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29277 LDKPersist_JCalls_cloned(&persister_conv);
29279 LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
29280 int64_t ret_ref = 0;
29281 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29282 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29286 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) {
29287 LDKChainMonitor this_arg_conv;
29288 this_arg_conv.inner = untag_ptr(this_arg);
29289 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29290 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29291 this_arg_conv.is_owned = false;
29292 LDKCVec_ChannelDetailsZ ignored_channels_constr;
29293 ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels);
29294 if (ignored_channels_constr.datalen > 0)
29295 ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
29297 ignored_channels_constr.data = NULL;
29298 int64_t* ignored_channels_vals = (*env)->GetLongArrayElements (env, ignored_channels, NULL);
29299 for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
29300 int64_t ignored_channels_conv_16 = ignored_channels_vals[q];
29301 LDKChannelDetails ignored_channels_conv_16_conv;
29302 ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16);
29303 ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16);
29304 CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv);
29305 ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
29306 ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
29308 (*env)->ReleaseLongArrayElements(env, ignored_channels, ignored_channels_vals, 0);
29309 LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
29310 int64_tArray ret_arr = NULL;
29311 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29312 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29313 for (size_t j = 0; j < ret_var.datalen; j++) {
29314 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29315 *ret_conv_9_copy = ret_var.data[j];
29316 int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
29317 ret_arr_ptr[j] = ret_conv_9_ref;
29319 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29320 FREE(ret_var.data);
29324 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo) {
29325 LDKChainMonitor this_arg_conv;
29326 this_arg_conv.inner = untag_ptr(this_arg);
29327 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29329 this_arg_conv.is_owned = false;
29330 LDKOutPoint funding_txo_conv;
29331 funding_txo_conv.inner = untag_ptr(funding_txo);
29332 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
29333 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
29334 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
29335 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
29336 *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv);
29337 return tag_ptr(ret_conv, true);
29340 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1monitors(JNIEnv *env, jclass clz, int64_t this_arg) {
29341 LDKChainMonitor this_arg_conv;
29342 this_arg_conv.inner = untag_ptr(this_arg);
29343 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29344 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29345 this_arg_conv.is_owned = false;
29346 LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
29347 int64_tArray ret_arr = NULL;
29348 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29349 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29350 for (size_t k = 0; k < ret_var.datalen; k++) {
29351 LDKOutPoint ret_conv_10_var = ret_var.data[k];
29352 int64_t ret_conv_10_ref = 0;
29353 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
29354 ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned);
29355 ret_arr_ptr[k] = ret_conv_10_ref;
29357 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29358 FREE(ret_var.data);
29362 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1pending_1monitor_1updates(JNIEnv *env, jclass clz, int64_t this_arg) {
29363 LDKChainMonitor this_arg_conv;
29364 this_arg_conv.inner = untag_ptr(this_arg);
29365 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29367 this_arg_conv.is_owned = false;
29368 LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv);
29369 int64_tArray ret_arr = NULL;
29370 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29371 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29372 for (size_t p = 0; p < ret_var.datalen; p++) {
29373 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
29374 *ret_conv_41_conv = ret_var.data[p];
29375 ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true);
29377 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29378 FREE(ret_var.data);
29382 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) {
29383 LDKChainMonitor this_arg_conv;
29384 this_arg_conv.inner = untag_ptr(this_arg);
29385 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29386 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29387 this_arg_conv.is_owned = false;
29388 LDKOutPoint funding_txo_conv;
29389 funding_txo_conv.inner = untag_ptr(funding_txo);
29390 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
29391 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
29392 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
29393 LDKMonitorUpdateId completed_update_id_conv;
29394 completed_update_id_conv.inner = untag_ptr(completed_update_id);
29395 completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id);
29396 CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv);
29397 completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
29398 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
29399 *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
29400 return tag_ptr(ret_conv, true);
29403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
29404 LDKChainMonitor this_arg_conv;
29405 this_arg_conv.inner = untag_ptr(this_arg);
29406 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29408 this_arg_conv.is_owned = false;
29409 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
29410 *ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
29411 return tag_ptr(ret_ret, true);
29414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) {
29415 LDKChainMonitor this_arg_conv;
29416 this_arg_conv.inner = untag_ptr(this_arg);
29417 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29419 this_arg_conv.is_owned = false;
29420 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
29421 *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
29422 return tag_ptr(ret_ret, true);
29425 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv *env, jclass clz, int64_t this_arg) {
29426 LDKChainMonitor this_arg_conv;
29427 this_arg_conv.inner = untag_ptr(this_arg);
29428 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29430 this_arg_conv.is_owned = false;
29431 LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
29432 *ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
29433 return tag_ptr(ret_ret, true);
29436 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
29437 LDKChainMonitor this_arg_conv;
29438 this_arg_conv.inner = untag_ptr(this_arg);
29439 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29440 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29441 this_arg_conv.is_owned = false;
29442 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
29443 *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
29444 return tag_ptr(ret_ret, true);
29447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29448 LDKChannelMonitorUpdate this_obj_conv;
29449 this_obj_conv.inner = untag_ptr(this_obj);
29450 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29452 ChannelMonitorUpdate_free(this_obj_conv);
29455 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
29456 LDKChannelMonitorUpdate this_ptr_conv;
29457 this_ptr_conv.inner = untag_ptr(this_ptr);
29458 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29460 this_ptr_conv.is_owned = false;
29461 int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
29465 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
29466 LDKChannelMonitorUpdate this_ptr_conv;
29467 this_ptr_conv.inner = untag_ptr(this_ptr);
29468 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29469 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29470 this_ptr_conv.is_owned = false;
29471 ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
29474 static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) {
29475 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg);
29476 int64_t ret_ref = 0;
29477 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29478 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29481 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29482 LDKChannelMonitorUpdate arg_conv;
29483 arg_conv.inner = untag_ptr(arg);
29484 arg_conv.is_owned = ptr_is_owned(arg);
29485 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29486 arg_conv.is_owned = false;
29487 int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv);
29491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29492 LDKChannelMonitorUpdate orig_conv;
29493 orig_conv.inner = untag_ptr(orig);
29494 orig_conv.is_owned = ptr_is_owned(orig);
29495 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29496 orig_conv.is_owned = false;
29497 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
29498 int64_t ret_ref = 0;
29499 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29500 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29504 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
29505 LDKChannelMonitorUpdate obj_conv;
29506 obj_conv.inner = untag_ptr(obj);
29507 obj_conv.is_owned = ptr_is_owned(obj);
29508 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
29509 obj_conv.is_owned = false;
29510 LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
29511 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29512 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29513 CVec_u8Z_free(ret_var);
29517 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29518 LDKu8slice ser_ref;
29519 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29520 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29521 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
29522 *ret_conv = ChannelMonitorUpdate_read(ser_ref);
29523 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29524 return tag_ptr(ret_conv, true);
29527 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29528 if (!ptr_is_owned(this_ptr)) return;
29529 void* this_ptr_ptr = untag_ptr(this_ptr);
29530 CHECK_ACCESS(this_ptr_ptr);
29531 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
29532 FREE(untag_ptr(this_ptr));
29533 MonitorEvent_free(this_ptr_conv);
29536 static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) {
29537 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29538 *ret_copy = MonitorEvent_clone(arg);
29539 int64_t ret_ref = tag_ptr(ret_copy, true);
29542 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29543 LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg);
29544 int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv);
29548 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29549 LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig);
29550 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29551 *ret_copy = MonitorEvent_clone(orig_conv);
29552 int64_t ret_ref = tag_ptr(ret_copy, true);
29556 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNIEnv *env, jclass clz, int64_t a) {
29557 LDKHTLCUpdate a_conv;
29558 a_conv.inner = untag_ptr(a);
29559 a_conv.is_owned = ptr_is_owned(a);
29560 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29561 a_conv = HTLCUpdate_clone(&a_conv);
29562 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29563 *ret_copy = MonitorEvent_htlcevent(a_conv);
29564 int64_t ret_ref = tag_ptr(ret_copy, true);
29568 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz, int64_t a) {
29569 LDKOutPoint a_conv;
29570 a_conv.inner = untag_ptr(a);
29571 a_conv.is_owned = ptr_is_owned(a);
29572 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29573 a_conv = OutPoint_clone(&a_conv);
29574 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29575 *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv);
29576 int64_t ret_ref = tag_ptr(ret_copy, true);
29580 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) {
29581 LDKOutPoint funding_txo_conv;
29582 funding_txo_conv.inner = untag_ptr(funding_txo);
29583 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
29584 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
29585 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
29586 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29587 *ret_copy = MonitorEvent_completed(funding_txo_conv, monitor_update_id);
29588 int64_t ret_ref = tag_ptr(ret_copy, true);
29592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed(JNIEnv *env, jclass clz, int64_t a) {
29593 LDKOutPoint a_conv;
29594 a_conv.inner = untag_ptr(a);
29595 a_conv.is_owned = ptr_is_owned(a);
29596 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29597 a_conv = OutPoint_clone(&a_conv);
29598 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29599 *ret_copy = MonitorEvent_update_failed(a_conv);
29600 int64_t ret_ref = tag_ptr(ret_copy, true);
29604 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29605 LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a);
29606 LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b);
29607 jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv);
29611 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) {
29612 LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
29613 LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
29614 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29615 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29616 CVec_u8Z_free(ret_var);
29620 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29621 LDKu8slice ser_ref;
29622 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29623 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29624 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
29625 *ret_conv = MonitorEvent_read(ser_ref);
29626 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29627 return tag_ptr(ret_conv, true);
29630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29631 LDKHTLCUpdate this_obj_conv;
29632 this_obj_conv.inner = untag_ptr(this_obj);
29633 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29635 HTLCUpdate_free(this_obj_conv);
29638 static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) {
29639 LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg);
29640 int64_t ret_ref = 0;
29641 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29642 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29645 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29646 LDKHTLCUpdate arg_conv;
29647 arg_conv.inner = untag_ptr(arg);
29648 arg_conv.is_owned = ptr_is_owned(arg);
29649 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29650 arg_conv.is_owned = false;
29651 int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv);
29655 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29656 LDKHTLCUpdate orig_conv;
29657 orig_conv.inner = untag_ptr(orig);
29658 orig_conv.is_owned = ptr_is_owned(orig);
29659 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29660 orig_conv.is_owned = false;
29661 LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
29662 int64_t ret_ref = 0;
29663 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29664 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29668 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29669 LDKHTLCUpdate a_conv;
29670 a_conv.inner = untag_ptr(a);
29671 a_conv.is_owned = ptr_is_owned(a);
29672 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29673 a_conv.is_owned = false;
29674 LDKHTLCUpdate b_conv;
29675 b_conv.inner = untag_ptr(b);
29676 b_conv.is_owned = ptr_is_owned(b);
29677 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29678 b_conv.is_owned = false;
29679 jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv);
29683 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
29684 LDKHTLCUpdate obj_conv;
29685 obj_conv.inner = untag_ptr(obj);
29686 obj_conv.is_owned = ptr_is_owned(obj);
29687 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
29688 obj_conv.is_owned = false;
29689 LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
29690 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29691 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29692 CVec_u8Z_free(ret_var);
29696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29697 LDKu8slice ser_ref;
29698 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29699 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29700 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
29701 *ret_conv = HTLCUpdate_read(ser_ref);
29702 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29703 return tag_ptr(ret_conv, true);
29706 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29707 if (!ptr_is_owned(this_ptr)) return;
29708 void* this_ptr_ptr = untag_ptr(this_ptr);
29709 CHECK_ACCESS(this_ptr_ptr);
29710 LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
29711 FREE(untag_ptr(this_ptr));
29712 Balance_free(this_ptr_conv);
29715 static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) {
29716 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29717 *ret_copy = Balance_clone(arg);
29718 int64_t ret_ref = tag_ptr(ret_copy, true);
29721 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29722 LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg);
29723 int64_t ret_conv = Balance_clone_ptr(arg_conv);
29727 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29728 LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig);
29729 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29730 *ret_copy = Balance_clone(orig_conv);
29731 int64_t ret_ref = tag_ptr(ret_copy, true);
29735 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) {
29736 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29737 *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis);
29738 int64_t ret_ref = tag_ptr(ret_copy, true);
29742 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) {
29743 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29744 *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
29745 int64_t ret_ref = tag_ptr(ret_copy, true);
29749 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) {
29750 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29751 *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
29752 int64_t ret_ref = tag_ptr(ret_copy, true);
29756 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1timeout_1claimable_1htlc(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t claimable_height) {
29757 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29758 *ret_copy = Balance_maybe_timeout_claimable_htlc(claimable_amount_satoshis, claimable_height);
29759 int64_t ret_ref = tag_ptr(ret_copy, true);
29763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1preimage_1claimable_1htlc(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t expiry_height) {
29764 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29765 *ret_copy = Balance_maybe_preimage_claimable_htlc(claimable_amount_satoshis, expiry_height);
29766 int64_t ret_ref = tag_ptr(ret_copy, true);
29770 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1counterparty_1revoked_1output_1claimable(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) {
29771 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29772 *ret_copy = Balance_counterparty_revoked_output_claimable(claimable_amount_satoshis);
29773 int64_t ret_ref = tag_ptr(ret_copy, true);
29777 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Balance_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29778 LDKBalance* a_conv = (LDKBalance*)untag_ptr(a);
29779 LDKBalance* b_conv = (LDKBalance*)untag_ptr(b);
29780 jboolean ret_conv = Balance_eq(a_conv, b_conv);
29784 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29785 LDKChannelMonitor this_obj_conv;
29786 this_obj_conv.inner = untag_ptr(this_obj);
29787 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29789 ChannelMonitor_free(this_obj_conv);
29792 static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) {
29793 LDKChannelMonitor ret_var = ChannelMonitor_clone(arg);
29794 int64_t ret_ref = 0;
29795 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29796 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29799 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29800 LDKChannelMonitor arg_conv;
29801 arg_conv.inner = untag_ptr(arg);
29802 arg_conv.is_owned = ptr_is_owned(arg);
29803 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29804 arg_conv.is_owned = false;
29805 int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv);
29809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29810 LDKChannelMonitor orig_conv;
29811 orig_conv.inner = untag_ptr(orig);
29812 orig_conv.is_owned = ptr_is_owned(orig);
29813 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29814 orig_conv.is_owned = false;
29815 LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv);
29816 int64_t ret_ref = 0;
29817 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29818 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29822 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(JNIEnv *env, jclass clz, int64_t obj) {
29823 LDKChannelMonitor obj_conv;
29824 obj_conv.inner = untag_ptr(obj);
29825 obj_conv.is_owned = ptr_is_owned(obj);
29826 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
29827 obj_conv.is_owned = false;
29828 LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
29829 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29830 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29831 CVec_u8Z_free(ret_var);
29835 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) {
29836 LDKChannelMonitor this_arg_conv;
29837 this_arg_conv.inner = untag_ptr(this_arg);
29838 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29840 this_arg_conv.is_owned = false;
29841 LDKChannelMonitorUpdate updates_conv;
29842 updates_conv.inner = untag_ptr(updates);
29843 updates_conv.is_owned = ptr_is_owned(updates);
29844 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
29845 updates_conv.is_owned = false;
29846 void* broadcaster_ptr = untag_ptr(broadcaster);
29847 if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); }
29848 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
29849 void* fee_estimator_ptr = untag_ptr(fee_estimator);
29850 CHECK_ACCESS(fee_estimator_ptr);
29851 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
29852 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
29853 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29854 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
29856 void* logger_ptr = untag_ptr(logger);
29857 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
29858 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
29859 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
29860 *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
29861 return tag_ptr(ret_conv, true);
29864 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
29865 LDKChannelMonitor this_arg_conv;
29866 this_arg_conv.inner = untag_ptr(this_arg);
29867 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29868 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29869 this_arg_conv.is_owned = false;
29870 int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv);
29874 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_arg) {
29875 LDKChannelMonitor this_arg_conv;
29876 this_arg_conv.inner = untag_ptr(this_arg);
29877 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29878 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29879 this_arg_conv.is_owned = false;
29880 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
29881 *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv);
29882 return tag_ptr(ret_conv, true);
29885 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg) {
29886 LDKChannelMonitor this_arg_conv;
29887 this_arg_conv.inner = untag_ptr(this_arg);
29888 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29890 this_arg_conv.is_owned = false;
29891 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
29892 int64_tArray ret_arr = NULL;
29893 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29894 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29895 for (size_t o = 0; o < ret_var.datalen; o++) {
29896 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
29897 *ret_conv_40_conv = ret_var.data[o];
29898 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
29900 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29901 FREE(ret_var.data);
29905 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg, int64_t filter) {
29906 LDKChannelMonitor this_arg_conv;
29907 this_arg_conv.inner = untag_ptr(this_arg);
29908 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29910 this_arg_conv.is_owned = false;
29911 void* filter_ptr = untag_ptr(filter);
29912 if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); }
29913 LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
29914 ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
29917 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
29918 LDKChannelMonitor this_arg_conv;
29919 this_arg_conv.inner = untag_ptr(this_arg);
29920 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29921 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29922 this_arg_conv.is_owned = false;
29923 LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
29924 int64_tArray ret_arr = NULL;
29925 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29926 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29927 for (size_t o = 0; o < ret_var.datalen; o++) {
29928 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29929 *ret_conv_14_copy = ret_var.data[o];
29930 int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
29931 ret_arr_ptr[o] = ret_conv_14_ref;
29933 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29934 FREE(ret_var.data);
29938 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
29939 LDKChannelMonitor this_arg_conv;
29940 this_arg_conv.inner = untag_ptr(this_arg);
29941 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29943 this_arg_conv.is_owned = false;
29944 LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
29945 int64_tArray ret_arr = NULL;
29946 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29947 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29948 for (size_t h = 0; h < ret_var.datalen; h++) {
29949 LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
29950 *ret_conv_7_copy = ret_var.data[h];
29951 int64_t ret_conv_7_ref = tag_ptr(ret_conv_7_copy, true);
29952 ret_arr_ptr[h] = ret_conv_7_ref;
29954 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29955 FREE(ret_var.data);
29959 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1counterparty_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
29960 LDKChannelMonitor this_arg_conv;
29961 this_arg_conv.inner = untag_ptr(this_arg);
29962 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29964 this_arg_conv.is_owned = false;
29965 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
29966 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form);
29970 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) {
29971 LDKChannelMonitor this_arg_conv;
29972 this_arg_conv.inner = untag_ptr(this_arg);
29973 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29975 this_arg_conv.is_owned = false;
29976 void* logger_ptr = untag_ptr(logger);
29977 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
29978 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
29979 LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
29980 jobjectArray ret_arr = NULL;
29981 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
29983 for (size_t i = 0; i < ret_var.datalen; i++) {
29984 LDKTransaction ret_conv_8_var = ret_var.data[i];
29985 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen);
29986 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data);
29987 Transaction_free(ret_conv_8_var);
29988 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
29991 FREE(ret_var.data);
29995 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) {
29996 LDKChannelMonitor this_arg_conv;
29997 this_arg_conv.inner = untag_ptr(this_arg);
29998 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29999 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30000 this_arg_conv.is_owned = false;
30001 uint8_t header_arr[80];
30002 CHECK((*env)->GetArrayLength(env, header) == 80);
30003 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
30004 uint8_t (*header_ref)[80] = &header_arr;
30005 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
30006 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
30007 if (txdata_constr.datalen > 0)
30008 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
30010 txdata_constr.data = NULL;
30011 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
30012 for (size_t c = 0; c < txdata_constr.datalen; c++) {
30013 int64_t txdata_conv_28 = txdata_vals[c];
30014 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
30015 CHECK_ACCESS(txdata_conv_28_ptr);
30016 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
30017 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
30018 txdata_constr.data[c] = txdata_conv_28_conv;
30020 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
30021 void* broadcaster_ptr = untag_ptr(broadcaster);
30022 CHECK_ACCESS(broadcaster_ptr);
30023 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30024 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30025 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30026 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30028 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30029 CHECK_ACCESS(fee_estimator_ptr);
30030 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30031 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30032 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30033 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30035 void* logger_ptr = untag_ptr(logger);
30036 CHECK_ACCESS(logger_ptr);
30037 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30038 if (logger_conv.free == LDKLogger_JCalls_free) {
30039 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30040 LDKLogger_JCalls_cloned(&logger_conv);
30042 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);
30043 int64_tArray ret_arr = NULL;
30044 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
30045 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
30046 for (size_t n = 0; n < ret_var.datalen; n++) {
30047 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
30048 *ret_conv_39_conv = ret_var.data[n];
30049 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
30051 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
30052 FREE(ret_var.data);
30056 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) {
30057 LDKChannelMonitor this_arg_conv;
30058 this_arg_conv.inner = untag_ptr(this_arg);
30059 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30060 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30061 this_arg_conv.is_owned = false;
30062 uint8_t header_arr[80];
30063 CHECK((*env)->GetArrayLength(env, header) == 80);
30064 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
30065 uint8_t (*header_ref)[80] = &header_arr;
30066 void* broadcaster_ptr = untag_ptr(broadcaster);
30067 CHECK_ACCESS(broadcaster_ptr);
30068 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30069 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30070 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30071 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30073 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30074 CHECK_ACCESS(fee_estimator_ptr);
30075 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30076 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30077 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30078 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30080 void* logger_ptr = untag_ptr(logger);
30081 CHECK_ACCESS(logger_ptr);
30082 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30083 if (logger_conv.free == LDKLogger_JCalls_free) {
30084 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30085 LDKLogger_JCalls_cloned(&logger_conv);
30087 ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
30090 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) {
30091 LDKChannelMonitor this_arg_conv;
30092 this_arg_conv.inner = untag_ptr(this_arg);
30093 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30095 this_arg_conv.is_owned = false;
30096 uint8_t header_arr[80];
30097 CHECK((*env)->GetArrayLength(env, header) == 80);
30098 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
30099 uint8_t (*header_ref)[80] = &header_arr;
30100 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
30101 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
30102 if (txdata_constr.datalen > 0)
30103 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
30105 txdata_constr.data = NULL;
30106 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
30107 for (size_t c = 0; c < txdata_constr.datalen; c++) {
30108 int64_t txdata_conv_28 = txdata_vals[c];
30109 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
30110 CHECK_ACCESS(txdata_conv_28_ptr);
30111 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
30112 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
30113 txdata_constr.data[c] = txdata_conv_28_conv;
30115 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
30116 void* broadcaster_ptr = untag_ptr(broadcaster);
30117 CHECK_ACCESS(broadcaster_ptr);
30118 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30119 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30120 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30121 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30123 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30124 CHECK_ACCESS(fee_estimator_ptr);
30125 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30126 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30127 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30128 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30130 void* logger_ptr = untag_ptr(logger);
30131 CHECK_ACCESS(logger_ptr);
30132 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30133 if (logger_conv.free == LDKLogger_JCalls_free) {
30134 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30135 LDKLogger_JCalls_cloned(&logger_conv);
30137 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);
30138 int64_tArray ret_arr = NULL;
30139 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
30140 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
30141 for (size_t n = 0; n < ret_var.datalen; n++) {
30142 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
30143 *ret_conv_39_conv = ret_var.data[n];
30144 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
30146 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
30147 FREE(ret_var.data);
30151 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) {
30152 LDKChannelMonitor this_arg_conv;
30153 this_arg_conv.inner = untag_ptr(this_arg);
30154 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30155 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30156 this_arg_conv.is_owned = false;
30157 uint8_t txid_arr[32];
30158 CHECK((*env)->GetArrayLength(env, txid) == 32);
30159 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
30160 uint8_t (*txid_ref)[32] = &txid_arr;
30161 void* broadcaster_ptr = untag_ptr(broadcaster);
30162 CHECK_ACCESS(broadcaster_ptr);
30163 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30164 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30165 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30166 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30168 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30169 CHECK_ACCESS(fee_estimator_ptr);
30170 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30171 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30172 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30173 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30175 void* logger_ptr = untag_ptr(logger);
30176 CHECK_ACCESS(logger_ptr);
30177 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30178 if (logger_conv.free == LDKLogger_JCalls_free) {
30179 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30180 LDKLogger_JCalls_cloned(&logger_conv);
30182 ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
30185 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) {
30186 LDKChannelMonitor this_arg_conv;
30187 this_arg_conv.inner = untag_ptr(this_arg);
30188 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30190 this_arg_conv.is_owned = false;
30191 uint8_t header_arr[80];
30192 CHECK((*env)->GetArrayLength(env, header) == 80);
30193 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
30194 uint8_t (*header_ref)[80] = &header_arr;
30195 void* broadcaster_ptr = untag_ptr(broadcaster);
30196 CHECK_ACCESS(broadcaster_ptr);
30197 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30198 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30199 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30200 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30202 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30203 CHECK_ACCESS(fee_estimator_ptr);
30204 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30205 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30206 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30207 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30209 void* logger_ptr = untag_ptr(logger);
30210 CHECK_ACCESS(logger_ptr);
30211 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30212 if (logger_conv.free == LDKLogger_JCalls_free) {
30213 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30214 LDKLogger_JCalls_cloned(&logger_conv);
30216 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
30217 int64_tArray ret_arr = NULL;
30218 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
30219 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
30220 for (size_t n = 0; n < ret_var.datalen; n++) {
30221 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
30222 *ret_conv_39_conv = ret_var.data[n];
30223 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
30225 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
30226 FREE(ret_var.data);
30230 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) {
30231 LDKChannelMonitor this_arg_conv;
30232 this_arg_conv.inner = untag_ptr(this_arg);
30233 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30235 this_arg_conv.is_owned = false;
30236 LDKCVec_C2Tuple_TxidBlockHashZZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
30237 int64_tArray ret_arr = NULL;
30238 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
30239 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
30240 for (size_t z = 0; z < ret_var.datalen; z++) {
30241 LDKC2Tuple_TxidBlockHashZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
30242 *ret_conv_25_conv = ret_var.data[z];
30243 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
30245 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
30246 FREE(ret_var.data);
30250 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) {
30251 LDKChannelMonitor this_arg_conv;
30252 this_arg_conv.inner = untag_ptr(this_arg);
30253 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30255 this_arg_conv.is_owned = false;
30256 LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
30257 int64_t ret_ref = 0;
30258 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30259 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30263 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg) {
30264 LDKChannelMonitor this_arg_conv;
30265 this_arg_conv.inner = untag_ptr(this_arg);
30266 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30267 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30268 this_arg_conv.is_owned = false;
30269 LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
30270 int64_tArray ret_arr = NULL;
30271 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
30272 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
30273 for (size_t j = 0; j < ret_var.datalen; j++) {
30274 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
30275 *ret_conv_9_copy = ret_var.data[j];
30276 int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
30277 ret_arr_ptr[j] = ret_conv_9_ref;
30279 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
30280 FREE(ret_var.data);
30284 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b) {
30285 LDKu8slice ser_ref;
30286 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30287 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30288 void* arg_a_ptr = untag_ptr(arg_a);
30289 if (ptr_is_owned(arg_a)) { CHECK_ACCESS(arg_a_ptr); }
30290 LDKEntropySource* arg_a_conv = (LDKEntropySource*)arg_a_ptr;
30291 void* arg_b_ptr = untag_ptr(arg_b);
30292 if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); }
30293 LDKSignerProvider* arg_b_conv = (LDKSignerProvider*)arg_b_ptr;
30294 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
30295 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_a_conv, arg_b_conv);
30296 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30297 return tag_ptr(ret_conv, true);
30300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30301 LDKOutPoint this_obj_conv;
30302 this_obj_conv.inner = untag_ptr(this_obj);
30303 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30304 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30305 OutPoint_free(this_obj_conv);
30308 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
30309 LDKOutPoint this_ptr_conv;
30310 this_ptr_conv.inner = untag_ptr(this_ptr);
30311 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30313 this_ptr_conv.is_owned = false;
30314 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30315 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv));
30319 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30320 LDKOutPoint this_ptr_conv;
30321 this_ptr_conv.inner = untag_ptr(this_ptr);
30322 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30324 this_ptr_conv.is_owned = false;
30325 LDKThirtyTwoBytes val_ref;
30326 CHECK((*env)->GetArrayLength(env, val) == 32);
30327 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30328 OutPoint_set_txid(&this_ptr_conv, val_ref);
30331 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
30332 LDKOutPoint this_ptr_conv;
30333 this_ptr_conv.inner = untag_ptr(this_ptr);
30334 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30335 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30336 this_ptr_conv.is_owned = false;
30337 int16_t ret_conv = OutPoint_get_index(&this_ptr_conv);
30341 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
30342 LDKOutPoint this_ptr_conv;
30343 this_ptr_conv.inner = untag_ptr(this_ptr);
30344 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30345 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30346 this_ptr_conv.is_owned = false;
30347 OutPoint_set_index(&this_ptr_conv, val);
30350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) {
30351 LDKThirtyTwoBytes txid_arg_ref;
30352 CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
30353 (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
30354 LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
30355 int64_t ret_ref = 0;
30356 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30357 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30361 static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) {
30362 LDKOutPoint ret_var = OutPoint_clone(arg);
30363 int64_t ret_ref = 0;
30364 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30365 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30369 LDKOutPoint arg_conv;
30370 arg_conv.inner = untag_ptr(arg);
30371 arg_conv.is_owned = ptr_is_owned(arg);
30372 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30373 arg_conv.is_owned = false;
30374 int64_t ret_conv = OutPoint_clone_ptr(&arg_conv);
30378 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30379 LDKOutPoint orig_conv;
30380 orig_conv.inner = untag_ptr(orig);
30381 orig_conv.is_owned = ptr_is_owned(orig);
30382 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30383 orig_conv.is_owned = false;
30384 LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
30385 int64_t ret_ref = 0;
30386 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30387 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30391 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
30392 LDKOutPoint a_conv;
30393 a_conv.inner = untag_ptr(a);
30394 a_conv.is_owned = ptr_is_owned(a);
30395 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30396 a_conv.is_owned = false;
30397 LDKOutPoint b_conv;
30398 b_conv.inner = untag_ptr(b);
30399 b_conv.is_owned = ptr_is_owned(b);
30400 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30401 b_conv.is_owned = false;
30402 jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv);
30406 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, jclass clz, int64_t o) {
30407 LDKOutPoint o_conv;
30408 o_conv.inner = untag_ptr(o);
30409 o_conv.is_owned = ptr_is_owned(o);
30410 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
30411 o_conv.is_owned = false;
30412 int64_t ret_conv = OutPoint_hash(&o_conv);
30416 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
30417 LDKOutPoint this_arg_conv;
30418 this_arg_conv.inner = untag_ptr(this_arg);
30419 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30421 this_arg_conv.is_owned = false;
30422 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30423 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data);
30427 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *env, jclass clz, int64_t obj) {
30428 LDKOutPoint obj_conv;
30429 obj_conv.inner = untag_ptr(obj);
30430 obj_conv.is_owned = ptr_is_owned(obj);
30431 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30432 obj_conv.is_owned = false;
30433 LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
30434 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30435 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30436 CVec_u8Z_free(ret_var);
30440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
30441 LDKu8slice ser_ref;
30442 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30443 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30444 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
30445 *ret_conv = OutPoint_read(ser_ref);
30446 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30447 return tag_ptr(ret_conv, true);
30450 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30451 LDKDelayedPaymentOutputDescriptor this_obj_conv;
30452 this_obj_conv.inner = untag_ptr(this_obj);
30453 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30455 DelayedPaymentOutputDescriptor_free(this_obj_conv);
30458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
30459 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30460 this_ptr_conv.inner = untag_ptr(this_ptr);
30461 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30463 this_ptr_conv.is_owned = false;
30464 LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
30465 int64_t ret_ref = 0;
30466 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30467 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30472 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30473 this_ptr_conv.inner = untag_ptr(this_ptr);
30474 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30476 this_ptr_conv.is_owned = false;
30477 LDKOutPoint val_conv;
30478 val_conv.inner = untag_ptr(val);
30479 val_conv.is_owned = ptr_is_owned(val);
30480 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30481 val_conv = OutPoint_clone(&val_conv);
30482 DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
30485 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
30486 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30487 this_ptr_conv.inner = untag_ptr(this_ptr);
30488 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30489 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30490 this_ptr_conv.is_owned = false;
30491 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
30492 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form);
30496 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30497 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30498 this_ptr_conv.inner = untag_ptr(this_ptr);
30499 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30500 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30501 this_ptr_conv.is_owned = false;
30502 LDKPublicKey val_ref;
30503 CHECK((*env)->GetArrayLength(env, val) == 33);
30504 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
30505 DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
30508 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
30509 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30510 this_ptr_conv.inner = untag_ptr(this_ptr);
30511 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30513 this_ptr_conv.is_owned = false;
30514 int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
30518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
30519 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30520 this_ptr_conv.inner = untag_ptr(this_ptr);
30521 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30523 this_ptr_conv.is_owned = false;
30524 DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
30527 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) {
30528 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30529 this_ptr_conv.inner = untag_ptr(this_ptr);
30530 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30532 this_ptr_conv.is_owned = false;
30533 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
30534 *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv);
30535 return tag_ptr(ret_ref, true);
30538 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30539 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30540 this_ptr_conv.inner = untag_ptr(this_ptr);
30541 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30543 this_ptr_conv.is_owned = false;
30544 void* val_ptr = untag_ptr(val);
30545 CHECK_ACCESS(val_ptr);
30546 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
30547 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
30548 DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
30551 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
30552 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30553 this_ptr_conv.inner = untag_ptr(this_ptr);
30554 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30555 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30556 this_ptr_conv.is_owned = false;
30557 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
30558 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form);
30562 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30563 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30564 this_ptr_conv.inner = untag_ptr(this_ptr);
30565 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30566 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30567 this_ptr_conv.is_owned = false;
30568 LDKPublicKey val_ref;
30569 CHECK((*env)->GetArrayLength(env, val) == 33);
30570 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
30571 DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
30574 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
30575 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30576 this_ptr_conv.inner = untag_ptr(this_ptr);
30577 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30579 this_ptr_conv.is_owned = false;
30580 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30581 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
30585 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30586 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30587 this_ptr_conv.inner = untag_ptr(this_ptr);
30588 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30590 this_ptr_conv.is_owned = false;
30591 LDKThirtyTwoBytes val_ref;
30592 CHECK((*env)->GetArrayLength(env, val) == 32);
30593 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30594 DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
30597 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
30598 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30599 this_ptr_conv.inner = untag_ptr(this_ptr);
30600 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30601 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30602 this_ptr_conv.is_owned = false;
30603 int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
30607 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30608 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30609 this_ptr_conv.inner = untag_ptr(this_ptr);
30610 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30612 this_ptr_conv.is_owned = false;
30613 DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
30616 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) {
30617 LDKOutPoint outpoint_arg_conv;
30618 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
30619 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
30620 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
30621 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
30622 LDKPublicKey per_commitment_point_arg_ref;
30623 CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
30624 (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
30625 void* output_arg_ptr = untag_ptr(output_arg);
30626 CHECK_ACCESS(output_arg_ptr);
30627 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
30628 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
30629 LDKPublicKey revocation_pubkey_arg_ref;
30630 CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33);
30631 (*env)->GetByteArrayRegion(env, revocation_pubkey_arg, 0, 33, revocation_pubkey_arg_ref.compressed_form);
30632 LDKThirtyTwoBytes channel_keys_id_arg_ref;
30633 CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
30634 (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
30635 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);
30636 int64_t ret_ref = 0;
30637 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30638 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30642 static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) {
30643 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg);
30644 int64_t ret_ref = 0;
30645 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30646 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30650 LDKDelayedPaymentOutputDescriptor arg_conv;
30651 arg_conv.inner = untag_ptr(arg);
30652 arg_conv.is_owned = ptr_is_owned(arg);
30653 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30654 arg_conv.is_owned = false;
30655 int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv);
30659 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30660 LDKDelayedPaymentOutputDescriptor orig_conv;
30661 orig_conv.inner = untag_ptr(orig);
30662 orig_conv.is_owned = ptr_is_owned(orig);
30663 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30664 orig_conv.is_owned = false;
30665 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
30666 int64_t ret_ref = 0;
30667 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30668 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30672 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
30673 LDKDelayedPaymentOutputDescriptor a_conv;
30674 a_conv.inner = untag_ptr(a);
30675 a_conv.is_owned = ptr_is_owned(a);
30676 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30677 a_conv.is_owned = false;
30678 LDKDelayedPaymentOutputDescriptor b_conv;
30679 b_conv.inner = untag_ptr(b);
30680 b_conv.is_owned = ptr_is_owned(b);
30681 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30682 b_conv.is_owned = false;
30683 jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv);
30687 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
30688 LDKDelayedPaymentOutputDescriptor obj_conv;
30689 obj_conv.inner = untag_ptr(obj);
30690 obj_conv.is_owned = ptr_is_owned(obj);
30691 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30692 obj_conv.is_owned = false;
30693 LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv);
30694 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30695 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30696 CVec_u8Z_free(ret_var);
30700 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
30701 LDKu8slice ser_ref;
30702 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30703 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30704 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
30705 *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
30706 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30707 return tag_ptr(ret_conv, true);
30710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30711 LDKStaticPaymentOutputDescriptor this_obj_conv;
30712 this_obj_conv.inner = untag_ptr(this_obj);
30713 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30714 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30715 StaticPaymentOutputDescriptor_free(this_obj_conv);
30718 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
30719 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30720 this_ptr_conv.inner = untag_ptr(this_ptr);
30721 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30722 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30723 this_ptr_conv.is_owned = false;
30724 LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
30725 int64_t ret_ref = 0;
30726 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30727 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30731 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30732 LDKStaticPaymentOutputDescriptor 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 LDKOutPoint val_conv;
30738 val_conv.inner = untag_ptr(val);
30739 val_conv.is_owned = ptr_is_owned(val);
30740 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30741 val_conv = OutPoint_clone(&val_conv);
30742 StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
30745 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) {
30746 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30747 this_ptr_conv.inner = untag_ptr(this_ptr);
30748 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30750 this_ptr_conv.is_owned = false;
30751 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
30752 *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv);
30753 return tag_ptr(ret_ref, true);
30756 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30757 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30758 this_ptr_conv.inner = untag_ptr(this_ptr);
30759 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30760 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30761 this_ptr_conv.is_owned = false;
30762 void* val_ptr = untag_ptr(val);
30763 CHECK_ACCESS(val_ptr);
30764 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
30765 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
30766 StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
30769 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
30770 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30771 this_ptr_conv.inner = untag_ptr(this_ptr);
30772 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30774 this_ptr_conv.is_owned = false;
30775 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30776 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
30780 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30781 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30782 this_ptr_conv.inner = untag_ptr(this_ptr);
30783 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30785 this_ptr_conv.is_owned = false;
30786 LDKThirtyTwoBytes val_ref;
30787 CHECK((*env)->GetArrayLength(env, val) == 32);
30788 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30789 StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
30792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
30793 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30794 this_ptr_conv.inner = untag_ptr(this_ptr);
30795 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30796 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30797 this_ptr_conv.is_owned = false;
30798 int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
30802 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30803 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30804 this_ptr_conv.inner = untag_ptr(this_ptr);
30805 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30807 this_ptr_conv.is_owned = false;
30808 StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
30811 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) {
30812 LDKOutPoint outpoint_arg_conv;
30813 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
30814 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
30815 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
30816 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
30817 void* output_arg_ptr = untag_ptr(output_arg);
30818 CHECK_ACCESS(output_arg_ptr);
30819 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
30820 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
30821 LDKThirtyTwoBytes channel_keys_id_arg_ref;
30822 CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
30823 (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
30824 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
30825 int64_t ret_ref = 0;
30826 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30827 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30831 static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) {
30832 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg);
30833 int64_t ret_ref = 0;
30834 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30835 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30838 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30839 LDKStaticPaymentOutputDescriptor arg_conv;
30840 arg_conv.inner = untag_ptr(arg);
30841 arg_conv.is_owned = ptr_is_owned(arg);
30842 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30843 arg_conv.is_owned = false;
30844 int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv);
30848 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30849 LDKStaticPaymentOutputDescriptor orig_conv;
30850 orig_conv.inner = untag_ptr(orig);
30851 orig_conv.is_owned = ptr_is_owned(orig);
30852 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30853 orig_conv.is_owned = false;
30854 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
30855 int64_t ret_ref = 0;
30856 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30857 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30861 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
30862 LDKStaticPaymentOutputDescriptor a_conv;
30863 a_conv.inner = untag_ptr(a);
30864 a_conv.is_owned = ptr_is_owned(a);
30865 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30866 a_conv.is_owned = false;
30867 LDKStaticPaymentOutputDescriptor b_conv;
30868 b_conv.inner = untag_ptr(b);
30869 b_conv.is_owned = ptr_is_owned(b);
30870 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30871 b_conv.is_owned = false;
30872 jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv);
30876 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
30877 LDKStaticPaymentOutputDescriptor obj_conv;
30878 obj_conv.inner = untag_ptr(obj);
30879 obj_conv.is_owned = ptr_is_owned(obj);
30880 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30881 obj_conv.is_owned = false;
30882 LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv);
30883 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30884 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30885 CVec_u8Z_free(ret_var);
30889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
30890 LDKu8slice ser_ref;
30891 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30892 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30893 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
30894 *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
30895 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30896 return tag_ptr(ret_conv, true);
30899 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
30900 if (!ptr_is_owned(this_ptr)) return;
30901 void* this_ptr_ptr = untag_ptr(this_ptr);
30902 CHECK_ACCESS(this_ptr_ptr);
30903 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
30904 FREE(untag_ptr(this_ptr));
30905 SpendableOutputDescriptor_free(this_ptr_conv);
30908 static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) {
30909 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
30910 *ret_copy = SpendableOutputDescriptor_clone(arg);
30911 int64_t ret_ref = tag_ptr(ret_copy, true);
30914 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30915 LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg);
30916 int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv);
30920 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30921 LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig);
30922 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
30923 *ret_copy = SpendableOutputDescriptor_clone(orig_conv);
30924 int64_t ret_ref = tag_ptr(ret_copy, true);
30928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output) {
30929 LDKOutPoint outpoint_conv;
30930 outpoint_conv.inner = untag_ptr(outpoint);
30931 outpoint_conv.is_owned = ptr_is_owned(outpoint);
30932 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv);
30933 outpoint_conv = OutPoint_clone(&outpoint_conv);
30934 void* output_ptr = untag_ptr(output);
30935 CHECK_ACCESS(output_ptr);
30936 LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
30937 output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output));
30938 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
30939 *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
30940 int64_t ret_ref = tag_ptr(ret_copy, true);
30944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
30945 LDKDelayedPaymentOutputDescriptor a_conv;
30946 a_conv.inner = untag_ptr(a);
30947 a_conv.is_owned = ptr_is_owned(a);
30948 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30949 a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
30950 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
30951 *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
30952 int64_t ret_ref = tag_ptr(ret_copy, true);
30956 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
30957 LDKStaticPaymentOutputDescriptor a_conv;
30958 a_conv.inner = untag_ptr(a);
30959 a_conv.is_owned = ptr_is_owned(a);
30960 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30961 a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
30962 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
30963 *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
30964 int64_t ret_ref = tag_ptr(ret_copy, true);
30968 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
30969 LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a);
30970 LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b);
30971 jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv);
30975 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
30976 LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
30977 LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
30978 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30979 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30980 CVec_u8Z_free(ret_var);
30984 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
30985 LDKu8slice ser_ref;
30986 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30987 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30988 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
30989 *ret_conv = SpendableOutputDescriptor_read(ser_ref);
30990 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30991 return tag_ptr(ret_conv, true);
30994 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
30995 if (!ptr_is_owned(this_ptr)) return;
30996 void* this_ptr_ptr = untag_ptr(this_ptr);
30997 CHECK_ACCESS(this_ptr_ptr);
30998 LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr);
30999 FREE(untag_ptr(this_ptr));
31000 ChannelSigner_free(this_ptr_conv);
31003 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31004 if (!ptr_is_owned(this_ptr)) return;
31005 void* this_ptr_ptr = untag_ptr(this_ptr);
31006 CHECK_ACCESS(this_ptr_ptr);
31007 LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr);
31008 FREE(untag_ptr(this_ptr));
31009 EcdsaChannelSigner_free(this_ptr_conv);
31012 static inline uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg) {
31013 LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
31014 *ret_ret = WriteableEcdsaChannelSigner_clone(arg);
31015 return tag_ptr(ret_ret, true);
31017 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31018 void* arg_ptr = untag_ptr(arg);
31019 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
31020 LDKWriteableEcdsaChannelSigner* arg_conv = (LDKWriteableEcdsaChannelSigner*)arg_ptr;
31021 int64_t ret_conv = WriteableEcdsaChannelSigner_clone_ptr(arg_conv);
31025 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31026 void* orig_ptr = untag_ptr(orig);
31027 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
31028 LDKWriteableEcdsaChannelSigner* orig_conv = (LDKWriteableEcdsaChannelSigner*)orig_ptr;
31029 LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
31030 *ret_ret = WriteableEcdsaChannelSigner_clone(orig_conv);
31031 return tag_ptr(ret_ret, true);
31034 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31035 if (!ptr_is_owned(this_ptr)) return;
31036 void* this_ptr_ptr = untag_ptr(this_ptr);
31037 CHECK_ACCESS(this_ptr_ptr);
31038 LDKWriteableEcdsaChannelSigner this_ptr_conv = *(LDKWriteableEcdsaChannelSigner*)(this_ptr_ptr);
31039 FREE(untag_ptr(this_ptr));
31040 WriteableEcdsaChannelSigner_free(this_ptr_conv);
31043 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31044 LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig);
31045 jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv));
31049 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) {
31050 jclass ret_conv = LDKRecipient_to_java(env, Recipient_node());
31054 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) {
31055 jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node());
31059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EntropySource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31060 if (!ptr_is_owned(this_ptr)) return;
31061 void* this_ptr_ptr = untag_ptr(this_ptr);
31062 CHECK_ACCESS(this_ptr_ptr);
31063 LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr);
31064 FREE(untag_ptr(this_ptr));
31065 EntropySource_free(this_ptr_conv);
31068 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31069 if (!ptr_is_owned(this_ptr)) return;
31070 void* this_ptr_ptr = untag_ptr(this_ptr);
31071 CHECK_ACCESS(this_ptr_ptr);
31072 LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr);
31073 FREE(untag_ptr(this_ptr));
31074 NodeSigner_free(this_ptr_conv);
31077 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignerProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31078 if (!ptr_is_owned(this_ptr)) return;
31079 void* this_ptr_ptr = untag_ptr(this_ptr);
31080 CHECK_ACCESS(this_ptr_ptr);
31081 LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr);
31082 FREE(untag_ptr(this_ptr));
31083 SignerProvider_free(this_ptr_conv);
31086 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31087 LDKInMemorySigner this_obj_conv;
31088 this_obj_conv.inner = untag_ptr(this_obj);
31089 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31090 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31091 InMemorySigner_free(this_obj_conv);
31094 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
31095 LDKInMemorySigner this_ptr_conv;
31096 this_ptr_conv.inner = untag_ptr(this_ptr);
31097 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31098 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31099 this_ptr_conv.is_owned = false;
31100 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31101 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv));
31105 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31106 LDKInMemorySigner this_ptr_conv;
31107 this_ptr_conv.inner = untag_ptr(this_ptr);
31108 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31110 this_ptr_conv.is_owned = false;
31111 LDKSecretKey val_ref;
31112 CHECK((*env)->GetArrayLength(env, val) == 32);
31113 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
31114 InMemorySigner_set_funding_key(&this_ptr_conv, val_ref);
31117 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
31118 LDKInMemorySigner this_ptr_conv;
31119 this_ptr_conv.inner = untag_ptr(this_ptr);
31120 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31122 this_ptr_conv.is_owned = false;
31123 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31124 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv));
31128 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31129 LDKInMemorySigner this_ptr_conv;
31130 this_ptr_conv.inner = untag_ptr(this_ptr);
31131 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31133 this_ptr_conv.is_owned = false;
31134 LDKSecretKey val_ref;
31135 CHECK((*env)->GetArrayLength(env, val) == 32);
31136 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
31137 InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref);
31140 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
31141 LDKInMemorySigner this_ptr_conv;
31142 this_ptr_conv.inner = untag_ptr(this_ptr);
31143 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31144 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31145 this_ptr_conv.is_owned = false;
31146 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31147 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv));
31151 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31152 LDKInMemorySigner this_ptr_conv;
31153 this_ptr_conv.inner = untag_ptr(this_ptr);
31154 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31155 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31156 this_ptr_conv.is_owned = false;
31157 LDKSecretKey val_ref;
31158 CHECK((*env)->GetArrayLength(env, val) == 32);
31159 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
31160 InMemorySigner_set_payment_key(&this_ptr_conv, val_ref);
31163 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
31164 LDKInMemorySigner this_ptr_conv;
31165 this_ptr_conv.inner = untag_ptr(this_ptr);
31166 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31168 this_ptr_conv.is_owned = false;
31169 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31170 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv));
31174 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) {
31175 LDKInMemorySigner this_ptr_conv;
31176 this_ptr_conv.inner = untag_ptr(this_ptr);
31177 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31179 this_ptr_conv.is_owned = false;
31180 LDKSecretKey val_ref;
31181 CHECK((*env)->GetArrayLength(env, val) == 32);
31182 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
31183 InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
31186 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
31187 LDKInMemorySigner this_ptr_conv;
31188 this_ptr_conv.inner = untag_ptr(this_ptr);
31189 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31191 this_ptr_conv.is_owned = false;
31192 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31193 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv));
31197 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31198 LDKInMemorySigner this_ptr_conv;
31199 this_ptr_conv.inner = untag_ptr(this_ptr);
31200 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31202 this_ptr_conv.is_owned = false;
31203 LDKSecretKey val_ref;
31204 CHECK((*env)->GetArrayLength(env, val) == 32);
31205 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
31206 InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
31209 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) {
31210 LDKInMemorySigner this_ptr_conv;
31211 this_ptr_conv.inner = untag_ptr(this_ptr);
31212 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31214 this_ptr_conv.is_owned = false;
31215 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31216 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv));
31220 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31221 LDKInMemorySigner this_ptr_conv;
31222 this_ptr_conv.inner = untag_ptr(this_ptr);
31223 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31224 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31225 this_ptr_conv.is_owned = false;
31226 LDKThirtyTwoBytes val_ref;
31227 CHECK((*env)->GetArrayLength(env, val) == 32);
31228 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
31229 InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
31232 static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) {
31233 LDKInMemorySigner ret_var = InMemorySigner_clone(arg);
31234 int64_t ret_ref = 0;
31235 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31236 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31240 LDKInMemorySigner arg_conv;
31241 arg_conv.inner = untag_ptr(arg);
31242 arg_conv.is_owned = ptr_is_owned(arg);
31243 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31244 arg_conv.is_owned = false;
31245 int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv);
31249 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31250 LDKInMemorySigner orig_conv;
31251 orig_conv.inner = untag_ptr(orig);
31252 orig_conv.is_owned = ptr_is_owned(orig);
31253 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31254 orig_conv.is_owned = false;
31255 LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
31256 int64_t ret_ref = 0;
31257 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31258 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, 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) {
31263 LDKSecretKey funding_key_ref;
31264 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
31265 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes);
31266 LDKSecretKey revocation_base_key_ref;
31267 CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32);
31268 (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes);
31269 LDKSecretKey payment_key_ref;
31270 CHECK((*env)->GetArrayLength(env, payment_key) == 32);
31271 (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes);
31272 LDKSecretKey delayed_payment_base_key_ref;
31273 CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32);
31274 (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes);
31275 LDKSecretKey htlc_base_key_ref;
31276 CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32);
31277 (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes);
31278 LDKThirtyTwoBytes commitment_seed_ref;
31279 CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
31280 (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data);
31281 LDKThirtyTwoBytes channel_keys_id_ref;
31282 CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32);
31283 (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data);
31284 LDKInMemorySigner ret_var = InMemorySigner_new(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);
31285 int64_t ret_ref = 0;
31286 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31287 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31291 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
31292 LDKInMemorySigner this_arg_conv;
31293 this_arg_conv.inner = untag_ptr(this_arg);
31294 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31296 this_arg_conv.is_owned = false;
31297 LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
31298 int64_t ret_ref = 0;
31299 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31300 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31304 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
31305 LDKInMemorySigner this_arg_conv;
31306 this_arg_conv.inner = untag_ptr(this_arg);
31307 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31308 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31309 this_arg_conv.is_owned = false;
31310 int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
31314 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
31315 LDKInMemorySigner this_arg_conv;
31316 this_arg_conv.inner = untag_ptr(this_arg);
31317 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31319 this_arg_conv.is_owned = false;
31320 int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
31324 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) {
31325 LDKInMemorySigner this_arg_conv;
31326 this_arg_conv.inner = untag_ptr(this_arg);
31327 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31329 this_arg_conv.is_owned = false;
31330 jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv);
31334 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) {
31335 LDKInMemorySigner this_arg_conv;
31336 this_arg_conv.inner = untag_ptr(this_arg);
31337 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31339 this_arg_conv.is_owned = false;
31340 LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
31341 int64_t ret_ref = 0;
31342 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31343 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) {
31348 LDKInMemorySigner this_arg_conv;
31349 this_arg_conv.inner = untag_ptr(this_arg);
31350 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31352 this_arg_conv.is_owned = false;
31353 LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
31354 int64_t ret_ref = 0;
31355 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31356 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31360 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
31361 LDKInMemorySigner this_arg_conv;
31362 this_arg_conv.inner = untag_ptr(this_arg);
31363 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31365 this_arg_conv.is_owned = false;
31366 jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv);
31370 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) {
31371 LDKInMemorySigner this_arg_conv;
31372 this_arg_conv.inner = untag_ptr(this_arg);
31373 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31375 this_arg_conv.is_owned = false;
31376 LDKTransaction spend_tx_ref;
31377 spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
31378 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
31379 (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data);
31380 spend_tx_ref.data_is_owned = true;
31381 LDKStaticPaymentOutputDescriptor descriptor_conv;
31382 descriptor_conv.inner = untag_ptr(descriptor);
31383 descriptor_conv.is_owned = ptr_is_owned(descriptor);
31384 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
31385 descriptor_conv.is_owned = false;
31386 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
31387 *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
31388 return tag_ptr(ret_conv, true);
31391 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) {
31392 LDKInMemorySigner this_arg_conv;
31393 this_arg_conv.inner = untag_ptr(this_arg);
31394 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31396 this_arg_conv.is_owned = false;
31397 LDKTransaction spend_tx_ref;
31398 spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
31399 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
31400 (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data);
31401 spend_tx_ref.data_is_owned = true;
31402 LDKDelayedPaymentOutputDescriptor descriptor_conv;
31403 descriptor_conv.inner = untag_ptr(descriptor);
31404 descriptor_conv.is_owned = ptr_is_owned(descriptor);
31405 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
31406 descriptor_conv.is_owned = false;
31407 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
31408 *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
31409 return tag_ptr(ret_conv, true);
31412 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1ChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) {
31413 LDKInMemorySigner this_arg_conv;
31414 this_arg_conv.inner = untag_ptr(this_arg);
31415 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31417 this_arg_conv.is_owned = false;
31418 LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner");
31419 *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv);
31420 return tag_ptr(ret_ret, true);
31423 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) {
31424 LDKInMemorySigner this_arg_conv;
31425 this_arg_conv.inner = untag_ptr(this_arg);
31426 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31427 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31428 this_arg_conv.is_owned = false;
31429 LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner");
31430 *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv);
31431 return tag_ptr(ret_ret, true);
31434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1WriteableEcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) {
31435 LDKInMemorySigner this_arg_conv;
31436 this_arg_conv.inner = untag_ptr(this_arg);
31437 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31438 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31439 this_arg_conv.is_owned = false;
31440 LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
31441 *ret_ret = InMemorySigner_as_WriteableEcdsaChannelSigner(&this_arg_conv);
31442 return tag_ptr(ret_ret, true);
31445 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) {
31446 LDKInMemorySigner obj_conv;
31447 obj_conv.inner = untag_ptr(obj);
31448 obj_conv.is_owned = ptr_is_owned(obj);
31449 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
31450 obj_conv.is_owned = false;
31451 LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
31452 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
31453 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
31454 CVec_u8Z_free(ret_var);
31458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
31459 LDKu8slice ser_ref;
31460 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
31461 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
31462 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
31463 *ret_conv = InMemorySigner_read(ser_ref);
31464 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
31465 return tag_ptr(ret_conv, true);
31468 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31469 LDKKeysManager this_obj_conv;
31470 this_obj_conv.inner = untag_ptr(this_obj);
31471 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31473 KeysManager_free(this_obj_conv);
31476 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) {
31477 uint8_t seed_arr[32];
31478 CHECK((*env)->GetArrayLength(env, seed) == 32);
31479 (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
31480 uint8_t (*seed_ref)[32] = &seed_arr;
31481 LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
31482 int64_t ret_ref = 0;
31483 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31484 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31488 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
31489 LDKKeysManager this_arg_conv;
31490 this_arg_conv.inner = untag_ptr(this_arg);
31491 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31493 this_arg_conv.is_owned = false;
31494 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31495 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, KeysManager_get_node_secret_key(&this_arg_conv).bytes);
31499 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) {
31500 LDKKeysManager this_arg_conv;
31501 this_arg_conv.inner = untag_ptr(this_arg);
31502 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31504 this_arg_conv.is_owned = false;
31505 uint8_t params_arr[32];
31506 CHECK((*env)->GetArrayLength(env, params) == 32);
31507 (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
31508 uint8_t (*params_ref)[32] = ¶ms_arr;
31509 LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
31510 int64_t ret_ref = 0;
31511 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31512 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31516 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) {
31517 LDKKeysManager this_arg_conv;
31518 this_arg_conv.inner = untag_ptr(this_arg);
31519 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31520 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31521 this_arg_conv.is_owned = false;
31522 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
31523 descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors);
31524 if (descriptors_constr.datalen > 0)
31525 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
31527 descriptors_constr.data = NULL;
31528 int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
31529 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
31530 int64_t descriptors_conv_27 = descriptors_vals[b];
31531 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
31532 CHECK_ACCESS(descriptors_conv_27_ptr);
31533 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
31534 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
31535 descriptors_constr.data[b] = descriptors_conv_27_conv;
31537 (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0);
31538 LDKCVec_TxOutZ outputs_constr;
31539 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
31540 if (outputs_constr.datalen > 0)
31541 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
31543 outputs_constr.data = NULL;
31544 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
31545 for (size_t h = 0; h < outputs_constr.datalen; h++) {
31546 int64_t outputs_conv_7 = outputs_vals[h];
31547 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
31548 CHECK_ACCESS(outputs_conv_7_ptr);
31549 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
31550 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
31551 outputs_constr.data[h] = outputs_conv_7_conv;
31553 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
31554 LDKCVec_u8Z change_destination_script_ref;
31555 change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script);
31556 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
31557 (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data);
31558 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
31559 *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
31560 return tag_ptr(ret_conv, true);
31563 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) {
31564 LDKKeysManager this_arg_conv;
31565 this_arg_conv.inner = untag_ptr(this_arg);
31566 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31567 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31568 this_arg_conv.is_owned = false;
31569 LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource");
31570 *ret_ret = KeysManager_as_EntropySource(&this_arg_conv);
31571 return tag_ptr(ret_ret, true);
31574 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) {
31575 LDKKeysManager this_arg_conv;
31576 this_arg_conv.inner = untag_ptr(this_arg);
31577 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31579 this_arg_conv.is_owned = false;
31580 LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner");
31581 *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv);
31582 return tag_ptr(ret_ret, true);
31585 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
31586 LDKKeysManager this_arg_conv;
31587 this_arg_conv.inner = untag_ptr(this_arg);
31588 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31590 this_arg_conv.is_owned = false;
31591 LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider");
31592 *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv);
31593 return tag_ptr(ret_ret, true);
31596 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31597 LDKPhantomKeysManager this_obj_conv;
31598 this_obj_conv.inner = untag_ptr(this_obj);
31599 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31600 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31601 PhantomKeysManager_free(this_obj_conv);
31604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) {
31605 LDKPhantomKeysManager this_arg_conv;
31606 this_arg_conv.inner = untag_ptr(this_arg);
31607 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31608 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31609 this_arg_conv.is_owned = false;
31610 LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource");
31611 *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv);
31612 return tag_ptr(ret_ret, true);
31615 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) {
31616 LDKPhantomKeysManager this_arg_conv;
31617 this_arg_conv.inner = untag_ptr(this_arg);
31618 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31619 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31620 this_arg_conv.is_owned = false;
31621 LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner");
31622 *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv);
31623 return tag_ptr(ret_ret, true);
31626 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
31627 LDKPhantomKeysManager this_arg_conv;
31628 this_arg_conv.inner = untag_ptr(this_arg);
31629 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31630 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31631 this_arg_conv.is_owned = false;
31632 LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider");
31633 *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv);
31634 return tag_ptr(ret_ret, true);
31637 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) {
31638 uint8_t seed_arr[32];
31639 CHECK((*env)->GetArrayLength(env, seed) == 32);
31640 (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
31641 uint8_t (*seed_ref)[32] = &seed_arr;
31642 uint8_t cross_node_seed_arr[32];
31643 CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32);
31644 (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr);
31645 uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
31646 LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref);
31647 int64_t ret_ref = 0;
31648 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31649 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31653 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) {
31654 LDKPhantomKeysManager this_arg_conv;
31655 this_arg_conv.inner = untag_ptr(this_arg);
31656 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31658 this_arg_conv.is_owned = false;
31659 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
31660 descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors);
31661 if (descriptors_constr.datalen > 0)
31662 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
31664 descriptors_constr.data = NULL;
31665 int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
31666 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
31667 int64_t descriptors_conv_27 = descriptors_vals[b];
31668 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
31669 CHECK_ACCESS(descriptors_conv_27_ptr);
31670 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
31671 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
31672 descriptors_constr.data[b] = descriptors_conv_27_conv;
31674 (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0);
31675 LDKCVec_TxOutZ outputs_constr;
31676 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
31677 if (outputs_constr.datalen > 0)
31678 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
31680 outputs_constr.data = NULL;
31681 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
31682 for (size_t h = 0; h < outputs_constr.datalen; h++) {
31683 int64_t outputs_conv_7 = outputs_vals[h];
31684 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
31685 CHECK_ACCESS(outputs_conv_7_ptr);
31686 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
31687 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
31688 outputs_constr.data[h] = outputs_conv_7_conv;
31690 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
31691 LDKCVec_u8Z change_destination_script_ref;
31692 change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script);
31693 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
31694 (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data);
31695 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
31696 *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
31697 return tag_ptr(ret_conv, true);
31700 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) {
31701 LDKPhantomKeysManager this_arg_conv;
31702 this_arg_conv.inner = untag_ptr(this_arg);
31703 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31704 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31705 this_arg_conv.is_owned = false;
31706 uint8_t params_arr[32];
31707 CHECK((*env)->GetArrayLength(env, params) == 32);
31708 (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
31709 uint8_t (*params_ref)[32] = ¶ms_arr;
31710 LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
31711 int64_t ret_ref = 0;
31712 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31713 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31717 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
31718 LDKPhantomKeysManager this_arg_conv;
31719 this_arg_conv.inner = untag_ptr(this_arg);
31720 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31722 this_arg_conv.is_owned = false;
31723 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31724 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes);
31728 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1phantom_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
31729 LDKPhantomKeysManager this_arg_conv;
31730 this_arg_conv.inner = untag_ptr(this_arg);
31731 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31732 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31733 this_arg_conv.is_owned = false;
31734 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31735 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes);
31739 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_FailureCode_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31740 LDKFailureCode* orig_conv = (LDKFailureCode*)untag_ptr(orig);
31741 jclass ret_conv = LDKFailureCode_to_java(env, FailureCode_clone(orig_conv));
31745 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_FailureCode_1temporary_1node_1failure(JNIEnv *env, jclass clz) {
31746 jclass ret_conv = LDKFailureCode_to_java(env, FailureCode_temporary_node_failure());
31750 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_FailureCode_1required_1node_1feature_1missing(JNIEnv *env, jclass clz) {
31751 jclass ret_conv = LDKFailureCode_to_java(env, FailureCode_required_node_feature_missing());
31755 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_FailureCode_1incorrect_1or_1unknown_1payment_1details(JNIEnv *env, jclass clz) {
31756 jclass ret_conv = LDKFailureCode_to_java(env, FailureCode_incorrect_or_unknown_payment_details());
31760 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31761 LDKChannelManager this_obj_conv;
31762 this_obj_conv.inner = untag_ptr(this_obj);
31763 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31765 ChannelManager_free(this_obj_conv);
31768 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31769 LDKChainParameters this_obj_conv;
31770 this_obj_conv.inner = untag_ptr(this_obj);
31771 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31773 ChainParameters_free(this_obj_conv);
31776 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1network(JNIEnv *env, jclass clz, int64_t this_ptr) {
31777 LDKChainParameters this_ptr_conv;
31778 this_ptr_conv.inner = untag_ptr(this_ptr);
31779 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31781 this_ptr_conv.is_owned = false;
31782 jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv));
31786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
31787 LDKChainParameters this_ptr_conv;
31788 this_ptr_conv.inner = untag_ptr(this_ptr);
31789 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31790 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31791 this_ptr_conv.is_owned = false;
31792 LDKNetwork val_conv = LDKNetwork_from_java(env, val);
31793 ChainParameters_set_network(&this_ptr_conv, val_conv);
31796 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr) {
31797 LDKChainParameters this_ptr_conv;
31798 this_ptr_conv.inner = untag_ptr(this_ptr);
31799 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31800 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31801 this_ptr_conv.is_owned = false;
31802 LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv);
31803 int64_t ret_ref = 0;
31804 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31805 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31809 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31810 LDKChainParameters this_ptr_conv;
31811 this_ptr_conv.inner = untag_ptr(this_ptr);
31812 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31814 this_ptr_conv.is_owned = false;
31815 LDKBestBlock val_conv;
31816 val_conv.inner = untag_ptr(val);
31817 val_conv.is_owned = ptr_is_owned(val);
31818 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
31819 val_conv = BestBlock_clone(&val_conv);
31820 ChainParameters_set_best_block(&this_ptr_conv, val_conv);
31823 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv *env, jclass clz, jclass network_arg, int64_t best_block_arg) {
31824 LDKNetwork network_arg_conv = LDKNetwork_from_java(env, network_arg);
31825 LDKBestBlock best_block_arg_conv;
31826 best_block_arg_conv.inner = untag_ptr(best_block_arg);
31827 best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg);
31828 CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv);
31829 best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
31830 LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv);
31831 int64_t ret_ref = 0;
31832 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31833 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31837 static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) {
31838 LDKChainParameters ret_var = ChainParameters_clone(arg);
31839 int64_t ret_ref = 0;
31840 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31841 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31844 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31845 LDKChainParameters arg_conv;
31846 arg_conv.inner = untag_ptr(arg);
31847 arg_conv.is_owned = ptr_is_owned(arg);
31848 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31849 arg_conv.is_owned = false;
31850 int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv);
31854 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31855 LDKChainParameters orig_conv;
31856 orig_conv.inner = untag_ptr(orig);
31857 orig_conv.is_owned = ptr_is_owned(orig);
31858 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31859 orig_conv.is_owned = false;
31860 LDKChainParameters ret_var = ChainParameters_clone(&orig_conv);
31861 int64_t ret_ref = 0;
31862 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31863 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31867 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31868 LDKCounterpartyForwardingInfo this_obj_conv;
31869 this_obj_conv.inner = untag_ptr(this_obj);
31870 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31872 CounterpartyForwardingInfo_free(this_obj_conv);
31875 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
31876 LDKCounterpartyForwardingInfo this_ptr_conv;
31877 this_ptr_conv.inner = untag_ptr(this_ptr);
31878 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31880 this_ptr_conv.is_owned = false;
31881 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv);
31885 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
31886 LDKCounterpartyForwardingInfo this_ptr_conv;
31887 this_ptr_conv.inner = untag_ptr(this_ptr);
31888 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31890 this_ptr_conv.is_owned = false;
31891 CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val);
31894 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
31895 LDKCounterpartyForwardingInfo this_ptr_conv;
31896 this_ptr_conv.inner = untag_ptr(this_ptr);
31897 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31899 this_ptr_conv.is_owned = false;
31900 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv);
31904 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
31905 LDKCounterpartyForwardingInfo this_ptr_conv;
31906 this_ptr_conv.inner = untag_ptr(this_ptr);
31907 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31908 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31909 this_ptr_conv.is_owned = false;
31910 CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
31913 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
31914 LDKCounterpartyForwardingInfo this_ptr_conv;
31915 this_ptr_conv.inner = untag_ptr(this_ptr);
31916 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31917 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31918 this_ptr_conv.is_owned = false;
31919 int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv);
31923 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
31924 LDKCounterpartyForwardingInfo this_ptr_conv;
31925 this_ptr_conv.inner = untag_ptr(this_ptr);
31926 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31927 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31928 this_ptr_conv.is_owned = false;
31929 CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
31932 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) {
31933 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
31934 int64_t ret_ref = 0;
31935 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31936 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31940 static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) {
31941 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg);
31942 int64_t ret_ref = 0;
31943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31947 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31948 LDKCounterpartyForwardingInfo arg_conv;
31949 arg_conv.inner = untag_ptr(arg);
31950 arg_conv.is_owned = ptr_is_owned(arg);
31951 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31952 arg_conv.is_owned = false;
31953 int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv);
31957 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31958 LDKCounterpartyForwardingInfo orig_conv;
31959 orig_conv.inner = untag_ptr(orig);
31960 orig_conv.is_owned = ptr_is_owned(orig);
31961 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31962 orig_conv.is_owned = false;
31963 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv);
31964 int64_t ret_ref = 0;
31965 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31966 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31970 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31971 LDKChannelCounterparty this_obj_conv;
31972 this_obj_conv.inner = untag_ptr(this_obj);
31973 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31975 ChannelCounterparty_free(this_obj_conv);
31978 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
31979 LDKChannelCounterparty this_ptr_conv;
31980 this_ptr_conv.inner = untag_ptr(this_ptr);
31981 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31983 this_ptr_conv.is_owned = false;
31984 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
31985 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form);
31989 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31990 LDKChannelCounterparty this_ptr_conv;
31991 this_ptr_conv.inner = untag_ptr(this_ptr);
31992 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31994 this_ptr_conv.is_owned = false;
31995 LDKPublicKey val_ref;
31996 CHECK((*env)->GetArrayLength(env, val) == 33);
31997 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
31998 ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref);
32001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
32002 LDKChannelCounterparty this_ptr_conv;
32003 this_ptr_conv.inner = untag_ptr(this_ptr);
32004 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32006 this_ptr_conv.is_owned = false;
32007 LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv);
32008 int64_t ret_ref = 0;
32009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32014 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32015 LDKChannelCounterparty this_ptr_conv;
32016 this_ptr_conv.inner = untag_ptr(this_ptr);
32017 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32019 this_ptr_conv.is_owned = false;
32020 LDKInitFeatures val_conv;
32021 val_conv.inner = untag_ptr(val);
32022 val_conv.is_owned = ptr_is_owned(val);
32023 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32024 val_conv = InitFeatures_clone(&val_conv);
32025 ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
32028 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) {
32029 LDKChannelCounterparty this_ptr_conv;
32030 this_ptr_conv.inner = untag_ptr(this_ptr);
32031 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32033 this_ptr_conv.is_owned = false;
32034 int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
32038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32039 LDKChannelCounterparty this_ptr_conv;
32040 this_ptr_conv.inner = untag_ptr(this_ptr);
32041 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32043 this_ptr_conv.is_owned = false;
32044 ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
32047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr) {
32048 LDKChannelCounterparty this_ptr_conv;
32049 this_ptr_conv.inner = untag_ptr(this_ptr);
32050 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32051 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32052 this_ptr_conv.is_owned = false;
32053 LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
32054 int64_t ret_ref = 0;
32055 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32056 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32060 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32061 LDKChannelCounterparty this_ptr_conv;
32062 this_ptr_conv.inner = untag_ptr(this_ptr);
32063 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32065 this_ptr_conv.is_owned = false;
32066 LDKCounterpartyForwardingInfo val_conv;
32067 val_conv.inner = untag_ptr(val);
32068 val_conv.is_owned = ptr_is_owned(val);
32069 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32070 val_conv = CounterpartyForwardingInfo_clone(&val_conv);
32071 ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv);
32074 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32075 LDKChannelCounterparty this_ptr_conv;
32076 this_ptr_conv.inner = untag_ptr(this_ptr);
32077 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32078 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32079 this_ptr_conv.is_owned = false;
32080 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32081 *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv);
32082 int64_t ret_ref = tag_ptr(ret_copy, true);
32086 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) {
32087 LDKChannelCounterparty this_ptr_conv;
32088 this_ptr_conv.inner = untag_ptr(this_ptr);
32089 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32090 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32091 this_ptr_conv.is_owned = false;
32092 void* val_ptr = untag_ptr(val);
32093 CHECK_ACCESS(val_ptr);
32094 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32095 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32096 ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
32099 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32100 LDKChannelCounterparty this_ptr_conv;
32101 this_ptr_conv.inner = untag_ptr(this_ptr);
32102 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32103 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32104 this_ptr_conv.is_owned = false;
32105 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32106 *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv);
32107 int64_t ret_ref = tag_ptr(ret_copy, true);
32111 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) {
32112 LDKChannelCounterparty this_ptr_conv;
32113 this_ptr_conv.inner = untag_ptr(this_ptr);
32114 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32116 this_ptr_conv.is_owned = false;
32117 void* val_ptr = untag_ptr(val);
32118 CHECK_ACCESS(val_ptr);
32119 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32120 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32121 ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
32124 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) {
32125 LDKPublicKey node_id_arg_ref;
32126 CHECK((*env)->GetArrayLength(env, node_id_arg) == 33);
32127 (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form);
32128 LDKInitFeatures features_arg_conv;
32129 features_arg_conv.inner = untag_ptr(features_arg);
32130 features_arg_conv.is_owned = ptr_is_owned(features_arg);
32131 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
32132 features_arg_conv = InitFeatures_clone(&features_arg_conv);
32133 LDKCounterpartyForwardingInfo forwarding_info_arg_conv;
32134 forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg);
32135 forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg);
32136 CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv);
32137 forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
32138 void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg);
32139 CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr);
32140 LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr);
32141 outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg));
32142 void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg);
32143 CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr);
32144 LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr);
32145 outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg));
32146 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);
32147 int64_t ret_ref = 0;
32148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32149 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32153 static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) {
32154 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg);
32155 int64_t ret_ref = 0;
32156 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32157 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32160 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32161 LDKChannelCounterparty arg_conv;
32162 arg_conv.inner = untag_ptr(arg);
32163 arg_conv.is_owned = ptr_is_owned(arg);
32164 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32165 arg_conv.is_owned = false;
32166 int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv);
32170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32171 LDKChannelCounterparty orig_conv;
32172 orig_conv.inner = untag_ptr(orig);
32173 orig_conv.is_owned = ptr_is_owned(orig);
32174 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32175 orig_conv.is_owned = false;
32176 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv);
32177 int64_t ret_ref = 0;
32178 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32179 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32183 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32184 LDKChannelDetails this_obj_conv;
32185 this_obj_conv.inner = untag_ptr(this_obj);
32186 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32187 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32188 ChannelDetails_free(this_obj_conv);
32191 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32192 LDKChannelDetails this_ptr_conv;
32193 this_ptr_conv.inner = untag_ptr(this_ptr);
32194 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32196 this_ptr_conv.is_owned = false;
32197 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32198 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv));
32202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32203 LDKChannelDetails this_ptr_conv;
32204 this_ptr_conv.inner = untag_ptr(this_ptr);
32205 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32206 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32207 this_ptr_conv.is_owned = false;
32208 LDKThirtyTwoBytes val_ref;
32209 CHECK((*env)->GetArrayLength(env, val) == 32);
32210 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32211 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref);
32214 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr) {
32215 LDKChannelDetails this_ptr_conv;
32216 this_ptr_conv.inner = untag_ptr(this_ptr);
32217 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32219 this_ptr_conv.is_owned = false;
32220 LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
32221 int64_t ret_ref = 0;
32222 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32223 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32227 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32228 LDKChannelDetails this_ptr_conv;
32229 this_ptr_conv.inner = untag_ptr(this_ptr);
32230 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32232 this_ptr_conv.is_owned = false;
32233 LDKChannelCounterparty val_conv;
32234 val_conv.inner = untag_ptr(val);
32235 val_conv.is_owned = ptr_is_owned(val);
32236 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32237 val_conv = ChannelCounterparty_clone(&val_conv);
32238 ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
32241 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr) {
32242 LDKChannelDetails this_ptr_conv;
32243 this_ptr_conv.inner = untag_ptr(this_ptr);
32244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32246 this_ptr_conv.is_owned = false;
32247 LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
32248 int64_t ret_ref = 0;
32249 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32250 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32254 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32255 LDKChannelDetails 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 LDKOutPoint val_conv;
32261 val_conv.inner = untag_ptr(val);
32262 val_conv.is_owned = ptr_is_owned(val);
32263 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32264 val_conv = OutPoint_clone(&val_conv);
32265 ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv);
32268 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
32269 LDKChannelDetails this_ptr_conv;
32270 this_ptr_conv.inner = untag_ptr(this_ptr);
32271 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32273 this_ptr_conv.is_owned = false;
32274 LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv);
32275 int64_t ret_ref = 0;
32276 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32277 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32281 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32282 LDKChannelDetails this_ptr_conv;
32283 this_ptr_conv.inner = untag_ptr(this_ptr);
32284 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32286 this_ptr_conv.is_owned = false;
32287 LDKChannelTypeFeatures val_conv;
32288 val_conv.inner = untag_ptr(val);
32289 val_conv.is_owned = ptr_is_owned(val);
32290 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32291 val_conv = ChannelTypeFeatures_clone(&val_conv);
32292 ChannelDetails_set_channel_type(&this_ptr_conv, val_conv);
32295 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32296 LDKChannelDetails this_ptr_conv;
32297 this_ptr_conv.inner = untag_ptr(this_ptr);
32298 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32300 this_ptr_conv.is_owned = false;
32301 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32302 *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv);
32303 int64_t ret_ref = tag_ptr(ret_copy, true);
32307 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32308 LDKChannelDetails this_ptr_conv;
32309 this_ptr_conv.inner = untag_ptr(this_ptr);
32310 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32312 this_ptr_conv.is_owned = false;
32313 void* val_ptr = untag_ptr(val);
32314 CHECK_ACCESS(val_ptr);
32315 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32316 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32317 ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
32320 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
32321 LDKChannelDetails this_ptr_conv;
32322 this_ptr_conv.inner = untag_ptr(this_ptr);
32323 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32325 this_ptr_conv.is_owned = false;
32326 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32327 *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv);
32328 int64_t ret_ref = tag_ptr(ret_copy, true);
32332 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32333 LDKChannelDetails this_ptr_conv;
32334 this_ptr_conv.inner = untag_ptr(this_ptr);
32335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32337 this_ptr_conv.is_owned = false;
32338 void* val_ptr = untag_ptr(val);
32339 CHECK_ACCESS(val_ptr);
32340 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32341 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32342 ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv);
32345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
32346 LDKChannelDetails this_ptr_conv;
32347 this_ptr_conv.inner = untag_ptr(this_ptr);
32348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32350 this_ptr_conv.is_owned = false;
32351 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32352 *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv);
32353 int64_t ret_ref = tag_ptr(ret_copy, true);
32357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32358 LDKChannelDetails this_ptr_conv;
32359 this_ptr_conv.inner = untag_ptr(this_ptr);
32360 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32362 this_ptr_conv.is_owned = false;
32363 void* val_ptr = untag_ptr(val);
32364 CHECK_ACCESS(val_ptr);
32365 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32366 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32367 ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv);
32370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
32371 LDKChannelDetails this_ptr_conv;
32372 this_ptr_conv.inner = untag_ptr(this_ptr);
32373 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32375 this_ptr_conv.is_owned = false;
32376 int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
32380 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32381 LDKChannelDetails 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 ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
32389 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) {
32390 LDKChannelDetails this_ptr_conv;
32391 this_ptr_conv.inner = untag_ptr(this_ptr);
32392 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32394 this_ptr_conv.is_owned = false;
32395 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32396 *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv);
32397 int64_t ret_ref = tag_ptr(ret_copy, true);
32401 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32402 LDKChannelDetails this_ptr_conv;
32403 this_ptr_conv.inner = untag_ptr(this_ptr);
32404 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32405 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32406 this_ptr_conv.is_owned = false;
32407 void* val_ptr = untag_ptr(val);
32408 CHECK_ACCESS(val_ptr);
32409 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32410 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32411 ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
32414 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32415 LDKChannelDetails this_ptr_conv;
32416 this_ptr_conv.inner = untag_ptr(this_ptr);
32417 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32419 this_ptr_conv.is_owned = false;
32420 int8_tArray ret_arr = (*env)->NewByteArray(env, 16);
32421 (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes);
32425 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32426 LDKChannelDetails this_ptr_conv;
32427 this_ptr_conv.inner = untag_ptr(this_ptr);
32428 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32430 this_ptr_conv.is_owned = false;
32432 CHECK((*env)->GetArrayLength(env, val) == 16);
32433 (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes);
32434 ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref);
32437 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32438 LDKChannelDetails this_ptr_conv;
32439 this_ptr_conv.inner = untag_ptr(this_ptr);
32440 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32442 this_ptr_conv.is_owned = false;
32443 int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv);
32447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32448 LDKChannelDetails this_ptr_conv;
32449 this_ptr_conv.inner = untag_ptr(this_ptr);
32450 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32452 this_ptr_conv.is_owned = false;
32453 ChannelDetails_set_balance_msat(&this_ptr_conv, val);
32456 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32457 LDKChannelDetails this_ptr_conv;
32458 this_ptr_conv.inner = untag_ptr(this_ptr);
32459 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32461 this_ptr_conv.is_owned = false;
32462 int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
32466 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32467 LDKChannelDetails this_ptr_conv;
32468 this_ptr_conv.inner = untag_ptr(this_ptr);
32469 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32471 this_ptr_conv.is_owned = false;
32472 ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
32475 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1next_1outbound_1htlc_1limit_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32476 LDKChannelDetails this_ptr_conv;
32477 this_ptr_conv.inner = untag_ptr(this_ptr);
32478 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32479 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32480 this_ptr_conv.is_owned = false;
32481 int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv);
32485 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) {
32486 LDKChannelDetails this_ptr_conv;
32487 this_ptr_conv.inner = untag_ptr(this_ptr);
32488 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32489 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32490 this_ptr_conv.is_owned = false;
32491 ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val);
32494 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32495 LDKChannelDetails this_ptr_conv;
32496 this_ptr_conv.inner = untag_ptr(this_ptr);
32497 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32499 this_ptr_conv.is_owned = false;
32500 int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
32504 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32505 LDKChannelDetails this_ptr_conv;
32506 this_ptr_conv.inner = untag_ptr(this_ptr);
32507 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32508 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32509 this_ptr_conv.is_owned = false;
32510 ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
32513 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr) {
32514 LDKChannelDetails this_ptr_conv;
32515 this_ptr_conv.inner = untag_ptr(this_ptr);
32516 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32518 this_ptr_conv.is_owned = false;
32519 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
32520 *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv);
32521 int64_t ret_ref = tag_ptr(ret_copy, true);
32525 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32526 LDKChannelDetails this_ptr_conv;
32527 this_ptr_conv.inner = untag_ptr(this_ptr);
32528 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32530 this_ptr_conv.is_owned = false;
32531 void* val_ptr = untag_ptr(val);
32532 CHECK_ACCESS(val_ptr);
32533 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
32534 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
32535 ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
32538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations(JNIEnv *env, jclass clz, int64_t this_ptr) {
32539 LDKChannelDetails this_ptr_conv;
32540 this_ptr_conv.inner = untag_ptr(this_ptr);
32541 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32543 this_ptr_conv.is_owned = false;
32544 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
32545 *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv);
32546 int64_t ret_ref = tag_ptr(ret_copy, true);
32550 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32551 LDKChannelDetails this_ptr_conv;
32552 this_ptr_conv.inner = untag_ptr(this_ptr);
32553 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32554 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32555 this_ptr_conv.is_owned = false;
32556 void* val_ptr = untag_ptr(val);
32557 CHECK_ACCESS(val_ptr);
32558 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
32559 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
32560 ChannelDetails_set_confirmations(&this_ptr_conv, val_conv);
32563 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
32564 LDKChannelDetails 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 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
32570 *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv);
32571 int64_t ret_ref = tag_ptr(ret_copy, true);
32575 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) {
32576 LDKChannelDetails this_ptr_conv;
32577 this_ptr_conv.inner = untag_ptr(this_ptr);
32578 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32580 this_ptr_conv.is_owned = false;
32581 void* val_ptr = untag_ptr(val);
32582 CHECK_ACCESS(val_ptr);
32583 LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
32584 val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val));
32585 ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
32588 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr) {
32589 LDKChannelDetails this_ptr_conv;
32590 this_ptr_conv.inner = untag_ptr(this_ptr);
32591 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32592 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32593 this_ptr_conv.is_owned = false;
32594 jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv);
32598 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
32599 LDKChannelDetails this_ptr_conv;
32600 this_ptr_conv.inner = untag_ptr(this_ptr);
32601 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32602 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32603 this_ptr_conv.is_owned = false;
32604 ChannelDetails_set_is_outbound(&this_ptr_conv, val);
32607 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr) {
32608 LDKChannelDetails this_ptr_conv;
32609 this_ptr_conv.inner = untag_ptr(this_ptr);
32610 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32612 this_ptr_conv.is_owned = false;
32613 jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv);
32617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
32618 LDKChannelDetails this_ptr_conv;
32619 this_ptr_conv.inner = untag_ptr(this_ptr);
32620 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32622 this_ptr_conv.is_owned = false;
32623 ChannelDetails_set_is_channel_ready(&this_ptr_conv, val);
32626 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr) {
32627 LDKChannelDetails this_ptr_conv;
32628 this_ptr_conv.inner = untag_ptr(this_ptr);
32629 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32630 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32631 this_ptr_conv.is_owned = false;
32632 jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv);
32636 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
32637 LDKChannelDetails this_ptr_conv;
32638 this_ptr_conv.inner = untag_ptr(this_ptr);
32639 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32640 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32641 this_ptr_conv.is_owned = false;
32642 ChannelDetails_set_is_usable(&this_ptr_conv, val);
32645 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr) {
32646 LDKChannelDetails this_ptr_conv;
32647 this_ptr_conv.inner = untag_ptr(this_ptr);
32648 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32649 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32650 this_ptr_conv.is_owned = false;
32651 jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv);
32655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
32656 LDKChannelDetails this_ptr_conv;
32657 this_ptr_conv.inner = untag_ptr(this_ptr);
32658 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32659 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32660 this_ptr_conv.is_owned = false;
32661 ChannelDetails_set_is_public(&this_ptr_conv, val);
32664 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32665 LDKChannelDetails this_ptr_conv;
32666 this_ptr_conv.inner = untag_ptr(this_ptr);
32667 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32668 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32669 this_ptr_conv.is_owned = false;
32670 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32671 *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv);
32672 int64_t ret_ref = tag_ptr(ret_copy, true);
32676 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) {
32677 LDKChannelDetails this_ptr_conv;
32678 this_ptr_conv.inner = untag_ptr(this_ptr);
32679 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32681 this_ptr_conv.is_owned = false;
32682 void* val_ptr = untag_ptr(val);
32683 CHECK_ACCESS(val_ptr);
32684 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32685 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32686 ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
32689 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32690 LDKChannelDetails this_ptr_conv;
32691 this_ptr_conv.inner = untag_ptr(this_ptr);
32692 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32694 this_ptr_conv.is_owned = false;
32695 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32696 *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv);
32697 int64_t ret_ref = tag_ptr(ret_copy, true);
32701 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) {
32702 LDKChannelDetails this_ptr_conv;
32703 this_ptr_conv.inner = untag_ptr(this_ptr);
32704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32706 this_ptr_conv.is_owned = false;
32707 void* val_ptr = untag_ptr(val);
32708 CHECK_ACCESS(val_ptr);
32709 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32710 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32711 ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
32714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
32715 LDKChannelDetails this_ptr_conv;
32716 this_ptr_conv.inner = untag_ptr(this_ptr);
32717 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32719 this_ptr_conv.is_owned = false;
32720 LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv);
32721 int64_t ret_ref = 0;
32722 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32723 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32727 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32728 LDKChannelDetails this_ptr_conv;
32729 this_ptr_conv.inner = untag_ptr(this_ptr);
32730 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32732 this_ptr_conv.is_owned = false;
32733 LDKChannelConfig val_conv;
32734 val_conv.inner = untag_ptr(val);
32735 val_conv.is_owned = ptr_is_owned(val);
32736 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32737 val_conv = ChannelConfig_clone(&val_conv);
32738 ChannelDetails_set_config(&this_ptr_conv, val_conv);
32741 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, int8_tArray 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 confirmations_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) {
32742 LDKThirtyTwoBytes channel_id_arg_ref;
32743 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
32744 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
32745 LDKChannelCounterparty counterparty_arg_conv;
32746 counterparty_arg_conv.inner = untag_ptr(counterparty_arg);
32747 counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg);
32748 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv);
32749 counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
32750 LDKOutPoint funding_txo_arg_conv;
32751 funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg);
32752 funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg);
32753 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv);
32754 funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
32755 LDKChannelTypeFeatures channel_type_arg_conv;
32756 channel_type_arg_conv.inner = untag_ptr(channel_type_arg);
32757 channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg);
32758 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv);
32759 channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv);
32760 void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg);
32761 CHECK_ACCESS(short_channel_id_arg_ptr);
32762 LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
32763 short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg));
32764 void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg);
32765 CHECK_ACCESS(outbound_scid_alias_arg_ptr);
32766 LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr);
32767 outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg));
32768 void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg);
32769 CHECK_ACCESS(inbound_scid_alias_arg_ptr);
32770 LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr);
32771 inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg));
32772 void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg);
32773 CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
32774 LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
32775 LDKU128 user_channel_id_arg_ref;
32776 CHECK((*env)->GetArrayLength(env, user_channel_id_arg) == 16);
32777 (*env)->GetByteArrayRegion(env, user_channel_id_arg, 0, 16, user_channel_id_arg_ref.le_bytes);
32778 void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg);
32779 CHECK_ACCESS(confirmations_required_arg_ptr);
32780 LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
32781 confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg));
32782 void* confirmations_arg_ptr = untag_ptr(confirmations_arg);
32783 CHECK_ACCESS(confirmations_arg_ptr);
32784 LDKCOption_u32Z confirmations_arg_conv = *(LDKCOption_u32Z*)(confirmations_arg_ptr);
32785 confirmations_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_arg));
32786 void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg);
32787 CHECK_ACCESS(force_close_spend_delay_arg_ptr);
32788 LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
32789 force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg));
32790 void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg);
32791 CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr);
32792 LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr);
32793 inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg));
32794 void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg);
32795 CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr);
32796 LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr);
32797 inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg));
32798 LDKChannelConfig config_arg_conv;
32799 config_arg_conv.inner = untag_ptr(config_arg);
32800 config_arg_conv.is_owned = ptr_is_owned(config_arg);
32801 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv);
32802 config_arg_conv = ChannelConfig_clone(&config_arg_conv);
32803 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_ref, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_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);
32804 int64_t ret_ref = 0;
32805 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32806 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32810 static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) {
32811 LDKChannelDetails ret_var = ChannelDetails_clone(arg);
32812 int64_t ret_ref = 0;
32813 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32814 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32817 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32818 LDKChannelDetails arg_conv;
32819 arg_conv.inner = untag_ptr(arg);
32820 arg_conv.is_owned = ptr_is_owned(arg);
32821 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32822 arg_conv.is_owned = false;
32823 int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv);
32827 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32828 LDKChannelDetails orig_conv;
32829 orig_conv.inner = untag_ptr(orig);
32830 orig_conv.is_owned = ptr_is_owned(orig);
32831 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32832 orig_conv.is_owned = false;
32833 LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
32834 int64_t ret_ref = 0;
32835 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32836 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
32841 LDKChannelDetails this_arg_conv;
32842 this_arg_conv.inner = untag_ptr(this_arg);
32843 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32845 this_arg_conv.is_owned = false;
32846 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32847 *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv);
32848 int64_t ret_ref = tag_ptr(ret_copy, true);
32852 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
32853 LDKChannelDetails this_arg_conv;
32854 this_arg_conv.inner = untag_ptr(this_arg);
32855 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32856 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32857 this_arg_conv.is_owned = false;
32858 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32859 *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv);
32860 int64_t ret_ref = tag_ptr(ret_copy, true);
32864 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
32865 if (!ptr_is_owned(this_ptr)) return;
32866 void* this_ptr_ptr = untag_ptr(this_ptr);
32867 CHECK_ACCESS(this_ptr_ptr);
32868 LDKRecentPaymentDetails this_ptr_conv = *(LDKRecentPaymentDetails*)(this_ptr_ptr);
32869 FREE(untag_ptr(this_ptr));
32870 RecentPaymentDetails_free(this_ptr_conv);
32873 static inline uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg) {
32874 LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
32875 *ret_copy = RecentPaymentDetails_clone(arg);
32876 int64_t ret_ref = tag_ptr(ret_copy, true);
32879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32880 LDKRecentPaymentDetails* arg_conv = (LDKRecentPaymentDetails*)untag_ptr(arg);
32881 int64_t ret_conv = RecentPaymentDetails_clone_ptr(arg_conv);
32885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32886 LDKRecentPaymentDetails* orig_conv = (LDKRecentPaymentDetails*)untag_ptr(orig);
32887 LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
32888 *ret_copy = RecentPaymentDetails_clone(orig_conv);
32889 int64_t ret_ref = tag_ptr(ret_copy, true);
32893 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1pending(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t total_msat) {
32894 LDKThirtyTwoBytes payment_hash_ref;
32895 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32896 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
32897 LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
32898 *ret_copy = RecentPaymentDetails_pending(payment_hash_ref, total_msat);
32899 int64_t ret_ref = tag_ptr(ret_copy, true);
32903 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1fulfilled(JNIEnv *env, jclass clz, int8_tArray payment_hash) {
32904 LDKThirtyTwoBytes payment_hash_ref;
32905 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32906 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
32907 LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
32908 *ret_copy = RecentPaymentDetails_fulfilled(payment_hash_ref);
32909 int64_t ret_ref = tag_ptr(ret_copy, true);
32913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1abandoned(JNIEnv *env, jclass clz, int8_tArray payment_hash) {
32914 LDKThirtyTwoBytes payment_hash_ref;
32915 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32916 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
32917 LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
32918 *ret_copy = RecentPaymentDetails_abandoned(payment_hash_ref);
32919 int64_t ret_ref = tag_ptr(ret_copy, true);
32923 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32924 LDKPhantomRouteHints this_obj_conv;
32925 this_obj_conv.inner = untag_ptr(this_obj);
32926 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32927 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32928 PhantomRouteHints_free(this_obj_conv);
32931 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
32932 LDKPhantomRouteHints this_ptr_conv;
32933 this_ptr_conv.inner = untag_ptr(this_ptr);
32934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32936 this_ptr_conv.is_owned = false;
32937 LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv);
32938 int64_tArray ret_arr = NULL;
32939 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
32940 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
32941 for (size_t q = 0; q < ret_var.datalen; q++) {
32942 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
32943 int64_t ret_conv_16_ref = 0;
32944 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
32945 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
32946 ret_arr_ptr[q] = ret_conv_16_ref;
32948 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
32949 FREE(ret_var.data);
32953 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
32954 LDKPhantomRouteHints this_ptr_conv;
32955 this_ptr_conv.inner = untag_ptr(this_ptr);
32956 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32958 this_ptr_conv.is_owned = false;
32959 LDKCVec_ChannelDetailsZ val_constr;
32960 val_constr.datalen = (*env)->GetArrayLength(env, val);
32961 if (val_constr.datalen > 0)
32962 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
32964 val_constr.data = NULL;
32965 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
32966 for (size_t q = 0; q < val_constr.datalen; q++) {
32967 int64_t val_conv_16 = val_vals[q];
32968 LDKChannelDetails val_conv_16_conv;
32969 val_conv_16_conv.inner = untag_ptr(val_conv_16);
32970 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
32971 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
32972 val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
32973 val_constr.data[q] = val_conv_16_conv;
32975 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
32976 PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
32979 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr) {
32980 LDKPhantomRouteHints this_ptr_conv;
32981 this_ptr_conv.inner = untag_ptr(this_ptr);
32982 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32984 this_ptr_conv.is_owned = false;
32985 int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv);
32989 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32990 LDKPhantomRouteHints this_ptr_conv;
32991 this_ptr_conv.inner = untag_ptr(this_ptr);
32992 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32994 this_ptr_conv.is_owned = false;
32995 PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val);
32998 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
32999 LDKPhantomRouteHints this_ptr_conv;
33000 this_ptr_conv.inner = untag_ptr(this_ptr);
33001 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33003 this_ptr_conv.is_owned = false;
33004 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33005 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form);
33009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33010 LDKPhantomRouteHints this_ptr_conv;
33011 this_ptr_conv.inner = untag_ptr(this_ptr);
33012 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33014 this_ptr_conv.is_owned = false;
33015 LDKPublicKey val_ref;
33016 CHECK((*env)->GetArrayLength(env, val) == 33);
33017 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33018 PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref);
33021 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) {
33022 LDKCVec_ChannelDetailsZ channels_arg_constr;
33023 channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg);
33024 if (channels_arg_constr.datalen > 0)
33025 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
33027 channels_arg_constr.data = NULL;
33028 int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL);
33029 for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
33030 int64_t channels_arg_conv_16 = channels_arg_vals[q];
33031 LDKChannelDetails channels_arg_conv_16_conv;
33032 channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16);
33033 channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16);
33034 CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv);
33035 channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
33036 channels_arg_constr.data[q] = channels_arg_conv_16_conv;
33038 (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0);
33039 LDKPublicKey real_node_pubkey_arg_ref;
33040 CHECK((*env)->GetArrayLength(env, real_node_pubkey_arg) == 33);
33041 (*env)->GetByteArrayRegion(env, real_node_pubkey_arg, 0, 33, real_node_pubkey_arg_ref.compressed_form);
33042 LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref);
33043 int64_t ret_ref = 0;
33044 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33045 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33049 static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) {
33050 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg);
33051 int64_t ret_ref = 0;
33052 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33053 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33057 LDKPhantomRouteHints arg_conv;
33058 arg_conv.inner = untag_ptr(arg);
33059 arg_conv.is_owned = ptr_is_owned(arg);
33060 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33061 arg_conv.is_owned = false;
33062 int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv);
33066 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33067 LDKPhantomRouteHints orig_conv;
33068 orig_conv.inner = untag_ptr(orig);
33069 orig_conv.is_owned = ptr_is_owned(orig);
33070 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33071 orig_conv.is_owned = false;
33072 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv);
33073 int64_t ret_ref = 0;
33074 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33075 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33079 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 router, int64_t logger, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t config, int64_t params) {
33080 void* fee_est_ptr = untag_ptr(fee_est);
33081 CHECK_ACCESS(fee_est_ptr);
33082 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
33083 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
33084 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33085 LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
33087 void* chain_monitor_ptr = untag_ptr(chain_monitor);
33088 CHECK_ACCESS(chain_monitor_ptr);
33089 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
33090 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
33091 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33092 LDKWatch_JCalls_cloned(&chain_monitor_conv);
33094 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
33095 CHECK_ACCESS(tx_broadcaster_ptr);
33096 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
33097 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
33098 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33099 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
33101 void* router_ptr = untag_ptr(router);
33102 CHECK_ACCESS(router_ptr);
33103 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
33104 if (router_conv.free == LDKRouter_JCalls_free) {
33105 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33106 LDKRouter_JCalls_cloned(&router_conv);
33108 void* logger_ptr = untag_ptr(logger);
33109 CHECK_ACCESS(logger_ptr);
33110 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
33111 if (logger_conv.free == LDKLogger_JCalls_free) {
33112 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33113 LDKLogger_JCalls_cloned(&logger_conv);
33115 void* entropy_source_ptr = untag_ptr(entropy_source);
33116 CHECK_ACCESS(entropy_source_ptr);
33117 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
33118 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
33119 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33120 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
33122 void* node_signer_ptr = untag_ptr(node_signer);
33123 CHECK_ACCESS(node_signer_ptr);
33124 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
33125 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
33126 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33127 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
33129 void* signer_provider_ptr = untag_ptr(signer_provider);
33130 CHECK_ACCESS(signer_provider_ptr);
33131 LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr);
33132 if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) {
33133 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33134 LDKSignerProvider_JCalls_cloned(&signer_provider_conv);
33136 LDKUserConfig config_conv;
33137 config_conv.inner = untag_ptr(config);
33138 config_conv.is_owned = ptr_is_owned(config);
33139 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
33140 config_conv = UserConfig_clone(&config_conv);
33141 LDKChainParameters params_conv;
33142 params_conv.inner = untag_ptr(params);
33143 params_conv.is_owned = ptr_is_owned(params);
33144 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
33145 params_conv = ChainParameters_clone(¶ms_conv);
33146 LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv);
33147 int64_t ret_ref = 0;
33148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33149 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33153 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1current_1default_1configuration(JNIEnv *env, jclass clz, int64_t this_arg) {
33154 LDKChannelManager this_arg_conv;
33155 this_arg_conv.inner = untag_ptr(this_arg);
33156 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33157 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33158 this_arg_conv.is_owned = false;
33159 LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv);
33160 int64_t ret_ref = 0;
33161 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33162 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33166 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, int8_tArray user_channel_id, int64_t override_config) {
33167 LDKChannelManager this_arg_conv;
33168 this_arg_conv.inner = untag_ptr(this_arg);
33169 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33171 this_arg_conv.is_owned = false;
33172 LDKPublicKey their_network_key_ref;
33173 CHECK((*env)->GetArrayLength(env, their_network_key) == 33);
33174 (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form);
33175 LDKU128 user_channel_id_ref;
33176 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
33177 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
33178 LDKUserConfig override_config_conv;
33179 override_config_conv.inner = untag_ptr(override_config);
33180 override_config_conv.is_owned = ptr_is_owned(override_config);
33181 CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
33182 override_config_conv = UserConfig_clone(&override_config_conv);
33183 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
33184 *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, override_config_conv);
33185 return tag_ptr(ret_conv, true);
33188 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
33189 LDKChannelManager this_arg_conv;
33190 this_arg_conv.inner = untag_ptr(this_arg);
33191 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33193 this_arg_conv.is_owned = false;
33194 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
33195 int64_tArray ret_arr = NULL;
33196 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
33197 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
33198 for (size_t q = 0; q < ret_var.datalen; q++) {
33199 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
33200 int64_t ret_conv_16_ref = 0;
33201 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
33202 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
33203 ret_arr_ptr[q] = ret_conv_16_ref;
33205 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
33206 FREE(ret_var.data);
33210 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
33211 LDKChannelManager this_arg_conv;
33212 this_arg_conv.inner = untag_ptr(this_arg);
33213 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33215 this_arg_conv.is_owned = false;
33216 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
33217 int64_tArray ret_arr = NULL;
33218 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
33219 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
33220 for (size_t q = 0; q < ret_var.datalen; q++) {
33221 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
33222 int64_t ret_conv_16_ref = 0;
33223 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
33224 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
33225 ret_arr_ptr[q] = ret_conv_16_ref;
33227 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
33228 FREE(ret_var.data);
33232 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1recent_1payments(JNIEnv *env, jclass clz, int64_t this_arg) {
33233 LDKChannelManager this_arg_conv;
33234 this_arg_conv.inner = untag_ptr(this_arg);
33235 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33237 this_arg_conv.is_owned = false;
33238 LDKCVec_RecentPaymentDetailsZ ret_var = ChannelManager_list_recent_payments(&this_arg_conv);
33239 int64_tArray ret_arr = NULL;
33240 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
33241 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
33242 for (size_t w = 0; w < ret_var.datalen; w++) {
33243 LDKRecentPaymentDetails *ret_conv_22_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
33244 *ret_conv_22_copy = ret_var.data[w];
33245 int64_t ret_conv_22_ref = tag_ptr(ret_conv_22_copy, true);
33246 ret_arr_ptr[w] = ret_conv_22_ref;
33248 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
33249 FREE(ret_var.data);
33253 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) {
33254 LDKChannelManager this_arg_conv;
33255 this_arg_conv.inner = untag_ptr(this_arg);
33256 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33257 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33258 this_arg_conv.is_owned = false;
33259 uint8_t channel_id_arr[32];
33260 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
33261 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
33262 uint8_t (*channel_id_ref)[32] = &channel_id_arr;
33263 LDKPublicKey counterparty_node_id_ref;
33264 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33265 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33266 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33267 *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
33268 return tag_ptr(ret_conv, true);
33271 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) {
33272 LDKChannelManager this_arg_conv;
33273 this_arg_conv.inner = untag_ptr(this_arg);
33274 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33276 this_arg_conv.is_owned = false;
33277 uint8_t channel_id_arr[32];
33278 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
33279 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
33280 uint8_t (*channel_id_ref)[32] = &channel_id_arr;
33281 LDKPublicKey counterparty_node_id_ref;
33282 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33283 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33284 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33285 *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight);
33286 return tag_ptr(ret_conv, true);
33289 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) {
33290 LDKChannelManager this_arg_conv;
33291 this_arg_conv.inner = untag_ptr(this_arg);
33292 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33293 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33294 this_arg_conv.is_owned = false;
33295 uint8_t channel_id_arr[32];
33296 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
33297 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
33298 uint8_t (*channel_id_ref)[32] = &channel_id_arr;
33299 LDKPublicKey counterparty_node_id_ref;
33300 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33301 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33302 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33303 *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
33304 return tag_ptr(ret_conv, true);
33307 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) {
33308 LDKChannelManager this_arg_conv;
33309 this_arg_conv.inner = untag_ptr(this_arg);
33310 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33312 this_arg_conv.is_owned = false;
33313 uint8_t channel_id_arr[32];
33314 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
33315 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
33316 uint8_t (*channel_id_ref)[32] = &channel_id_arr;
33317 LDKPublicKey counterparty_node_id_ref;
33318 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33319 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33320 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33321 *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
33322 return tag_ptr(ret_conv, true);
33325 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg) {
33326 LDKChannelManager this_arg_conv;
33327 this_arg_conv.inner = untag_ptr(this_arg);
33328 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33330 this_arg_conv.is_owned = false;
33331 ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv);
33334 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg) {
33335 LDKChannelManager this_arg_conv;
33336 this_arg_conv.inner = untag_ptr(this_arg);
33337 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33339 this_arg_conv.is_owned = false;
33340 ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv);
33343 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, int8_tArray payment_id) {
33344 LDKChannelManager this_arg_conv;
33345 this_arg_conv.inner = untag_ptr(this_arg);
33346 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33348 this_arg_conv.is_owned = false;
33349 LDKRoute route_conv;
33350 route_conv.inner = untag_ptr(route);
33351 route_conv.is_owned = ptr_is_owned(route);
33352 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
33353 route_conv.is_owned = false;
33354 LDKThirtyTwoBytes payment_hash_ref;
33355 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33356 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
33357 LDKThirtyTwoBytes payment_secret_ref;
33358 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
33359 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
33360 LDKThirtyTwoBytes payment_id_ref;
33361 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
33362 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
33363 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
33364 *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref, payment_id_ref);
33365 return tag_ptr(ret_conv, true);
33368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment_1with_1retry(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) {
33369 LDKChannelManager this_arg_conv;
33370 this_arg_conv.inner = untag_ptr(this_arg);
33371 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33373 this_arg_conv.is_owned = false;
33374 LDKThirtyTwoBytes payment_hash_ref;
33375 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33376 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
33377 LDKThirtyTwoBytes payment_secret_ref;
33378 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
33379 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
33380 LDKThirtyTwoBytes payment_id_ref;
33381 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
33382 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
33383 LDKRouteParameters route_params_conv;
33384 route_params_conv.inner = untag_ptr(route_params);
33385 route_params_conv.is_owned = ptr_is_owned(route_params);
33386 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
33387 route_params_conv = RouteParameters_clone(&route_params_conv);
33388 void* retry_strategy_ptr = untag_ptr(retry_strategy);
33389 CHECK_ACCESS(retry_strategy_ptr);
33390 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
33391 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
33392 LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
33393 *ret_conv = ChannelManager_send_payment_with_retry(&this_arg_conv, payment_hash_ref, payment_secret_ref, payment_id_ref, route_params_conv, retry_strategy_conv);
33394 return tag_ptr(ret_conv, true);
33397 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) {
33398 LDKChannelManager this_arg_conv;
33399 this_arg_conv.inner = untag_ptr(this_arg);
33400 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33402 this_arg_conv.is_owned = false;
33403 LDKThirtyTwoBytes payment_id_ref;
33404 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
33405 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
33406 ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
33409 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, int8_tArray payment_id) {
33410 LDKChannelManager this_arg_conv;
33411 this_arg_conv.inner = untag_ptr(this_arg);
33412 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33414 this_arg_conv.is_owned = false;
33415 LDKRoute route_conv;
33416 route_conv.inner = untag_ptr(route);
33417 route_conv.is_owned = ptr_is_owned(route);
33418 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
33419 route_conv.is_owned = false;
33420 LDKThirtyTwoBytes payment_preimage_ref;
33421 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
33422 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
33423 LDKThirtyTwoBytes payment_id_ref;
33424 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
33425 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
33426 LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
33427 *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref, payment_id_ref);
33428 return tag_ptr(ret_conv, true);
33431 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment_1with_1retry(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_preimage, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) {
33432 LDKChannelManager this_arg_conv;
33433 this_arg_conv.inner = untag_ptr(this_arg);
33434 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33436 this_arg_conv.is_owned = false;
33437 LDKThirtyTwoBytes payment_preimage_ref;
33438 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
33439 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
33440 LDKThirtyTwoBytes payment_id_ref;
33441 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
33442 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
33443 LDKRouteParameters route_params_conv;
33444 route_params_conv.inner = untag_ptr(route_params);
33445 route_params_conv.is_owned = ptr_is_owned(route_params);
33446 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
33447 route_params_conv = RouteParameters_clone(&route_params_conv);
33448 void* retry_strategy_ptr = untag_ptr(retry_strategy);
33449 CHECK_ACCESS(retry_strategy_ptr);
33450 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
33451 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
33452 LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
33453 *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_ref, payment_id_ref, route_params_conv, retry_strategy_conv);
33454 return tag_ptr(ret_conv, true);
33457 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1probe(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray hops) {
33458 LDKChannelManager this_arg_conv;
33459 this_arg_conv.inner = untag_ptr(this_arg);
33460 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33461 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33462 this_arg_conv.is_owned = false;
33463 LDKCVec_RouteHopZ hops_constr;
33464 hops_constr.datalen = (*env)->GetArrayLength(env, hops);
33465 if (hops_constr.datalen > 0)
33466 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
33468 hops_constr.data = NULL;
33469 int64_t* hops_vals = (*env)->GetLongArrayElements (env, hops, NULL);
33470 for (size_t k = 0; k < hops_constr.datalen; k++) {
33471 int64_t hops_conv_10 = hops_vals[k];
33472 LDKRouteHop hops_conv_10_conv;
33473 hops_conv_10_conv.inner = untag_ptr(hops_conv_10);
33474 hops_conv_10_conv.is_owned = ptr_is_owned(hops_conv_10);
33475 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv_10_conv);
33476 hops_conv_10_conv = RouteHop_clone(&hops_conv_10_conv);
33477 hops_constr.data[k] = hops_conv_10_conv;
33479 (*env)->ReleaseLongArrayElements(env, hops, hops_vals, 0);
33480 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
33481 *ret_conv = ChannelManager_send_probe(&this_arg_conv, hops_constr);
33482 return tag_ptr(ret_conv, true);
33485 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) {
33486 LDKChannelManager this_arg_conv;
33487 this_arg_conv.inner = untag_ptr(this_arg);
33488 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33489 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33490 this_arg_conv.is_owned = false;
33491 uint8_t temporary_channel_id_arr[32];
33492 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
33493 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
33494 uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
33495 LDKPublicKey counterparty_node_id_ref;
33496 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33497 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33498 LDKTransaction funding_transaction_ref;
33499 funding_transaction_ref.datalen = (*env)->GetArrayLength(env, funding_transaction);
33500 funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes");
33501 (*env)->GetByteArrayRegion(env, funding_transaction, 0, funding_transaction_ref.datalen, funding_transaction_ref.data);
33502 funding_transaction_ref.data_is_owned = true;
33503 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33504 *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref);
33505 return tag_ptr(ret_conv, true);
33508 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) {
33509 LDKChannelManager this_arg_conv;
33510 this_arg_conv.inner = untag_ptr(this_arg);
33511 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33513 this_arg_conv.is_owned = false;
33514 LDKPublicKey counterparty_node_id_ref;
33515 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33516 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33517 LDKCVec_ThirtyTwoBytesZ channel_ids_constr;
33518 channel_ids_constr.datalen = (*env)->GetArrayLength(env, channel_ids);
33519 if (channel_ids_constr.datalen > 0)
33520 channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
33522 channel_ids_constr.data = NULL;
33523 for (size_t i = 0; i < channel_ids_constr.datalen; i++) {
33524 int8_tArray channel_ids_conv_8 = (*env)->GetObjectArrayElement(env, channel_ids, i);
33525 LDKThirtyTwoBytes channel_ids_conv_8_ref;
33526 CHECK((*env)->GetArrayLength(env, channel_ids_conv_8) == 32);
33527 (*env)->GetByteArrayRegion(env, channel_ids_conv_8, 0, 32, channel_ids_conv_8_ref.data);
33528 channel_ids_constr.data[i] = channel_ids_conv_8_ref;
33530 LDKChannelConfig config_conv;
33531 config_conv.inner = untag_ptr(config);
33532 config_conv.is_owned = ptr_is_owned(config);
33533 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
33534 config_conv.is_owned = false;
33535 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33536 *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv);
33537 return tag_ptr(ret_conv, true);
33540 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1forward_1intercepted_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray intercept_id, int8_tArray next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) {
33541 LDKChannelManager this_arg_conv;
33542 this_arg_conv.inner = untag_ptr(this_arg);
33543 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33545 this_arg_conv.is_owned = false;
33546 LDKThirtyTwoBytes intercept_id_ref;
33547 CHECK((*env)->GetArrayLength(env, intercept_id) == 32);
33548 (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data);
33549 uint8_t next_hop_channel_id_arr[32];
33550 CHECK((*env)->GetArrayLength(env, next_hop_channel_id) == 32);
33551 (*env)->GetByteArrayRegion(env, next_hop_channel_id, 0, 32, next_hop_channel_id_arr);
33552 uint8_t (*next_hop_channel_id_ref)[32] = &next_hop_channel_id_arr;
33553 LDKPublicKey next_node_id_ref;
33554 CHECK((*env)->GetArrayLength(env, next_node_id) == 33);
33555 (*env)->GetByteArrayRegion(env, next_node_id, 0, 33, next_node_id_ref.compressed_form);
33556 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33557 *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, next_hop_channel_id_ref, next_node_id_ref, amt_to_forward_msat);
33558 return tag_ptr(ret_conv, true);
33561 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1intercepted_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray intercept_id) {
33562 LDKChannelManager this_arg_conv;
33563 this_arg_conv.inner = untag_ptr(this_arg);
33564 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33566 this_arg_conv.is_owned = false;
33567 LDKThirtyTwoBytes intercept_id_ref;
33568 CHECK((*env)->GetArrayLength(env, intercept_id) == 32);
33569 (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data);
33570 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33571 *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref);
33572 return tag_ptr(ret_conv, true);
33575 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv *env, jclass clz, int64_t this_arg) {
33576 LDKChannelManager this_arg_conv;
33577 this_arg_conv.inner = untag_ptr(this_arg);
33578 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33580 this_arg_conv.is_owned = false;
33581 ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
33584 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
33585 LDKChannelManager this_arg_conv;
33586 this_arg_conv.inner = untag_ptr(this_arg);
33587 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33589 this_arg_conv.is_owned = false;
33590 ChannelManager_timer_tick_occurred(&this_arg_conv);
33593 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) {
33594 LDKChannelManager this_arg_conv;
33595 this_arg_conv.inner = untag_ptr(this_arg);
33596 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33598 this_arg_conv.is_owned = false;
33599 uint8_t payment_hash_arr[32];
33600 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33601 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
33602 uint8_t (*payment_hash_ref)[32] = &payment_hash_arr;
33603 ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref);
33606 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards_1with_1reason(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, jclass failure_code) {
33607 LDKChannelManager this_arg_conv;
33608 this_arg_conv.inner = untag_ptr(this_arg);
33609 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33611 this_arg_conv.is_owned = false;
33612 uint8_t payment_hash_arr[32];
33613 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33614 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
33615 uint8_t (*payment_hash_ref)[32] = &payment_hash_arr;
33616 LDKFailureCode failure_code_conv = LDKFailureCode_from_java(env, failure_code);
33617 ChannelManager_fail_htlc_backwards_with_reason(&this_arg_conv, payment_hash_ref, failure_code_conv);
33620 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_preimage) {
33621 LDKChannelManager this_arg_conv;
33622 this_arg_conv.inner = untag_ptr(this_arg);
33623 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33625 this_arg_conv.is_owned = false;
33626 LDKThirtyTwoBytes payment_preimage_ref;
33627 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
33628 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
33629 ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref);
33632 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
33633 LDKChannelManager this_arg_conv;
33634 this_arg_conv.inner = untag_ptr(this_arg);
33635 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33637 this_arg_conv.is_owned = false;
33638 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33639 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form);
33643 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, int8_tArray user_channel_id) {
33644 LDKChannelManager this_arg_conv;
33645 this_arg_conv.inner = untag_ptr(this_arg);
33646 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33648 this_arg_conv.is_owned = false;
33649 uint8_t temporary_channel_id_arr[32];
33650 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
33651 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
33652 uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
33653 LDKPublicKey counterparty_node_id_ref;
33654 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33655 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33656 LDKU128 user_channel_id_ref;
33657 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
33658 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
33659 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33660 *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref);
33661 return tag_ptr(ret_conv, true);
33664 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, int8_tArray user_channel_id) {
33665 LDKChannelManager this_arg_conv;
33666 this_arg_conv.inner = untag_ptr(this_arg);
33667 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33668 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33669 this_arg_conv.is_owned = false;
33670 uint8_t temporary_channel_id_arr[32];
33671 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
33672 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
33673 uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
33674 LDKPublicKey counterparty_node_id_ref;
33675 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33676 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33677 LDKU128 user_channel_id_ref;
33678 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
33679 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
33680 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33681 *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref);
33682 return tag_ptr(ret_conv, true);
33685 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, int64_t min_final_cltv_expiry_delta) {
33686 LDKChannelManager this_arg_conv;
33687 this_arg_conv.inner = untag_ptr(this_arg);
33688 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33689 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33690 this_arg_conv.is_owned = false;
33691 void* min_value_msat_ptr = untag_ptr(min_value_msat);
33692 CHECK_ACCESS(min_value_msat_ptr);
33693 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
33694 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
33695 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
33696 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
33697 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
33698 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
33699 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
33700 *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv);
33701 return tag_ptr(ret_conv, true);
33704 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) {
33705 LDKChannelManager this_arg_conv;
33706 this_arg_conv.inner = untag_ptr(this_arg);
33707 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33709 this_arg_conv.is_owned = false;
33710 void* min_value_msat_ptr = untag_ptr(min_value_msat);
33711 CHECK_ACCESS(min_value_msat_ptr);
33712 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
33713 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
33714 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
33715 *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
33716 return tag_ptr(ret_conv, true);
33719 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, int64_t min_final_cltv_expiry) {
33720 LDKChannelManager this_arg_conv;
33721 this_arg_conv.inner = untag_ptr(this_arg);
33722 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33724 this_arg_conv.is_owned = false;
33725 LDKThirtyTwoBytes payment_hash_ref;
33726 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33727 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
33728 void* min_value_msat_ptr = untag_ptr(min_value_msat);
33729 CHECK_ACCESS(min_value_msat_ptr);
33730 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
33731 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
33732 void* min_final_cltv_expiry_ptr = untag_ptr(min_final_cltv_expiry);
33733 CHECK_ACCESS(min_final_cltv_expiry_ptr);
33734 LDKCOption_u16Z min_final_cltv_expiry_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_ptr);
33735 min_final_cltv_expiry_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry));
33736 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
33737 *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_conv);
33738 return tag_ptr(ret_conv, true);
33741 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) {
33742 LDKChannelManager this_arg_conv;
33743 this_arg_conv.inner = untag_ptr(this_arg);
33744 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33746 this_arg_conv.is_owned = false;
33747 LDKThirtyTwoBytes payment_hash_ref;
33748 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33749 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
33750 void* min_value_msat_ptr = untag_ptr(min_value_msat);
33751 CHECK_ACCESS(min_value_msat_ptr);
33752 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
33753 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
33754 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
33755 *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
33756 return tag_ptr(ret_conv, true);
33759 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) {
33760 LDKChannelManager this_arg_conv;
33761 this_arg_conv.inner = untag_ptr(this_arg);
33762 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33764 this_arg_conv.is_owned = false;
33765 LDKThirtyTwoBytes payment_hash_ref;
33766 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33767 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
33768 LDKThirtyTwoBytes payment_secret_ref;
33769 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
33770 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
33771 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
33772 *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
33773 return tag_ptr(ret_conv, true);
33776 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
33777 LDKChannelManager this_arg_conv;
33778 this_arg_conv.inner = untag_ptr(this_arg);
33779 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33781 this_arg_conv.is_owned = false;
33782 int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv);
33786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) {
33787 LDKChannelManager this_arg_conv;
33788 this_arg_conv.inner = untag_ptr(this_arg);
33789 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33790 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33791 this_arg_conv.is_owned = false;
33792 LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv);
33793 int64_t ret_ref = 0;
33794 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33795 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33799 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1intercept_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
33800 LDKChannelManager this_arg_conv;
33801 this_arg_conv.inner = untag_ptr(this_arg);
33802 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33804 this_arg_conv.is_owned = false;
33805 int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv);
33809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1compute_1inflight_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg) {
33810 LDKChannelManager this_arg_conv;
33811 this_arg_conv.inner = untag_ptr(this_arg);
33812 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33814 this_arg_conv.is_owned = false;
33815 LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&this_arg_conv);
33816 int64_t ret_ref = 0;
33817 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33818 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33822 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
33823 LDKChannelManager this_arg_conv;
33824 this_arg_conv.inner = untag_ptr(this_arg);
33825 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33827 this_arg_conv.is_owned = false;
33828 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
33829 *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
33830 return tag_ptr(ret_ret, true);
33833 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
33834 LDKChannelManager this_arg_conv;
33835 this_arg_conv.inner = untag_ptr(this_arg);
33836 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33838 this_arg_conv.is_owned = false;
33839 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
33840 *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
33841 return tag_ptr(ret_ret, true);
33844 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
33845 LDKChannelManager this_arg_conv;
33846 this_arg_conv.inner = untag_ptr(this_arg);
33847 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33849 this_arg_conv.is_owned = false;
33850 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
33851 *ret_ret = ChannelManager_as_Listen(&this_arg_conv);
33852 return tag_ptr(ret_ret, true);
33855 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) {
33856 LDKChannelManager this_arg_conv;
33857 this_arg_conv.inner = untag_ptr(this_arg);
33858 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33860 this_arg_conv.is_owned = false;
33861 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
33862 *ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
33863 return tag_ptr(ret_ret, true);
33866 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) {
33867 LDKChannelManager this_arg_conv;
33868 this_arg_conv.inner = untag_ptr(this_arg);
33869 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33870 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33871 this_arg_conv.is_owned = false;
33872 jboolean ret_conv = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait);
33876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update(JNIEnv *env, jclass clz, int64_t this_arg) {
33877 LDKChannelManager this_arg_conv;
33878 this_arg_conv.inner = untag_ptr(this_arg);
33879 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33880 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33881 this_arg_conv.is_owned = false;
33882 ChannelManager_await_persistable_update(&this_arg_conv);
33885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1persistable_1update_1future(JNIEnv *env, jclass clz, int64_t this_arg) {
33886 LDKChannelManager this_arg_conv;
33887 this_arg_conv.inner = untag_ptr(this_arg);
33888 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33890 this_arg_conv.is_owned = false;
33891 LDKFuture ret_var = ChannelManager_get_persistable_update_future(&this_arg_conv);
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);
33898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) {
33899 LDKChannelManager this_arg_conv;
33900 this_arg_conv.inner = untag_ptr(this_arg);
33901 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33903 this_arg_conv.is_owned = false;
33904 LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
33905 int64_t ret_ref = 0;
33906 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33907 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33911 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
33912 LDKChannelManager this_arg_conv;
33913 this_arg_conv.inner = untag_ptr(this_arg);
33914 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33916 this_arg_conv.is_owned = false;
33917 LDKNodeFeatures ret_var = ChannelManager_node_features(&this_arg_conv);
33918 int64_t ret_ref = 0;
33919 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33920 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33924 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
33925 LDKChannelManager this_arg_conv;
33926 this_arg_conv.inner = untag_ptr(this_arg);
33927 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33929 this_arg_conv.is_owned = false;
33930 LDKChannelFeatures ret_var = ChannelManager_channel_features(&this_arg_conv);
33931 int64_t ret_ref = 0;
33932 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33933 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33937 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1type_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
33938 LDKChannelManager this_arg_conv;
33939 this_arg_conv.inner = untag_ptr(this_arg);
33940 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33942 this_arg_conv.is_owned = false;
33943 LDKChannelTypeFeatures ret_var = ChannelManager_channel_type_features(&this_arg_conv);
33944 int64_t ret_ref = 0;
33945 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33946 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33950 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1init_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
33951 LDKChannelManager this_arg_conv;
33952 this_arg_conv.inner = untag_ptr(this_arg);
33953 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33955 this_arg_conv.is_owned = false;
33956 LDKInitFeatures ret_var = ChannelManager_init_features(&this_arg_conv);
33957 int64_t ret_ref = 0;
33958 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33959 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33963 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
33964 LDKChannelManager this_arg_conv;
33965 this_arg_conv.inner = untag_ptr(this_arg);
33966 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33967 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33968 this_arg_conv.is_owned = false;
33969 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
33970 *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
33971 return tag_ptr(ret_ret, true);
33974 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1init_1features(JNIEnv *env, jclass clz, int64_t _config) {
33975 LDKUserConfig _config_conv;
33976 _config_conv.inner = untag_ptr(_config);
33977 _config_conv.is_owned = ptr_is_owned(_config);
33978 CHECK_INNER_FIELD_ACCESS_OR_NULL(_config_conv);
33979 _config_conv.is_owned = false;
33980 LDKInitFeatures ret_var = provided_init_features(&_config_conv);
33981 int64_t ret_ref = 0;
33982 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33983 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33987 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
33988 LDKCounterpartyForwardingInfo obj_conv;
33989 obj_conv.inner = untag_ptr(obj);
33990 obj_conv.is_owned = ptr_is_owned(obj);
33991 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33992 obj_conv.is_owned = false;
33993 LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv);
33994 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
33995 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
33996 CVec_u8Z_free(ret_var);
34000 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
34001 LDKu8slice ser_ref;
34002 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
34003 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
34004 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
34005 *ret_conv = CounterpartyForwardingInfo_read(ser_ref);
34006 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
34007 return tag_ptr(ret_conv, true);
34010 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1write(JNIEnv *env, jclass clz, int64_t obj) {
34011 LDKChannelCounterparty obj_conv;
34012 obj_conv.inner = untag_ptr(obj);
34013 obj_conv.is_owned = ptr_is_owned(obj);
34014 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34015 obj_conv.is_owned = false;
34016 LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv);
34017 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34018 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34019 CVec_u8Z_free(ret_var);
34023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
34024 LDKu8slice ser_ref;
34025 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
34026 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
34027 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
34028 *ret_conv = ChannelCounterparty_read(ser_ref);
34029 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
34030 return tag_ptr(ret_conv, true);
34033 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1write(JNIEnv *env, jclass clz, int64_t obj) {
34034 LDKChannelDetails obj_conv;
34035 obj_conv.inner = untag_ptr(obj);
34036 obj_conv.is_owned = ptr_is_owned(obj);
34037 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34038 obj_conv.is_owned = false;
34039 LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv);
34040 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34041 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34042 CVec_u8Z_free(ret_var);
34046 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
34047 LDKu8slice ser_ref;
34048 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
34049 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
34050 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
34051 *ret_conv = ChannelDetails_read(ser_ref);
34052 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
34053 return tag_ptr(ret_conv, true);
34056 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1write(JNIEnv *env, jclass clz, int64_t obj) {
34057 LDKPhantomRouteHints obj_conv;
34058 obj_conv.inner = untag_ptr(obj);
34059 obj_conv.is_owned = ptr_is_owned(obj);
34060 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34061 obj_conv.is_owned = false;
34062 LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv);
34063 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34064 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34065 CVec_u8Z_free(ret_var);
34069 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
34070 LDKu8slice ser_ref;
34071 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
34072 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
34073 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
34074 *ret_conv = PhantomRouteHints_read(ser_ref);
34075 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
34076 return tag_ptr(ret_conv, true);
34079 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(JNIEnv *env, jclass clz, int64_t obj) {
34080 LDKChannelManager obj_conv;
34081 obj_conv.inner = untag_ptr(obj);
34082 obj_conv.is_owned = ptr_is_owned(obj);
34083 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34084 obj_conv.is_owned = false;
34085 LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
34086 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34087 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34088 CVec_u8Z_free(ret_var);
34092 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34093 LDKChannelManagerReadArgs this_obj_conv;
34094 this_obj_conv.inner = untag_ptr(this_obj);
34095 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34096 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34097 ChannelManagerReadArgs_free(this_obj_conv);
34100 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1entropy_1source(JNIEnv *env, jclass clz, int64_t this_ptr) {
34101 LDKChannelManagerReadArgs this_ptr_conv;
34102 this_ptr_conv.inner = untag_ptr(this_ptr);
34103 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34105 this_ptr_conv.is_owned = false;
34106 // WARNING: This object doesn't live past this scope, needs clone!
34107 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_entropy_source(&this_ptr_conv), false);
34111 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1entropy_1source(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34112 LDKChannelManagerReadArgs this_ptr_conv;
34113 this_ptr_conv.inner = untag_ptr(this_ptr);
34114 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34116 this_ptr_conv.is_owned = false;
34117 void* val_ptr = untag_ptr(val);
34118 CHECK_ACCESS(val_ptr);
34119 LDKEntropySource val_conv = *(LDKEntropySource*)(val_ptr);
34120 if (val_conv.free == LDKEntropySource_JCalls_free) {
34121 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34122 LDKEntropySource_JCalls_cloned(&val_conv);
34124 ChannelManagerReadArgs_set_entropy_source(&this_ptr_conv, val_conv);
34127 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1node_1signer(JNIEnv *env, jclass clz, int64_t this_ptr) {
34128 LDKChannelManagerReadArgs 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 // WARNING: This object doesn't live past this scope, needs clone!
34134 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_node_signer(&this_ptr_conv), false);
34138 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1node_1signer(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34139 LDKChannelManagerReadArgs 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 void* val_ptr = untag_ptr(val);
34145 CHECK_ACCESS(val_ptr);
34146 LDKNodeSigner val_conv = *(LDKNodeSigner*)(val_ptr);
34147 if (val_conv.free == LDKNodeSigner_JCalls_free) {
34148 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34149 LDKNodeSigner_JCalls_cloned(&val_conv);
34151 ChannelManagerReadArgs_set_node_signer(&this_ptr_conv, val_conv);
34154 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1signer_1provider(JNIEnv *env, jclass clz, int64_t this_ptr) {
34155 LDKChannelManagerReadArgs this_ptr_conv;
34156 this_ptr_conv.inner = untag_ptr(this_ptr);
34157 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34158 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34159 this_ptr_conv.is_owned = false;
34160 // WARNING: This object doesn't live past this scope, needs clone!
34161 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_signer_provider(&this_ptr_conv), false);
34165 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1signer_1provider(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34166 LDKChannelManagerReadArgs this_ptr_conv;
34167 this_ptr_conv.inner = untag_ptr(this_ptr);
34168 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34170 this_ptr_conv.is_owned = false;
34171 void* val_ptr = untag_ptr(val);
34172 CHECK_ACCESS(val_ptr);
34173 LDKSignerProvider val_conv = *(LDKSignerProvider*)(val_ptr);
34174 if (val_conv.free == LDKSignerProvider_JCalls_free) {
34175 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34176 LDKSignerProvider_JCalls_cloned(&val_conv);
34178 ChannelManagerReadArgs_set_signer_provider(&this_ptr_conv, val_conv);
34181 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr) {
34182 LDKChannelManagerReadArgs this_ptr_conv;
34183 this_ptr_conv.inner = untag_ptr(this_ptr);
34184 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34185 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34186 this_ptr_conv.is_owned = false;
34187 // WARNING: This object doesn't live past this scope, needs clone!
34188 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false);
34192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34193 LDKChannelManagerReadArgs this_ptr_conv;
34194 this_ptr_conv.inner = untag_ptr(this_ptr);
34195 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34196 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34197 this_ptr_conv.is_owned = false;
34198 void* val_ptr = untag_ptr(val);
34199 CHECK_ACCESS(val_ptr);
34200 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
34201 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
34202 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34203 LDKFeeEstimator_JCalls_cloned(&val_conv);
34205 ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
34208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr) {
34209 LDKChannelManagerReadArgs this_ptr_conv;
34210 this_ptr_conv.inner = untag_ptr(this_ptr);
34211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34213 this_ptr_conv.is_owned = false;
34214 // WARNING: This object doesn't live past this scope, needs clone!
34215 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false);
34219 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34220 LDKChannelManagerReadArgs 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 void* val_ptr = untag_ptr(val);
34226 CHECK_ACCESS(val_ptr);
34227 LDKWatch val_conv = *(LDKWatch*)(val_ptr);
34228 if (val_conv.free == LDKWatch_JCalls_free) {
34229 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34230 LDKWatch_JCalls_cloned(&val_conv);
34232 ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
34235 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr) {
34236 LDKChannelManagerReadArgs this_ptr_conv;
34237 this_ptr_conv.inner = untag_ptr(this_ptr);
34238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34240 this_ptr_conv.is_owned = false;
34241 // WARNING: This object doesn't live past this scope, needs clone!
34242 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false);
34246 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34247 LDKChannelManagerReadArgs this_ptr_conv;
34248 this_ptr_conv.inner = untag_ptr(this_ptr);
34249 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34250 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34251 this_ptr_conv.is_owned = false;
34252 void* val_ptr = untag_ptr(val);
34253 CHECK_ACCESS(val_ptr);
34254 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
34255 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
34256 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34257 LDKBroadcasterInterface_JCalls_cloned(&val_conv);
34259 ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
34262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1router(JNIEnv *env, jclass clz, int64_t this_ptr) {
34263 LDKChannelManagerReadArgs this_ptr_conv;
34264 this_ptr_conv.inner = untag_ptr(this_ptr);
34265 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34267 this_ptr_conv.is_owned = false;
34268 // WARNING: This object doesn't live past this scope, needs clone!
34269 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_router(&this_ptr_conv), false);
34273 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1router(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34274 LDKChannelManagerReadArgs this_ptr_conv;
34275 this_ptr_conv.inner = untag_ptr(this_ptr);
34276 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34278 this_ptr_conv.is_owned = false;
34279 void* val_ptr = untag_ptr(val);
34280 CHECK_ACCESS(val_ptr);
34281 LDKRouter val_conv = *(LDKRouter*)(val_ptr);
34282 if (val_conv.free == LDKRouter_JCalls_free) {
34283 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34284 LDKRouter_JCalls_cloned(&val_conv);
34286 ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv);
34289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv *env, jclass clz, int64_t this_ptr) {
34290 LDKChannelManagerReadArgs this_ptr_conv;
34291 this_ptr_conv.inner = untag_ptr(this_ptr);
34292 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34293 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34294 this_ptr_conv.is_owned = false;
34295 // WARNING: This object doesn't live past this scope, needs clone!
34296 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false);
34300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34301 LDKChannelManagerReadArgs this_ptr_conv;
34302 this_ptr_conv.inner = untag_ptr(this_ptr);
34303 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34304 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34305 this_ptr_conv.is_owned = false;
34306 void* val_ptr = untag_ptr(val);
34307 CHECK_ACCESS(val_ptr);
34308 LDKLogger val_conv = *(LDKLogger*)(val_ptr);
34309 if (val_conv.free == LDKLogger_JCalls_free) {
34310 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34311 LDKLogger_JCalls_cloned(&val_conv);
34313 ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
34316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
34317 LDKChannelManagerReadArgs this_ptr_conv;
34318 this_ptr_conv.inner = untag_ptr(this_ptr);
34319 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34321 this_ptr_conv.is_owned = false;
34322 LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
34323 int64_t ret_ref = 0;
34324 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34325 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34329 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34330 LDKChannelManagerReadArgs this_ptr_conv;
34331 this_ptr_conv.inner = untag_ptr(this_ptr);
34332 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34333 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34334 this_ptr_conv.is_owned = false;
34335 LDKUserConfig val_conv;
34336 val_conv.inner = untag_ptr(val);
34337 val_conv.is_owned = ptr_is_owned(val);
34338 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34339 val_conv = UserConfig_clone(&val_conv);
34340 ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
34343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t default_config, int64_tArray channel_monitors) {
34344 void* entropy_source_ptr = untag_ptr(entropy_source);
34345 CHECK_ACCESS(entropy_source_ptr);
34346 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
34347 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
34348 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34349 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
34351 void* node_signer_ptr = untag_ptr(node_signer);
34352 CHECK_ACCESS(node_signer_ptr);
34353 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
34354 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
34355 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34356 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
34358 void* signer_provider_ptr = untag_ptr(signer_provider);
34359 CHECK_ACCESS(signer_provider_ptr);
34360 LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr);
34361 if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) {
34362 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34363 LDKSignerProvider_JCalls_cloned(&signer_provider_conv);
34365 void* fee_estimator_ptr = untag_ptr(fee_estimator);
34366 CHECK_ACCESS(fee_estimator_ptr);
34367 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
34368 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
34369 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34370 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
34372 void* chain_monitor_ptr = untag_ptr(chain_monitor);
34373 CHECK_ACCESS(chain_monitor_ptr);
34374 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
34375 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
34376 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34377 LDKWatch_JCalls_cloned(&chain_monitor_conv);
34379 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
34380 CHECK_ACCESS(tx_broadcaster_ptr);
34381 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
34382 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
34383 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34384 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
34386 void* router_ptr = untag_ptr(router);
34387 CHECK_ACCESS(router_ptr);
34388 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
34389 if (router_conv.free == LDKRouter_JCalls_free) {
34390 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34391 LDKRouter_JCalls_cloned(&router_conv);
34393 void* logger_ptr = untag_ptr(logger);
34394 CHECK_ACCESS(logger_ptr);
34395 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
34396 if (logger_conv.free == LDKLogger_JCalls_free) {
34397 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34398 LDKLogger_JCalls_cloned(&logger_conv);
34400 LDKUserConfig default_config_conv;
34401 default_config_conv.inner = untag_ptr(default_config);
34402 default_config_conv.is_owned = ptr_is_owned(default_config);
34403 CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv);
34404 default_config_conv = UserConfig_clone(&default_config_conv);
34405 LDKCVec_ChannelMonitorZ channel_monitors_constr;
34406 channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors);
34407 if (channel_monitors_constr.datalen > 0)
34408 channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
34410 channel_monitors_constr.data = NULL;
34411 int64_t* channel_monitors_vals = (*env)->GetLongArrayElements (env, channel_monitors, NULL);
34412 for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
34413 int64_t channel_monitors_conv_16 = channel_monitors_vals[q];
34414 LDKChannelMonitor channel_monitors_conv_16_conv;
34415 channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16);
34416 channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16);
34417 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
34418 channel_monitors_conv_16_conv.is_owned = false;
34419 channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
34421 (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0);
34422 LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, default_config_conv, channel_monitors_constr);
34423 int64_t ret_ref = 0;
34424 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34425 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34429 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
34430 LDKu8slice ser_ref;
34431 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
34432 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
34433 LDKChannelManagerReadArgs arg_conv;
34434 arg_conv.inner = untag_ptr(arg);
34435 arg_conv.is_owned = ptr_is_owned(arg);
34436 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34437 // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
34439 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
34440 *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
34441 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
34442 return tag_ptr(ret_conv, true);
34445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34446 LDKExpandedKey this_obj_conv;
34447 this_obj_conv.inner = untag_ptr(this_obj);
34448 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34450 ExpandedKey_free(this_obj_conv);
34453 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1new(JNIEnv *env, jclass clz, int8_tArray key_material) {
34454 uint8_t key_material_arr[32];
34455 CHECK((*env)->GetArrayLength(env, key_material) == 32);
34456 (*env)->GetByteArrayRegion(env, key_material, 0, 32, key_material_arr);
34457 uint8_t (*key_material_ref)[32] = &key_material_arr;
34458 LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref);
34459 int64_t ret_ref = 0;
34460 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34461 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34465 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 entropy_source, int64_t current_time, int64_t min_final_cltv_expiry_delta) {
34466 LDKExpandedKey keys_conv;
34467 keys_conv.inner = untag_ptr(keys);
34468 keys_conv.is_owned = ptr_is_owned(keys);
34469 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
34470 keys_conv.is_owned = false;
34471 void* min_value_msat_ptr = untag_ptr(min_value_msat);
34472 CHECK_ACCESS(min_value_msat_ptr);
34473 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
34474 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
34475 void* entropy_source_ptr = untag_ptr(entropy_source);
34476 if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); }
34477 LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr;
34478 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
34479 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
34480 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
34481 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
34482 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
34483 *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, entropy_source_conv, current_time, min_final_cltv_expiry_delta_conv);
34484 return tag_ptr(ret_conv, true);
34487 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, int64_t min_final_cltv_expiry_delta) {
34488 LDKExpandedKey keys_conv;
34489 keys_conv.inner = untag_ptr(keys);
34490 keys_conv.is_owned = ptr_is_owned(keys);
34491 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
34492 keys_conv.is_owned = false;
34493 void* min_value_msat_ptr = untag_ptr(min_value_msat);
34494 CHECK_ACCESS(min_value_msat_ptr);
34495 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
34496 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
34497 LDKThirtyTwoBytes payment_hash_ref;
34498 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
34499 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
34500 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
34501 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
34502 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
34503 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
34504 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
34505 *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time, min_final_cltv_expiry_delta_conv);
34506 return tag_ptr(ret_conv, true);
34509 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
34510 if (!ptr_is_owned(this_ptr)) return;
34511 void* this_ptr_ptr = untag_ptr(this_ptr);
34512 CHECK_ACCESS(this_ptr_ptr);
34513 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)(this_ptr_ptr);
34514 FREE(untag_ptr(this_ptr));
34515 DecodeError_free(this_ptr_conv);
34518 static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
34519 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34520 *ret_copy = DecodeError_clone(arg);
34521 int64_t ret_ref = tag_ptr(ret_copy, true);
34524 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34525 LDKDecodeError* arg_conv = (LDKDecodeError*)untag_ptr(arg);
34526 int64_t ret_conv = DecodeError_clone_ptr(arg_conv);
34530 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34531 LDKDecodeError* orig_conv = (LDKDecodeError*)untag_ptr(orig);
34532 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34533 *ret_copy = DecodeError_clone(orig_conv);
34534 int64_t ret_ref = tag_ptr(ret_copy, true);
34538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1version(JNIEnv *env, jclass clz) {
34539 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34540 *ret_copy = DecodeError_unknown_version();
34541 int64_t ret_ref = tag_ptr(ret_copy, true);
34545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1required_1feature(JNIEnv *env, jclass clz) {
34546 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34547 *ret_copy = DecodeError_unknown_required_feature();
34548 int64_t ret_ref = tag_ptr(ret_copy, true);
34552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1invalid_1value(JNIEnv *env, jclass clz) {
34553 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34554 *ret_copy = DecodeError_invalid_value();
34555 int64_t ret_ref = tag_ptr(ret_copy, true);
34559 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1short_1read(JNIEnv *env, jclass clz) {
34560 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34561 *ret_copy = DecodeError_short_read();
34562 int64_t ret_ref = tag_ptr(ret_copy, true);
34566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1bad_1length_1descriptor(JNIEnv *env, jclass clz) {
34567 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34568 *ret_copy = DecodeError_bad_length_descriptor();
34569 int64_t ret_ref = tag_ptr(ret_copy, true);
34573 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1io(JNIEnv *env, jclass clz, jclass a) {
34574 LDKIOError a_conv = LDKIOError_from_java(env, a);
34575 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34576 *ret_copy = DecodeError_io(a_conv);
34577 int64_t ret_ref = tag_ptr(ret_copy, true);
34581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unsupported_1compression(JNIEnv *env, jclass clz) {
34582 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34583 *ret_copy = DecodeError_unsupported_compression();
34584 int64_t ret_ref = tag_ptr(ret_copy, true);
34588 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DecodeError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34589 LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a);
34590 LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b);
34591 jboolean ret_conv = DecodeError_eq(a_conv, b_conv);
34595 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34596 LDKInit this_obj_conv;
34597 this_obj_conv.inner = untag_ptr(this_obj);
34598 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34600 Init_free(this_obj_conv);
34603 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
34604 LDKInit this_ptr_conv;
34605 this_ptr_conv.inner = untag_ptr(this_ptr);
34606 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34608 this_ptr_conv.is_owned = false;
34609 LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
34610 int64_t ret_ref = 0;
34611 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34612 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34616 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34617 LDKInit this_ptr_conv;
34618 this_ptr_conv.inner = untag_ptr(this_ptr);
34619 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34620 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34621 this_ptr_conv.is_owned = false;
34622 LDKInitFeatures val_conv;
34623 val_conv.inner = untag_ptr(val);
34624 val_conv.is_owned = ptr_is_owned(val);
34625 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34626 val_conv = InitFeatures_clone(&val_conv);
34627 Init_set_features(&this_ptr_conv, val_conv);
34630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr) {
34631 LDKInit this_ptr_conv;
34632 this_ptr_conv.inner = untag_ptr(this_ptr);
34633 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34635 this_ptr_conv.is_owned = false;
34636 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
34637 *ret_copy = Init_get_remote_network_address(&this_ptr_conv);
34638 int64_t ret_ref = tag_ptr(ret_copy, true);
34642 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34643 LDKInit this_ptr_conv;
34644 this_ptr_conv.inner = untag_ptr(this_ptr);
34645 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34646 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34647 this_ptr_conv.is_owned = false;
34648 void* val_ptr = untag_ptr(val);
34649 CHECK_ACCESS(val_ptr);
34650 LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr);
34651 val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(val));
34652 Init_set_remote_network_address(&this_ptr_conv, val_conv);
34655 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) {
34656 LDKInitFeatures features_arg_conv;
34657 features_arg_conv.inner = untag_ptr(features_arg);
34658 features_arg_conv.is_owned = ptr_is_owned(features_arg);
34659 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
34660 features_arg_conv = InitFeatures_clone(&features_arg_conv);
34661 void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg);
34662 CHECK_ACCESS(remote_network_address_arg_ptr);
34663 LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr);
34664 LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv);
34665 int64_t ret_ref = 0;
34666 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34667 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34671 static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) {
34672 LDKInit ret_var = Init_clone(arg);
34673 int64_t ret_ref = 0;
34674 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34675 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34678 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34680 arg_conv.inner = untag_ptr(arg);
34681 arg_conv.is_owned = ptr_is_owned(arg);
34682 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34683 arg_conv.is_owned = false;
34684 int64_t ret_conv = Init_clone_ptr(&arg_conv);
34688 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34690 orig_conv.inner = untag_ptr(orig);
34691 orig_conv.is_owned = ptr_is_owned(orig);
34692 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34693 orig_conv.is_owned = false;
34694 LDKInit ret_var = Init_clone(&orig_conv);
34695 int64_t ret_ref = 0;
34696 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34697 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34701 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Init_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34703 a_conv.inner = untag_ptr(a);
34704 a_conv.is_owned = ptr_is_owned(a);
34705 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34706 a_conv.is_owned = false;
34708 b_conv.inner = untag_ptr(b);
34709 b_conv.is_owned = ptr_is_owned(b);
34710 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34711 b_conv.is_owned = false;
34712 jboolean ret_conv = Init_eq(&a_conv, &b_conv);
34716 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34717 LDKErrorMessage this_obj_conv;
34718 this_obj_conv.inner = untag_ptr(this_obj);
34719 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34720 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34721 ErrorMessage_free(this_obj_conv);
34724 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
34725 LDKErrorMessage this_ptr_conv;
34726 this_ptr_conv.inner = untag_ptr(this_ptr);
34727 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34729 this_ptr_conv.is_owned = false;
34730 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34731 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv));
34735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34736 LDKErrorMessage this_ptr_conv;
34737 this_ptr_conv.inner = untag_ptr(this_ptr);
34738 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34740 this_ptr_conv.is_owned = false;
34741 LDKThirtyTwoBytes val_ref;
34742 CHECK((*env)->GetArrayLength(env, val) == 32);
34743 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34744 ErrorMessage_set_channel_id(&this_ptr_conv, val_ref);
34747 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
34748 LDKErrorMessage this_ptr_conv;
34749 this_ptr_conv.inner = untag_ptr(this_ptr);
34750 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34752 this_ptr_conv.is_owned = false;
34753 LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
34754 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
34759 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
34760 LDKErrorMessage this_ptr_conv;
34761 this_ptr_conv.inner = untag_ptr(this_ptr);
34762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34764 this_ptr_conv.is_owned = false;
34765 LDKStr val_conv = java_to_owned_str(env, val);
34766 ErrorMessage_set_data(&this_ptr_conv, val_conv);
34769 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) {
34770 LDKThirtyTwoBytes channel_id_arg_ref;
34771 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
34772 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
34773 LDKStr data_arg_conv = java_to_owned_str(env, data_arg);
34774 LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
34775 int64_t ret_ref = 0;
34776 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34777 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34781 static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) {
34782 LDKErrorMessage ret_var = ErrorMessage_clone(arg);
34783 int64_t ret_ref = 0;
34784 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34785 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34788 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34789 LDKErrorMessage arg_conv;
34790 arg_conv.inner = untag_ptr(arg);
34791 arg_conv.is_owned = ptr_is_owned(arg);
34792 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34793 arg_conv.is_owned = false;
34794 int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv);
34798 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34799 LDKErrorMessage orig_conv;
34800 orig_conv.inner = untag_ptr(orig);
34801 orig_conv.is_owned = ptr_is_owned(orig);
34802 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34803 orig_conv.is_owned = false;
34804 LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv);
34805 int64_t ret_ref = 0;
34806 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34807 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34811 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34812 LDKErrorMessage a_conv;
34813 a_conv.inner = untag_ptr(a);
34814 a_conv.is_owned = ptr_is_owned(a);
34815 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34816 a_conv.is_owned = false;
34817 LDKErrorMessage b_conv;
34818 b_conv.inner = untag_ptr(b);
34819 b_conv.is_owned = ptr_is_owned(b);
34820 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34821 b_conv.is_owned = false;
34822 jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv);
34826 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34827 LDKWarningMessage this_obj_conv;
34828 this_obj_conv.inner = untag_ptr(this_obj);
34829 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34830 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34831 WarningMessage_free(this_obj_conv);
34834 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
34835 LDKWarningMessage this_ptr_conv;
34836 this_ptr_conv.inner = untag_ptr(this_ptr);
34837 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34839 this_ptr_conv.is_owned = false;
34840 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34841 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *WarningMessage_get_channel_id(&this_ptr_conv));
34845 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34846 LDKWarningMessage this_ptr_conv;
34847 this_ptr_conv.inner = untag_ptr(this_ptr);
34848 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34849 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34850 this_ptr_conv.is_owned = false;
34851 LDKThirtyTwoBytes val_ref;
34852 CHECK((*env)->GetArrayLength(env, val) == 32);
34853 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34854 WarningMessage_set_channel_id(&this_ptr_conv, val_ref);
34857 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
34858 LDKWarningMessage 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 LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv);
34864 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
34869 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
34870 LDKWarningMessage this_ptr_conv;
34871 this_ptr_conv.inner = untag_ptr(this_ptr);
34872 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34874 this_ptr_conv.is_owned = false;
34875 LDKStr val_conv = java_to_owned_str(env, val);
34876 WarningMessage_set_data(&this_ptr_conv, val_conv);
34879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) {
34880 LDKThirtyTwoBytes channel_id_arg_ref;
34881 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
34882 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
34883 LDKStr data_arg_conv = java_to_owned_str(env, data_arg);
34884 LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv);
34885 int64_t ret_ref = 0;
34886 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34887 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34891 static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) {
34892 LDKWarningMessage ret_var = WarningMessage_clone(arg);
34893 int64_t ret_ref = 0;
34894 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34895 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34899 LDKWarningMessage arg_conv;
34900 arg_conv.inner = untag_ptr(arg);
34901 arg_conv.is_owned = ptr_is_owned(arg);
34902 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34903 arg_conv.is_owned = false;
34904 int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv);
34908 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34909 LDKWarningMessage orig_conv;
34910 orig_conv.inner = untag_ptr(orig);
34911 orig_conv.is_owned = ptr_is_owned(orig);
34912 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34913 orig_conv.is_owned = false;
34914 LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv);
34915 int64_t ret_ref = 0;
34916 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34917 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34921 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WarningMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34922 LDKWarningMessage a_conv;
34923 a_conv.inner = untag_ptr(a);
34924 a_conv.is_owned = ptr_is_owned(a);
34925 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34926 a_conv.is_owned = false;
34927 LDKWarningMessage b_conv;
34928 b_conv.inner = untag_ptr(b);
34929 b_conv.is_owned = ptr_is_owned(b);
34930 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34931 b_conv.is_owned = false;
34932 jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv);
34936 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34937 LDKPing this_obj_conv;
34938 this_obj_conv.inner = untag_ptr(this_obj);
34939 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34940 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34941 Ping_free(this_obj_conv);
34944 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) {
34945 LDKPing this_ptr_conv;
34946 this_ptr_conv.inner = untag_ptr(this_ptr);
34947 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34948 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34949 this_ptr_conv.is_owned = false;
34950 int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv);
34954 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
34955 LDKPing this_ptr_conv;
34956 this_ptr_conv.inner = untag_ptr(this_ptr);
34957 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34959 this_ptr_conv.is_owned = false;
34960 Ping_set_ponglen(&this_ptr_conv, val);
34963 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) {
34964 LDKPing this_ptr_conv;
34965 this_ptr_conv.inner = untag_ptr(this_ptr);
34966 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34967 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34968 this_ptr_conv.is_owned = false;
34969 int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv);
34973 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
34974 LDKPing this_ptr_conv;
34975 this_ptr_conv.inner = untag_ptr(this_ptr);
34976 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34978 this_ptr_conv.is_owned = false;
34979 Ping_set_byteslen(&this_ptr_conv, val);
34982 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) {
34983 LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg);
34984 int64_t ret_ref = 0;
34985 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34986 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34990 static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) {
34991 LDKPing ret_var = Ping_clone(arg);
34992 int64_t ret_ref = 0;
34993 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34994 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34997 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34999 arg_conv.inner = untag_ptr(arg);
35000 arg_conv.is_owned = ptr_is_owned(arg);
35001 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35002 arg_conv.is_owned = false;
35003 int64_t ret_conv = Ping_clone_ptr(&arg_conv);
35007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35009 orig_conv.inner = untag_ptr(orig);
35010 orig_conv.is_owned = ptr_is_owned(orig);
35011 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35012 orig_conv.is_owned = false;
35013 LDKPing ret_var = Ping_clone(&orig_conv);
35014 int64_t ret_ref = 0;
35015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35020 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Ping_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35022 a_conv.inner = untag_ptr(a);
35023 a_conv.is_owned = ptr_is_owned(a);
35024 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35025 a_conv.is_owned = false;
35027 b_conv.inner = untag_ptr(b);
35028 b_conv.is_owned = ptr_is_owned(b);
35029 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35030 b_conv.is_owned = false;
35031 jboolean ret_conv = Ping_eq(&a_conv, &b_conv);
35035 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35036 LDKPong this_obj_conv;
35037 this_obj_conv.inner = untag_ptr(this_obj);
35038 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35040 Pong_free(this_obj_conv);
35043 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) {
35044 LDKPong this_ptr_conv;
35045 this_ptr_conv.inner = untag_ptr(this_ptr);
35046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35048 this_ptr_conv.is_owned = false;
35049 int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv);
35053 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35054 LDKPong this_ptr_conv;
35055 this_ptr_conv.inner = untag_ptr(this_ptr);
35056 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35058 this_ptr_conv.is_owned = false;
35059 Pong_set_byteslen(&this_ptr_conv, val);
35062 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) {
35063 LDKPong ret_var = Pong_new(byteslen_arg);
35064 int64_t ret_ref = 0;
35065 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35066 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35070 static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) {
35071 LDKPong ret_var = Pong_clone(arg);
35072 int64_t ret_ref = 0;
35073 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35074 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35077 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35079 arg_conv.inner = untag_ptr(arg);
35080 arg_conv.is_owned = ptr_is_owned(arg);
35081 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35082 arg_conv.is_owned = false;
35083 int64_t ret_conv = Pong_clone_ptr(&arg_conv);
35087 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35089 orig_conv.inner = untag_ptr(orig);
35090 orig_conv.is_owned = ptr_is_owned(orig);
35091 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35092 orig_conv.is_owned = false;
35093 LDKPong ret_var = Pong_clone(&orig_conv);
35094 int64_t ret_ref = 0;
35095 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35096 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35100 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Pong_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35102 a_conv.inner = untag_ptr(a);
35103 a_conv.is_owned = ptr_is_owned(a);
35104 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35105 a_conv.is_owned = false;
35107 b_conv.inner = untag_ptr(b);
35108 b_conv.is_owned = ptr_is_owned(b);
35109 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35110 b_conv.is_owned = false;
35111 jboolean ret_conv = Pong_eq(&a_conv, &b_conv);
35115 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35116 LDKOpenChannel this_obj_conv;
35117 this_obj_conv.inner = untag_ptr(this_obj);
35118 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35120 OpenChannel_free(this_obj_conv);
35123 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
35124 LDKOpenChannel this_ptr_conv;
35125 this_ptr_conv.inner = untag_ptr(this_ptr);
35126 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35127 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35128 this_ptr_conv.is_owned = false;
35129 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35130 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv));
35134 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35135 LDKOpenChannel this_ptr_conv;
35136 this_ptr_conv.inner = untag_ptr(this_ptr);
35137 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35138 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35139 this_ptr_conv.is_owned = false;
35140 LDKThirtyTwoBytes val_ref;
35141 CHECK((*env)->GetArrayLength(env, val) == 32);
35142 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35143 OpenChannel_set_chain_hash(&this_ptr_conv, val_ref);
35146 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35147 LDKOpenChannel this_ptr_conv;
35148 this_ptr_conv.inner = untag_ptr(this_ptr);
35149 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35151 this_ptr_conv.is_owned = false;
35152 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35153 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv));
35157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35158 LDKOpenChannel this_ptr_conv;
35159 this_ptr_conv.inner = untag_ptr(this_ptr);
35160 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35162 this_ptr_conv.is_owned = false;
35163 LDKThirtyTwoBytes val_ref;
35164 CHECK((*env)->GetArrayLength(env, val) == 32);
35165 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35166 OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
35169 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
35170 LDKOpenChannel this_ptr_conv;
35171 this_ptr_conv.inner = untag_ptr(this_ptr);
35172 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35173 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35174 this_ptr_conv.is_owned = false;
35175 int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv);
35179 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35180 LDKOpenChannel this_ptr_conv;
35181 this_ptr_conv.inner = untag_ptr(this_ptr);
35182 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35183 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35184 this_ptr_conv.is_owned = false;
35185 OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
35188 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
35189 LDKOpenChannel this_ptr_conv;
35190 this_ptr_conv.inner = untag_ptr(this_ptr);
35191 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35193 this_ptr_conv.is_owned = false;
35194 int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv);
35198 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35199 LDKOpenChannel this_ptr_conv;
35200 this_ptr_conv.inner = untag_ptr(this_ptr);
35201 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35202 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35203 this_ptr_conv.is_owned = false;
35204 OpenChannel_set_push_msat(&this_ptr_conv, val);
35207 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
35208 LDKOpenChannel this_ptr_conv;
35209 this_ptr_conv.inner = untag_ptr(this_ptr);
35210 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35211 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35212 this_ptr_conv.is_owned = false;
35213 int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
35217 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35218 LDKOpenChannel this_ptr_conv;
35219 this_ptr_conv.inner = untag_ptr(this_ptr);
35220 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35222 this_ptr_conv.is_owned = false;
35223 OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
35226 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) {
35227 LDKOpenChannel this_ptr_conv;
35228 this_ptr_conv.inner = untag_ptr(this_ptr);
35229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35231 this_ptr_conv.is_owned = false;
35232 int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
35236 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) {
35237 LDKOpenChannel this_ptr_conv;
35238 this_ptr_conv.inner = untag_ptr(this_ptr);
35239 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35240 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35241 this_ptr_conv.is_owned = false;
35242 OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
35245 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
35246 LDKOpenChannel this_ptr_conv;
35247 this_ptr_conv.inner = untag_ptr(this_ptr);
35248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35250 this_ptr_conv.is_owned = false;
35251 int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
35255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35256 LDKOpenChannel this_ptr_conv;
35257 this_ptr_conv.inner = untag_ptr(this_ptr);
35258 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35259 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35260 this_ptr_conv.is_owned = false;
35261 OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
35264 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
35265 LDKOpenChannel this_ptr_conv;
35266 this_ptr_conv.inner = untag_ptr(this_ptr);
35267 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35269 this_ptr_conv.is_owned = false;
35270 int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
35274 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35275 LDKOpenChannel this_ptr_conv;
35276 this_ptr_conv.inner = untag_ptr(this_ptr);
35277 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35279 this_ptr_conv.is_owned = false;
35280 OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
35283 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) {
35284 LDKOpenChannel this_ptr_conv;
35285 this_ptr_conv.inner = untag_ptr(this_ptr);
35286 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35288 this_ptr_conv.is_owned = false;
35289 int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
35293 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
35294 LDKOpenChannel this_ptr_conv;
35295 this_ptr_conv.inner = untag_ptr(this_ptr);
35296 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35298 this_ptr_conv.is_owned = false;
35299 OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
35302 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
35303 LDKOpenChannel this_ptr_conv;
35304 this_ptr_conv.inner = untag_ptr(this_ptr);
35305 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35306 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35307 this_ptr_conv.is_owned = false;
35308 int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv);
35312 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35313 LDKOpenChannel this_ptr_conv;
35314 this_ptr_conv.inner = untag_ptr(this_ptr);
35315 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35317 this_ptr_conv.is_owned = false;
35318 OpenChannel_set_to_self_delay(&this_ptr_conv, val);
35321 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
35322 LDKOpenChannel this_ptr_conv;
35323 this_ptr_conv.inner = untag_ptr(this_ptr);
35324 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35326 this_ptr_conv.is_owned = false;
35327 int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
35331 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35332 LDKOpenChannel this_ptr_conv;
35333 this_ptr_conv.inner = untag_ptr(this_ptr);
35334 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35335 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35336 this_ptr_conv.is_owned = false;
35337 OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
35340 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
35341 LDKOpenChannel this_ptr_conv;
35342 this_ptr_conv.inner = untag_ptr(this_ptr);
35343 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35344 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35345 this_ptr_conv.is_owned = false;
35346 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35347 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
35351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35352 LDKOpenChannel this_ptr_conv;
35353 this_ptr_conv.inner = untag_ptr(this_ptr);
35354 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35355 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35356 this_ptr_conv.is_owned = false;
35357 LDKPublicKey val_ref;
35358 CHECK((*env)->GetArrayLength(env, val) == 33);
35359 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35360 OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
35363 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35364 LDKOpenChannel this_ptr_conv;
35365 this_ptr_conv.inner = untag_ptr(this_ptr);
35366 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35367 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35368 this_ptr_conv.is_owned = false;
35369 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35370 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
35374 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35375 LDKOpenChannel this_ptr_conv;
35376 this_ptr_conv.inner = untag_ptr(this_ptr);
35377 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35379 this_ptr_conv.is_owned = false;
35380 LDKPublicKey val_ref;
35381 CHECK((*env)->GetArrayLength(env, val) == 33);
35382 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35383 OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
35386 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
35387 LDKOpenChannel this_ptr_conv;
35388 this_ptr_conv.inner = untag_ptr(this_ptr);
35389 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35391 this_ptr_conv.is_owned = false;
35392 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35393 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form);
35397 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35398 LDKOpenChannel this_ptr_conv;
35399 this_ptr_conv.inner = untag_ptr(this_ptr);
35400 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35402 this_ptr_conv.is_owned = false;
35403 LDKPublicKey val_ref;
35404 CHECK((*env)->GetArrayLength(env, val) == 33);
35405 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35406 OpenChannel_set_payment_point(&this_ptr_conv, val_ref);
35409 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35410 LDKOpenChannel this_ptr_conv;
35411 this_ptr_conv.inner = untag_ptr(this_ptr);
35412 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35414 this_ptr_conv.is_owned = false;
35415 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35416 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
35420 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35421 LDKOpenChannel this_ptr_conv;
35422 this_ptr_conv.inner = untag_ptr(this_ptr);
35423 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35425 this_ptr_conv.is_owned = false;
35426 LDKPublicKey val_ref;
35427 CHECK((*env)->GetArrayLength(env, val) == 33);
35428 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35429 OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
35432 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35433 LDKOpenChannel this_ptr_conv;
35434 this_ptr_conv.inner = untag_ptr(this_ptr);
35435 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35437 this_ptr_conv.is_owned = false;
35438 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35439 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
35443 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35444 LDKOpenChannel this_ptr_conv;
35445 this_ptr_conv.inner = untag_ptr(this_ptr);
35446 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35448 this_ptr_conv.is_owned = false;
35449 LDKPublicKey val_ref;
35450 CHECK((*env)->GetArrayLength(env, val) == 33);
35451 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35452 OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
35455 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
35456 LDKOpenChannel this_ptr_conv;
35457 this_ptr_conv.inner = untag_ptr(this_ptr);
35458 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35460 this_ptr_conv.is_owned = false;
35461 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35462 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
35466 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) {
35467 LDKOpenChannel this_ptr_conv;
35468 this_ptr_conv.inner = untag_ptr(this_ptr);
35469 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35471 this_ptr_conv.is_owned = false;
35472 LDKPublicKey val_ref;
35473 CHECK((*env)->GetArrayLength(env, val) == 33);
35474 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35475 OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
35478 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) {
35479 LDKOpenChannel this_ptr_conv;
35480 this_ptr_conv.inner = untag_ptr(this_ptr);
35481 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35482 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35483 this_ptr_conv.is_owned = false;
35484 int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv);
35488 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
35489 LDKOpenChannel this_ptr_conv;
35490 this_ptr_conv.inner = untag_ptr(this_ptr);
35491 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35493 this_ptr_conv.is_owned = false;
35494 OpenChannel_set_channel_flags(&this_ptr_conv, val);
35497 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
35498 LDKOpenChannel this_ptr_conv;
35499 this_ptr_conv.inner = untag_ptr(this_ptr);
35500 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35501 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35502 this_ptr_conv.is_owned = false;
35503 LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
35504 int64_t ret_ref = 0;
35505 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35506 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35510 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35511 LDKOpenChannel this_ptr_conv;
35512 this_ptr_conv.inner = untag_ptr(this_ptr);
35513 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35514 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35515 this_ptr_conv.is_owned = false;
35516 LDKChannelTypeFeatures val_conv;
35517 val_conv.inner = untag_ptr(val);
35518 val_conv.is_owned = ptr_is_owned(val);
35519 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
35520 val_conv = ChannelTypeFeatures_clone(&val_conv);
35521 OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
35524 static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
35525 LDKOpenChannel ret_var = OpenChannel_clone(arg);
35526 int64_t ret_ref = 0;
35527 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35528 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35531 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35532 LDKOpenChannel arg_conv;
35533 arg_conv.inner = untag_ptr(arg);
35534 arg_conv.is_owned = ptr_is_owned(arg);
35535 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35536 arg_conv.is_owned = false;
35537 int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv);
35541 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35542 LDKOpenChannel orig_conv;
35543 orig_conv.inner = untag_ptr(orig);
35544 orig_conv.is_owned = ptr_is_owned(orig);
35545 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35546 orig_conv.is_owned = false;
35547 LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
35548 int64_t ret_ref = 0;
35549 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35550 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35554 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OpenChannel_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35555 LDKOpenChannel a_conv;
35556 a_conv.inner = untag_ptr(a);
35557 a_conv.is_owned = ptr_is_owned(a);
35558 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35559 a_conv.is_owned = false;
35560 LDKOpenChannel b_conv;
35561 b_conv.inner = untag_ptr(b);
35562 b_conv.is_owned = ptr_is_owned(b);
35563 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35564 b_conv.is_owned = false;
35565 jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv);
35569 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35570 LDKAcceptChannel this_obj_conv;
35571 this_obj_conv.inner = untag_ptr(this_obj);
35572 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35574 AcceptChannel_free(this_obj_conv);
35577 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35578 LDKAcceptChannel this_ptr_conv;
35579 this_ptr_conv.inner = untag_ptr(this_ptr);
35580 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35581 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35582 this_ptr_conv.is_owned = false;
35583 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35584 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv));
35588 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35589 LDKAcceptChannel this_ptr_conv;
35590 this_ptr_conv.inner = untag_ptr(this_ptr);
35591 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35592 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35593 this_ptr_conv.is_owned = false;
35594 LDKThirtyTwoBytes val_ref;
35595 CHECK((*env)->GetArrayLength(env, val) == 32);
35596 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35597 AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
35600 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
35601 LDKAcceptChannel this_ptr_conv;
35602 this_ptr_conv.inner = untag_ptr(this_ptr);
35603 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35604 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35605 this_ptr_conv.is_owned = false;
35606 int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
35610 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35611 LDKAcceptChannel this_ptr_conv;
35612 this_ptr_conv.inner = untag_ptr(this_ptr);
35613 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35614 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35615 this_ptr_conv.is_owned = false;
35616 AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
35619 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) {
35620 LDKAcceptChannel this_ptr_conv;
35621 this_ptr_conv.inner = untag_ptr(this_ptr);
35622 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35624 this_ptr_conv.is_owned = false;
35625 int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
35629 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) {
35630 LDKAcceptChannel this_ptr_conv;
35631 this_ptr_conv.inner = untag_ptr(this_ptr);
35632 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35634 this_ptr_conv.is_owned = false;
35635 AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
35638 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
35639 LDKAcceptChannel this_ptr_conv;
35640 this_ptr_conv.inner = untag_ptr(this_ptr);
35641 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35643 this_ptr_conv.is_owned = false;
35644 int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
35648 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35649 LDKAcceptChannel this_ptr_conv;
35650 this_ptr_conv.inner = untag_ptr(this_ptr);
35651 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35652 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35653 this_ptr_conv.is_owned = false;
35654 AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
35657 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
35658 LDKAcceptChannel this_ptr_conv;
35659 this_ptr_conv.inner = untag_ptr(this_ptr);
35660 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35662 this_ptr_conv.is_owned = false;
35663 int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
35667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35668 LDKAcceptChannel this_ptr_conv;
35669 this_ptr_conv.inner = untag_ptr(this_ptr);
35670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35672 this_ptr_conv.is_owned = false;
35673 AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
35676 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
35677 LDKAcceptChannel this_ptr_conv;
35678 this_ptr_conv.inner = untag_ptr(this_ptr);
35679 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35681 this_ptr_conv.is_owned = false;
35682 int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv);
35686 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
35687 LDKAcceptChannel this_ptr_conv;
35688 this_ptr_conv.inner = untag_ptr(this_ptr);
35689 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35691 this_ptr_conv.is_owned = false;
35692 AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
35695 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
35696 LDKAcceptChannel this_ptr_conv;
35697 this_ptr_conv.inner = untag_ptr(this_ptr);
35698 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35700 this_ptr_conv.is_owned = false;
35701 int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv);
35705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35706 LDKAcceptChannel this_ptr_conv;
35707 this_ptr_conv.inner = untag_ptr(this_ptr);
35708 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35709 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35710 this_ptr_conv.is_owned = false;
35711 AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
35714 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
35715 LDKAcceptChannel this_ptr_conv;
35716 this_ptr_conv.inner = untag_ptr(this_ptr);
35717 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35719 this_ptr_conv.is_owned = false;
35720 int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
35724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35725 LDKAcceptChannel this_ptr_conv;
35726 this_ptr_conv.inner = untag_ptr(this_ptr);
35727 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35729 this_ptr_conv.is_owned = false;
35730 AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
35733 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
35734 LDKAcceptChannel this_ptr_conv;
35735 this_ptr_conv.inner = untag_ptr(this_ptr);
35736 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35738 this_ptr_conv.is_owned = false;
35739 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35740 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
35744 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35745 LDKAcceptChannel this_ptr_conv;
35746 this_ptr_conv.inner = untag_ptr(this_ptr);
35747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35749 this_ptr_conv.is_owned = false;
35750 LDKPublicKey val_ref;
35751 CHECK((*env)->GetArrayLength(env, val) == 33);
35752 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35753 AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
35756 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35757 LDKAcceptChannel this_ptr_conv;
35758 this_ptr_conv.inner = untag_ptr(this_ptr);
35759 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35760 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35761 this_ptr_conv.is_owned = false;
35762 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35763 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
35767 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35768 LDKAcceptChannel this_ptr_conv;
35769 this_ptr_conv.inner = untag_ptr(this_ptr);
35770 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35772 this_ptr_conv.is_owned = false;
35773 LDKPublicKey val_ref;
35774 CHECK((*env)->GetArrayLength(env, val) == 33);
35775 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35776 AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
35779 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
35780 LDKAcceptChannel this_ptr_conv;
35781 this_ptr_conv.inner = untag_ptr(this_ptr);
35782 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35784 this_ptr_conv.is_owned = false;
35785 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35786 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form);
35790 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35791 LDKAcceptChannel this_ptr_conv;
35792 this_ptr_conv.inner = untag_ptr(this_ptr);
35793 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35794 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35795 this_ptr_conv.is_owned = false;
35796 LDKPublicKey val_ref;
35797 CHECK((*env)->GetArrayLength(env, val) == 33);
35798 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35799 AcceptChannel_set_payment_point(&this_ptr_conv, val_ref);
35802 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35803 LDKAcceptChannel this_ptr_conv;
35804 this_ptr_conv.inner = untag_ptr(this_ptr);
35805 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35807 this_ptr_conv.is_owned = false;
35808 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35809 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
35813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35814 LDKAcceptChannel this_ptr_conv;
35815 this_ptr_conv.inner = untag_ptr(this_ptr);
35816 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35818 this_ptr_conv.is_owned = false;
35819 LDKPublicKey val_ref;
35820 CHECK((*env)->GetArrayLength(env, val) == 33);
35821 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35822 AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
35825 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35826 LDKAcceptChannel this_ptr_conv;
35827 this_ptr_conv.inner = untag_ptr(this_ptr);
35828 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35829 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35830 this_ptr_conv.is_owned = false;
35831 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35832 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
35836 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35837 LDKAcceptChannel this_ptr_conv;
35838 this_ptr_conv.inner = untag_ptr(this_ptr);
35839 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35840 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35841 this_ptr_conv.is_owned = false;
35842 LDKPublicKey val_ref;
35843 CHECK((*env)->GetArrayLength(env, val) == 33);
35844 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35845 AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
35848 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
35849 LDKAcceptChannel this_ptr_conv;
35850 this_ptr_conv.inner = untag_ptr(this_ptr);
35851 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35852 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35853 this_ptr_conv.is_owned = false;
35854 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35855 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
35859 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) {
35860 LDKAcceptChannel this_ptr_conv;
35861 this_ptr_conv.inner = untag_ptr(this_ptr);
35862 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35863 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35864 this_ptr_conv.is_owned = false;
35865 LDKPublicKey val_ref;
35866 CHECK((*env)->GetArrayLength(env, val) == 33);
35867 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35868 AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
35871 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
35872 LDKAcceptChannel this_ptr_conv;
35873 this_ptr_conv.inner = untag_ptr(this_ptr);
35874 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35875 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35876 this_ptr_conv.is_owned = false;
35877 LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv);
35878 int64_t ret_ref = 0;
35879 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35880 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35884 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35885 LDKAcceptChannel this_ptr_conv;
35886 this_ptr_conv.inner = untag_ptr(this_ptr);
35887 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35888 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35889 this_ptr_conv.is_owned = false;
35890 LDKChannelTypeFeatures val_conv;
35891 val_conv.inner = untag_ptr(val);
35892 val_conv.is_owned = ptr_is_owned(val);
35893 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
35894 val_conv = ChannelTypeFeatures_clone(&val_conv);
35895 AcceptChannel_set_channel_type(&this_ptr_conv, val_conv);
35898 static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) {
35899 LDKAcceptChannel ret_var = AcceptChannel_clone(arg);
35900 int64_t ret_ref = 0;
35901 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35902 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35905 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35906 LDKAcceptChannel arg_conv;
35907 arg_conv.inner = untag_ptr(arg);
35908 arg_conv.is_owned = ptr_is_owned(arg);
35909 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35910 arg_conv.is_owned = false;
35911 int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv);
35915 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35916 LDKAcceptChannel orig_conv;
35917 orig_conv.inner = untag_ptr(orig);
35918 orig_conv.is_owned = ptr_is_owned(orig);
35919 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35920 orig_conv.is_owned = false;
35921 LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
35922 int64_t ret_ref = 0;
35923 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35924 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35928 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35929 LDKAcceptChannel a_conv;
35930 a_conv.inner = untag_ptr(a);
35931 a_conv.is_owned = ptr_is_owned(a);
35932 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35933 a_conv.is_owned = false;
35934 LDKAcceptChannel b_conv;
35935 b_conv.inner = untag_ptr(b);
35936 b_conv.is_owned = ptr_is_owned(b);
35937 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35938 b_conv.is_owned = false;
35939 jboolean ret_conv = AcceptChannel_eq(&a_conv, &b_conv);
35943 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35944 LDKFundingCreated this_obj_conv;
35945 this_obj_conv.inner = untag_ptr(this_obj);
35946 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35948 FundingCreated_free(this_obj_conv);
35951 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35952 LDKFundingCreated this_ptr_conv;
35953 this_ptr_conv.inner = untag_ptr(this_ptr);
35954 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35956 this_ptr_conv.is_owned = false;
35957 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35958 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv));
35962 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35963 LDKFundingCreated this_ptr_conv;
35964 this_ptr_conv.inner = untag_ptr(this_ptr);
35965 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35966 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35967 this_ptr_conv.is_owned = false;
35968 LDKThirtyTwoBytes val_ref;
35969 CHECK((*env)->GetArrayLength(env, val) == 32);
35970 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35971 FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref);
35974 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
35975 LDKFundingCreated this_ptr_conv;
35976 this_ptr_conv.inner = untag_ptr(this_ptr);
35977 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35978 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35979 this_ptr_conv.is_owned = false;
35980 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35981 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv));
35985 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35986 LDKFundingCreated this_ptr_conv;
35987 this_ptr_conv.inner = untag_ptr(this_ptr);
35988 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35990 this_ptr_conv.is_owned = false;
35991 LDKThirtyTwoBytes val_ref;
35992 CHECK((*env)->GetArrayLength(env, val) == 32);
35993 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35994 FundingCreated_set_funding_txid(&this_ptr_conv, val_ref);
35997 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
35998 LDKFundingCreated this_ptr_conv;
35999 this_ptr_conv.inner = untag_ptr(this_ptr);
36000 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36002 this_ptr_conv.is_owned = false;
36003 int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv);
36007 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
36008 LDKFundingCreated this_ptr_conv;
36009 this_ptr_conv.inner = untag_ptr(this_ptr);
36010 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36012 this_ptr_conv.is_owned = false;
36013 FundingCreated_set_funding_output_index(&this_ptr_conv, val);
36016 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
36017 LDKFundingCreated this_ptr_conv;
36018 this_ptr_conv.inner = untag_ptr(this_ptr);
36019 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36021 this_ptr_conv.is_owned = false;
36022 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
36023 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form);
36027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36028 LDKFundingCreated this_ptr_conv;
36029 this_ptr_conv.inner = untag_ptr(this_ptr);
36030 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36032 this_ptr_conv.is_owned = false;
36033 LDKSignature val_ref;
36034 CHECK((*env)->GetArrayLength(env, val) == 64);
36035 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
36036 FundingCreated_set_signature(&this_ptr_conv, val_ref);
36039 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) {
36040 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
36041 CHECK((*env)->GetArrayLength(env, temporary_channel_id_arg) == 32);
36042 (*env)->GetByteArrayRegion(env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data);
36043 LDKThirtyTwoBytes funding_txid_arg_ref;
36044 CHECK((*env)->GetArrayLength(env, funding_txid_arg) == 32);
36045 (*env)->GetByteArrayRegion(env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data);
36046 LDKSignature signature_arg_ref;
36047 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
36048 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
36049 LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
36050 int64_t ret_ref = 0;
36051 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36052 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36056 static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) {
36057 LDKFundingCreated ret_var = FundingCreated_clone(arg);
36058 int64_t ret_ref = 0;
36059 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36060 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36064 LDKFundingCreated arg_conv;
36065 arg_conv.inner = untag_ptr(arg);
36066 arg_conv.is_owned = ptr_is_owned(arg);
36067 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36068 arg_conv.is_owned = false;
36069 int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv);
36073 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36074 LDKFundingCreated orig_conv;
36075 orig_conv.inner = untag_ptr(orig);
36076 orig_conv.is_owned = ptr_is_owned(orig);
36077 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36078 orig_conv.is_owned = false;
36079 LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
36080 int64_t ret_ref = 0;
36081 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36082 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36086 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingCreated_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36087 LDKFundingCreated a_conv;
36088 a_conv.inner = untag_ptr(a);
36089 a_conv.is_owned = ptr_is_owned(a);
36090 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36091 a_conv.is_owned = false;
36092 LDKFundingCreated b_conv;
36093 b_conv.inner = untag_ptr(b);
36094 b_conv.is_owned = ptr_is_owned(b);
36095 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36096 b_conv.is_owned = false;
36097 jboolean ret_conv = FundingCreated_eq(&a_conv, &b_conv);
36101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36102 LDKFundingSigned this_obj_conv;
36103 this_obj_conv.inner = untag_ptr(this_obj);
36104 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36105 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36106 FundingSigned_free(this_obj_conv);
36109 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36110 LDKFundingSigned this_ptr_conv;
36111 this_ptr_conv.inner = untag_ptr(this_ptr);
36112 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36114 this_ptr_conv.is_owned = false;
36115 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36116 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv));
36120 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36121 LDKFundingSigned this_ptr_conv;
36122 this_ptr_conv.inner = untag_ptr(this_ptr);
36123 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36125 this_ptr_conv.is_owned = false;
36126 LDKThirtyTwoBytes val_ref;
36127 CHECK((*env)->GetArrayLength(env, val) == 32);
36128 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36129 FundingSigned_set_channel_id(&this_ptr_conv, val_ref);
36132 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
36133 LDKFundingSigned this_ptr_conv;
36134 this_ptr_conv.inner = untag_ptr(this_ptr);
36135 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36136 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36137 this_ptr_conv.is_owned = false;
36138 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
36139 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form);
36143 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36144 LDKFundingSigned this_ptr_conv;
36145 this_ptr_conv.inner = untag_ptr(this_ptr);
36146 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36147 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36148 this_ptr_conv.is_owned = false;
36149 LDKSignature val_ref;
36150 CHECK((*env)->GetArrayLength(env, val) == 64);
36151 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
36152 FundingSigned_set_signature(&this_ptr_conv, val_ref);
36155 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg) {
36156 LDKThirtyTwoBytes channel_id_arg_ref;
36157 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
36158 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
36159 LDKSignature signature_arg_ref;
36160 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
36161 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
36162 LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
36163 int64_t ret_ref = 0;
36164 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36165 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36169 static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) {
36170 LDKFundingSigned ret_var = FundingSigned_clone(arg);
36171 int64_t ret_ref = 0;
36172 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36173 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36176 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36177 LDKFundingSigned arg_conv;
36178 arg_conv.inner = untag_ptr(arg);
36179 arg_conv.is_owned = ptr_is_owned(arg);
36180 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36181 arg_conv.is_owned = false;
36182 int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv);
36186 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36187 LDKFundingSigned orig_conv;
36188 orig_conv.inner = untag_ptr(orig);
36189 orig_conv.is_owned = ptr_is_owned(orig);
36190 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36191 orig_conv.is_owned = false;
36192 LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
36193 int64_t ret_ref = 0;
36194 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36195 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36199 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36200 LDKFundingSigned a_conv;
36201 a_conv.inner = untag_ptr(a);
36202 a_conv.is_owned = ptr_is_owned(a);
36203 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36204 a_conv.is_owned = false;
36205 LDKFundingSigned b_conv;
36206 b_conv.inner = untag_ptr(b);
36207 b_conv.is_owned = ptr_is_owned(b);
36208 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36209 b_conv.is_owned = false;
36210 jboolean ret_conv = FundingSigned_eq(&a_conv, &b_conv);
36214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36215 LDKChannelReady this_obj_conv;
36216 this_obj_conv.inner = untag_ptr(this_obj);
36217 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36219 ChannelReady_free(this_obj_conv);
36222 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36223 LDKChannelReady this_ptr_conv;
36224 this_ptr_conv.inner = untag_ptr(this_ptr);
36225 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36227 this_ptr_conv.is_owned = false;
36228 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36229 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReady_get_channel_id(&this_ptr_conv));
36233 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36234 LDKChannelReady this_ptr_conv;
36235 this_ptr_conv.inner = untag_ptr(this_ptr);
36236 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36238 this_ptr_conv.is_owned = false;
36239 LDKThirtyTwoBytes val_ref;
36240 CHECK((*env)->GetArrayLength(env, val) == 32);
36241 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36242 ChannelReady_set_channel_id(&this_ptr_conv, val_ref);
36245 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
36246 LDKChannelReady this_ptr_conv;
36247 this_ptr_conv.inner = untag_ptr(this_ptr);
36248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36250 this_ptr_conv.is_owned = false;
36251 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
36252 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
36256 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) {
36257 LDKChannelReady this_ptr_conv;
36258 this_ptr_conv.inner = untag_ptr(this_ptr);
36259 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36260 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36261 this_ptr_conv.is_owned = false;
36262 LDKPublicKey val_ref;
36263 CHECK((*env)->GetArrayLength(env, val) == 33);
36264 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
36265 ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref);
36268 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
36269 LDKChannelReady this_ptr_conv;
36270 this_ptr_conv.inner = untag_ptr(this_ptr);
36271 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36273 this_ptr_conv.is_owned = false;
36274 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
36275 *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv);
36276 int64_t ret_ref = tag_ptr(ret_copy, true);
36280 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) {
36281 LDKChannelReady this_ptr_conv;
36282 this_ptr_conv.inner = untag_ptr(this_ptr);
36283 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36285 this_ptr_conv.is_owned = false;
36286 void* val_ptr = untag_ptr(val);
36287 CHECK_ACCESS(val_ptr);
36288 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
36289 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
36290 ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv);
36293 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) {
36294 LDKThirtyTwoBytes channel_id_arg_ref;
36295 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
36296 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
36297 LDKPublicKey next_per_commitment_point_arg_ref;
36298 CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
36299 (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
36300 void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg);
36301 CHECK_ACCESS(short_channel_id_alias_arg_ptr);
36302 LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr);
36303 short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg));
36304 LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv);
36305 int64_t ret_ref = 0;
36306 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36307 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36311 static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) {
36312 LDKChannelReady ret_var = ChannelReady_clone(arg);
36313 int64_t ret_ref = 0;
36314 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36315 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36318 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36319 LDKChannelReady arg_conv;
36320 arg_conv.inner = untag_ptr(arg);
36321 arg_conv.is_owned = ptr_is_owned(arg);
36322 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36323 arg_conv.is_owned = false;
36324 int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv);
36328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36329 LDKChannelReady orig_conv;
36330 orig_conv.inner = untag_ptr(orig);
36331 orig_conv.is_owned = ptr_is_owned(orig);
36332 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36333 orig_conv.is_owned = false;
36334 LDKChannelReady ret_var = ChannelReady_clone(&orig_conv);
36335 int64_t ret_ref = 0;
36336 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36337 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36341 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReady_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36342 LDKChannelReady a_conv;
36343 a_conv.inner = untag_ptr(a);
36344 a_conv.is_owned = ptr_is_owned(a);
36345 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36346 a_conv.is_owned = false;
36347 LDKChannelReady b_conv;
36348 b_conv.inner = untag_ptr(b);
36349 b_conv.is_owned = ptr_is_owned(b);
36350 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36351 b_conv.is_owned = false;
36352 jboolean ret_conv = ChannelReady_eq(&a_conv, &b_conv);
36356 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36357 LDKShutdown this_obj_conv;
36358 this_obj_conv.inner = untag_ptr(this_obj);
36359 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36361 Shutdown_free(this_obj_conv);
36364 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36365 LDKShutdown this_ptr_conv;
36366 this_ptr_conv.inner = untag_ptr(this_ptr);
36367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36369 this_ptr_conv.is_owned = false;
36370 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36371 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv));
36375 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36376 LDKShutdown this_ptr_conv;
36377 this_ptr_conv.inner = untag_ptr(this_ptr);
36378 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36380 this_ptr_conv.is_owned = false;
36381 LDKThirtyTwoBytes val_ref;
36382 CHECK((*env)->GetArrayLength(env, val) == 32);
36383 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36384 Shutdown_set_channel_id(&this_ptr_conv, val_ref);
36387 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
36388 LDKShutdown this_ptr_conv;
36389 this_ptr_conv.inner = untag_ptr(this_ptr);
36390 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36392 this_ptr_conv.is_owned = false;
36393 LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
36394 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36395 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36399 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36400 LDKShutdown this_ptr_conv;
36401 this_ptr_conv.inner = untag_ptr(this_ptr);
36402 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36403 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36404 this_ptr_conv.is_owned = false;
36405 LDKCVec_u8Z val_ref;
36406 val_ref.datalen = (*env)->GetArrayLength(env, val);
36407 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
36408 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
36409 Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref);
36412 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) {
36413 LDKThirtyTwoBytes channel_id_arg_ref;
36414 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
36415 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
36416 LDKCVec_u8Z scriptpubkey_arg_ref;
36417 scriptpubkey_arg_ref.datalen = (*env)->GetArrayLength(env, scriptpubkey_arg);
36418 scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
36419 (*env)->GetByteArrayRegion(env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data);
36420 LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
36421 int64_t ret_ref = 0;
36422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36423 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36427 static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) {
36428 LDKShutdown ret_var = Shutdown_clone(arg);
36429 int64_t ret_ref = 0;
36430 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36431 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36435 LDKShutdown arg_conv;
36436 arg_conv.inner = untag_ptr(arg);
36437 arg_conv.is_owned = ptr_is_owned(arg);
36438 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36439 arg_conv.is_owned = false;
36440 int64_t ret_conv = Shutdown_clone_ptr(&arg_conv);
36444 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36445 LDKShutdown orig_conv;
36446 orig_conv.inner = untag_ptr(orig);
36447 orig_conv.is_owned = ptr_is_owned(orig);
36448 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36449 orig_conv.is_owned = false;
36450 LDKShutdown ret_var = Shutdown_clone(&orig_conv);
36451 int64_t ret_ref = 0;
36452 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36453 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36457 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Shutdown_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36458 LDKShutdown a_conv;
36459 a_conv.inner = untag_ptr(a);
36460 a_conv.is_owned = ptr_is_owned(a);
36461 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36462 a_conv.is_owned = false;
36463 LDKShutdown b_conv;
36464 b_conv.inner = untag_ptr(b);
36465 b_conv.is_owned = ptr_is_owned(b);
36466 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36467 b_conv.is_owned = false;
36468 jboolean ret_conv = Shutdown_eq(&a_conv, &b_conv);
36472 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36473 LDKClosingSignedFeeRange this_obj_conv;
36474 this_obj_conv.inner = untag_ptr(this_obj);
36475 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36476 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36477 ClosingSignedFeeRange_free(this_obj_conv);
36480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
36481 LDKClosingSignedFeeRange this_ptr_conv;
36482 this_ptr_conv.inner = untag_ptr(this_ptr);
36483 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36485 this_ptr_conv.is_owned = false;
36486 int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
36490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36491 LDKClosingSignedFeeRange this_ptr_conv;
36492 this_ptr_conv.inner = untag_ptr(this_ptr);
36493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36495 this_ptr_conv.is_owned = false;
36496 ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
36499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
36500 LDKClosingSignedFeeRange this_ptr_conv;
36501 this_ptr_conv.inner = untag_ptr(this_ptr);
36502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36504 this_ptr_conv.is_owned = false;
36505 int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
36509 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36510 LDKClosingSignedFeeRange this_ptr_conv;
36511 this_ptr_conv.inner = untag_ptr(this_ptr);
36512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36514 this_ptr_conv.is_owned = false;
36515 ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
36518 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) {
36519 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
36520 int64_t ret_ref = 0;
36521 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36522 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36526 static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) {
36527 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg);
36528 int64_t ret_ref = 0;
36529 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36530 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36533 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36534 LDKClosingSignedFeeRange arg_conv;
36535 arg_conv.inner = untag_ptr(arg);
36536 arg_conv.is_owned = ptr_is_owned(arg);
36537 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36538 arg_conv.is_owned = false;
36539 int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv);
36543 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36544 LDKClosingSignedFeeRange orig_conv;
36545 orig_conv.inner = untag_ptr(orig);
36546 orig_conv.is_owned = ptr_is_owned(orig);
36547 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36548 orig_conv.is_owned = false;
36549 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
36550 int64_t ret_ref = 0;
36551 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36552 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36556 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36557 LDKClosingSignedFeeRange a_conv;
36558 a_conv.inner = untag_ptr(a);
36559 a_conv.is_owned = ptr_is_owned(a);
36560 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36561 a_conv.is_owned = false;
36562 LDKClosingSignedFeeRange b_conv;
36563 b_conv.inner = untag_ptr(b);
36564 b_conv.is_owned = ptr_is_owned(b);
36565 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36566 b_conv.is_owned = false;
36567 jboolean ret_conv = ClosingSignedFeeRange_eq(&a_conv, &b_conv);
36571 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36572 LDKClosingSigned this_obj_conv;
36573 this_obj_conv.inner = untag_ptr(this_obj);
36574 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36576 ClosingSigned_free(this_obj_conv);
36579 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36580 LDKClosingSigned this_ptr_conv;
36581 this_ptr_conv.inner = untag_ptr(this_ptr);
36582 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36584 this_ptr_conv.is_owned = false;
36585 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36586 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv));
36590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36591 LDKClosingSigned this_ptr_conv;
36592 this_ptr_conv.inner = untag_ptr(this_ptr);
36593 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36595 this_ptr_conv.is_owned = false;
36596 LDKThirtyTwoBytes val_ref;
36597 CHECK((*env)->GetArrayLength(env, val) == 32);
36598 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36599 ClosingSigned_set_channel_id(&this_ptr_conv, val_ref);
36602 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
36603 LDKClosingSigned this_ptr_conv;
36604 this_ptr_conv.inner = untag_ptr(this_ptr);
36605 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36606 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36607 this_ptr_conv.is_owned = false;
36608 int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
36612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36613 LDKClosingSigned this_ptr_conv;
36614 this_ptr_conv.inner = untag_ptr(this_ptr);
36615 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36616 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36617 this_ptr_conv.is_owned = false;
36618 ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
36621 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
36622 LDKClosingSigned this_ptr_conv;
36623 this_ptr_conv.inner = untag_ptr(this_ptr);
36624 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36625 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36626 this_ptr_conv.is_owned = false;
36627 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
36628 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form);
36632 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36633 LDKClosingSigned this_ptr_conv;
36634 this_ptr_conv.inner = untag_ptr(this_ptr);
36635 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36637 this_ptr_conv.is_owned = false;
36638 LDKSignature val_ref;
36639 CHECK((*env)->GetArrayLength(env, val) == 64);
36640 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
36641 ClosingSigned_set_signature(&this_ptr_conv, val_ref);
36644 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr) {
36645 LDKClosingSigned this_ptr_conv;
36646 this_ptr_conv.inner = untag_ptr(this_ptr);
36647 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36649 this_ptr_conv.is_owned = false;
36650 LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
36651 int64_t ret_ref = 0;
36652 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36653 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36657 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36658 LDKClosingSigned this_ptr_conv;
36659 this_ptr_conv.inner = untag_ptr(this_ptr);
36660 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36662 this_ptr_conv.is_owned = false;
36663 LDKClosingSignedFeeRange val_conv;
36664 val_conv.inner = untag_ptr(val);
36665 val_conv.is_owned = ptr_is_owned(val);
36666 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
36667 val_conv = ClosingSignedFeeRange_clone(&val_conv);
36668 ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
36671 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) {
36672 LDKThirtyTwoBytes channel_id_arg_ref;
36673 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
36674 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
36675 LDKSignature signature_arg_ref;
36676 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
36677 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
36678 LDKClosingSignedFeeRange fee_range_arg_conv;
36679 fee_range_arg_conv.inner = untag_ptr(fee_range_arg);
36680 fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg);
36681 CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv);
36682 fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
36683 LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv);
36684 int64_t ret_ref = 0;
36685 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36686 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36690 static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) {
36691 LDKClosingSigned ret_var = ClosingSigned_clone(arg);
36692 int64_t ret_ref = 0;
36693 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36694 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36697 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36698 LDKClosingSigned arg_conv;
36699 arg_conv.inner = untag_ptr(arg);
36700 arg_conv.is_owned = ptr_is_owned(arg);
36701 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36702 arg_conv.is_owned = false;
36703 int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv);
36707 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36708 LDKClosingSigned orig_conv;
36709 orig_conv.inner = untag_ptr(orig);
36710 orig_conv.is_owned = ptr_is_owned(orig);
36711 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36712 orig_conv.is_owned = false;
36713 LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
36714 int64_t ret_ref = 0;
36715 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36716 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36720 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36721 LDKClosingSigned a_conv;
36722 a_conv.inner = untag_ptr(a);
36723 a_conv.is_owned = ptr_is_owned(a);
36724 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36725 a_conv.is_owned = false;
36726 LDKClosingSigned b_conv;
36727 b_conv.inner = untag_ptr(b);
36728 b_conv.is_owned = ptr_is_owned(b);
36729 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36730 b_conv.is_owned = false;
36731 jboolean ret_conv = ClosingSigned_eq(&a_conv, &b_conv);
36735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36736 LDKUpdateAddHTLC this_obj_conv;
36737 this_obj_conv.inner = untag_ptr(this_obj);
36738 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36740 UpdateAddHTLC_free(this_obj_conv);
36743 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36744 LDKUpdateAddHTLC this_ptr_conv;
36745 this_ptr_conv.inner = untag_ptr(this_ptr);
36746 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36747 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36748 this_ptr_conv.is_owned = false;
36749 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36750 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv));
36754 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36755 LDKUpdateAddHTLC this_ptr_conv;
36756 this_ptr_conv.inner = untag_ptr(this_ptr);
36757 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36759 this_ptr_conv.is_owned = false;
36760 LDKThirtyTwoBytes val_ref;
36761 CHECK((*env)->GetArrayLength(env, val) == 32);
36762 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36763 UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref);
36766 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36767 LDKUpdateAddHTLC this_ptr_conv;
36768 this_ptr_conv.inner = untag_ptr(this_ptr);
36769 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36770 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36771 this_ptr_conv.is_owned = false;
36772 int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
36776 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36777 LDKUpdateAddHTLC this_ptr_conv;
36778 this_ptr_conv.inner = untag_ptr(this_ptr);
36779 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36781 this_ptr_conv.is_owned = false;
36782 UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
36785 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
36786 LDKUpdateAddHTLC this_ptr_conv;
36787 this_ptr_conv.inner = untag_ptr(this_ptr);
36788 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36789 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36790 this_ptr_conv.is_owned = false;
36791 int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
36795 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36796 LDKUpdateAddHTLC this_ptr_conv;
36797 this_ptr_conv.inner = untag_ptr(this_ptr);
36798 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36800 this_ptr_conv.is_owned = false;
36801 UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
36804 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
36805 LDKUpdateAddHTLC this_ptr_conv;
36806 this_ptr_conv.inner = untag_ptr(this_ptr);
36807 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36808 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36809 this_ptr_conv.is_owned = false;
36810 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36811 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv));
36815 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36816 LDKUpdateAddHTLC this_ptr_conv;
36817 this_ptr_conv.inner = untag_ptr(this_ptr);
36818 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36820 this_ptr_conv.is_owned = false;
36821 LDKThirtyTwoBytes val_ref;
36822 CHECK((*env)->GetArrayLength(env, val) == 32);
36823 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36824 UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref);
36827 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) {
36828 LDKUpdateAddHTLC this_ptr_conv;
36829 this_ptr_conv.inner = untag_ptr(this_ptr);
36830 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36831 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36832 this_ptr_conv.is_owned = false;
36833 int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
36837 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
36838 LDKUpdateAddHTLC this_ptr_conv;
36839 this_ptr_conv.inner = untag_ptr(this_ptr);
36840 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36841 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36842 this_ptr_conv.is_owned = false;
36843 UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
36846 static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) {
36847 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg);
36848 int64_t ret_ref = 0;
36849 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36850 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36853 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36854 LDKUpdateAddHTLC arg_conv;
36855 arg_conv.inner = untag_ptr(arg);
36856 arg_conv.is_owned = ptr_is_owned(arg);
36857 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36858 arg_conv.is_owned = false;
36859 int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv);
36863 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36864 LDKUpdateAddHTLC orig_conv;
36865 orig_conv.inner = untag_ptr(orig);
36866 orig_conv.is_owned = ptr_is_owned(orig);
36867 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36868 orig_conv.is_owned = false;
36869 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
36870 int64_t ret_ref = 0;
36871 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36872 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36876 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36877 LDKUpdateAddHTLC a_conv;
36878 a_conv.inner = untag_ptr(a);
36879 a_conv.is_owned = ptr_is_owned(a);
36880 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36881 a_conv.is_owned = false;
36882 LDKUpdateAddHTLC b_conv;
36883 b_conv.inner = untag_ptr(b);
36884 b_conv.is_owned = ptr_is_owned(b);
36885 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36886 b_conv.is_owned = false;
36887 jboolean ret_conv = UpdateAddHTLC_eq(&a_conv, &b_conv);
36891 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36892 LDKOnionMessage this_obj_conv;
36893 this_obj_conv.inner = untag_ptr(this_obj);
36894 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36895 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36896 OnionMessage_free(this_obj_conv);
36899 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessage_1get_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
36900 LDKOnionMessage this_ptr_conv;
36901 this_ptr_conv.inner = untag_ptr(this_ptr);
36902 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36904 this_ptr_conv.is_owned = false;
36905 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
36906 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OnionMessage_get_blinding_point(&this_ptr_conv).compressed_form);
36910 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessage_1set_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36911 LDKOnionMessage this_ptr_conv;
36912 this_ptr_conv.inner = untag_ptr(this_ptr);
36913 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36915 this_ptr_conv.is_owned = false;
36916 LDKPublicKey val_ref;
36917 CHECK((*env)->GetArrayLength(env, val) == 33);
36918 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
36919 OnionMessage_set_blinding_point(&this_ptr_conv, val_ref);
36922 static inline uint64_t OnionMessage_clone_ptr(LDKOnionMessage *NONNULL_PTR arg) {
36923 LDKOnionMessage ret_var = OnionMessage_clone(arg);
36924 int64_t ret_ref = 0;
36925 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36926 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36929 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36930 LDKOnionMessage arg_conv;
36931 arg_conv.inner = untag_ptr(arg);
36932 arg_conv.is_owned = ptr_is_owned(arg);
36933 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36934 arg_conv.is_owned = false;
36935 int64_t ret_conv = OnionMessage_clone_ptr(&arg_conv);
36939 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36940 LDKOnionMessage orig_conv;
36941 orig_conv.inner = untag_ptr(orig);
36942 orig_conv.is_owned = ptr_is_owned(orig);
36943 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36944 orig_conv.is_owned = false;
36945 LDKOnionMessage ret_var = OnionMessage_clone(&orig_conv);
36946 int64_t ret_ref = 0;
36947 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36948 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36952 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OnionMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36953 LDKOnionMessage a_conv;
36954 a_conv.inner = untag_ptr(a);
36955 a_conv.is_owned = ptr_is_owned(a);
36956 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36957 a_conv.is_owned = false;
36958 LDKOnionMessage b_conv;
36959 b_conv.inner = untag_ptr(b);
36960 b_conv.is_owned = ptr_is_owned(b);
36961 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36962 b_conv.is_owned = false;
36963 jboolean ret_conv = OnionMessage_eq(&a_conv, &b_conv);
36967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36968 LDKUpdateFulfillHTLC this_obj_conv;
36969 this_obj_conv.inner = untag_ptr(this_obj);
36970 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36972 UpdateFulfillHTLC_free(this_obj_conv);
36975 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36976 LDKUpdateFulfillHTLC this_ptr_conv;
36977 this_ptr_conv.inner = untag_ptr(this_ptr);
36978 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36979 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36980 this_ptr_conv.is_owned = false;
36981 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36982 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv));
36986 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36987 LDKUpdateFulfillHTLC this_ptr_conv;
36988 this_ptr_conv.inner = untag_ptr(this_ptr);
36989 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36990 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36991 this_ptr_conv.is_owned = false;
36992 LDKThirtyTwoBytes val_ref;
36993 CHECK((*env)->GetArrayLength(env, val) == 32);
36994 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36995 UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref);
36998 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36999 LDKUpdateFulfillHTLC this_ptr_conv;
37000 this_ptr_conv.inner = untag_ptr(this_ptr);
37001 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37003 this_ptr_conv.is_owned = false;
37004 int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
37008 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37009 LDKUpdateFulfillHTLC this_ptr_conv;
37010 this_ptr_conv.inner = untag_ptr(this_ptr);
37011 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37012 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37013 this_ptr_conv.is_owned = false;
37014 UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
37017 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) {
37018 LDKUpdateFulfillHTLC this_ptr_conv;
37019 this_ptr_conv.inner = untag_ptr(this_ptr);
37020 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37022 this_ptr_conv.is_owned = false;
37023 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37024 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv));
37028 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37029 LDKUpdateFulfillHTLC this_ptr_conv;
37030 this_ptr_conv.inner = untag_ptr(this_ptr);
37031 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37033 this_ptr_conv.is_owned = false;
37034 LDKThirtyTwoBytes val_ref;
37035 CHECK((*env)->GetArrayLength(env, val) == 32);
37036 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37037 UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref);
37040 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) {
37041 LDKThirtyTwoBytes channel_id_arg_ref;
37042 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
37043 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
37044 LDKThirtyTwoBytes payment_preimage_arg_ref;
37045 CHECK((*env)->GetArrayLength(env, payment_preimage_arg) == 32);
37046 (*env)->GetByteArrayRegion(env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data);
37047 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
37048 int64_t ret_ref = 0;
37049 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37050 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37054 static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) {
37055 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg);
37056 int64_t ret_ref = 0;
37057 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37058 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37061 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37062 LDKUpdateFulfillHTLC arg_conv;
37063 arg_conv.inner = untag_ptr(arg);
37064 arg_conv.is_owned = ptr_is_owned(arg);
37065 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37066 arg_conv.is_owned = false;
37067 int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv);
37071 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37072 LDKUpdateFulfillHTLC orig_conv;
37073 orig_conv.inner = untag_ptr(orig);
37074 orig_conv.is_owned = ptr_is_owned(orig);
37075 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37076 orig_conv.is_owned = false;
37077 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
37078 int64_t ret_ref = 0;
37079 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37080 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37084 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37085 LDKUpdateFulfillHTLC a_conv;
37086 a_conv.inner = untag_ptr(a);
37087 a_conv.is_owned = ptr_is_owned(a);
37088 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37089 a_conv.is_owned = false;
37090 LDKUpdateFulfillHTLC b_conv;
37091 b_conv.inner = untag_ptr(b);
37092 b_conv.is_owned = ptr_is_owned(b);
37093 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37094 b_conv.is_owned = false;
37095 jboolean ret_conv = UpdateFulfillHTLC_eq(&a_conv, &b_conv);
37099 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37100 LDKUpdateFailHTLC this_obj_conv;
37101 this_obj_conv.inner = untag_ptr(this_obj);
37102 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37103 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37104 UpdateFailHTLC_free(this_obj_conv);
37107 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37108 LDKUpdateFailHTLC this_ptr_conv;
37109 this_ptr_conv.inner = untag_ptr(this_ptr);
37110 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37112 this_ptr_conv.is_owned = false;
37113 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37114 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv));
37118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37119 LDKUpdateFailHTLC this_ptr_conv;
37120 this_ptr_conv.inner = untag_ptr(this_ptr);
37121 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37122 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37123 this_ptr_conv.is_owned = false;
37124 LDKThirtyTwoBytes val_ref;
37125 CHECK((*env)->GetArrayLength(env, val) == 32);
37126 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37127 UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref);
37130 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37131 LDKUpdateFailHTLC this_ptr_conv;
37132 this_ptr_conv.inner = untag_ptr(this_ptr);
37133 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37134 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37135 this_ptr_conv.is_owned = false;
37136 int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
37140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37141 LDKUpdateFailHTLC this_ptr_conv;
37142 this_ptr_conv.inner = untag_ptr(this_ptr);
37143 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37144 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37145 this_ptr_conv.is_owned = false;
37146 UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
37149 static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) {
37150 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg);
37151 int64_t ret_ref = 0;
37152 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37153 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37156 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37157 LDKUpdateFailHTLC arg_conv;
37158 arg_conv.inner = untag_ptr(arg);
37159 arg_conv.is_owned = ptr_is_owned(arg);
37160 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37161 arg_conv.is_owned = false;
37162 int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv);
37166 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37167 LDKUpdateFailHTLC orig_conv;
37168 orig_conv.inner = untag_ptr(orig);
37169 orig_conv.is_owned = ptr_is_owned(orig);
37170 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37171 orig_conv.is_owned = false;
37172 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
37173 int64_t ret_ref = 0;
37174 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37175 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37179 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37180 LDKUpdateFailHTLC a_conv;
37181 a_conv.inner = untag_ptr(a);
37182 a_conv.is_owned = ptr_is_owned(a);
37183 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37184 a_conv.is_owned = false;
37185 LDKUpdateFailHTLC b_conv;
37186 b_conv.inner = untag_ptr(b);
37187 b_conv.is_owned = ptr_is_owned(b);
37188 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37189 b_conv.is_owned = false;
37190 jboolean ret_conv = UpdateFailHTLC_eq(&a_conv, &b_conv);
37194 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37195 LDKUpdateFailMalformedHTLC this_obj_conv;
37196 this_obj_conv.inner = untag_ptr(this_obj);
37197 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37198 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37199 UpdateFailMalformedHTLC_free(this_obj_conv);
37202 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37203 LDKUpdateFailMalformedHTLC this_ptr_conv;
37204 this_ptr_conv.inner = untag_ptr(this_ptr);
37205 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37206 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37207 this_ptr_conv.is_owned = false;
37208 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37209 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv));
37213 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37214 LDKUpdateFailMalformedHTLC this_ptr_conv;
37215 this_ptr_conv.inner = untag_ptr(this_ptr);
37216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37218 this_ptr_conv.is_owned = false;
37219 LDKThirtyTwoBytes val_ref;
37220 CHECK((*env)->GetArrayLength(env, val) == 32);
37221 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37222 UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref);
37225 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37226 LDKUpdateFailMalformedHTLC this_ptr_conv;
37227 this_ptr_conv.inner = untag_ptr(this_ptr);
37228 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37229 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37230 this_ptr_conv.is_owned = false;
37231 int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
37235 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37236 LDKUpdateFailMalformedHTLC this_ptr_conv;
37237 this_ptr_conv.inner = untag_ptr(this_ptr);
37238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37240 this_ptr_conv.is_owned = false;
37241 UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
37244 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr) {
37245 LDKUpdateFailMalformedHTLC this_ptr_conv;
37246 this_ptr_conv.inner = untag_ptr(this_ptr);
37247 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37248 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37249 this_ptr_conv.is_owned = false;
37250 int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
37254 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
37255 LDKUpdateFailMalformedHTLC this_ptr_conv;
37256 this_ptr_conv.inner = untag_ptr(this_ptr);
37257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37259 this_ptr_conv.is_owned = false;
37260 UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
37263 static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) {
37264 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg);
37265 int64_t ret_ref = 0;
37266 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37267 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37270 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37271 LDKUpdateFailMalformedHTLC arg_conv;
37272 arg_conv.inner = untag_ptr(arg);
37273 arg_conv.is_owned = ptr_is_owned(arg);
37274 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37275 arg_conv.is_owned = false;
37276 int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv);
37280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37281 LDKUpdateFailMalformedHTLC orig_conv;
37282 orig_conv.inner = untag_ptr(orig);
37283 orig_conv.is_owned = ptr_is_owned(orig);
37284 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37285 orig_conv.is_owned = false;
37286 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
37287 int64_t ret_ref = 0;
37288 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37289 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37293 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37294 LDKUpdateFailMalformedHTLC a_conv;
37295 a_conv.inner = untag_ptr(a);
37296 a_conv.is_owned = ptr_is_owned(a);
37297 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37298 a_conv.is_owned = false;
37299 LDKUpdateFailMalformedHTLC b_conv;
37300 b_conv.inner = untag_ptr(b);
37301 b_conv.is_owned = ptr_is_owned(b);
37302 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37303 b_conv.is_owned = false;
37304 jboolean ret_conv = UpdateFailMalformedHTLC_eq(&a_conv, &b_conv);
37308 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37309 LDKCommitmentSigned this_obj_conv;
37310 this_obj_conv.inner = untag_ptr(this_obj);
37311 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37313 CommitmentSigned_free(this_obj_conv);
37316 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37317 LDKCommitmentSigned this_ptr_conv;
37318 this_ptr_conv.inner = untag_ptr(this_ptr);
37319 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37321 this_ptr_conv.is_owned = false;
37322 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37323 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv));
37327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37328 LDKCommitmentSigned this_ptr_conv;
37329 this_ptr_conv.inner = untag_ptr(this_ptr);
37330 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37332 this_ptr_conv.is_owned = false;
37333 LDKThirtyTwoBytes val_ref;
37334 CHECK((*env)->GetArrayLength(env, val) == 32);
37335 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37336 CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref);
37339 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
37340 LDKCommitmentSigned this_ptr_conv;
37341 this_ptr_conv.inner = untag_ptr(this_ptr);
37342 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37344 this_ptr_conv.is_owned = false;
37345 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
37346 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form);
37350 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37351 LDKCommitmentSigned this_ptr_conv;
37352 this_ptr_conv.inner = untag_ptr(this_ptr);
37353 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37354 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37355 this_ptr_conv.is_owned = false;
37356 LDKSignature val_ref;
37357 CHECK((*env)->GetArrayLength(env, val) == 64);
37358 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
37359 CommitmentSigned_set_signature(&this_ptr_conv, val_ref);
37362 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr) {
37363 LDKCommitmentSigned this_ptr_conv;
37364 this_ptr_conv.inner = untag_ptr(this_ptr);
37365 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37367 this_ptr_conv.is_owned = false;
37368 LDKCVec_SignatureZ ret_var = CommitmentSigned_get_htlc_signatures(&this_ptr_conv);
37369 jobjectArray ret_arr = NULL;
37370 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
37372 for (size_t i = 0; i < ret_var.datalen; i++) {
37373 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
37374 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
37375 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
37378 FREE(ret_var.data);
37382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
37383 LDKCommitmentSigned this_ptr_conv;
37384 this_ptr_conv.inner = untag_ptr(this_ptr);
37385 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37386 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37387 this_ptr_conv.is_owned = false;
37388 LDKCVec_SignatureZ val_constr;
37389 val_constr.datalen = (*env)->GetArrayLength(env, val);
37390 if (val_constr.datalen > 0)
37391 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
37393 val_constr.data = NULL;
37394 for (size_t i = 0; i < val_constr.datalen; i++) {
37395 int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
37396 LDKSignature val_conv_8_ref;
37397 CHECK((*env)->GetArrayLength(env, val_conv_8) == 64);
37398 (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form);
37399 val_constr.data[i] = val_conv_8_ref;
37401 CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
37404 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) {
37405 LDKThirtyTwoBytes channel_id_arg_ref;
37406 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
37407 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
37408 LDKSignature signature_arg_ref;
37409 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
37410 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
37411 LDKCVec_SignatureZ htlc_signatures_arg_constr;
37412 htlc_signatures_arg_constr.datalen = (*env)->GetArrayLength(env, htlc_signatures_arg);
37413 if (htlc_signatures_arg_constr.datalen > 0)
37414 htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
37416 htlc_signatures_arg_constr.data = NULL;
37417 for (size_t i = 0; i < htlc_signatures_arg_constr.datalen; i++) {
37418 int8_tArray htlc_signatures_arg_conv_8 = (*env)->GetObjectArrayElement(env, htlc_signatures_arg, i);
37419 LDKSignature htlc_signatures_arg_conv_8_ref;
37420 CHECK((*env)->GetArrayLength(env, htlc_signatures_arg_conv_8) == 64);
37421 (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form);
37422 htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref;
37424 LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
37425 int64_t ret_ref = 0;
37426 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37427 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37431 static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) {
37432 LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg);
37433 int64_t ret_ref = 0;
37434 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37435 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37438 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37439 LDKCommitmentSigned arg_conv;
37440 arg_conv.inner = untag_ptr(arg);
37441 arg_conv.is_owned = ptr_is_owned(arg);
37442 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37443 arg_conv.is_owned = false;
37444 int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv);
37448 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37449 LDKCommitmentSigned orig_conv;
37450 orig_conv.inner = untag_ptr(orig);
37451 orig_conv.is_owned = ptr_is_owned(orig);
37452 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37453 orig_conv.is_owned = false;
37454 LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
37455 int64_t ret_ref = 0;
37456 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37457 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37461 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37462 LDKCommitmentSigned a_conv;
37463 a_conv.inner = untag_ptr(a);
37464 a_conv.is_owned = ptr_is_owned(a);
37465 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37466 a_conv.is_owned = false;
37467 LDKCommitmentSigned b_conv;
37468 b_conv.inner = untag_ptr(b);
37469 b_conv.is_owned = ptr_is_owned(b);
37470 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37471 b_conv.is_owned = false;
37472 jboolean ret_conv = CommitmentSigned_eq(&a_conv, &b_conv);
37476 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37477 LDKRevokeAndACK this_obj_conv;
37478 this_obj_conv.inner = untag_ptr(this_obj);
37479 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37480 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37481 RevokeAndACK_free(this_obj_conv);
37484 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37485 LDKRevokeAndACK this_ptr_conv;
37486 this_ptr_conv.inner = untag_ptr(this_ptr);
37487 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37488 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37489 this_ptr_conv.is_owned = false;
37490 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37491 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv));
37495 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37496 LDKRevokeAndACK this_ptr_conv;
37497 this_ptr_conv.inner = untag_ptr(this_ptr);
37498 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37499 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37500 this_ptr_conv.is_owned = false;
37501 LDKThirtyTwoBytes val_ref;
37502 CHECK((*env)->GetArrayLength(env, val) == 32);
37503 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37504 RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref);
37507 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) {
37508 LDKRevokeAndACK this_ptr_conv;
37509 this_ptr_conv.inner = untag_ptr(this_ptr);
37510 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37511 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37512 this_ptr_conv.is_owned = false;
37513 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37514 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv));
37518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37519 LDKRevokeAndACK this_ptr_conv;
37520 this_ptr_conv.inner = untag_ptr(this_ptr);
37521 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37523 this_ptr_conv.is_owned = false;
37524 LDKThirtyTwoBytes val_ref;
37525 CHECK((*env)->GetArrayLength(env, val) == 32);
37526 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37527 RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref);
37530 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
37531 LDKRevokeAndACK this_ptr_conv;
37532 this_ptr_conv.inner = untag_ptr(this_ptr);
37533 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37534 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37535 this_ptr_conv.is_owned = false;
37536 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37537 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
37541 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) {
37542 LDKRevokeAndACK this_ptr_conv;
37543 this_ptr_conv.inner = untag_ptr(this_ptr);
37544 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37545 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37546 this_ptr_conv.is_owned = false;
37547 LDKPublicKey val_ref;
37548 CHECK((*env)->GetArrayLength(env, val) == 33);
37549 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37550 RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref);
37553 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) {
37554 LDKThirtyTwoBytes channel_id_arg_ref;
37555 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
37556 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
37557 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
37558 CHECK((*env)->GetArrayLength(env, per_commitment_secret_arg) == 32);
37559 (*env)->GetByteArrayRegion(env, per_commitment_secret_arg, 0, 32, per_commitment_secret_arg_ref.data);
37560 LDKPublicKey next_per_commitment_point_arg_ref;
37561 CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
37562 (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
37563 LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
37564 int64_t ret_ref = 0;
37565 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37566 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37570 static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) {
37571 LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg);
37572 int64_t ret_ref = 0;
37573 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37574 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37577 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37578 LDKRevokeAndACK arg_conv;
37579 arg_conv.inner = untag_ptr(arg);
37580 arg_conv.is_owned = ptr_is_owned(arg);
37581 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37582 arg_conv.is_owned = false;
37583 int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv);
37587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37588 LDKRevokeAndACK orig_conv;
37589 orig_conv.inner = untag_ptr(orig);
37590 orig_conv.is_owned = ptr_is_owned(orig);
37591 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37592 orig_conv.is_owned = false;
37593 LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
37594 int64_t ret_ref = 0;
37595 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37596 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37600 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37601 LDKRevokeAndACK a_conv;
37602 a_conv.inner = untag_ptr(a);
37603 a_conv.is_owned = ptr_is_owned(a);
37604 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37605 a_conv.is_owned = false;
37606 LDKRevokeAndACK b_conv;
37607 b_conv.inner = untag_ptr(b);
37608 b_conv.is_owned = ptr_is_owned(b);
37609 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37610 b_conv.is_owned = false;
37611 jboolean ret_conv = RevokeAndACK_eq(&a_conv, &b_conv);
37615 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37616 LDKUpdateFee this_obj_conv;
37617 this_obj_conv.inner = untag_ptr(this_obj);
37618 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37619 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37620 UpdateFee_free(this_obj_conv);
37623 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37624 LDKUpdateFee this_ptr_conv;
37625 this_ptr_conv.inner = untag_ptr(this_ptr);
37626 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37627 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37628 this_ptr_conv.is_owned = false;
37629 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37630 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv));
37634 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37635 LDKUpdateFee this_ptr_conv;
37636 this_ptr_conv.inner = untag_ptr(this_ptr);
37637 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37638 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37639 this_ptr_conv.is_owned = false;
37640 LDKThirtyTwoBytes val_ref;
37641 CHECK((*env)->GetArrayLength(env, val) == 32);
37642 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37643 UpdateFee_set_channel_id(&this_ptr_conv, val_ref);
37646 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) {
37647 LDKUpdateFee this_ptr_conv;
37648 this_ptr_conv.inner = untag_ptr(this_ptr);
37649 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37650 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37651 this_ptr_conv.is_owned = false;
37652 int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
37656 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
37657 LDKUpdateFee this_ptr_conv;
37658 this_ptr_conv.inner = untag_ptr(this_ptr);
37659 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37661 this_ptr_conv.is_owned = false;
37662 UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
37665 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) {
37666 LDKThirtyTwoBytes channel_id_arg_ref;
37667 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
37668 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
37669 LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
37670 int64_t ret_ref = 0;
37671 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37672 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37676 static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) {
37677 LDKUpdateFee ret_var = UpdateFee_clone(arg);
37678 int64_t ret_ref = 0;
37679 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37680 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37684 LDKUpdateFee arg_conv;
37685 arg_conv.inner = untag_ptr(arg);
37686 arg_conv.is_owned = ptr_is_owned(arg);
37687 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37688 arg_conv.is_owned = false;
37689 int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv);
37693 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37694 LDKUpdateFee orig_conv;
37695 orig_conv.inner = untag_ptr(orig);
37696 orig_conv.is_owned = ptr_is_owned(orig);
37697 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37698 orig_conv.is_owned = false;
37699 LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
37700 int64_t ret_ref = 0;
37701 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37702 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37706 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37707 LDKUpdateFee a_conv;
37708 a_conv.inner = untag_ptr(a);
37709 a_conv.is_owned = ptr_is_owned(a);
37710 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37711 a_conv.is_owned = false;
37712 LDKUpdateFee b_conv;
37713 b_conv.inner = untag_ptr(b);
37714 b_conv.is_owned = ptr_is_owned(b);
37715 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37716 b_conv.is_owned = false;
37717 jboolean ret_conv = UpdateFee_eq(&a_conv, &b_conv);
37721 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37722 LDKDataLossProtect this_obj_conv;
37723 this_obj_conv.inner = untag_ptr(this_obj);
37724 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37725 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37726 DataLossProtect_free(this_obj_conv);
37729 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) {
37730 LDKDataLossProtect this_ptr_conv;
37731 this_ptr_conv.inner = untag_ptr(this_ptr);
37732 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37734 this_ptr_conv.is_owned = false;
37735 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37736 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv));
37740 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) {
37741 LDKDataLossProtect this_ptr_conv;
37742 this_ptr_conv.inner = untag_ptr(this_ptr);
37743 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37745 this_ptr_conv.is_owned = false;
37746 LDKThirtyTwoBytes val_ref;
37747 CHECK((*env)->GetArrayLength(env, val) == 32);
37748 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37749 DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref);
37752 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
37753 LDKDataLossProtect 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 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37759 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form);
37763 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) {
37764 LDKDataLossProtect this_ptr_conv;
37765 this_ptr_conv.inner = untag_ptr(this_ptr);
37766 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37767 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37768 this_ptr_conv.is_owned = false;
37769 LDKPublicKey val_ref;
37770 CHECK((*env)->GetArrayLength(env, val) == 33);
37771 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37772 DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref);
37775 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) {
37776 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
37777 CHECK((*env)->GetArrayLength(env, your_last_per_commitment_secret_arg) == 32);
37778 (*env)->GetByteArrayRegion(env, your_last_per_commitment_secret_arg, 0, 32, your_last_per_commitment_secret_arg_ref.data);
37779 LDKPublicKey my_current_per_commitment_point_arg_ref;
37780 CHECK((*env)->GetArrayLength(env, my_current_per_commitment_point_arg) == 33);
37781 (*env)->GetByteArrayRegion(env, my_current_per_commitment_point_arg, 0, 33, my_current_per_commitment_point_arg_ref.compressed_form);
37782 LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
37783 int64_t ret_ref = 0;
37784 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37785 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37789 static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) {
37790 LDKDataLossProtect ret_var = DataLossProtect_clone(arg);
37791 int64_t ret_ref = 0;
37792 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37793 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37796 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37797 LDKDataLossProtect arg_conv;
37798 arg_conv.inner = untag_ptr(arg);
37799 arg_conv.is_owned = ptr_is_owned(arg);
37800 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37801 arg_conv.is_owned = false;
37802 int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv);
37806 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37807 LDKDataLossProtect orig_conv;
37808 orig_conv.inner = untag_ptr(orig);
37809 orig_conv.is_owned = ptr_is_owned(orig);
37810 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37811 orig_conv.is_owned = false;
37812 LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
37813 int64_t ret_ref = 0;
37814 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37815 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37819 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37820 LDKDataLossProtect a_conv;
37821 a_conv.inner = untag_ptr(a);
37822 a_conv.is_owned = ptr_is_owned(a);
37823 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37824 a_conv.is_owned = false;
37825 LDKDataLossProtect b_conv;
37826 b_conv.inner = untag_ptr(b);
37827 b_conv.is_owned = ptr_is_owned(b);
37828 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37829 b_conv.is_owned = false;
37830 jboolean ret_conv = DataLossProtect_eq(&a_conv, &b_conv);
37834 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37835 LDKChannelReestablish this_obj_conv;
37836 this_obj_conv.inner = untag_ptr(this_obj);
37837 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37839 ChannelReestablish_free(this_obj_conv);
37842 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37843 LDKChannelReestablish this_ptr_conv;
37844 this_ptr_conv.inner = untag_ptr(this_ptr);
37845 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37846 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37847 this_ptr_conv.is_owned = false;
37848 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37849 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv));
37853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37854 LDKChannelReestablish this_ptr_conv;
37855 this_ptr_conv.inner = untag_ptr(this_ptr);
37856 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37858 this_ptr_conv.is_owned = false;
37859 LDKThirtyTwoBytes val_ref;
37860 CHECK((*env)->GetArrayLength(env, val) == 32);
37861 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37862 ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref);
37865 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) {
37866 LDKChannelReestablish this_ptr_conv;
37867 this_ptr_conv.inner = untag_ptr(this_ptr);
37868 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37869 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37870 this_ptr_conv.is_owned = false;
37871 int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
37875 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) {
37876 LDKChannelReestablish this_ptr_conv;
37877 this_ptr_conv.inner = untag_ptr(this_ptr);
37878 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37880 this_ptr_conv.is_owned = false;
37881 ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
37884 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) {
37885 LDKChannelReestablish this_ptr_conv;
37886 this_ptr_conv.inner = untag_ptr(this_ptr);
37887 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37888 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37889 this_ptr_conv.is_owned = false;
37890 int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
37894 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) {
37895 LDKChannelReestablish this_ptr_conv;
37896 this_ptr_conv.inner = untag_ptr(this_ptr);
37897 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37899 this_ptr_conv.is_owned = false;
37900 ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
37903 static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) {
37904 LDKChannelReestablish ret_var = ChannelReestablish_clone(arg);
37905 int64_t ret_ref = 0;
37906 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37907 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37910 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37911 LDKChannelReestablish arg_conv;
37912 arg_conv.inner = untag_ptr(arg);
37913 arg_conv.is_owned = ptr_is_owned(arg);
37914 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37915 arg_conv.is_owned = false;
37916 int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv);
37920 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37921 LDKChannelReestablish orig_conv;
37922 orig_conv.inner = untag_ptr(orig);
37923 orig_conv.is_owned = ptr_is_owned(orig);
37924 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37925 orig_conv.is_owned = false;
37926 LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
37927 int64_t ret_ref = 0;
37928 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37929 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37933 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37934 LDKChannelReestablish a_conv;
37935 a_conv.inner = untag_ptr(a);
37936 a_conv.is_owned = ptr_is_owned(a);
37937 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37938 a_conv.is_owned = false;
37939 LDKChannelReestablish b_conv;
37940 b_conv.inner = untag_ptr(b);
37941 b_conv.is_owned = ptr_is_owned(b);
37942 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37943 b_conv.is_owned = false;
37944 jboolean ret_conv = ChannelReestablish_eq(&a_conv, &b_conv);
37948 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37949 LDKAnnouncementSignatures this_obj_conv;
37950 this_obj_conv.inner = untag_ptr(this_obj);
37951 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37953 AnnouncementSignatures_free(this_obj_conv);
37956 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37957 LDKAnnouncementSignatures this_ptr_conv;
37958 this_ptr_conv.inner = untag_ptr(this_ptr);
37959 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37961 this_ptr_conv.is_owned = false;
37962 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37963 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv));
37967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37968 LDKAnnouncementSignatures this_ptr_conv;
37969 this_ptr_conv.inner = untag_ptr(this_ptr);
37970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37972 this_ptr_conv.is_owned = false;
37973 LDKThirtyTwoBytes val_ref;
37974 CHECK((*env)->GetArrayLength(env, val) == 32);
37975 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37976 AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref);
37979 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37980 LDKAnnouncementSignatures this_ptr_conv;
37981 this_ptr_conv.inner = untag_ptr(this_ptr);
37982 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37984 this_ptr_conv.is_owned = false;
37985 int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
37989 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37990 LDKAnnouncementSignatures this_ptr_conv;
37991 this_ptr_conv.inner = untag_ptr(this_ptr);
37992 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37994 this_ptr_conv.is_owned = false;
37995 AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
37998 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
37999 LDKAnnouncementSignatures this_ptr_conv;
38000 this_ptr_conv.inner = untag_ptr(this_ptr);
38001 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38003 this_ptr_conv.is_owned = false;
38004 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38005 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form);
38009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38010 LDKAnnouncementSignatures this_ptr_conv;
38011 this_ptr_conv.inner = untag_ptr(this_ptr);
38012 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38014 this_ptr_conv.is_owned = false;
38015 LDKSignature val_ref;
38016 CHECK((*env)->GetArrayLength(env, val) == 64);
38017 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38018 AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref);
38021 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
38022 LDKAnnouncementSignatures this_ptr_conv;
38023 this_ptr_conv.inner = untag_ptr(this_ptr);
38024 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38025 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38026 this_ptr_conv.is_owned = false;
38027 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38028 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form);
38032 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38033 LDKAnnouncementSignatures this_ptr_conv;
38034 this_ptr_conv.inner = untag_ptr(this_ptr);
38035 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38037 this_ptr_conv.is_owned = false;
38038 LDKSignature val_ref;
38039 CHECK((*env)->GetArrayLength(env, val) == 64);
38040 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38041 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref);
38044 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) {
38045 LDKThirtyTwoBytes channel_id_arg_ref;
38046 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
38047 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
38048 LDKSignature node_signature_arg_ref;
38049 CHECK((*env)->GetArrayLength(env, node_signature_arg) == 64);
38050 (*env)->GetByteArrayRegion(env, node_signature_arg, 0, 64, node_signature_arg_ref.compact_form);
38051 LDKSignature bitcoin_signature_arg_ref;
38052 CHECK((*env)->GetArrayLength(env, bitcoin_signature_arg) == 64);
38053 (*env)->GetByteArrayRegion(env, bitcoin_signature_arg, 0, 64, bitcoin_signature_arg_ref.compact_form);
38054 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
38055 int64_t ret_ref = 0;
38056 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38057 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38061 static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) {
38062 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg);
38063 int64_t ret_ref = 0;
38064 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38065 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38068 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38069 LDKAnnouncementSignatures arg_conv;
38070 arg_conv.inner = untag_ptr(arg);
38071 arg_conv.is_owned = ptr_is_owned(arg);
38072 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38073 arg_conv.is_owned = false;
38074 int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv);
38078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38079 LDKAnnouncementSignatures orig_conv;
38080 orig_conv.inner = untag_ptr(orig);
38081 orig_conv.is_owned = ptr_is_owned(orig);
38082 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38083 orig_conv.is_owned = false;
38084 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
38085 int64_t ret_ref = 0;
38086 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38087 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38091 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38092 LDKAnnouncementSignatures a_conv;
38093 a_conv.inner = untag_ptr(a);
38094 a_conv.is_owned = ptr_is_owned(a);
38095 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38096 a_conv.is_owned = false;
38097 LDKAnnouncementSignatures b_conv;
38098 b_conv.inner = untag_ptr(b);
38099 b_conv.is_owned = ptr_is_owned(b);
38100 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38101 b_conv.is_owned = false;
38102 jboolean ret_conv = AnnouncementSignatures_eq(&a_conv, &b_conv);
38106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
38107 if (!ptr_is_owned(this_ptr)) return;
38108 void* this_ptr_ptr = untag_ptr(this_ptr);
38109 CHECK_ACCESS(this_ptr_ptr);
38110 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
38111 FREE(untag_ptr(this_ptr));
38112 NetAddress_free(this_ptr_conv);
38115 static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) {
38116 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38117 *ret_copy = NetAddress_clone(arg);
38118 int64_t ret_ref = tag_ptr(ret_copy, true);
38121 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38122 LDKNetAddress* arg_conv = (LDKNetAddress*)untag_ptr(arg);
38123 int64_t ret_conv = NetAddress_clone_ptr(arg_conv);
38127 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38128 LDKNetAddress* orig_conv = (LDKNetAddress*)untag_ptr(orig);
38129 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38130 *ret_copy = NetAddress_clone(orig_conv);
38131 int64_t ret_ref = tag_ptr(ret_copy, true);
38135 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
38136 LDKFourBytes addr_ref;
38137 CHECK((*env)->GetArrayLength(env, addr) == 4);
38138 (*env)->GetByteArrayRegion(env, addr, 0, 4, addr_ref.data);
38139 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38140 *ret_copy = NetAddress_ipv4(addr_ref, port);
38141 int64_t ret_ref = tag_ptr(ret_copy, true);
38145 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
38146 LDKSixteenBytes addr_ref;
38147 CHECK((*env)->GetArrayLength(env, addr) == 16);
38148 (*env)->GetByteArrayRegion(env, addr, 0, 16, addr_ref.data);
38149 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38150 *ret_copy = NetAddress_ipv6(addr_ref, port);
38151 int64_t ret_ref = tag_ptr(ret_copy, true);
38155 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray a) {
38156 LDKTwelveBytes a_ref;
38157 CHECK((*env)->GetArrayLength(env, a) == 12);
38158 (*env)->GetByteArrayRegion(env, a, 0, 12, a_ref.data);
38159 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38160 *ret_copy = NetAddress_onion_v2(a_ref);
38161 int64_t ret_ref = tag_ptr(ret_copy, true);
38165 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) {
38166 LDKThirtyTwoBytes ed25519_pubkey_ref;
38167 CHECK((*env)->GetArrayLength(env, ed25519_pubkey) == 32);
38168 (*env)->GetByteArrayRegion(env, ed25519_pubkey, 0, 32, ed25519_pubkey_ref.data);
38169 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38170 *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
38171 int64_t ret_ref = tag_ptr(ret_copy, true);
38175 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1hostname(JNIEnv *env, jclass clz, int64_t hostname, int16_t port) {
38176 LDKHostname hostname_conv;
38177 hostname_conv.inner = untag_ptr(hostname);
38178 hostname_conv.is_owned = ptr_is_owned(hostname);
38179 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_conv);
38180 hostname_conv = Hostname_clone(&hostname_conv);
38181 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38182 *ret_copy = NetAddress_hostname(hostname_conv, port);
38183 int64_t ret_ref = tag_ptr(ret_copy, true);
38187 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetAddress_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38188 LDKNetAddress* a_conv = (LDKNetAddress*)untag_ptr(a);
38189 LDKNetAddress* b_conv = (LDKNetAddress*)untag_ptr(b);
38190 jboolean ret_conv = NetAddress_eq(a_conv, b_conv);
38194 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) {
38195 LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
38196 LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
38197 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38198 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38199 CVec_u8Z_free(ret_var);
38203 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
38204 LDKu8slice ser_ref;
38205 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
38206 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
38207 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
38208 *ret_conv = NetAddress_read(ser_ref);
38209 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
38210 return tag_ptr(ret_conv, true);
38213 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
38214 if (!ptr_is_owned(this_ptr)) return;
38215 void* this_ptr_ptr = untag_ptr(this_ptr);
38216 CHECK_ACCESS(this_ptr_ptr);
38217 LDKUnsignedGossipMessage this_ptr_conv = *(LDKUnsignedGossipMessage*)(this_ptr_ptr);
38218 FREE(untag_ptr(this_ptr));
38219 UnsignedGossipMessage_free(this_ptr_conv);
38222 static inline uint64_t UnsignedGossipMessage_clone_ptr(LDKUnsignedGossipMessage *NONNULL_PTR arg) {
38223 LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
38224 *ret_copy = UnsignedGossipMessage_clone(arg);
38225 int64_t ret_ref = tag_ptr(ret_copy, true);
38228 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38229 LDKUnsignedGossipMessage* arg_conv = (LDKUnsignedGossipMessage*)untag_ptr(arg);
38230 int64_t ret_conv = UnsignedGossipMessage_clone_ptr(arg_conv);
38234 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38235 LDKUnsignedGossipMessage* orig_conv = (LDKUnsignedGossipMessage*)untag_ptr(orig);
38236 LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
38237 *ret_copy = UnsignedGossipMessage_clone(orig_conv);
38238 int64_t ret_ref = tag_ptr(ret_copy, true);
38242 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1channel_1announcement(JNIEnv *env, jclass clz, int64_t a) {
38243 LDKUnsignedChannelAnnouncement a_conv;
38244 a_conv.inner = untag_ptr(a);
38245 a_conv.is_owned = ptr_is_owned(a);
38246 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38247 a_conv = UnsignedChannelAnnouncement_clone(&a_conv);
38248 LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
38249 *ret_copy = UnsignedGossipMessage_channel_announcement(a_conv);
38250 int64_t ret_ref = tag_ptr(ret_copy, true);
38254 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1channel_1update(JNIEnv *env, jclass clz, int64_t a) {
38255 LDKUnsignedChannelUpdate a_conv;
38256 a_conv.inner = untag_ptr(a);
38257 a_conv.is_owned = ptr_is_owned(a);
38258 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38259 a_conv = UnsignedChannelUpdate_clone(&a_conv);
38260 LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
38261 *ret_copy = UnsignedGossipMessage_channel_update(a_conv);
38262 int64_t ret_ref = tag_ptr(ret_copy, true);
38266 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1node_1announcement(JNIEnv *env, jclass clz, int64_t a) {
38267 LDKUnsignedNodeAnnouncement a_conv;
38268 a_conv.inner = untag_ptr(a);
38269 a_conv.is_owned = ptr_is_owned(a);
38270 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38271 a_conv = UnsignedNodeAnnouncement_clone(&a_conv);
38272 LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
38273 *ret_copy = UnsignedGossipMessage_node_announcement(a_conv);
38274 int64_t ret_ref = tag_ptr(ret_copy, true);
38278 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
38279 LDKUnsignedGossipMessage* obj_conv = (LDKUnsignedGossipMessage*)untag_ptr(obj);
38280 LDKCVec_u8Z ret_var = UnsignedGossipMessage_write(obj_conv);
38281 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38282 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38283 CVec_u8Z_free(ret_var);
38287 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38288 LDKUnsignedNodeAnnouncement this_obj_conv;
38289 this_obj_conv.inner = untag_ptr(this_obj);
38290 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38291 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38292 UnsignedNodeAnnouncement_free(this_obj_conv);
38295 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
38296 LDKUnsignedNodeAnnouncement this_ptr_conv;
38297 this_ptr_conv.inner = untag_ptr(this_ptr);
38298 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38300 this_ptr_conv.is_owned = false;
38301 LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
38302 int64_t ret_ref = 0;
38303 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38304 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38308 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38309 LDKUnsignedNodeAnnouncement this_ptr_conv;
38310 this_ptr_conv.inner = untag_ptr(this_ptr);
38311 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38313 this_ptr_conv.is_owned = false;
38314 LDKNodeFeatures val_conv;
38315 val_conv.inner = untag_ptr(val);
38316 val_conv.is_owned = ptr_is_owned(val);
38317 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38318 val_conv = NodeFeatures_clone(&val_conv);
38319 UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv);
38322 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
38323 LDKUnsignedNodeAnnouncement this_ptr_conv;
38324 this_ptr_conv.inner = untag_ptr(this_ptr);
38325 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38326 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38327 this_ptr_conv.is_owned = false;
38328 int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
38332 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
38333 LDKUnsignedNodeAnnouncement this_ptr_conv;
38334 this_ptr_conv.inner = untag_ptr(this_ptr);
38335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38337 this_ptr_conv.is_owned = false;
38338 UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
38341 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
38342 LDKUnsignedNodeAnnouncement this_ptr_conv;
38343 this_ptr_conv.inner = untag_ptr(this_ptr);
38344 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38345 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38346 this_ptr_conv.is_owned = false;
38347 LDKNodeId ret_var = UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv);
38348 int64_t ret_ref = 0;
38349 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38350 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38354 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38355 LDKUnsignedNodeAnnouncement this_ptr_conv;
38356 this_ptr_conv.inner = untag_ptr(this_ptr);
38357 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38358 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38359 this_ptr_conv.is_owned = false;
38360 LDKNodeId val_conv;
38361 val_conv.inner = untag_ptr(val);
38362 val_conv.is_owned = ptr_is_owned(val);
38363 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38364 val_conv = NodeId_clone(&val_conv);
38365 UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_conv);
38368 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) {
38369 LDKUnsignedNodeAnnouncement this_ptr_conv;
38370 this_ptr_conv.inner = untag_ptr(this_ptr);
38371 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38373 this_ptr_conv.is_owned = false;
38374 int8_tArray ret_arr = (*env)->NewByteArray(env, 3);
38375 (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv));
38379 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38380 LDKUnsignedNodeAnnouncement this_ptr_conv;
38381 this_ptr_conv.inner = untag_ptr(this_ptr);
38382 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38384 this_ptr_conv.is_owned = false;
38385 LDKThreeBytes val_ref;
38386 CHECK((*env)->GetArrayLength(env, val) == 3);
38387 (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data);
38388 UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref);
38391 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
38392 LDKUnsignedNodeAnnouncement this_ptr_conv;
38393 this_ptr_conv.inner = untag_ptr(this_ptr);
38394 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38396 this_ptr_conv.is_owned = false;
38397 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
38398 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv));
38402 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38403 LDKUnsignedNodeAnnouncement this_ptr_conv;
38404 this_ptr_conv.inner = untag_ptr(this_ptr);
38405 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38407 this_ptr_conv.is_owned = false;
38408 LDKThirtyTwoBytes val_ref;
38409 CHECK((*env)->GetArrayLength(env, val) == 32);
38410 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
38411 UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref);
38414 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) {
38415 LDKUnsignedNodeAnnouncement this_ptr_conv;
38416 this_ptr_conv.inner = untag_ptr(this_ptr);
38417 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38419 this_ptr_conv.is_owned = false;
38420 LDKCVec_NetAddressZ ret_var = UnsignedNodeAnnouncement_get_addresses(&this_ptr_conv);
38421 int64_tArray ret_arr = NULL;
38422 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
38423 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
38424 for (size_t m = 0; m < ret_var.datalen; m++) {
38425 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38426 *ret_conv_12_copy = ret_var.data[m];
38427 int64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
38428 ret_arr_ptr[m] = ret_conv_12_ref;
38430 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
38431 FREE(ret_var.data);
38435 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
38436 LDKUnsignedNodeAnnouncement this_ptr_conv;
38437 this_ptr_conv.inner = untag_ptr(this_ptr);
38438 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38440 this_ptr_conv.is_owned = false;
38441 LDKCVec_NetAddressZ val_constr;
38442 val_constr.datalen = (*env)->GetArrayLength(env, val);
38443 if (val_constr.datalen > 0)
38444 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
38446 val_constr.data = NULL;
38447 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
38448 for (size_t m = 0; m < val_constr.datalen; m++) {
38449 int64_t val_conv_12 = val_vals[m];
38450 void* val_conv_12_ptr = untag_ptr(val_conv_12);
38451 CHECK_ACCESS(val_conv_12_ptr);
38452 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
38453 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
38454 val_constr.data[m] = val_conv_12_conv;
38456 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
38457 UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
38460 static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) {
38461 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg);
38462 int64_t ret_ref = 0;
38463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38467 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38468 LDKUnsignedNodeAnnouncement arg_conv;
38469 arg_conv.inner = untag_ptr(arg);
38470 arg_conv.is_owned = ptr_is_owned(arg);
38471 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38472 arg_conv.is_owned = false;
38473 int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv);
38477 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38478 LDKUnsignedNodeAnnouncement orig_conv;
38479 orig_conv.inner = untag_ptr(orig);
38480 orig_conv.is_owned = ptr_is_owned(orig);
38481 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38482 orig_conv.is_owned = false;
38483 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
38484 int64_t ret_ref = 0;
38485 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38486 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38490 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38491 LDKUnsignedNodeAnnouncement a_conv;
38492 a_conv.inner = untag_ptr(a);
38493 a_conv.is_owned = ptr_is_owned(a);
38494 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38495 a_conv.is_owned = false;
38496 LDKUnsignedNodeAnnouncement b_conv;
38497 b_conv.inner = untag_ptr(b);
38498 b_conv.is_owned = ptr_is_owned(b);
38499 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38500 b_conv.is_owned = false;
38501 jboolean ret_conv = UnsignedNodeAnnouncement_eq(&a_conv, &b_conv);
38505 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38506 LDKNodeAnnouncement this_obj_conv;
38507 this_obj_conv.inner = untag_ptr(this_obj);
38508 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38509 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38510 NodeAnnouncement_free(this_obj_conv);
38513 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
38514 LDKNodeAnnouncement this_ptr_conv;
38515 this_ptr_conv.inner = untag_ptr(this_ptr);
38516 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38518 this_ptr_conv.is_owned = false;
38519 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38520 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form);
38524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38525 LDKNodeAnnouncement this_ptr_conv;
38526 this_ptr_conv.inner = untag_ptr(this_ptr);
38527 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38528 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38529 this_ptr_conv.is_owned = false;
38530 LDKSignature val_ref;
38531 CHECK((*env)->GetArrayLength(env, val) == 64);
38532 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38533 NodeAnnouncement_set_signature(&this_ptr_conv, val_ref);
38536 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
38537 LDKNodeAnnouncement this_ptr_conv;
38538 this_ptr_conv.inner = untag_ptr(this_ptr);
38539 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38541 this_ptr_conv.is_owned = false;
38542 LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
38543 int64_t ret_ref = 0;
38544 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38545 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38549 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38550 LDKNodeAnnouncement this_ptr_conv;
38551 this_ptr_conv.inner = untag_ptr(this_ptr);
38552 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38553 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38554 this_ptr_conv.is_owned = false;
38555 LDKUnsignedNodeAnnouncement val_conv;
38556 val_conv.inner = untag_ptr(val);
38557 val_conv.is_owned = ptr_is_owned(val);
38558 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38559 val_conv = UnsignedNodeAnnouncement_clone(&val_conv);
38560 NodeAnnouncement_set_contents(&this_ptr_conv, val_conv);
38563 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) {
38564 LDKSignature signature_arg_ref;
38565 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
38566 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
38567 LDKUnsignedNodeAnnouncement contents_arg_conv;
38568 contents_arg_conv.inner = untag_ptr(contents_arg);
38569 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
38570 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
38571 contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
38572 LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv);
38573 int64_t ret_ref = 0;
38574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38579 static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) {
38580 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg);
38581 int64_t ret_ref = 0;
38582 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38583 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38587 LDKNodeAnnouncement arg_conv;
38588 arg_conv.inner = untag_ptr(arg);
38589 arg_conv.is_owned = ptr_is_owned(arg);
38590 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38591 arg_conv.is_owned = false;
38592 int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv);
38596 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38597 LDKNodeAnnouncement orig_conv;
38598 orig_conv.inner = untag_ptr(orig);
38599 orig_conv.is_owned = ptr_is_owned(orig);
38600 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38601 orig_conv.is_owned = false;
38602 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
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 jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38610 LDKNodeAnnouncement a_conv;
38611 a_conv.inner = untag_ptr(a);
38612 a_conv.is_owned = ptr_is_owned(a);
38613 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38614 a_conv.is_owned = false;
38615 LDKNodeAnnouncement b_conv;
38616 b_conv.inner = untag_ptr(b);
38617 b_conv.is_owned = ptr_is_owned(b);
38618 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38619 b_conv.is_owned = false;
38620 jboolean ret_conv = NodeAnnouncement_eq(&a_conv, &b_conv);
38624 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38625 LDKUnsignedChannelAnnouncement this_obj_conv;
38626 this_obj_conv.inner = untag_ptr(this_obj);
38627 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38628 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38629 UnsignedChannelAnnouncement_free(this_obj_conv);
38632 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
38633 LDKUnsignedChannelAnnouncement this_ptr_conv;
38634 this_ptr_conv.inner = untag_ptr(this_ptr);
38635 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38637 this_ptr_conv.is_owned = false;
38638 LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
38639 int64_t ret_ref = 0;
38640 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38641 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38645 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38646 LDKUnsignedChannelAnnouncement this_ptr_conv;
38647 this_ptr_conv.inner = untag_ptr(this_ptr);
38648 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38649 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38650 this_ptr_conv.is_owned = false;
38651 LDKChannelFeatures val_conv;
38652 val_conv.inner = untag_ptr(val);
38653 val_conv.is_owned = ptr_is_owned(val);
38654 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38655 val_conv = ChannelFeatures_clone(&val_conv);
38656 UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv);
38659 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
38660 LDKUnsignedChannelAnnouncement this_ptr_conv;
38661 this_ptr_conv.inner = untag_ptr(this_ptr);
38662 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38664 this_ptr_conv.is_owned = false;
38665 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
38666 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv));
38670 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38671 LDKUnsignedChannelAnnouncement this_ptr_conv;
38672 this_ptr_conv.inner = untag_ptr(this_ptr);
38673 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38675 this_ptr_conv.is_owned = false;
38676 LDKThirtyTwoBytes val_ref;
38677 CHECK((*env)->GetArrayLength(env, val) == 32);
38678 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
38679 UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref);
38682 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
38683 LDKUnsignedChannelAnnouncement this_ptr_conv;
38684 this_ptr_conv.inner = untag_ptr(this_ptr);
38685 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38687 this_ptr_conv.is_owned = false;
38688 int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
38692 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38693 LDKUnsignedChannelAnnouncement this_ptr_conv;
38694 this_ptr_conv.inner = untag_ptr(this_ptr);
38695 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38697 this_ptr_conv.is_owned = false;
38698 UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
38701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
38702 LDKUnsignedChannelAnnouncement this_ptr_conv;
38703 this_ptr_conv.inner = untag_ptr(this_ptr);
38704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38706 this_ptr_conv.is_owned = false;
38707 LDKNodeId ret_var = UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv);
38708 int64_t ret_ref = 0;
38709 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38710 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38714 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38715 LDKUnsignedChannelAnnouncement this_ptr_conv;
38716 this_ptr_conv.inner = untag_ptr(this_ptr);
38717 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38719 this_ptr_conv.is_owned = false;
38720 LDKNodeId val_conv;
38721 val_conv.inner = untag_ptr(val);
38722 val_conv.is_owned = ptr_is_owned(val);
38723 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38724 val_conv = NodeId_clone(&val_conv);
38725 UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_conv);
38728 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
38729 LDKUnsignedChannelAnnouncement this_ptr_conv;
38730 this_ptr_conv.inner = untag_ptr(this_ptr);
38731 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38732 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38733 this_ptr_conv.is_owned = false;
38734 LDKNodeId ret_var = UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv);
38735 int64_t ret_ref = 0;
38736 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38737 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38742 LDKUnsignedChannelAnnouncement this_ptr_conv;
38743 this_ptr_conv.inner = untag_ptr(this_ptr);
38744 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38746 this_ptr_conv.is_owned = false;
38747 LDKNodeId val_conv;
38748 val_conv.inner = untag_ptr(val);
38749 val_conv.is_owned = ptr_is_owned(val);
38750 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38751 val_conv = NodeId_clone(&val_conv);
38752 UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_conv);
38755 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
38756 LDKUnsignedChannelAnnouncement this_ptr_conv;
38757 this_ptr_conv.inner = untag_ptr(this_ptr);
38758 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38760 this_ptr_conv.is_owned = false;
38761 LDKNodeId ret_var = UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv);
38762 int64_t ret_ref = 0;
38763 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38764 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38768 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38769 LDKUnsignedChannelAnnouncement this_ptr_conv;
38770 this_ptr_conv.inner = untag_ptr(this_ptr);
38771 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38773 this_ptr_conv.is_owned = false;
38774 LDKNodeId val_conv;
38775 val_conv.inner = untag_ptr(val);
38776 val_conv.is_owned = ptr_is_owned(val);
38777 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38778 val_conv = NodeId_clone(&val_conv);
38779 UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_conv);
38782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
38783 LDKUnsignedChannelAnnouncement this_ptr_conv;
38784 this_ptr_conv.inner = untag_ptr(this_ptr);
38785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38787 this_ptr_conv.is_owned = false;
38788 LDKNodeId ret_var = UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv);
38789 int64_t ret_ref = 0;
38790 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38791 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38795 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38796 LDKUnsignedChannelAnnouncement this_ptr_conv;
38797 this_ptr_conv.inner = untag_ptr(this_ptr);
38798 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38800 this_ptr_conv.is_owned = false;
38801 LDKNodeId val_conv;
38802 val_conv.inner = untag_ptr(val);
38803 val_conv.is_owned = ptr_is_owned(val);
38804 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38805 val_conv = NodeId_clone(&val_conv);
38806 UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_conv);
38809 static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
38810 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg);
38811 int64_t ret_ref = 0;
38812 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38813 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38816 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38817 LDKUnsignedChannelAnnouncement arg_conv;
38818 arg_conv.inner = untag_ptr(arg);
38819 arg_conv.is_owned = ptr_is_owned(arg);
38820 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38821 arg_conv.is_owned = false;
38822 int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv);
38826 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38827 LDKUnsignedChannelAnnouncement orig_conv;
38828 orig_conv.inner = untag_ptr(orig);
38829 orig_conv.is_owned = ptr_is_owned(orig);
38830 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38831 orig_conv.is_owned = false;
38832 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_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 jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38840 LDKUnsignedChannelAnnouncement a_conv;
38841 a_conv.inner = untag_ptr(a);
38842 a_conv.is_owned = ptr_is_owned(a);
38843 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38844 a_conv.is_owned = false;
38845 LDKUnsignedChannelAnnouncement b_conv;
38846 b_conv.inner = untag_ptr(b);
38847 b_conv.is_owned = ptr_is_owned(b);
38848 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38849 b_conv.is_owned = false;
38850 jboolean ret_conv = UnsignedChannelAnnouncement_eq(&a_conv, &b_conv);
38854 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38855 LDKChannelAnnouncement this_obj_conv;
38856 this_obj_conv.inner = untag_ptr(this_obj);
38857 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38859 ChannelAnnouncement_free(this_obj_conv);
38862 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
38863 LDKChannelAnnouncement this_ptr_conv;
38864 this_ptr_conv.inner = untag_ptr(this_ptr);
38865 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38867 this_ptr_conv.is_owned = false;
38868 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38869 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form);
38873 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38874 LDKChannelAnnouncement this_ptr_conv;
38875 this_ptr_conv.inner = untag_ptr(this_ptr);
38876 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38877 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38878 this_ptr_conv.is_owned = false;
38879 LDKSignature val_ref;
38880 CHECK((*env)->GetArrayLength(env, val) == 64);
38881 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38882 ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref);
38885 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
38886 LDKChannelAnnouncement this_ptr_conv;
38887 this_ptr_conv.inner = untag_ptr(this_ptr);
38888 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38890 this_ptr_conv.is_owned = false;
38891 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38892 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form);
38896 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38897 LDKChannelAnnouncement this_ptr_conv;
38898 this_ptr_conv.inner = untag_ptr(this_ptr);
38899 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38900 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38901 this_ptr_conv.is_owned = false;
38902 LDKSignature val_ref;
38903 CHECK((*env)->GetArrayLength(env, val) == 64);
38904 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38905 ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref);
38908 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
38909 LDKChannelAnnouncement this_ptr_conv;
38910 this_ptr_conv.inner = untag_ptr(this_ptr);
38911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38913 this_ptr_conv.is_owned = false;
38914 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38915 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form);
38919 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38920 LDKChannelAnnouncement this_ptr_conv;
38921 this_ptr_conv.inner = untag_ptr(this_ptr);
38922 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38924 this_ptr_conv.is_owned = false;
38925 LDKSignature val_ref;
38926 CHECK((*env)->GetArrayLength(env, val) == 64);
38927 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38928 ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref);
38931 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
38932 LDKChannelAnnouncement this_ptr_conv;
38933 this_ptr_conv.inner = untag_ptr(this_ptr);
38934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38936 this_ptr_conv.is_owned = false;
38937 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38938 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form);
38942 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38943 LDKChannelAnnouncement this_ptr_conv;
38944 this_ptr_conv.inner = untag_ptr(this_ptr);
38945 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38946 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38947 this_ptr_conv.is_owned = false;
38948 LDKSignature val_ref;
38949 CHECK((*env)->GetArrayLength(env, val) == 64);
38950 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38951 ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref);
38954 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
38955 LDKChannelAnnouncement this_ptr_conv;
38956 this_ptr_conv.inner = untag_ptr(this_ptr);
38957 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38959 this_ptr_conv.is_owned = false;
38960 LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
38961 int64_t ret_ref = 0;
38962 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38963 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38968 LDKChannelAnnouncement this_ptr_conv;
38969 this_ptr_conv.inner = untag_ptr(this_ptr);
38970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38972 this_ptr_conv.is_owned = false;
38973 LDKUnsignedChannelAnnouncement val_conv;
38974 val_conv.inner = untag_ptr(val);
38975 val_conv.is_owned = ptr_is_owned(val);
38976 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38977 val_conv = UnsignedChannelAnnouncement_clone(&val_conv);
38978 ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv);
38981 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) {
38982 LDKSignature node_signature_1_arg_ref;
38983 CHECK((*env)->GetArrayLength(env, node_signature_1_arg) == 64);
38984 (*env)->GetByteArrayRegion(env, node_signature_1_arg, 0, 64, node_signature_1_arg_ref.compact_form);
38985 LDKSignature node_signature_2_arg_ref;
38986 CHECK((*env)->GetArrayLength(env, node_signature_2_arg) == 64);
38987 (*env)->GetByteArrayRegion(env, node_signature_2_arg, 0, 64, node_signature_2_arg_ref.compact_form);
38988 LDKSignature bitcoin_signature_1_arg_ref;
38989 CHECK((*env)->GetArrayLength(env, bitcoin_signature_1_arg) == 64);
38990 (*env)->GetByteArrayRegion(env, bitcoin_signature_1_arg, 0, 64, bitcoin_signature_1_arg_ref.compact_form);
38991 LDKSignature bitcoin_signature_2_arg_ref;
38992 CHECK((*env)->GetArrayLength(env, bitcoin_signature_2_arg) == 64);
38993 (*env)->GetByteArrayRegion(env, bitcoin_signature_2_arg, 0, 64, bitcoin_signature_2_arg_ref.compact_form);
38994 LDKUnsignedChannelAnnouncement contents_arg_conv;
38995 contents_arg_conv.inner = untag_ptr(contents_arg);
38996 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
38997 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
38998 contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
38999 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);
39000 int64_t ret_ref = 0;
39001 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39002 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39006 static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) {
39007 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg);
39008 int64_t ret_ref = 0;
39009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39013 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39014 LDKChannelAnnouncement arg_conv;
39015 arg_conv.inner = untag_ptr(arg);
39016 arg_conv.is_owned = ptr_is_owned(arg);
39017 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39018 arg_conv.is_owned = false;
39019 int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv);
39023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39024 LDKChannelAnnouncement orig_conv;
39025 orig_conv.inner = untag_ptr(orig);
39026 orig_conv.is_owned = ptr_is_owned(orig);
39027 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39028 orig_conv.is_owned = false;
39029 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
39030 int64_t ret_ref = 0;
39031 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39032 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39036 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39037 LDKChannelAnnouncement a_conv;
39038 a_conv.inner = untag_ptr(a);
39039 a_conv.is_owned = ptr_is_owned(a);
39040 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39041 a_conv.is_owned = false;
39042 LDKChannelAnnouncement b_conv;
39043 b_conv.inner = untag_ptr(b);
39044 b_conv.is_owned = ptr_is_owned(b);
39045 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39046 b_conv.is_owned = false;
39047 jboolean ret_conv = ChannelAnnouncement_eq(&a_conv, &b_conv);
39051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39052 LDKUnsignedChannelUpdate this_obj_conv;
39053 this_obj_conv.inner = untag_ptr(this_obj);
39054 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39056 UnsignedChannelUpdate_free(this_obj_conv);
39059 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
39060 LDKUnsignedChannelUpdate this_ptr_conv;
39061 this_ptr_conv.inner = untag_ptr(this_ptr);
39062 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39064 this_ptr_conv.is_owned = false;
39065 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39066 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv));
39070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39071 LDKUnsignedChannelUpdate this_ptr_conv;
39072 this_ptr_conv.inner = untag_ptr(this_ptr);
39073 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39074 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39075 this_ptr_conv.is_owned = false;
39076 LDKThirtyTwoBytes val_ref;
39077 CHECK((*env)->GetArrayLength(env, val) == 32);
39078 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
39079 UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref);
39082 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
39083 LDKUnsignedChannelUpdate this_ptr_conv;
39084 this_ptr_conv.inner = untag_ptr(this_ptr);
39085 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39087 this_ptr_conv.is_owned = false;
39088 int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
39092 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39093 LDKUnsignedChannelUpdate this_ptr_conv;
39094 this_ptr_conv.inner = untag_ptr(this_ptr);
39095 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39096 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39097 this_ptr_conv.is_owned = false;
39098 UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
39101 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
39102 LDKUnsignedChannelUpdate this_ptr_conv;
39103 this_ptr_conv.inner = untag_ptr(this_ptr);
39104 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39105 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39106 this_ptr_conv.is_owned = false;
39107 int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
39111 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39112 LDKUnsignedChannelUpdate this_ptr_conv;
39113 this_ptr_conv.inner = untag_ptr(this_ptr);
39114 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39116 this_ptr_conv.is_owned = false;
39117 UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
39120 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) {
39121 LDKUnsignedChannelUpdate this_ptr_conv;
39122 this_ptr_conv.inner = untag_ptr(this_ptr);
39123 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39125 this_ptr_conv.is_owned = false;
39126 int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
39130 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
39131 LDKUnsignedChannelUpdate this_ptr_conv;
39132 this_ptr_conv.inner = untag_ptr(this_ptr);
39133 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39134 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39135 this_ptr_conv.is_owned = false;
39136 UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
39139 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
39140 LDKUnsignedChannelUpdate this_ptr_conv;
39141 this_ptr_conv.inner = untag_ptr(this_ptr);
39142 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39144 this_ptr_conv.is_owned = false;
39145 int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
39149 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
39150 LDKUnsignedChannelUpdate this_ptr_conv;
39151 this_ptr_conv.inner = untag_ptr(this_ptr);
39152 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39153 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39154 this_ptr_conv.is_owned = false;
39155 UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
39158 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
39159 LDKUnsignedChannelUpdate this_ptr_conv;
39160 this_ptr_conv.inner = untag_ptr(this_ptr);
39161 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39162 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39163 this_ptr_conv.is_owned = false;
39164 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
39168 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39169 LDKUnsignedChannelUpdate this_ptr_conv;
39170 this_ptr_conv.inner = untag_ptr(this_ptr);
39171 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39172 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39173 this_ptr_conv.is_owned = false;
39174 UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
39177 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
39178 LDKUnsignedChannelUpdate this_ptr_conv;
39179 this_ptr_conv.inner = untag_ptr(this_ptr);
39180 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39181 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39182 this_ptr_conv.is_owned = false;
39183 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv);
39187 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39188 LDKUnsignedChannelUpdate this_ptr_conv;
39189 this_ptr_conv.inner = untag_ptr(this_ptr);
39190 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39192 this_ptr_conv.is_owned = false;
39193 UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val);
39196 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
39197 LDKUnsignedChannelUpdate this_ptr_conv;
39198 this_ptr_conv.inner = untag_ptr(this_ptr);
39199 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39201 this_ptr_conv.is_owned = false;
39202 int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
39206 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39207 LDKUnsignedChannelUpdate this_ptr_conv;
39208 this_ptr_conv.inner = untag_ptr(this_ptr);
39209 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39211 this_ptr_conv.is_owned = false;
39212 UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
39215 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
39216 LDKUnsignedChannelUpdate this_ptr_conv;
39217 this_ptr_conv.inner = untag_ptr(this_ptr);
39218 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39220 this_ptr_conv.is_owned = false;
39221 int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
39225 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39226 LDKUnsignedChannelUpdate this_ptr_conv;
39227 this_ptr_conv.inner = untag_ptr(this_ptr);
39228 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39229 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39230 this_ptr_conv.is_owned = false;
39231 UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
39234 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1excess_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
39235 LDKUnsignedChannelUpdate this_ptr_conv;
39236 this_ptr_conv.inner = untag_ptr(this_ptr);
39237 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39238 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39239 this_ptr_conv.is_owned = false;
39240 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_conv);
39241 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39242 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39243 CVec_u8Z_free(ret_var);
39247 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1excess_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39248 LDKUnsignedChannelUpdate this_ptr_conv;
39249 this_ptr_conv.inner = untag_ptr(this_ptr);
39250 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39251 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39252 this_ptr_conv.is_owned = false;
39253 LDKCVec_u8Z val_ref;
39254 val_ref.datalen = (*env)->GetArrayLength(env, val);
39255 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
39256 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
39257 UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref);
39260 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) {
39261 LDKThirtyTwoBytes chain_hash_arg_ref;
39262 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
39263 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
39264 LDKCVec_u8Z excess_data_arg_ref;
39265 excess_data_arg_ref.datalen = (*env)->GetArrayLength(env, excess_data_arg);
39266 excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes");
39267 (*env)->GetByteArrayRegion(env, excess_data_arg, 0, excess_data_arg_ref.datalen, excess_data_arg_ref.data);
39268 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);
39269 int64_t ret_ref = 0;
39270 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39271 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39275 static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) {
39276 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg);
39277 int64_t ret_ref = 0;
39278 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39279 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39282 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39283 LDKUnsignedChannelUpdate arg_conv;
39284 arg_conv.inner = untag_ptr(arg);
39285 arg_conv.is_owned = ptr_is_owned(arg);
39286 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39287 arg_conv.is_owned = false;
39288 int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv);
39292 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39293 LDKUnsignedChannelUpdate orig_conv;
39294 orig_conv.inner = untag_ptr(orig);
39295 orig_conv.is_owned = ptr_is_owned(orig);
39296 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39297 orig_conv.is_owned = false;
39298 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
39299 int64_t ret_ref = 0;
39300 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39301 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39305 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39306 LDKUnsignedChannelUpdate a_conv;
39307 a_conv.inner = untag_ptr(a);
39308 a_conv.is_owned = ptr_is_owned(a);
39309 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39310 a_conv.is_owned = false;
39311 LDKUnsignedChannelUpdate b_conv;
39312 b_conv.inner = untag_ptr(b);
39313 b_conv.is_owned = ptr_is_owned(b);
39314 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39315 b_conv.is_owned = false;
39316 jboolean ret_conv = UnsignedChannelUpdate_eq(&a_conv, &b_conv);
39320 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39321 LDKChannelUpdate this_obj_conv;
39322 this_obj_conv.inner = untag_ptr(this_obj);
39323 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39325 ChannelUpdate_free(this_obj_conv);
39328 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
39329 LDKChannelUpdate this_ptr_conv;
39330 this_ptr_conv.inner = untag_ptr(this_ptr);
39331 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39332 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39333 this_ptr_conv.is_owned = false;
39334 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
39335 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form);
39339 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39340 LDKChannelUpdate this_ptr_conv;
39341 this_ptr_conv.inner = untag_ptr(this_ptr);
39342 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39344 this_ptr_conv.is_owned = false;
39345 LDKSignature val_ref;
39346 CHECK((*env)->GetArrayLength(env, val) == 64);
39347 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
39348 ChannelUpdate_set_signature(&this_ptr_conv, val_ref);
39351 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
39352 LDKChannelUpdate this_ptr_conv;
39353 this_ptr_conv.inner = untag_ptr(this_ptr);
39354 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39355 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39356 this_ptr_conv.is_owned = false;
39357 LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
39358 int64_t ret_ref = 0;
39359 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39360 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39364 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39365 LDKChannelUpdate this_ptr_conv;
39366 this_ptr_conv.inner = untag_ptr(this_ptr);
39367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39369 this_ptr_conv.is_owned = false;
39370 LDKUnsignedChannelUpdate val_conv;
39371 val_conv.inner = untag_ptr(val);
39372 val_conv.is_owned = ptr_is_owned(val);
39373 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39374 val_conv = UnsignedChannelUpdate_clone(&val_conv);
39375 ChannelUpdate_set_contents(&this_ptr_conv, val_conv);
39378 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) {
39379 LDKSignature signature_arg_ref;
39380 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
39381 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
39382 LDKUnsignedChannelUpdate contents_arg_conv;
39383 contents_arg_conv.inner = untag_ptr(contents_arg);
39384 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
39385 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
39386 contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
39387 LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv);
39388 int64_t ret_ref = 0;
39389 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39390 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39394 static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) {
39395 LDKChannelUpdate ret_var = ChannelUpdate_clone(arg);
39396 int64_t ret_ref = 0;
39397 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39398 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39401 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39402 LDKChannelUpdate arg_conv;
39403 arg_conv.inner = untag_ptr(arg);
39404 arg_conv.is_owned = ptr_is_owned(arg);
39405 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39406 arg_conv.is_owned = false;
39407 int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv);
39411 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39412 LDKChannelUpdate orig_conv;
39413 orig_conv.inner = untag_ptr(orig);
39414 orig_conv.is_owned = ptr_is_owned(orig);
39415 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39416 orig_conv.is_owned = false;
39417 LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
39418 int64_t ret_ref = 0;
39419 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39420 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39424 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39425 LDKChannelUpdate a_conv;
39426 a_conv.inner = untag_ptr(a);
39427 a_conv.is_owned = ptr_is_owned(a);
39428 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39429 a_conv.is_owned = false;
39430 LDKChannelUpdate b_conv;
39431 b_conv.inner = untag_ptr(b);
39432 b_conv.is_owned = ptr_is_owned(b);
39433 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39434 b_conv.is_owned = false;
39435 jboolean ret_conv = ChannelUpdate_eq(&a_conv, &b_conv);
39439 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39440 LDKQueryChannelRange this_obj_conv;
39441 this_obj_conv.inner = untag_ptr(this_obj);
39442 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39444 QueryChannelRange_free(this_obj_conv);
39447 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
39448 LDKQueryChannelRange this_ptr_conv;
39449 this_ptr_conv.inner = untag_ptr(this_ptr);
39450 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39452 this_ptr_conv.is_owned = false;
39453 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39454 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv));
39458 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39459 LDKQueryChannelRange this_ptr_conv;
39460 this_ptr_conv.inner = untag_ptr(this_ptr);
39461 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39463 this_ptr_conv.is_owned = false;
39464 LDKThirtyTwoBytes val_ref;
39465 CHECK((*env)->GetArrayLength(env, val) == 32);
39466 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
39467 QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
39470 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) {
39471 LDKQueryChannelRange this_ptr_conv;
39472 this_ptr_conv.inner = untag_ptr(this_ptr);
39473 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39474 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39475 this_ptr_conv.is_owned = false;
39476 int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
39480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39481 LDKQueryChannelRange this_ptr_conv;
39482 this_ptr_conv.inner = untag_ptr(this_ptr);
39483 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39485 this_ptr_conv.is_owned = false;
39486 QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
39489 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) {
39490 LDKQueryChannelRange this_ptr_conv;
39491 this_ptr_conv.inner = untag_ptr(this_ptr);
39492 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39494 this_ptr_conv.is_owned = false;
39495 int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
39499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39500 LDKQueryChannelRange this_ptr_conv;
39501 this_ptr_conv.inner = untag_ptr(this_ptr);
39502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39504 this_ptr_conv.is_owned = false;
39505 QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
39508 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) {
39509 LDKThirtyTwoBytes chain_hash_arg_ref;
39510 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
39511 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
39512 LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
39513 int64_t ret_ref = 0;
39514 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39515 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39519 static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) {
39520 LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg);
39521 int64_t ret_ref = 0;
39522 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39523 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39527 LDKQueryChannelRange arg_conv;
39528 arg_conv.inner = untag_ptr(arg);
39529 arg_conv.is_owned = ptr_is_owned(arg);
39530 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39531 arg_conv.is_owned = false;
39532 int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv);
39536 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39537 LDKQueryChannelRange orig_conv;
39538 orig_conv.inner = untag_ptr(orig);
39539 orig_conv.is_owned = ptr_is_owned(orig);
39540 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39541 orig_conv.is_owned = false;
39542 LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
39543 int64_t ret_ref = 0;
39544 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39545 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39549 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39550 LDKQueryChannelRange a_conv;
39551 a_conv.inner = untag_ptr(a);
39552 a_conv.is_owned = ptr_is_owned(a);
39553 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39554 a_conv.is_owned = false;
39555 LDKQueryChannelRange b_conv;
39556 b_conv.inner = untag_ptr(b);
39557 b_conv.is_owned = ptr_is_owned(b);
39558 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39559 b_conv.is_owned = false;
39560 jboolean ret_conv = QueryChannelRange_eq(&a_conv, &b_conv);
39564 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39565 LDKReplyChannelRange this_obj_conv;
39566 this_obj_conv.inner = untag_ptr(this_obj);
39567 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39568 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39569 ReplyChannelRange_free(this_obj_conv);
39572 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
39573 LDKReplyChannelRange this_ptr_conv;
39574 this_ptr_conv.inner = untag_ptr(this_ptr);
39575 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39577 this_ptr_conv.is_owned = false;
39578 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39579 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv));
39583 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39584 LDKReplyChannelRange this_ptr_conv;
39585 this_ptr_conv.inner = untag_ptr(this_ptr);
39586 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39587 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39588 this_ptr_conv.is_owned = false;
39589 LDKThirtyTwoBytes val_ref;
39590 CHECK((*env)->GetArrayLength(env, val) == 32);
39591 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
39592 ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
39595 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) {
39596 LDKReplyChannelRange this_ptr_conv;
39597 this_ptr_conv.inner = untag_ptr(this_ptr);
39598 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39600 this_ptr_conv.is_owned = false;
39601 int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
39605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39606 LDKReplyChannelRange this_ptr_conv;
39607 this_ptr_conv.inner = untag_ptr(this_ptr);
39608 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39609 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39610 this_ptr_conv.is_owned = false;
39611 ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
39614 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) {
39615 LDKReplyChannelRange this_ptr_conv;
39616 this_ptr_conv.inner = untag_ptr(this_ptr);
39617 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39618 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39619 this_ptr_conv.is_owned = false;
39620 int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
39624 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39625 LDKReplyChannelRange this_ptr_conv;
39626 this_ptr_conv.inner = untag_ptr(this_ptr);
39627 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39628 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39629 this_ptr_conv.is_owned = false;
39630 ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
39633 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr) {
39634 LDKReplyChannelRange this_ptr_conv;
39635 this_ptr_conv.inner = untag_ptr(this_ptr);
39636 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39638 this_ptr_conv.is_owned = false;
39639 jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv);
39643 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
39644 LDKReplyChannelRange this_ptr_conv;
39645 this_ptr_conv.inner = untag_ptr(this_ptr);
39646 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39648 this_ptr_conv.is_owned = false;
39649 ReplyChannelRange_set_sync_complete(&this_ptr_conv, val);
39652 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr) {
39653 LDKReplyChannelRange this_ptr_conv;
39654 this_ptr_conv.inner = untag_ptr(this_ptr);
39655 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39657 this_ptr_conv.is_owned = false;
39658 LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv);
39659 int64_tArray ret_arr = NULL;
39660 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
39661 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
39662 for (size_t g = 0; g < ret_var.datalen; g++) {
39663 int64_t ret_conv_6_conv = ret_var.data[g];
39664 ret_arr_ptr[g] = ret_conv_6_conv;
39666 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
39667 FREE(ret_var.data);
39671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
39672 LDKReplyChannelRange this_ptr_conv;
39673 this_ptr_conv.inner = untag_ptr(this_ptr);
39674 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39676 this_ptr_conv.is_owned = false;
39677 LDKCVec_u64Z val_constr;
39678 val_constr.datalen = (*env)->GetArrayLength(env, val);
39679 if (val_constr.datalen > 0)
39680 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39682 val_constr.data = NULL;
39683 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
39684 for (size_t g = 0; g < val_constr.datalen; g++) {
39685 int64_t val_conv_6 = val_vals[g];
39686 val_constr.data[g] = val_conv_6;
39688 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
39689 ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
39692 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) {
39693 LDKThirtyTwoBytes chain_hash_arg_ref;
39694 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
39695 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
39696 LDKCVec_u64Z short_channel_ids_arg_constr;
39697 short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg);
39698 if (short_channel_ids_arg_constr.datalen > 0)
39699 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39701 short_channel_ids_arg_constr.data = NULL;
39702 int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL);
39703 for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) {
39704 int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g];
39705 short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6;
39707 (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
39708 LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
39709 int64_t ret_ref = 0;
39710 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39711 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39715 static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) {
39716 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg);
39717 int64_t ret_ref = 0;
39718 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39719 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39722 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39723 LDKReplyChannelRange arg_conv;
39724 arg_conv.inner = untag_ptr(arg);
39725 arg_conv.is_owned = ptr_is_owned(arg);
39726 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39727 arg_conv.is_owned = false;
39728 int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv);
39732 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39733 LDKReplyChannelRange orig_conv;
39734 orig_conv.inner = untag_ptr(orig);
39735 orig_conv.is_owned = ptr_is_owned(orig);
39736 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39737 orig_conv.is_owned = false;
39738 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
39739 int64_t ret_ref = 0;
39740 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39741 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39745 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39746 LDKReplyChannelRange a_conv;
39747 a_conv.inner = untag_ptr(a);
39748 a_conv.is_owned = ptr_is_owned(a);
39749 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39750 a_conv.is_owned = false;
39751 LDKReplyChannelRange b_conv;
39752 b_conv.inner = untag_ptr(b);
39753 b_conv.is_owned = ptr_is_owned(b);
39754 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39755 b_conv.is_owned = false;
39756 jboolean ret_conv = ReplyChannelRange_eq(&a_conv, &b_conv);
39760 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39761 LDKQueryShortChannelIds this_obj_conv;
39762 this_obj_conv.inner = untag_ptr(this_obj);
39763 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39765 QueryShortChannelIds_free(this_obj_conv);
39768 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
39769 LDKQueryShortChannelIds this_ptr_conv;
39770 this_ptr_conv.inner = untag_ptr(this_ptr);
39771 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39773 this_ptr_conv.is_owned = false;
39774 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39775 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv));
39779 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39780 LDKQueryShortChannelIds this_ptr_conv;
39781 this_ptr_conv.inner = untag_ptr(this_ptr);
39782 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39784 this_ptr_conv.is_owned = false;
39785 LDKThirtyTwoBytes val_ref;
39786 CHECK((*env)->GetArrayLength(env, val) == 32);
39787 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
39788 QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref);
39791 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr) {
39792 LDKQueryShortChannelIds this_ptr_conv;
39793 this_ptr_conv.inner = untag_ptr(this_ptr);
39794 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39796 this_ptr_conv.is_owned = false;
39797 LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv);
39798 int64_tArray ret_arr = NULL;
39799 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
39800 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
39801 for (size_t g = 0; g < ret_var.datalen; g++) {
39802 int64_t ret_conv_6_conv = ret_var.data[g];
39803 ret_arr_ptr[g] = ret_conv_6_conv;
39805 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
39806 FREE(ret_var.data);
39810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
39811 LDKQueryShortChannelIds this_ptr_conv;
39812 this_ptr_conv.inner = untag_ptr(this_ptr);
39813 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39815 this_ptr_conv.is_owned = false;
39816 LDKCVec_u64Z val_constr;
39817 val_constr.datalen = (*env)->GetArrayLength(env, val);
39818 if (val_constr.datalen > 0)
39819 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39821 val_constr.data = NULL;
39822 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
39823 for (size_t g = 0; g < val_constr.datalen; g++) {
39824 int64_t val_conv_6 = val_vals[g];
39825 val_constr.data[g] = val_conv_6;
39827 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
39828 QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
39831 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) {
39832 LDKThirtyTwoBytes chain_hash_arg_ref;
39833 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
39834 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
39835 LDKCVec_u64Z short_channel_ids_arg_constr;
39836 short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg);
39837 if (short_channel_ids_arg_constr.datalen > 0)
39838 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39840 short_channel_ids_arg_constr.data = NULL;
39841 int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL);
39842 for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) {
39843 int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g];
39844 short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6;
39846 (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
39847 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
39848 int64_t ret_ref = 0;
39849 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39850 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39854 static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) {
39855 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg);
39856 int64_t ret_ref = 0;
39857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39858 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39861 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39862 LDKQueryShortChannelIds arg_conv;
39863 arg_conv.inner = untag_ptr(arg);
39864 arg_conv.is_owned = ptr_is_owned(arg);
39865 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39866 arg_conv.is_owned = false;
39867 int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv);
39871 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39872 LDKQueryShortChannelIds orig_conv;
39873 orig_conv.inner = untag_ptr(orig);
39874 orig_conv.is_owned = ptr_is_owned(orig);
39875 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39876 orig_conv.is_owned = false;
39877 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
39878 int64_t ret_ref = 0;
39879 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39880 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39884 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39885 LDKQueryShortChannelIds a_conv;
39886 a_conv.inner = untag_ptr(a);
39887 a_conv.is_owned = ptr_is_owned(a);
39888 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39889 a_conv.is_owned = false;
39890 LDKQueryShortChannelIds b_conv;
39891 b_conv.inner = untag_ptr(b);
39892 b_conv.is_owned = ptr_is_owned(b);
39893 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39894 b_conv.is_owned = false;
39895 jboolean ret_conv = QueryShortChannelIds_eq(&a_conv, &b_conv);
39899 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39900 LDKReplyShortChannelIdsEnd this_obj_conv;
39901 this_obj_conv.inner = untag_ptr(this_obj);
39902 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39904 ReplyShortChannelIdsEnd_free(this_obj_conv);
39907 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
39908 LDKReplyShortChannelIdsEnd this_ptr_conv;
39909 this_ptr_conv.inner = untag_ptr(this_ptr);
39910 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39911 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39912 this_ptr_conv.is_owned = false;
39913 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39914 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv));
39918 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39919 LDKReplyShortChannelIdsEnd this_ptr_conv;
39920 this_ptr_conv.inner = untag_ptr(this_ptr);
39921 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39922 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39923 this_ptr_conv.is_owned = false;
39924 LDKThirtyTwoBytes val_ref;
39925 CHECK((*env)->GetArrayLength(env, val) == 32);
39926 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
39927 ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref);
39930 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr) {
39931 LDKReplyShortChannelIdsEnd this_ptr_conv;
39932 this_ptr_conv.inner = untag_ptr(this_ptr);
39933 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39935 this_ptr_conv.is_owned = false;
39936 jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
39940 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
39941 LDKReplyShortChannelIdsEnd this_ptr_conv;
39942 this_ptr_conv.inner = untag_ptr(this_ptr);
39943 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39945 this_ptr_conv.is_owned = false;
39946 ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
39949 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, jboolean full_information_arg) {
39950 LDKThirtyTwoBytes chain_hash_arg_ref;
39951 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
39952 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
39953 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
39954 int64_t ret_ref = 0;
39955 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39956 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39960 static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) {
39961 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg);
39962 int64_t ret_ref = 0;
39963 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39964 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39967 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39968 LDKReplyShortChannelIdsEnd arg_conv;
39969 arg_conv.inner = untag_ptr(arg);
39970 arg_conv.is_owned = ptr_is_owned(arg);
39971 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39972 arg_conv.is_owned = false;
39973 int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv);
39977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39978 LDKReplyShortChannelIdsEnd orig_conv;
39979 orig_conv.inner = untag_ptr(orig);
39980 orig_conv.is_owned = ptr_is_owned(orig);
39981 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39982 orig_conv.is_owned = false;
39983 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
39984 int64_t ret_ref = 0;
39985 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39986 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39990 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39991 LDKReplyShortChannelIdsEnd a_conv;
39992 a_conv.inner = untag_ptr(a);
39993 a_conv.is_owned = ptr_is_owned(a);
39994 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39995 a_conv.is_owned = false;
39996 LDKReplyShortChannelIdsEnd b_conv;
39997 b_conv.inner = untag_ptr(b);
39998 b_conv.is_owned = ptr_is_owned(b);
39999 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40000 b_conv.is_owned = false;
40001 jboolean ret_conv = ReplyShortChannelIdsEnd_eq(&a_conv, &b_conv);
40005 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40006 LDKGossipTimestampFilter this_obj_conv;
40007 this_obj_conv.inner = untag_ptr(this_obj);
40008 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40010 GossipTimestampFilter_free(this_obj_conv);
40013 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
40014 LDKGossipTimestampFilter this_ptr_conv;
40015 this_ptr_conv.inner = untag_ptr(this_ptr);
40016 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40017 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40018 this_ptr_conv.is_owned = false;
40019 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
40020 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv));
40024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40025 LDKGossipTimestampFilter this_ptr_conv;
40026 this_ptr_conv.inner = untag_ptr(this_ptr);
40027 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40029 this_ptr_conv.is_owned = false;
40030 LDKThirtyTwoBytes val_ref;
40031 CHECK((*env)->GetArrayLength(env, val) == 32);
40032 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
40033 GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref);
40036 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
40037 LDKGossipTimestampFilter this_ptr_conv;
40038 this_ptr_conv.inner = untag_ptr(this_ptr);
40039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40041 this_ptr_conv.is_owned = false;
40042 int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
40046 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
40047 LDKGossipTimestampFilter this_ptr_conv;
40048 this_ptr_conv.inner = untag_ptr(this_ptr);
40049 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40050 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40051 this_ptr_conv.is_owned = false;
40052 GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
40055 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr) {
40056 LDKGossipTimestampFilter this_ptr_conv;
40057 this_ptr_conv.inner = untag_ptr(this_ptr);
40058 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40060 this_ptr_conv.is_owned = false;
40061 int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
40065 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
40066 LDKGossipTimestampFilter this_ptr_conv;
40067 this_ptr_conv.inner = untag_ptr(this_ptr);
40068 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40070 this_ptr_conv.is_owned = false;
40071 GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
40074 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) {
40075 LDKThirtyTwoBytes chain_hash_arg_ref;
40076 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
40077 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
40078 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
40079 int64_t ret_ref = 0;
40080 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40081 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40085 static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) {
40086 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg);
40087 int64_t ret_ref = 0;
40088 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40089 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40092 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40093 LDKGossipTimestampFilter arg_conv;
40094 arg_conv.inner = untag_ptr(arg);
40095 arg_conv.is_owned = ptr_is_owned(arg);
40096 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40097 arg_conv.is_owned = false;
40098 int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv);
40102 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40103 LDKGossipTimestampFilter orig_conv;
40104 orig_conv.inner = untag_ptr(orig);
40105 orig_conv.is_owned = ptr_is_owned(orig);
40106 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40107 orig_conv.is_owned = false;
40108 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv);
40109 int64_t ret_ref = 0;
40110 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40111 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40115 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
40116 LDKGossipTimestampFilter a_conv;
40117 a_conv.inner = untag_ptr(a);
40118 a_conv.is_owned = ptr_is_owned(a);
40119 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40120 a_conv.is_owned = false;
40121 LDKGossipTimestampFilter b_conv;
40122 b_conv.inner = untag_ptr(b);
40123 b_conv.is_owned = ptr_is_owned(b);
40124 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40125 b_conv.is_owned = false;
40126 jboolean ret_conv = GossipTimestampFilter_eq(&a_conv, &b_conv);
40130 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
40131 if (!ptr_is_owned(this_ptr)) return;
40132 void* this_ptr_ptr = untag_ptr(this_ptr);
40133 CHECK_ACCESS(this_ptr_ptr);
40134 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
40135 FREE(untag_ptr(this_ptr));
40136 ErrorAction_free(this_ptr_conv);
40139 static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) {
40140 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40141 *ret_copy = ErrorAction_clone(arg);
40142 int64_t ret_ref = tag_ptr(ret_copy, true);
40145 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40146 LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg);
40147 int64_t ret_conv = ErrorAction_clone_ptr(arg_conv);
40151 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40152 LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig);
40153 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40154 *ret_copy = ErrorAction_clone(orig_conv);
40155 int64_t ret_ref = tag_ptr(ret_copy, true);
40159 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1peer(JNIEnv *env, jclass clz, int64_t msg) {
40160 LDKErrorMessage msg_conv;
40161 msg_conv.inner = untag_ptr(msg);
40162 msg_conv.is_owned = ptr_is_owned(msg);
40163 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40164 msg_conv = ErrorMessage_clone(&msg_conv);
40165 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40166 *ret_copy = ErrorAction_disconnect_peer(msg_conv);
40167 int64_t ret_ref = tag_ptr(ret_copy, true);
40171 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error(JNIEnv *env, jclass clz) {
40172 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40173 *ret_copy = ErrorAction_ignore_error();
40174 int64_t ret_ref = tag_ptr(ret_copy, true);
40178 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1and_1log(JNIEnv *env, jclass clz, jclass a) {
40179 LDKLevel a_conv = LDKLevel_from_java(env, a);
40180 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40181 *ret_copy = ErrorAction_ignore_and_log(a_conv);
40182 int64_t ret_ref = tag_ptr(ret_copy, true);
40186 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip(JNIEnv *env, jclass clz) {
40187 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40188 *ret_copy = ErrorAction_ignore_duplicate_gossip();
40189 int64_t ret_ref = tag_ptr(ret_copy, true);
40193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) {
40194 LDKErrorMessage msg_conv;
40195 msg_conv.inner = untag_ptr(msg);
40196 msg_conv.is_owned = ptr_is_owned(msg);
40197 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40198 msg_conv = ErrorMessage_clone(&msg_conv);
40199 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40200 *ret_copy = ErrorAction_send_error_message(msg_conv);
40201 int64_t ret_ref = tag_ptr(ret_copy, true);
40205 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1warning_1message(JNIEnv *env, jclass clz, int64_t msg, jclass log_level) {
40206 LDKWarningMessage msg_conv;
40207 msg_conv.inner = untag_ptr(msg);
40208 msg_conv.is_owned = ptr_is_owned(msg);
40209 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40210 msg_conv = WarningMessage_clone(&msg_conv);
40211 LDKLevel log_level_conv = LDKLevel_from_java(env, log_level);
40212 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40213 *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv);
40214 int64_t ret_ref = tag_ptr(ret_copy, true);
40218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40219 LDKLightningError this_obj_conv;
40220 this_obj_conv.inner = untag_ptr(this_obj);
40221 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40223 LightningError_free(this_obj_conv);
40226 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv *env, jclass clz, int64_t this_ptr) {
40227 LDKLightningError this_ptr_conv;
40228 this_ptr_conv.inner = untag_ptr(this_ptr);
40229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40231 this_ptr_conv.is_owned = false;
40232 LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
40233 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
40238 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
40239 LDKLightningError this_ptr_conv;
40240 this_ptr_conv.inner = untag_ptr(this_ptr);
40241 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40242 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40243 this_ptr_conv.is_owned = false;
40244 LDKStr val_conv = java_to_owned_str(env, val);
40245 LightningError_set_err(&this_ptr_conv, val_conv);
40248 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv *env, jclass clz, int64_t this_ptr) {
40249 LDKLightningError this_ptr_conv;
40250 this_ptr_conv.inner = untag_ptr(this_ptr);
40251 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40253 this_ptr_conv.is_owned = false;
40254 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40255 *ret_copy = LightningError_get_action(&this_ptr_conv);
40256 int64_t ret_ref = tag_ptr(ret_copy, true);
40260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
40261 LDKLightningError this_ptr_conv;
40262 this_ptr_conv.inner = untag_ptr(this_ptr);
40263 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40265 this_ptr_conv.is_owned = false;
40266 void* val_ptr = untag_ptr(val);
40267 CHECK_ACCESS(val_ptr);
40268 LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
40269 val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val));
40270 LightningError_set_action(&this_ptr_conv, val_conv);
40273 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *env, jclass clz, jstring err_arg, int64_t action_arg) {
40274 LDKStr err_arg_conv = java_to_owned_str(env, err_arg);
40275 void* action_arg_ptr = untag_ptr(action_arg);
40276 CHECK_ACCESS(action_arg_ptr);
40277 LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
40278 action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg));
40279 LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
40280 int64_t ret_ref = 0;
40281 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40282 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40286 static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) {
40287 LDKLightningError ret_var = LightningError_clone(arg);
40288 int64_t ret_ref = 0;
40289 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40290 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40293 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40294 LDKLightningError arg_conv;
40295 arg_conv.inner = untag_ptr(arg);
40296 arg_conv.is_owned = ptr_is_owned(arg);
40297 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40298 arg_conv.is_owned = false;
40299 int64_t ret_conv = LightningError_clone_ptr(&arg_conv);
40303 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40304 LDKLightningError orig_conv;
40305 orig_conv.inner = untag_ptr(orig);
40306 orig_conv.is_owned = ptr_is_owned(orig);
40307 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40308 orig_conv.is_owned = false;
40309 LDKLightningError ret_var = LightningError_clone(&orig_conv);
40310 int64_t ret_ref = 0;
40311 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40312 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40316 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40317 LDKCommitmentUpdate this_obj_conv;
40318 this_obj_conv.inner = untag_ptr(this_obj);
40319 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40321 CommitmentUpdate_free(this_obj_conv);
40324 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
40325 LDKCommitmentUpdate this_ptr_conv;
40326 this_ptr_conv.inner = untag_ptr(this_ptr);
40327 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40329 this_ptr_conv.is_owned = false;
40330 LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
40331 int64_tArray ret_arr = NULL;
40332 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
40333 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
40334 for (size_t p = 0; p < ret_var.datalen; p++) {
40335 LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
40336 int64_t ret_conv_15_ref = 0;
40337 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var);
40338 ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned);
40339 ret_arr_ptr[p] = ret_conv_15_ref;
40341 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
40342 FREE(ret_var.data);
40346 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
40347 LDKCommitmentUpdate this_ptr_conv;
40348 this_ptr_conv.inner = untag_ptr(this_ptr);
40349 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40351 this_ptr_conv.is_owned = false;
40352 LDKCVec_UpdateAddHTLCZ val_constr;
40353 val_constr.datalen = (*env)->GetArrayLength(env, val);
40354 if (val_constr.datalen > 0)
40355 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
40357 val_constr.data = NULL;
40358 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
40359 for (size_t p = 0; p < val_constr.datalen; p++) {
40360 int64_t val_conv_15 = val_vals[p];
40361 LDKUpdateAddHTLC val_conv_15_conv;
40362 val_conv_15_conv.inner = untag_ptr(val_conv_15);
40363 val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15);
40364 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv);
40365 val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
40366 val_constr.data[p] = val_conv_15_conv;
40368 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
40369 CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
40372 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
40373 LDKCommitmentUpdate this_ptr_conv;
40374 this_ptr_conv.inner = untag_ptr(this_ptr);
40375 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40376 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40377 this_ptr_conv.is_owned = false;
40378 LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
40379 int64_tArray ret_arr = NULL;
40380 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
40381 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
40382 for (size_t t = 0; t < ret_var.datalen; t++) {
40383 LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
40384 int64_t ret_conv_19_ref = 0;
40385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var);
40386 ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned);
40387 ret_arr_ptr[t] = ret_conv_19_ref;
40389 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
40390 FREE(ret_var.data);
40394 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
40395 LDKCommitmentUpdate this_ptr_conv;
40396 this_ptr_conv.inner = untag_ptr(this_ptr);
40397 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40399 this_ptr_conv.is_owned = false;
40400 LDKCVec_UpdateFulfillHTLCZ val_constr;
40401 val_constr.datalen = (*env)->GetArrayLength(env, val);
40402 if (val_constr.datalen > 0)
40403 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
40405 val_constr.data = NULL;
40406 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
40407 for (size_t t = 0; t < val_constr.datalen; t++) {
40408 int64_t val_conv_19 = val_vals[t];
40409 LDKUpdateFulfillHTLC val_conv_19_conv;
40410 val_conv_19_conv.inner = untag_ptr(val_conv_19);
40411 val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19);
40412 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv);
40413 val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
40414 val_constr.data[t] = val_conv_19_conv;
40416 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
40417 CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
40420 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
40421 LDKCommitmentUpdate this_ptr_conv;
40422 this_ptr_conv.inner = untag_ptr(this_ptr);
40423 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40425 this_ptr_conv.is_owned = false;
40426 LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
40427 int64_tArray ret_arr = NULL;
40428 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
40429 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
40430 for (size_t q = 0; q < ret_var.datalen; q++) {
40431 LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
40432 int64_t ret_conv_16_ref = 0;
40433 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
40434 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
40435 ret_arr_ptr[q] = ret_conv_16_ref;
40437 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
40438 FREE(ret_var.data);
40442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
40443 LDKCommitmentUpdate this_ptr_conv;
40444 this_ptr_conv.inner = untag_ptr(this_ptr);
40445 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40447 this_ptr_conv.is_owned = false;
40448 LDKCVec_UpdateFailHTLCZ val_constr;
40449 val_constr.datalen = (*env)->GetArrayLength(env, val);
40450 if (val_constr.datalen > 0)
40451 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
40453 val_constr.data = NULL;
40454 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
40455 for (size_t q = 0; q < val_constr.datalen; q++) {
40456 int64_t val_conv_16 = val_vals[q];
40457 LDKUpdateFailHTLC val_conv_16_conv;
40458 val_conv_16_conv.inner = untag_ptr(val_conv_16);
40459 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
40460 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
40461 val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
40462 val_constr.data[q] = val_conv_16_conv;
40464 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
40465 CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
40468 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
40469 LDKCommitmentUpdate this_ptr_conv;
40470 this_ptr_conv.inner = untag_ptr(this_ptr);
40471 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40473 this_ptr_conv.is_owned = false;
40474 LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
40475 int64_tArray ret_arr = NULL;
40476 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
40477 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
40478 for (size_t z = 0; z < ret_var.datalen; z++) {
40479 LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
40480 int64_t ret_conv_25_ref = 0;
40481 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var);
40482 ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned);
40483 ret_arr_ptr[z] = ret_conv_25_ref;
40485 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
40486 FREE(ret_var.data);
40490 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) {
40491 LDKCommitmentUpdate this_ptr_conv;
40492 this_ptr_conv.inner = untag_ptr(this_ptr);
40493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40495 this_ptr_conv.is_owned = false;
40496 LDKCVec_UpdateFailMalformedHTLCZ val_constr;
40497 val_constr.datalen = (*env)->GetArrayLength(env, val);
40498 if (val_constr.datalen > 0)
40499 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
40501 val_constr.data = NULL;
40502 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
40503 for (size_t z = 0; z < val_constr.datalen; z++) {
40504 int64_t val_conv_25 = val_vals[z];
40505 LDKUpdateFailMalformedHTLC val_conv_25_conv;
40506 val_conv_25_conv.inner = untag_ptr(val_conv_25);
40507 val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25);
40508 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv);
40509 val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
40510 val_constr.data[z] = val_conv_25_conv;
40512 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
40513 CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
40516 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr) {
40517 LDKCommitmentUpdate this_ptr_conv;
40518 this_ptr_conv.inner = untag_ptr(this_ptr);
40519 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40520 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40521 this_ptr_conv.is_owned = false;
40522 LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
40523 int64_t ret_ref = 0;
40524 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40525 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
40530 LDKCommitmentUpdate this_ptr_conv;
40531 this_ptr_conv.inner = untag_ptr(this_ptr);
40532 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40533 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40534 this_ptr_conv.is_owned = false;
40535 LDKUpdateFee val_conv;
40536 val_conv.inner = untag_ptr(val);
40537 val_conv.is_owned = ptr_is_owned(val);
40538 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40539 val_conv = UpdateFee_clone(&val_conv);
40540 CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv);
40543 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr) {
40544 LDKCommitmentUpdate this_ptr_conv;
40545 this_ptr_conv.inner = untag_ptr(this_ptr);
40546 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40547 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40548 this_ptr_conv.is_owned = false;
40549 LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
40550 int64_t ret_ref = 0;
40551 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40552 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40556 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
40557 LDKCommitmentUpdate this_ptr_conv;
40558 this_ptr_conv.inner = untag_ptr(this_ptr);
40559 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40561 this_ptr_conv.is_owned = false;
40562 LDKCommitmentSigned val_conv;
40563 val_conv.inner = untag_ptr(val);
40564 val_conv.is_owned = ptr_is_owned(val);
40565 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40566 val_conv = CommitmentSigned_clone(&val_conv);
40567 CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv);
40570 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) {
40571 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr;
40572 update_add_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_add_htlcs_arg);
40573 if (update_add_htlcs_arg_constr.datalen > 0)
40574 update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
40576 update_add_htlcs_arg_constr.data = NULL;
40577 int64_t* update_add_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_add_htlcs_arg, NULL);
40578 for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
40579 int64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
40580 LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
40581 update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15);
40582 update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15);
40583 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv);
40584 update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
40585 update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
40587 (*env)->ReleaseLongArrayElements(env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0);
40588 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
40589 update_fulfill_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fulfill_htlcs_arg);
40590 if (update_fulfill_htlcs_arg_constr.datalen > 0)
40591 update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
40593 update_fulfill_htlcs_arg_constr.data = NULL;
40594 int64_t* update_fulfill_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fulfill_htlcs_arg, NULL);
40595 for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
40596 int64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
40597 LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
40598 update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19);
40599 update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19);
40600 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv);
40601 update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
40602 update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
40604 (*env)->ReleaseLongArrayElements(env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0);
40605 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
40606 update_fail_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_htlcs_arg);
40607 if (update_fail_htlcs_arg_constr.datalen > 0)
40608 update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
40610 update_fail_htlcs_arg_constr.data = NULL;
40611 int64_t* update_fail_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_htlcs_arg, NULL);
40612 for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
40613 int64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
40614 LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
40615 update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16);
40616 update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16);
40617 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv);
40618 update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
40619 update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
40621 (*env)->ReleaseLongArrayElements(env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0);
40622 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
40623 update_fail_malformed_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_malformed_htlcs_arg);
40624 if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
40625 update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
40627 update_fail_malformed_htlcs_arg_constr.data = NULL;
40628 int64_t* update_fail_malformed_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_malformed_htlcs_arg, NULL);
40629 for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
40630 int64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
40631 LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
40632 update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25);
40633 update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25);
40634 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv);
40635 update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
40636 update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
40638 (*env)->ReleaseLongArrayElements(env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0);
40639 LDKUpdateFee update_fee_arg_conv;
40640 update_fee_arg_conv.inner = untag_ptr(update_fee_arg);
40641 update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg);
40642 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv);
40643 update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv);
40644 LDKCommitmentSigned commitment_signed_arg_conv;
40645 commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg);
40646 commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg);
40647 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv);
40648 commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
40649 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);
40650 int64_t ret_ref = 0;
40651 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40652 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40656 static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) {
40657 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg);
40658 int64_t ret_ref = 0;
40659 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40660 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40663 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40664 LDKCommitmentUpdate arg_conv;
40665 arg_conv.inner = untag_ptr(arg);
40666 arg_conv.is_owned = ptr_is_owned(arg);
40667 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40668 arg_conv.is_owned = false;
40669 int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv);
40673 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40674 LDKCommitmentUpdate orig_conv;
40675 orig_conv.inner = untag_ptr(orig);
40676 orig_conv.is_owned = ptr_is_owned(orig);
40677 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40678 orig_conv.is_owned = false;
40679 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
40680 int64_t ret_ref = 0;
40681 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40682 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40686 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
40687 LDKCommitmentUpdate a_conv;
40688 a_conv.inner = untag_ptr(a);
40689 a_conv.is_owned = ptr_is_owned(a);
40690 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40691 a_conv.is_owned = false;
40692 LDKCommitmentUpdate b_conv;
40693 b_conv.inner = untag_ptr(b);
40694 b_conv.is_owned = ptr_is_owned(b);
40695 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40696 b_conv.is_owned = false;
40697 jboolean ret_conv = CommitmentUpdate_eq(&a_conv, &b_conv);
40701 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
40702 if (!ptr_is_owned(this_ptr)) return;
40703 void* this_ptr_ptr = untag_ptr(this_ptr);
40704 CHECK_ACCESS(this_ptr_ptr);
40705 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
40706 FREE(untag_ptr(this_ptr));
40707 ChannelMessageHandler_free(this_ptr_conv);
40710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
40711 if (!ptr_is_owned(this_ptr)) return;
40712 void* this_ptr_ptr = untag_ptr(this_ptr);
40713 CHECK_ACCESS(this_ptr_ptr);
40714 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
40715 FREE(untag_ptr(this_ptr));
40716 RoutingMessageHandler_free(this_ptr_conv);
40719 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
40720 if (!ptr_is_owned(this_ptr)) return;
40721 void* this_ptr_ptr = untag_ptr(this_ptr);
40722 CHECK_ACCESS(this_ptr_ptr);
40723 LDKOnionMessageHandler this_ptr_conv = *(LDKOnionMessageHandler*)(this_ptr_ptr);
40724 FREE(untag_ptr(this_ptr));
40725 OnionMessageHandler_free(this_ptr_conv);
40728 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv *env, jclass clz, int64_t obj) {
40729 LDKAcceptChannel obj_conv;
40730 obj_conv.inner = untag_ptr(obj);
40731 obj_conv.is_owned = ptr_is_owned(obj);
40732 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40733 obj_conv.is_owned = false;
40734 LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
40735 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40736 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40737 CVec_u8Z_free(ret_var);
40741 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40742 LDKu8slice ser_ref;
40743 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40744 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40745 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
40746 *ret_conv = AcceptChannel_read(ser_ref);
40747 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40748 return tag_ptr(ret_conv, true);
40751 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
40752 LDKAnnouncementSignatures obj_conv;
40753 obj_conv.inner = untag_ptr(obj);
40754 obj_conv.is_owned = ptr_is_owned(obj);
40755 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40756 obj_conv.is_owned = false;
40757 LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
40758 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40759 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40760 CVec_u8Z_free(ret_var);
40764 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40765 LDKu8slice ser_ref;
40766 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40767 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40768 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
40769 *ret_conv = AnnouncementSignatures_read(ser_ref);
40770 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40771 return tag_ptr(ret_conv, true);
40774 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv *env, jclass clz, int64_t obj) {
40775 LDKChannelReestablish obj_conv;
40776 obj_conv.inner = untag_ptr(obj);
40777 obj_conv.is_owned = ptr_is_owned(obj);
40778 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40779 obj_conv.is_owned = false;
40780 LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
40781 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40782 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40783 CVec_u8Z_free(ret_var);
40787 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40788 LDKu8slice ser_ref;
40789 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40790 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40791 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
40792 *ret_conv = ChannelReestablish_read(ser_ref);
40793 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40794 return tag_ptr(ret_conv, true);
40797 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
40798 LDKClosingSigned obj_conv;
40799 obj_conv.inner = untag_ptr(obj);
40800 obj_conv.is_owned = ptr_is_owned(obj);
40801 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40802 obj_conv.is_owned = false;
40803 LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
40804 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40805 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40806 CVec_u8Z_free(ret_var);
40810 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40811 LDKu8slice ser_ref;
40812 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40813 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40814 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
40815 *ret_conv = ClosingSigned_read(ser_ref);
40816 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40817 return tag_ptr(ret_conv, true);
40820 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
40821 LDKClosingSignedFeeRange obj_conv;
40822 obj_conv.inner = untag_ptr(obj);
40823 obj_conv.is_owned = ptr_is_owned(obj);
40824 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40825 obj_conv.is_owned = false;
40826 LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
40827 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40828 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40829 CVec_u8Z_free(ret_var);
40833 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40834 LDKu8slice ser_ref;
40835 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40836 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40837 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
40838 *ret_conv = ClosingSignedFeeRange_read(ser_ref);
40839 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40840 return tag_ptr(ret_conv, true);
40843 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
40844 LDKCommitmentSigned obj_conv;
40845 obj_conv.inner = untag_ptr(obj);
40846 obj_conv.is_owned = ptr_is_owned(obj);
40847 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40848 obj_conv.is_owned = false;
40849 LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
40850 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40851 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40852 CVec_u8Z_free(ret_var);
40856 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40857 LDKu8slice ser_ref;
40858 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40859 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40860 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
40861 *ret_conv = CommitmentSigned_read(ser_ref);
40862 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40863 return tag_ptr(ret_conv, true);
40866 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv *env, jclass clz, int64_t obj) {
40867 LDKFundingCreated obj_conv;
40868 obj_conv.inner = untag_ptr(obj);
40869 obj_conv.is_owned = ptr_is_owned(obj);
40870 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40871 obj_conv.is_owned = false;
40872 LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
40873 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40874 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40875 CVec_u8Z_free(ret_var);
40879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40880 LDKu8slice ser_ref;
40881 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40882 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40883 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
40884 *ret_conv = FundingCreated_read(ser_ref);
40885 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40886 return tag_ptr(ret_conv, true);
40889 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
40890 LDKFundingSigned obj_conv;
40891 obj_conv.inner = untag_ptr(obj);
40892 obj_conv.is_owned = ptr_is_owned(obj);
40893 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40894 obj_conv.is_owned = false;
40895 LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
40896 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40897 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40898 CVec_u8Z_free(ret_var);
40902 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40903 LDKu8slice ser_ref;
40904 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40905 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40906 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
40907 *ret_conv = FundingSigned_read(ser_ref);
40908 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40909 return tag_ptr(ret_conv, true);
40912 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1write(JNIEnv *env, jclass clz, int64_t obj) {
40913 LDKChannelReady obj_conv;
40914 obj_conv.inner = untag_ptr(obj);
40915 obj_conv.is_owned = ptr_is_owned(obj);
40916 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40917 obj_conv.is_owned = false;
40918 LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv);
40919 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40920 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40921 CVec_u8Z_free(ret_var);
40925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40926 LDKu8slice ser_ref;
40927 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40928 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40929 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
40930 *ret_conv = ChannelReady_read(ser_ref);
40931 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40932 return tag_ptr(ret_conv, true);
40935 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env, jclass clz, int64_t obj) {
40937 obj_conv.inner = untag_ptr(obj);
40938 obj_conv.is_owned = ptr_is_owned(obj);
40939 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40940 obj_conv.is_owned = false;
40941 LDKCVec_u8Z ret_var = Init_write(&obj_conv);
40942 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40943 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40944 CVec_u8Z_free(ret_var);
40948 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40949 LDKu8slice ser_ref;
40950 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40951 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40952 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
40953 *ret_conv = Init_read(ser_ref);
40954 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40955 return tag_ptr(ret_conv, true);
40958 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv *env, jclass clz, int64_t obj) {
40959 LDKOpenChannel obj_conv;
40960 obj_conv.inner = untag_ptr(obj);
40961 obj_conv.is_owned = ptr_is_owned(obj);
40962 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40963 obj_conv.is_owned = false;
40964 LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
40965 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40966 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40967 CVec_u8Z_free(ret_var);
40971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40972 LDKu8slice ser_ref;
40973 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40974 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40975 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
40976 *ret_conv = OpenChannel_read(ser_ref);
40977 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40978 return tag_ptr(ret_conv, true);
40981 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv *env, jclass clz, int64_t obj) {
40982 LDKRevokeAndACK obj_conv;
40983 obj_conv.inner = untag_ptr(obj);
40984 obj_conv.is_owned = ptr_is_owned(obj);
40985 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40986 obj_conv.is_owned = false;
40987 LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
40988 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40989 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40990 CVec_u8Z_free(ret_var);
40994 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40995 LDKu8slice ser_ref;
40996 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40997 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40998 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
40999 *ret_conv = RevokeAndACK_read(ser_ref);
41000 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41001 return tag_ptr(ret_conv, true);
41004 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv *env, jclass clz, int64_t obj) {
41005 LDKShutdown obj_conv;
41006 obj_conv.inner = untag_ptr(obj);
41007 obj_conv.is_owned = ptr_is_owned(obj);
41008 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41009 obj_conv.is_owned = false;
41010 LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
41011 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41012 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41013 CVec_u8Z_free(ret_var);
41017 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41018 LDKu8slice ser_ref;
41019 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41020 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41021 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
41022 *ret_conv = Shutdown_read(ser_ref);
41023 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41024 return tag_ptr(ret_conv, true);
41027 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
41028 LDKUpdateFailHTLC obj_conv;
41029 obj_conv.inner = untag_ptr(obj);
41030 obj_conv.is_owned = ptr_is_owned(obj);
41031 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41032 obj_conv.is_owned = false;
41033 LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
41034 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41035 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41036 CVec_u8Z_free(ret_var);
41040 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41041 LDKu8slice ser_ref;
41042 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41043 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41044 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
41045 *ret_conv = UpdateFailHTLC_read(ser_ref);
41046 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41047 return tag_ptr(ret_conv, true);
41050 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
41051 LDKUpdateFailMalformedHTLC obj_conv;
41052 obj_conv.inner = untag_ptr(obj);
41053 obj_conv.is_owned = ptr_is_owned(obj);
41054 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41055 obj_conv.is_owned = false;
41056 LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
41057 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41058 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41059 CVec_u8Z_free(ret_var);
41063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41064 LDKu8slice ser_ref;
41065 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41066 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41067 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
41068 *ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
41069 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41070 return tag_ptr(ret_conv, true);
41073 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv *env, jclass clz, int64_t obj) {
41074 LDKUpdateFee obj_conv;
41075 obj_conv.inner = untag_ptr(obj);
41076 obj_conv.is_owned = ptr_is_owned(obj);
41077 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41078 obj_conv.is_owned = false;
41079 LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
41080 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41081 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41082 CVec_u8Z_free(ret_var);
41086 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41087 LDKu8slice ser_ref;
41088 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41089 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41090 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
41091 *ret_conv = UpdateFee_read(ser_ref);
41092 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41093 return tag_ptr(ret_conv, true);
41096 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
41097 LDKUpdateFulfillHTLC obj_conv;
41098 obj_conv.inner = untag_ptr(obj);
41099 obj_conv.is_owned = ptr_is_owned(obj);
41100 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41101 obj_conv.is_owned = false;
41102 LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
41103 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41104 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41105 CVec_u8Z_free(ret_var);
41109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41110 LDKu8slice ser_ref;
41111 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41112 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41113 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
41114 *ret_conv = UpdateFulfillHTLC_read(ser_ref);
41115 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41116 return tag_ptr(ret_conv, true);
41119 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
41120 LDKUpdateAddHTLC obj_conv;
41121 obj_conv.inner = untag_ptr(obj);
41122 obj_conv.is_owned = ptr_is_owned(obj);
41123 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41124 obj_conv.is_owned = false;
41125 LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
41126 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41127 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41128 CVec_u8Z_free(ret_var);
41132 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41133 LDKu8slice ser_ref;
41134 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41135 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41136 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
41137 *ret_conv = UpdateAddHTLC_read(ser_ref);
41138 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41139 return tag_ptr(ret_conv, true);
41142 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41143 LDKu8slice ser_ref;
41144 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41145 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41146 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
41147 *ret_conv = OnionMessage_read(ser_ref);
41148 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41149 return tag_ptr(ret_conv, true);
41152 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
41153 LDKOnionMessage obj_conv;
41154 obj_conv.inner = untag_ptr(obj);
41155 obj_conv.is_owned = ptr_is_owned(obj);
41156 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41157 obj_conv.is_owned = false;
41158 LDKCVec_u8Z ret_var = OnionMessage_write(&obj_conv);
41159 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41160 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41161 CVec_u8Z_free(ret_var);
41165 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env, jclass clz, int64_t obj) {
41167 obj_conv.inner = untag_ptr(obj);
41168 obj_conv.is_owned = ptr_is_owned(obj);
41169 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41170 obj_conv.is_owned = false;
41171 LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
41172 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41173 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41174 CVec_u8Z_free(ret_var);
41178 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41179 LDKu8slice ser_ref;
41180 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41181 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41182 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
41183 *ret_conv = Ping_read(ser_ref);
41184 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41185 return tag_ptr(ret_conv, true);
41188 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env, jclass clz, int64_t obj) {
41190 obj_conv.inner = untag_ptr(obj);
41191 obj_conv.is_owned = ptr_is_owned(obj);
41192 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41193 obj_conv.is_owned = false;
41194 LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
41195 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41196 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41197 CVec_u8Z_free(ret_var);
41201 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41202 LDKu8slice ser_ref;
41203 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41204 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41205 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
41206 *ret_conv = Pong_read(ser_ref);
41207 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41208 return tag_ptr(ret_conv, true);
41211 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
41212 LDKUnsignedChannelAnnouncement obj_conv;
41213 obj_conv.inner = untag_ptr(obj);
41214 obj_conv.is_owned = ptr_is_owned(obj);
41215 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41216 obj_conv.is_owned = false;
41217 LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
41218 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41219 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41220 CVec_u8Z_free(ret_var);
41224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41225 LDKu8slice ser_ref;
41226 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41227 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41228 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
41229 *ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
41230 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41231 return tag_ptr(ret_conv, true);
41234 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
41235 LDKChannelAnnouncement obj_conv;
41236 obj_conv.inner = untag_ptr(obj);
41237 obj_conv.is_owned = ptr_is_owned(obj);
41238 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41239 obj_conv.is_owned = false;
41240 LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
41241 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41242 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41243 CVec_u8Z_free(ret_var);
41247 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41248 LDKu8slice ser_ref;
41249 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41250 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41251 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
41252 *ret_conv = ChannelAnnouncement_read(ser_ref);
41253 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41254 return tag_ptr(ret_conv, true);
41257 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
41258 LDKUnsignedChannelUpdate obj_conv;
41259 obj_conv.inner = untag_ptr(obj);
41260 obj_conv.is_owned = ptr_is_owned(obj);
41261 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41262 obj_conv.is_owned = false;
41263 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
41264 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41265 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41266 CVec_u8Z_free(ret_var);
41270 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41271 LDKu8slice ser_ref;
41272 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41273 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41274 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
41275 *ret_conv = UnsignedChannelUpdate_read(ser_ref);
41276 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41277 return tag_ptr(ret_conv, true);
41280 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
41281 LDKChannelUpdate obj_conv;
41282 obj_conv.inner = untag_ptr(obj);
41283 obj_conv.is_owned = ptr_is_owned(obj);
41284 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41285 obj_conv.is_owned = false;
41286 LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
41287 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41288 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41289 CVec_u8Z_free(ret_var);
41293 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41294 LDKu8slice ser_ref;
41295 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41296 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41297 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
41298 *ret_conv = ChannelUpdate_read(ser_ref);
41299 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41300 return tag_ptr(ret_conv, true);
41303 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
41304 LDKErrorMessage obj_conv;
41305 obj_conv.inner = untag_ptr(obj);
41306 obj_conv.is_owned = ptr_is_owned(obj);
41307 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41308 obj_conv.is_owned = false;
41309 LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
41310 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41311 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41312 CVec_u8Z_free(ret_var);
41316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41317 LDKu8slice ser_ref;
41318 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41319 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41320 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
41321 *ret_conv = ErrorMessage_read(ser_ref);
41322 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41323 return tag_ptr(ret_conv, true);
41326 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
41327 LDKWarningMessage obj_conv;
41328 obj_conv.inner = untag_ptr(obj);
41329 obj_conv.is_owned = ptr_is_owned(obj);
41330 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41331 obj_conv.is_owned = false;
41332 LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv);
41333 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41334 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41335 CVec_u8Z_free(ret_var);
41339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41340 LDKu8slice ser_ref;
41341 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41342 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41343 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
41344 *ret_conv = WarningMessage_read(ser_ref);
41345 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41346 return tag_ptr(ret_conv, true);
41349 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
41350 LDKUnsignedNodeAnnouncement obj_conv;
41351 obj_conv.inner = untag_ptr(obj);
41352 obj_conv.is_owned = ptr_is_owned(obj);
41353 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41354 obj_conv.is_owned = false;
41355 LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
41356 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41357 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41358 CVec_u8Z_free(ret_var);
41362 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41363 LDKu8slice ser_ref;
41364 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41365 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41366 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
41367 *ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
41368 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41369 return tag_ptr(ret_conv, true);
41372 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
41373 LDKNodeAnnouncement obj_conv;
41374 obj_conv.inner = untag_ptr(obj);
41375 obj_conv.is_owned = ptr_is_owned(obj);
41376 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41377 obj_conv.is_owned = false;
41378 LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
41379 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41380 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41381 CVec_u8Z_free(ret_var);
41385 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41386 LDKu8slice ser_ref;
41387 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41388 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41389 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
41390 *ret_conv = NodeAnnouncement_read(ser_ref);
41391 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41392 return tag_ptr(ret_conv, true);
41395 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41396 LDKu8slice ser_ref;
41397 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41398 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41399 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
41400 *ret_conv = QueryShortChannelIds_read(ser_ref);
41401 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41402 return tag_ptr(ret_conv, true);
41405 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv *env, jclass clz, int64_t obj) {
41406 LDKQueryShortChannelIds obj_conv;
41407 obj_conv.inner = untag_ptr(obj);
41408 obj_conv.is_owned = ptr_is_owned(obj);
41409 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41410 obj_conv.is_owned = false;
41411 LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
41412 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41413 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41414 CVec_u8Z_free(ret_var);
41418 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv *env, jclass clz, int64_t obj) {
41419 LDKReplyShortChannelIdsEnd obj_conv;
41420 obj_conv.inner = untag_ptr(obj);
41421 obj_conv.is_owned = ptr_is_owned(obj);
41422 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41423 obj_conv.is_owned = false;
41424 LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
41425 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41426 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41427 CVec_u8Z_free(ret_var);
41431 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41432 LDKu8slice ser_ref;
41433 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41434 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41435 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
41436 *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
41437 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41438 return tag_ptr(ret_conv, true);
41441 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blocknum(JNIEnv *env, jclass clz, int64_t this_arg) {
41442 LDKQueryChannelRange this_arg_conv;
41443 this_arg_conv.inner = untag_ptr(this_arg);
41444 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41446 this_arg_conv.is_owned = false;
41447 int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv);
41451 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
41452 LDKQueryChannelRange obj_conv;
41453 obj_conv.inner = untag_ptr(obj);
41454 obj_conv.is_owned = ptr_is_owned(obj);
41455 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41456 obj_conv.is_owned = false;
41457 LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
41458 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41459 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41460 CVec_u8Z_free(ret_var);
41464 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41465 LDKu8slice ser_ref;
41466 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41467 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41468 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
41469 *ret_conv = QueryChannelRange_read(ser_ref);
41470 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41471 return tag_ptr(ret_conv, true);
41474 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41475 LDKu8slice ser_ref;
41476 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41477 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41478 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
41479 *ret_conv = ReplyChannelRange_read(ser_ref);
41480 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41481 return tag_ptr(ret_conv, true);
41484 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
41485 LDKReplyChannelRange obj_conv;
41486 obj_conv.inner = untag_ptr(obj);
41487 obj_conv.is_owned = ptr_is_owned(obj);
41488 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41489 obj_conv.is_owned = false;
41490 LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
41491 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41492 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41493 CVec_u8Z_free(ret_var);
41497 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv *env, jclass clz, int64_t obj) {
41498 LDKGossipTimestampFilter obj_conv;
41499 obj_conv.inner = untag_ptr(obj);
41500 obj_conv.is_owned = ptr_is_owned(obj);
41501 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41502 obj_conv.is_owned = false;
41503 LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
41504 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41505 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41506 CVec_u8Z_free(ret_var);
41510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41511 LDKu8slice ser_ref;
41512 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41513 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41514 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
41515 *ret_conv = GossipTimestampFilter_read(ser_ref);
41516 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41517 return tag_ptr(ret_conv, true);
41520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
41521 if (!ptr_is_owned(this_ptr)) return;
41522 void* this_ptr_ptr = untag_ptr(this_ptr);
41523 CHECK_ACCESS(this_ptr_ptr);
41524 LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
41525 FREE(untag_ptr(this_ptr));
41526 CustomMessageHandler_free(this_ptr_conv);
41529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41530 LDKIgnoringMessageHandler this_obj_conv;
41531 this_obj_conv.inner = untag_ptr(this_obj);
41532 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41533 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41534 IgnoringMessageHandler_free(this_obj_conv);
41537 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) {
41538 LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
41539 int64_t ret_ref = 0;
41540 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41541 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
41546 LDKIgnoringMessageHandler this_arg_conv;
41547 this_arg_conv.inner = untag_ptr(this_arg);
41548 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41549 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41550 this_arg_conv.is_owned = false;
41551 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
41552 *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
41553 return tag_ptr(ret_ret, true);
41556 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41557 LDKIgnoringMessageHandler this_arg_conv;
41558 this_arg_conv.inner = untag_ptr(this_arg);
41559 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41561 this_arg_conv.is_owned = false;
41562 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
41563 *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
41564 return tag_ptr(ret_ret, true);
41567 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1OnionMessageProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
41568 LDKIgnoringMessageHandler this_arg_conv;
41569 this_arg_conv.inner = untag_ptr(this_arg);
41570 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41571 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41572 this_arg_conv.is_owned = false;
41573 LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
41574 *ret_ret = IgnoringMessageHandler_as_OnionMessageProvider(&this_arg_conv);
41575 return tag_ptr(ret_ret, true);
41578 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1OnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41579 LDKIgnoringMessageHandler this_arg_conv;
41580 this_arg_conv.inner = untag_ptr(this_arg);
41581 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41582 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41583 this_arg_conv.is_owned = false;
41584 LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
41585 *ret_ret = IgnoringMessageHandler_as_OnionMessageHandler(&this_arg_conv);
41586 return tag_ptr(ret_ret, true);
41589 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomOnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41590 LDKIgnoringMessageHandler this_arg_conv;
41591 this_arg_conv.inner = untag_ptr(this_arg);
41592 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41593 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41594 this_arg_conv.is_owned = false;
41595 LDKCustomOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
41596 *ret_ret = IgnoringMessageHandler_as_CustomOnionMessageHandler(&this_arg_conv);
41597 return tag_ptr(ret_ret, true);
41600 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t this_arg) {
41601 LDKIgnoringMessageHandler this_arg_conv;
41602 this_arg_conv.inner = untag_ptr(this_arg);
41603 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41604 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41605 this_arg_conv.is_owned = false;
41606 LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
41607 *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
41608 return tag_ptr(ret_ret, true);
41611 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41612 LDKIgnoringMessageHandler this_arg_conv;
41613 this_arg_conv.inner = untag_ptr(this_arg);
41614 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41616 this_arg_conv.is_owned = false;
41617 LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
41618 *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
41619 return tag_ptr(ret_ret, true);
41622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41623 LDKErroringMessageHandler this_obj_conv;
41624 this_obj_conv.inner = untag_ptr(this_obj);
41625 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41626 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41627 ErroringMessageHandler_free(this_obj_conv);
41630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) {
41631 LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
41632 int64_t ret_ref = 0;
41633 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41634 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41638 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
41639 LDKErroringMessageHandler this_arg_conv;
41640 this_arg_conv.inner = untag_ptr(this_arg);
41641 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41643 this_arg_conv.is_owned = false;
41644 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
41645 *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
41646 return tag_ptr(ret_ret, true);
41649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41650 LDKErroringMessageHandler this_arg_conv;
41651 this_arg_conv.inner = untag_ptr(this_arg);
41652 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41653 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41654 this_arg_conv.is_owned = false;
41655 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
41656 *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
41657 return tag_ptr(ret_ret, true);
41660 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41661 LDKMessageHandler this_obj_conv;
41662 this_obj_conv.inner = untag_ptr(this_obj);
41663 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41665 MessageHandler_free(this_obj_conv);
41668 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
41669 LDKMessageHandler this_ptr_conv;
41670 this_ptr_conv.inner = untag_ptr(this_ptr);
41671 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41672 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41673 this_ptr_conv.is_owned = false;
41674 // WARNING: This object doesn't live past this scope, needs clone!
41675 int64_t ret_ret = tag_ptr(MessageHandler_get_chan_handler(&this_ptr_conv), false);
41679 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41680 LDKMessageHandler this_ptr_conv;
41681 this_ptr_conv.inner = untag_ptr(this_ptr);
41682 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41684 this_ptr_conv.is_owned = false;
41685 void* val_ptr = untag_ptr(val);
41686 CHECK_ACCESS(val_ptr);
41687 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
41688 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
41689 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41690 LDKChannelMessageHandler_JCalls_cloned(&val_conv);
41692 MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
41695 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
41696 LDKMessageHandler this_ptr_conv;
41697 this_ptr_conv.inner = untag_ptr(this_ptr);
41698 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41700 this_ptr_conv.is_owned = false;
41701 // WARNING: This object doesn't live past this scope, needs clone!
41702 int64_t ret_ret = tag_ptr(MessageHandler_get_route_handler(&this_ptr_conv), false);
41706 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41707 LDKMessageHandler this_ptr_conv;
41708 this_ptr_conv.inner = untag_ptr(this_ptr);
41709 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41710 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41711 this_ptr_conv.is_owned = false;
41712 void* val_ptr = untag_ptr(val);
41713 CHECK_ACCESS(val_ptr);
41714 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
41715 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
41716 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41717 LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
41719 MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
41722 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1onion_1message_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
41723 LDKMessageHandler this_ptr_conv;
41724 this_ptr_conv.inner = untag_ptr(this_ptr);
41725 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41727 this_ptr_conv.is_owned = false;
41728 // WARNING: This object doesn't live past this scope, needs clone!
41729 int64_t ret_ret = tag_ptr(MessageHandler_get_onion_message_handler(&this_ptr_conv), false);
41733 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1onion_1message_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41734 LDKMessageHandler this_ptr_conv;
41735 this_ptr_conv.inner = untag_ptr(this_ptr);
41736 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41738 this_ptr_conv.is_owned = false;
41739 void* val_ptr = untag_ptr(val);
41740 CHECK_ACCESS(val_ptr);
41741 LDKOnionMessageHandler val_conv = *(LDKOnionMessageHandler*)(val_ptr);
41742 if (val_conv.free == LDKOnionMessageHandler_JCalls_free) {
41743 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41744 LDKOnionMessageHandler_JCalls_cloned(&val_conv);
41746 MessageHandler_set_onion_message_handler(&this_ptr_conv, val_conv);
41749 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv *env, jclass clz, int64_t chan_handler_arg, int64_t route_handler_arg, int64_t onion_message_handler_arg) {
41750 void* chan_handler_arg_ptr = untag_ptr(chan_handler_arg);
41751 CHECK_ACCESS(chan_handler_arg_ptr);
41752 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
41753 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
41754 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41755 LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
41757 void* route_handler_arg_ptr = untag_ptr(route_handler_arg);
41758 CHECK_ACCESS(route_handler_arg_ptr);
41759 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
41760 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
41761 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41762 LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
41764 void* onion_message_handler_arg_ptr = untag_ptr(onion_message_handler_arg);
41765 CHECK_ACCESS(onion_message_handler_arg_ptr);
41766 LDKOnionMessageHandler onion_message_handler_arg_conv = *(LDKOnionMessageHandler*)(onion_message_handler_arg_ptr);
41767 if (onion_message_handler_arg_conv.free == LDKOnionMessageHandler_JCalls_free) {
41768 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41769 LDKOnionMessageHandler_JCalls_cloned(&onion_message_handler_arg_conv);
41771 LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv, onion_message_handler_arg_conv);
41772 int64_t ret_ref = 0;
41773 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41774 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41778 static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) {
41779 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
41780 *ret_ret = SocketDescriptor_clone(arg);
41781 return tag_ptr(ret_ret, true);
41783 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41784 void* arg_ptr = untag_ptr(arg);
41785 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
41786 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr;
41787 int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv);
41791 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41792 void* orig_ptr = untag_ptr(orig);
41793 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
41794 LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
41795 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
41796 *ret_ret = SocketDescriptor_clone(orig_conv);
41797 return tag_ptr(ret_ret, true);
41800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
41801 if (!ptr_is_owned(this_ptr)) return;
41802 void* this_ptr_ptr = untag_ptr(this_ptr);
41803 CHECK_ACCESS(this_ptr_ptr);
41804 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
41805 FREE(untag_ptr(this_ptr));
41806 SocketDescriptor_free(this_ptr_conv);
41809 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41810 LDKPeerHandleError this_obj_conv;
41811 this_obj_conv.inner = untag_ptr(this_obj);
41812 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41814 PeerHandleError_free(this_obj_conv);
41817 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv *env, jclass clz) {
41818 LDKPeerHandleError ret_var = PeerHandleError_new();
41819 int64_t ret_ref = 0;
41820 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41821 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41825 static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) {
41826 LDKPeerHandleError ret_var = PeerHandleError_clone(arg);
41827 int64_t ret_ref = 0;
41828 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41829 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41832 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41833 LDKPeerHandleError arg_conv;
41834 arg_conv.inner = untag_ptr(arg);
41835 arg_conv.is_owned = ptr_is_owned(arg);
41836 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41837 arg_conv.is_owned = false;
41838 int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv);
41842 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41843 LDKPeerHandleError orig_conv;
41844 orig_conv.inner = untag_ptr(orig);
41845 orig_conv.is_owned = ptr_is_owned(orig);
41846 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41847 orig_conv.is_owned = false;
41848 LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv);
41849 int64_t ret_ref = 0;
41850 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41851 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41855 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41856 LDKPeerManager this_obj_conv;
41857 this_obj_conv.inner = untag_ptr(this_obj);
41858 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41860 PeerManager_free(this_obj_conv);
41863 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int32_t current_time, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler, int64_t node_signer) {
41864 LDKMessageHandler message_handler_conv;
41865 message_handler_conv.inner = untag_ptr(message_handler);
41866 message_handler_conv.is_owned = ptr_is_owned(message_handler);
41867 CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
41868 // WARNING: we need a move here but no clone is available for LDKMessageHandler
41870 uint8_t ephemeral_random_data_arr[32];
41871 CHECK((*env)->GetArrayLength(env, ephemeral_random_data) == 32);
41872 (*env)->GetByteArrayRegion(env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
41873 uint8_t (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
41874 void* logger_ptr = untag_ptr(logger);
41875 CHECK_ACCESS(logger_ptr);
41876 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41877 if (logger_conv.free == LDKLogger_JCalls_free) {
41878 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41879 LDKLogger_JCalls_cloned(&logger_conv);
41881 void* custom_message_handler_ptr = untag_ptr(custom_message_handler);
41882 CHECK_ACCESS(custom_message_handler_ptr);
41883 LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
41884 if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
41885 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41886 LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
41888 void* node_signer_ptr = untag_ptr(node_signer);
41889 CHECK_ACCESS(node_signer_ptr);
41890 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
41891 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
41892 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41893 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
41895 LDKPeerManager ret_var = PeerManager_new(message_handler_conv, current_time, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv, node_signer_conv);
41896 int64_t ret_ref = 0;
41897 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41898 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41902 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv *env, jclass clz, int64_t this_arg) {
41903 LDKPeerManager this_arg_conv;
41904 this_arg_conv.inner = untag_ptr(this_arg);
41905 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41906 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41907 this_arg_conv.is_owned = false;
41908 LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
41909 int64_tArray ret_arr = NULL;
41910 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
41911 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
41912 for (size_t o = 0; o < ret_var.datalen; o++) {
41913 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
41914 *ret_conv_40_conv = ret_var.data[o];
41915 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
41917 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
41918 FREE(ret_var.data);
41922 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) {
41923 LDKPeerManager this_arg_conv;
41924 this_arg_conv.inner = untag_ptr(this_arg);
41925 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41926 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41927 this_arg_conv.is_owned = false;
41928 LDKPublicKey their_node_id_ref;
41929 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
41930 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
41931 void* descriptor_ptr = untag_ptr(descriptor);
41932 CHECK_ACCESS(descriptor_ptr);
41933 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
41934 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
41935 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41936 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
41938 void* remote_network_address_ptr = untag_ptr(remote_network_address);
41939 CHECK_ACCESS(remote_network_address_ptr);
41940 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
41941 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
41942 *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv);
41943 return tag_ptr(ret_conv, true);
41946 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) {
41947 LDKPeerManager this_arg_conv;
41948 this_arg_conv.inner = untag_ptr(this_arg);
41949 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41951 this_arg_conv.is_owned = false;
41952 void* descriptor_ptr = untag_ptr(descriptor);
41953 CHECK_ACCESS(descriptor_ptr);
41954 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
41955 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
41956 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41957 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
41959 void* remote_network_address_ptr = untag_ptr(remote_network_address);
41960 CHECK_ACCESS(remote_network_address_ptr);
41961 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
41962 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
41963 *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv);
41964 return tag_ptr(ret_conv, true);
41967 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) {
41968 LDKPeerManager this_arg_conv;
41969 this_arg_conv.inner = untag_ptr(this_arg);
41970 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41972 this_arg_conv.is_owned = false;
41973 void* descriptor_ptr = untag_ptr(descriptor);
41974 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
41975 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
41976 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
41977 *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
41978 return tag_ptr(ret_conv, true);
41981 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) {
41982 LDKPeerManager this_arg_conv;
41983 this_arg_conv.inner = untag_ptr(this_arg);
41984 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41986 this_arg_conv.is_owned = false;
41987 void* peer_descriptor_ptr = untag_ptr(peer_descriptor);
41988 if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); }
41989 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
41990 LDKu8slice data_ref;
41991 data_ref.datalen = (*env)->GetArrayLength(env, data);
41992 data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
41993 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
41994 *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
41995 (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0);
41996 return tag_ptr(ret_conv, true);
41999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
42000 LDKPeerManager this_arg_conv;
42001 this_arg_conv.inner = untag_ptr(this_arg);
42002 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42004 this_arg_conv.is_owned = false;
42005 PeerManager_process_events(&this_arg_conv);
42008 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) {
42009 LDKPeerManager this_arg_conv;
42010 this_arg_conv.inner = untag_ptr(this_arg);
42011 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42012 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42013 this_arg_conv.is_owned = false;
42014 void* descriptor_ptr = untag_ptr(descriptor);
42015 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
42016 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
42017 PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
42020 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) {
42021 LDKPeerManager this_arg_conv;
42022 this_arg_conv.inner = untag_ptr(this_arg);
42023 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42025 this_arg_conv.is_owned = false;
42026 LDKPublicKey node_id_ref;
42027 CHECK((*env)->GetArrayLength(env, node_id) == 33);
42028 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
42029 PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref);
42032 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers(JNIEnv *env, jclass clz, int64_t this_arg) {
42033 LDKPeerManager this_arg_conv;
42034 this_arg_conv.inner = untag_ptr(this_arg);
42035 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42037 this_arg_conv.is_owned = false;
42038 PeerManager_disconnect_all_peers(&this_arg_conv);
42041 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
42042 LDKPeerManager this_arg_conv;
42043 this_arg_conv.inner = untag_ptr(this_arg);
42044 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42046 this_arg_conv.is_owned = false;
42047 PeerManager_timer_tick_occurred(&this_arg_conv);
42050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray rgb, int8_tArray alias, int64_tArray addresses) {
42051 LDKPeerManager this_arg_conv;
42052 this_arg_conv.inner = untag_ptr(this_arg);
42053 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42055 this_arg_conv.is_owned = false;
42056 LDKThreeBytes rgb_ref;
42057 CHECK((*env)->GetArrayLength(env, rgb) == 3);
42058 (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data);
42059 LDKThirtyTwoBytes alias_ref;
42060 CHECK((*env)->GetArrayLength(env, alias) == 32);
42061 (*env)->GetByteArrayRegion(env, alias, 0, 32, alias_ref.data);
42062 LDKCVec_NetAddressZ addresses_constr;
42063 addresses_constr.datalen = (*env)->GetArrayLength(env, addresses);
42064 if (addresses_constr.datalen > 0)
42065 addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
42067 addresses_constr.data = NULL;
42068 int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL);
42069 for (size_t m = 0; m < addresses_constr.datalen; m++) {
42070 int64_t addresses_conv_12 = addresses_vals[m];
42071 void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
42072 CHECK_ACCESS(addresses_conv_12_ptr);
42073 LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
42074 addresses_constr.data[m] = addresses_conv_12_conv;
42076 (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0);
42077 PeerManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
42080 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
42081 int64_t ret_conv = htlc_success_tx_weight(opt_anchors);
42085 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
42086 int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors);
42090 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42091 LDKHTLCClaim* orig_conv = (LDKHTLCClaim*)untag_ptr(orig);
42092 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_clone(orig_conv));
42096 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1offered_1timeout(JNIEnv *env, jclass clz) {
42097 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_offered_timeout());
42101 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1offered_1preimage(JNIEnv *env, jclass clz) {
42102 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_offered_preimage());
42106 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1accepted_1timeout(JNIEnv *env, jclass clz) {
42107 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_accepted_timeout());
42111 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1accepted_1preimage(JNIEnv *env, jclass clz) {
42112 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_accepted_preimage());
42116 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1revocation(JNIEnv *env, jclass clz) {
42117 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_revocation());
42121 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42122 LDKHTLCClaim* a_conv = (LDKHTLCClaim*)untag_ptr(a);
42123 LDKHTLCClaim* b_conv = (LDKHTLCClaim*)untag_ptr(b);
42124 jboolean ret_conv = HTLCClaim_eq(a_conv, b_conv);
42128 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1from_1witness(JNIEnv *env, jclass clz, int8_tArray witness) {
42129 LDKWitness witness_ref;
42130 witness_ref.datalen = (*env)->GetArrayLength(env, witness);
42131 witness_ref.data = MALLOC(witness_ref.datalen, "LDKWitness Bytes");
42132 (*env)->GetByteArrayRegion(env, witness, 0, witness_ref.datalen, witness_ref.data);
42133 witness_ref.data_is_owned = true;
42134 LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ");
42135 *ret_copy = HTLCClaim_from_witness(witness_ref);
42136 int64_t ret_ref = tag_ptr(ret_copy, true);
42140 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) {
42141 uint8_t commitment_seed_arr[32];
42142 CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
42143 (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_arr);
42144 uint8_t (*commitment_seed_ref)[32] = &commitment_seed_arr;
42145 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42146 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data);
42150 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) {
42151 LDKCVec_u8Z to_holder_script_ref;
42152 to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
42153 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
42154 (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data);
42155 LDKCVec_u8Z to_counterparty_script_ref;
42156 to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script);
42157 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
42158 (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data);
42159 LDKOutPoint funding_outpoint_conv;
42160 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
42161 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
42162 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
42163 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
42164 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);
42165 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42166 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42167 Transaction_free(ret_var);
42171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42172 LDKCounterpartyCommitmentSecrets this_obj_conv;
42173 this_obj_conv.inner = untag_ptr(this_obj);
42174 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42175 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42176 CounterpartyCommitmentSecrets_free(this_obj_conv);
42179 static inline uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) {
42180 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg);
42181 int64_t ret_ref = 0;
42182 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42183 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42186 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42187 LDKCounterpartyCommitmentSecrets arg_conv;
42188 arg_conv.inner = untag_ptr(arg);
42189 arg_conv.is_owned = ptr_is_owned(arg);
42190 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42191 arg_conv.is_owned = false;
42192 int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv);
42196 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42197 LDKCounterpartyCommitmentSecrets orig_conv;
42198 orig_conv.inner = untag_ptr(orig);
42199 orig_conv.is_owned = ptr_is_owned(orig);
42200 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42201 orig_conv.is_owned = false;
42202 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv);
42203 int64_t ret_ref = 0;
42204 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42205 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1new(JNIEnv *env, jclass clz) {
42210 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new();
42211 int64_t ret_ref = 0;
42212 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42213 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42217 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1min_1seen_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
42218 LDKCounterpartyCommitmentSecrets this_arg_conv;
42219 this_arg_conv.inner = untag_ptr(this_arg);
42220 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42222 this_arg_conv.is_owned = false;
42223 int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv);
42227 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) {
42228 LDKCounterpartyCommitmentSecrets this_arg_conv;
42229 this_arg_conv.inner = untag_ptr(this_arg);
42230 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42232 this_arg_conv.is_owned = false;
42233 LDKThirtyTwoBytes secret_ref;
42234 CHECK((*env)->GetArrayLength(env, secret) == 32);
42235 (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_ref.data);
42236 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
42237 *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref);
42238 return tag_ptr(ret_conv, true);
42241 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
42242 LDKCounterpartyCommitmentSecrets this_arg_conv;
42243 this_arg_conv.inner = untag_ptr(this_arg);
42244 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42246 this_arg_conv.is_owned = false;
42247 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42248 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data);
42252 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1write(JNIEnv *env, jclass clz, int64_t obj) {
42253 LDKCounterpartyCommitmentSecrets obj_conv;
42254 obj_conv.inner = untag_ptr(obj);
42255 obj_conv.is_owned = ptr_is_owned(obj);
42256 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42257 obj_conv.is_owned = false;
42258 LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv);
42259 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42260 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42261 CVec_u8Z_free(ret_var);
42265 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42266 LDKu8slice ser_ref;
42267 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42268 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42269 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
42270 *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
42271 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42272 return tag_ptr(ret_conv, true);
42275 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_secret) {
42276 LDKPublicKey per_commitment_point_ref;
42277 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
42278 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
42279 uint8_t base_secret_arr[32];
42280 CHECK((*env)->GetArrayLength(env, base_secret) == 32);
42281 (*env)->GetByteArrayRegion(env, base_secret, 0, 32, base_secret_arr);
42282 uint8_t (*base_secret_ref)[32] = &base_secret_arr;
42283 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42284 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, derive_private_key(per_commitment_point_ref, base_secret_ref).bytes);
42288 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_point) {
42289 LDKPublicKey per_commitment_point_ref;
42290 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
42291 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
42292 LDKPublicKey base_point_ref;
42293 CHECK((*env)->GetArrayLength(env, base_point) == 33);
42294 (*env)->GetByteArrayRegion(env, base_point, 0, 33, base_point_ref.compressed_form);
42295 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42296 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, derive_public_key(per_commitment_point_ref, base_point_ref).compressed_form);
42300 JNIEXPORT int8_tArray 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) {
42301 uint8_t per_commitment_secret_arr[32];
42302 CHECK((*env)->GetArrayLength(env, per_commitment_secret) == 32);
42303 (*env)->GetByteArrayRegion(env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
42304 uint8_t (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
42305 uint8_t countersignatory_revocation_base_secret_arr[32];
42306 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_secret) == 32);
42307 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
42308 uint8_t (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
42309 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42310 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref).bytes);
42314 JNIEXPORT int8_tArray 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) {
42315 LDKPublicKey per_commitment_point_ref;
42316 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
42317 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
42318 LDKPublicKey countersignatory_revocation_base_point_ref;
42319 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_point) == 33);
42320 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_point, 0, 33, countersignatory_revocation_base_point_ref.compressed_form);
42321 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42322 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref).compressed_form);
42326 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42327 LDKTxCreationKeys this_obj_conv;
42328 this_obj_conv.inner = untag_ptr(this_obj);
42329 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42331 TxCreationKeys_free(this_obj_conv);
42334 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
42335 LDKTxCreationKeys this_ptr_conv;
42336 this_ptr_conv.inner = untag_ptr(this_ptr);
42337 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42339 this_ptr_conv.is_owned = false;
42340 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42341 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form);
42345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42346 LDKTxCreationKeys this_ptr_conv;
42347 this_ptr_conv.inner = untag_ptr(this_ptr);
42348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42350 this_ptr_conv.is_owned = false;
42351 LDKPublicKey val_ref;
42352 CHECK((*env)->GetArrayLength(env, val) == 33);
42353 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42354 TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref);
42357 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
42358 LDKTxCreationKeys this_ptr_conv;
42359 this_ptr_conv.inner = untag_ptr(this_ptr);
42360 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42362 this_ptr_conv.is_owned = false;
42363 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42364 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form);
42368 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42369 LDKTxCreationKeys this_ptr_conv;
42370 this_ptr_conv.inner = untag_ptr(this_ptr);
42371 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42373 this_ptr_conv.is_owned = false;
42374 LDKPublicKey val_ref;
42375 CHECK((*env)->GetArrayLength(env, val) == 33);
42376 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42377 TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref);
42380 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
42381 LDKTxCreationKeys this_ptr_conv;
42382 this_ptr_conv.inner = untag_ptr(this_ptr);
42383 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42384 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42385 this_ptr_conv.is_owned = false;
42386 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42387 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form);
42391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42392 LDKTxCreationKeys this_ptr_conv;
42393 this_ptr_conv.inner = untag_ptr(this_ptr);
42394 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42396 this_ptr_conv.is_owned = false;
42397 LDKPublicKey val_ref;
42398 CHECK((*env)->GetArrayLength(env, val) == 33);
42399 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42400 TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref);
42403 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
42404 LDKTxCreationKeys this_ptr_conv;
42405 this_ptr_conv.inner = untag_ptr(this_ptr);
42406 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42408 this_ptr_conv.is_owned = false;
42409 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42410 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form);
42414 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42415 LDKTxCreationKeys this_ptr_conv;
42416 this_ptr_conv.inner = untag_ptr(this_ptr);
42417 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42419 this_ptr_conv.is_owned = false;
42420 LDKPublicKey val_ref;
42421 CHECK((*env)->GetArrayLength(env, val) == 33);
42422 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42423 TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref);
42426 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
42427 LDKTxCreationKeys this_ptr_conv;
42428 this_ptr_conv.inner = untag_ptr(this_ptr);
42429 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42430 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42431 this_ptr_conv.is_owned = false;
42432 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42433 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form);
42437 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) {
42438 LDKTxCreationKeys this_ptr_conv;
42439 this_ptr_conv.inner = untag_ptr(this_ptr);
42440 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42442 this_ptr_conv.is_owned = false;
42443 LDKPublicKey val_ref;
42444 CHECK((*env)->GetArrayLength(env, val) == 33);
42445 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42446 TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref);
42449 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) {
42450 LDKPublicKey per_commitment_point_arg_ref;
42451 CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
42452 (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
42453 LDKPublicKey revocation_key_arg_ref;
42454 CHECK((*env)->GetArrayLength(env, revocation_key_arg) == 33);
42455 (*env)->GetByteArrayRegion(env, revocation_key_arg, 0, 33, revocation_key_arg_ref.compressed_form);
42456 LDKPublicKey broadcaster_htlc_key_arg_ref;
42457 CHECK((*env)->GetArrayLength(env, broadcaster_htlc_key_arg) == 33);
42458 (*env)->GetByteArrayRegion(env, broadcaster_htlc_key_arg, 0, 33, broadcaster_htlc_key_arg_ref.compressed_form);
42459 LDKPublicKey countersignatory_htlc_key_arg_ref;
42460 CHECK((*env)->GetArrayLength(env, countersignatory_htlc_key_arg) == 33);
42461 (*env)->GetByteArrayRegion(env, countersignatory_htlc_key_arg, 0, 33, countersignatory_htlc_key_arg_ref.compressed_form);
42462 LDKPublicKey broadcaster_delayed_payment_key_arg_ref;
42463 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key_arg) == 33);
42464 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form);
42465 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);
42466 int64_t ret_ref = 0;
42467 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42468 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42472 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42473 LDKTxCreationKeys a_conv;
42474 a_conv.inner = untag_ptr(a);
42475 a_conv.is_owned = ptr_is_owned(a);
42476 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42477 a_conv.is_owned = false;
42478 LDKTxCreationKeys b_conv;
42479 b_conv.inner = untag_ptr(b);
42480 b_conv.is_owned = ptr_is_owned(b);
42481 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42482 b_conv.is_owned = false;
42483 jboolean ret_conv = TxCreationKeys_eq(&a_conv, &b_conv);
42487 static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
42488 LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
42489 int64_t ret_ref = 0;
42490 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42491 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42494 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42495 LDKTxCreationKeys arg_conv;
42496 arg_conv.inner = untag_ptr(arg);
42497 arg_conv.is_owned = ptr_is_owned(arg);
42498 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42499 arg_conv.is_owned = false;
42500 int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv);
42504 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42505 LDKTxCreationKeys orig_conv;
42506 orig_conv.inner = untag_ptr(orig);
42507 orig_conv.is_owned = ptr_is_owned(orig);
42508 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42509 orig_conv.is_owned = false;
42510 LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
42511 int64_t ret_ref = 0;
42512 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42513 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42517 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
42518 LDKTxCreationKeys obj_conv;
42519 obj_conv.inner = untag_ptr(obj);
42520 obj_conv.is_owned = ptr_is_owned(obj);
42521 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42522 obj_conv.is_owned = false;
42523 LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
42524 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42525 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42526 CVec_u8Z_free(ret_var);
42530 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42531 LDKu8slice ser_ref;
42532 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42533 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42534 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
42535 *ret_conv = TxCreationKeys_read(ser_ref);
42536 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42537 return tag_ptr(ret_conv, true);
42540 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42541 LDKChannelPublicKeys this_obj_conv;
42542 this_obj_conv.inner = untag_ptr(this_obj);
42543 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42545 ChannelPublicKeys_free(this_obj_conv);
42548 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
42549 LDKChannelPublicKeys this_ptr_conv;
42550 this_ptr_conv.inner = untag_ptr(this_ptr);
42551 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42553 this_ptr_conv.is_owned = false;
42554 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42555 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form);
42559 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42560 LDKChannelPublicKeys this_ptr_conv;
42561 this_ptr_conv.inner = untag_ptr(this_ptr);
42562 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42564 this_ptr_conv.is_owned = false;
42565 LDKPublicKey val_ref;
42566 CHECK((*env)->GetArrayLength(env, val) == 33);
42567 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42568 ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref);
42571 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
42572 LDKChannelPublicKeys this_ptr_conv;
42573 this_ptr_conv.inner = untag_ptr(this_ptr);
42574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42576 this_ptr_conv.is_owned = false;
42577 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42578 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form);
42582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42583 LDKChannelPublicKeys this_ptr_conv;
42584 this_ptr_conv.inner = untag_ptr(this_ptr);
42585 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42587 this_ptr_conv.is_owned = false;
42588 LDKPublicKey val_ref;
42589 CHECK((*env)->GetArrayLength(env, val) == 33);
42590 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42591 ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref);
42594 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
42595 LDKChannelPublicKeys this_ptr_conv;
42596 this_ptr_conv.inner = untag_ptr(this_ptr);
42597 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42599 this_ptr_conv.is_owned = false;
42600 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42601 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form);
42605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42606 LDKChannelPublicKeys this_ptr_conv;
42607 this_ptr_conv.inner = untag_ptr(this_ptr);
42608 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42609 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42610 this_ptr_conv.is_owned = false;
42611 LDKPublicKey val_ref;
42612 CHECK((*env)->GetArrayLength(env, val) == 33);
42613 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42614 ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref);
42617 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
42618 LDKChannelPublicKeys this_ptr_conv;
42619 this_ptr_conv.inner = untag_ptr(this_ptr);
42620 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42622 this_ptr_conv.is_owned = false;
42623 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42624 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
42628 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42629 LDKChannelPublicKeys this_ptr_conv;
42630 this_ptr_conv.inner = untag_ptr(this_ptr);
42631 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42633 this_ptr_conv.is_owned = false;
42634 LDKPublicKey val_ref;
42635 CHECK((*env)->GetArrayLength(env, val) == 33);
42636 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42637 ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
42640 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
42641 LDKChannelPublicKeys this_ptr_conv;
42642 this_ptr_conv.inner = untag_ptr(this_ptr);
42643 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42645 this_ptr_conv.is_owned = false;
42646 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42647 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form);
42651 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42652 LDKChannelPublicKeys this_ptr_conv;
42653 this_ptr_conv.inner = untag_ptr(this_ptr);
42654 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42656 this_ptr_conv.is_owned = false;
42657 LDKPublicKey val_ref;
42658 CHECK((*env)->GetArrayLength(env, val) == 33);
42659 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42660 ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref);
42663 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) {
42664 LDKPublicKey funding_pubkey_arg_ref;
42665 CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33);
42666 (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form);
42667 LDKPublicKey revocation_basepoint_arg_ref;
42668 CHECK((*env)->GetArrayLength(env, revocation_basepoint_arg) == 33);
42669 (*env)->GetByteArrayRegion(env, revocation_basepoint_arg, 0, 33, revocation_basepoint_arg_ref.compressed_form);
42670 LDKPublicKey payment_point_arg_ref;
42671 CHECK((*env)->GetArrayLength(env, payment_point_arg) == 33);
42672 (*env)->GetByteArrayRegion(env, payment_point_arg, 0, 33, payment_point_arg_ref.compressed_form);
42673 LDKPublicKey delayed_payment_basepoint_arg_ref;
42674 CHECK((*env)->GetArrayLength(env, delayed_payment_basepoint_arg) == 33);
42675 (*env)->GetByteArrayRegion(env, delayed_payment_basepoint_arg, 0, 33, delayed_payment_basepoint_arg_ref.compressed_form);
42676 LDKPublicKey htlc_basepoint_arg_ref;
42677 CHECK((*env)->GetArrayLength(env, htlc_basepoint_arg) == 33);
42678 (*env)->GetByteArrayRegion(env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form);
42679 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);
42680 int64_t ret_ref = 0;
42681 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42682 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42686 static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) {
42687 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg);
42688 int64_t ret_ref = 0;
42689 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42690 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42693 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42694 LDKChannelPublicKeys arg_conv;
42695 arg_conv.inner = untag_ptr(arg);
42696 arg_conv.is_owned = ptr_is_owned(arg);
42697 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42698 arg_conv.is_owned = false;
42699 int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv);
42703 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42704 LDKChannelPublicKeys orig_conv;
42705 orig_conv.inner = untag_ptr(orig);
42706 orig_conv.is_owned = ptr_is_owned(orig);
42707 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42708 orig_conv.is_owned = false;
42709 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
42710 int64_t ret_ref = 0;
42711 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42712 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42716 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42717 LDKChannelPublicKeys a_conv;
42718 a_conv.inner = untag_ptr(a);
42719 a_conv.is_owned = ptr_is_owned(a);
42720 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42721 a_conv.is_owned = false;
42722 LDKChannelPublicKeys b_conv;
42723 b_conv.inner = untag_ptr(b);
42724 b_conv.is_owned = ptr_is_owned(b);
42725 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42726 b_conv.is_owned = false;
42727 jboolean ret_conv = ChannelPublicKeys_eq(&a_conv, &b_conv);
42731 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
42732 LDKChannelPublicKeys obj_conv;
42733 obj_conv.inner = untag_ptr(obj);
42734 obj_conv.is_owned = ptr_is_owned(obj);
42735 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42736 obj_conv.is_owned = false;
42737 LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
42738 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42739 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42740 CVec_u8Z_free(ret_var);
42744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42745 LDKu8slice ser_ref;
42746 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42747 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42748 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
42749 *ret_conv = ChannelPublicKeys_read(ser_ref);
42750 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42751 return tag_ptr(ret_conv, true);
42754 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) {
42755 LDKPublicKey per_commitment_point_ref;
42756 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
42757 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
42758 LDKPublicKey broadcaster_delayed_payment_base_ref;
42759 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_base) == 33);
42760 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_base, 0, 33, broadcaster_delayed_payment_base_ref.compressed_form);
42761 LDKPublicKey broadcaster_htlc_base_ref;
42762 CHECK((*env)->GetArrayLength(env, broadcaster_htlc_base) == 33);
42763 (*env)->GetByteArrayRegion(env, broadcaster_htlc_base, 0, 33, broadcaster_htlc_base_ref.compressed_form);
42764 LDKPublicKey countersignatory_revocation_base_ref;
42765 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base) == 33);
42766 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base, 0, 33, countersignatory_revocation_base_ref.compressed_form);
42767 LDKPublicKey countersignatory_htlc_base_ref;
42768 CHECK((*env)->GetArrayLength(env, countersignatory_htlc_base) == 33);
42769 (*env)->GetByteArrayRegion(env, countersignatory_htlc_base, 0, 33, countersignatory_htlc_base_ref.compressed_form);
42770 LDKTxCreationKeys ret_var = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref);
42771 int64_t ret_ref = 0;
42772 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42773 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42777 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) {
42778 LDKPublicKey per_commitment_point_ref;
42779 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
42780 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
42781 LDKChannelPublicKeys broadcaster_keys_conv;
42782 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
42783 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
42784 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
42785 broadcaster_keys_conv.is_owned = false;
42786 LDKChannelPublicKeys countersignatory_keys_conv;
42787 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
42788 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
42789 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
42790 countersignatory_keys_conv.is_owned = false;
42791 LDKTxCreationKeys ret_var = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
42792 int64_t ret_ref = 0;
42793 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42794 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42798 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) {
42799 LDKPublicKey revocation_key_ref;
42800 CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
42801 (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
42802 LDKPublicKey broadcaster_delayed_payment_key_ref;
42803 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33);
42804 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
42805 LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
42806 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42807 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42808 CVec_u8Z_free(ret_var);
42812 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42813 LDKHTLCOutputInCommitment this_obj_conv;
42814 this_obj_conv.inner = untag_ptr(this_obj);
42815 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42817 HTLCOutputInCommitment_free(this_obj_conv);
42820 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv *env, jclass clz, int64_t this_ptr) {
42821 LDKHTLCOutputInCommitment this_ptr_conv;
42822 this_ptr_conv.inner = untag_ptr(this_ptr);
42823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42825 this_ptr_conv.is_owned = false;
42826 jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
42830 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
42831 LDKHTLCOutputInCommitment this_ptr_conv;
42832 this_ptr_conv.inner = untag_ptr(this_ptr);
42833 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42834 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42835 this_ptr_conv.is_owned = false;
42836 HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
42839 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
42840 LDKHTLCOutputInCommitment this_ptr_conv;
42841 this_ptr_conv.inner = untag_ptr(this_ptr);
42842 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42843 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42844 this_ptr_conv.is_owned = false;
42845 int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
42849 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
42850 LDKHTLCOutputInCommitment this_ptr_conv;
42851 this_ptr_conv.inner = untag_ptr(this_ptr);
42852 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42854 this_ptr_conv.is_owned = false;
42855 HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
42858 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) {
42859 LDKHTLCOutputInCommitment this_ptr_conv;
42860 this_ptr_conv.inner = untag_ptr(this_ptr);
42861 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42862 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42863 this_ptr_conv.is_owned = false;
42864 int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
42868 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
42869 LDKHTLCOutputInCommitment this_ptr_conv;
42870 this_ptr_conv.inner = untag_ptr(this_ptr);
42871 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42873 this_ptr_conv.is_owned = false;
42874 HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
42877 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
42878 LDKHTLCOutputInCommitment this_ptr_conv;
42879 this_ptr_conv.inner = untag_ptr(this_ptr);
42880 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42881 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42882 this_ptr_conv.is_owned = false;
42883 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42884 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv));
42888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42889 LDKHTLCOutputInCommitment this_ptr_conv;
42890 this_ptr_conv.inner = untag_ptr(this_ptr);
42891 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42893 this_ptr_conv.is_owned = false;
42894 LDKThirtyTwoBytes val_ref;
42895 CHECK((*env)->GetArrayLength(env, val) == 32);
42896 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
42897 HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref);
42900 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
42901 LDKHTLCOutputInCommitment this_ptr_conv;
42902 this_ptr_conv.inner = untag_ptr(this_ptr);
42903 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42904 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42905 this_ptr_conv.is_owned = false;
42906 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
42907 *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv);
42908 int64_t ret_ref = tag_ptr(ret_copy, true);
42912 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
42913 LDKHTLCOutputInCommitment this_ptr_conv;
42914 this_ptr_conv.inner = untag_ptr(this_ptr);
42915 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42917 this_ptr_conv.is_owned = false;
42918 void* val_ptr = untag_ptr(val);
42919 CHECK_ACCESS(val_ptr);
42920 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
42921 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
42922 HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
42925 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) {
42926 LDKThirtyTwoBytes payment_hash_arg_ref;
42927 CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32);
42928 (*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data);
42929 void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg);
42930 CHECK_ACCESS(transaction_output_index_arg_ptr);
42931 LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
42932 transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg));
42933 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
42934 int64_t ret_ref = 0;
42935 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42936 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42940 static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) {
42941 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg);
42942 int64_t ret_ref = 0;
42943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42947 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42948 LDKHTLCOutputInCommitment arg_conv;
42949 arg_conv.inner = untag_ptr(arg);
42950 arg_conv.is_owned = ptr_is_owned(arg);
42951 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42952 arg_conv.is_owned = false;
42953 int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv);
42957 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42958 LDKHTLCOutputInCommitment orig_conv;
42959 orig_conv.inner = untag_ptr(orig);
42960 orig_conv.is_owned = ptr_is_owned(orig);
42961 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42962 orig_conv.is_owned = false;
42963 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
42964 int64_t ret_ref = 0;
42965 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42966 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42970 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42971 LDKHTLCOutputInCommitment a_conv;
42972 a_conv.inner = untag_ptr(a);
42973 a_conv.is_owned = ptr_is_owned(a);
42974 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42975 a_conv.is_owned = false;
42976 LDKHTLCOutputInCommitment b_conv;
42977 b_conv.inner = untag_ptr(b);
42978 b_conv.is_owned = ptr_is_owned(b);
42979 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42980 b_conv.is_owned = false;
42981 jboolean ret_conv = HTLCOutputInCommitment_eq(&a_conv, &b_conv);
42985 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) {
42986 LDKHTLCOutputInCommitment obj_conv;
42987 obj_conv.inner = untag_ptr(obj);
42988 obj_conv.is_owned = ptr_is_owned(obj);
42989 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42990 obj_conv.is_owned = false;
42991 LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
42992 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42993 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42994 CVec_u8Z_free(ret_var);
42998 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42999 LDKu8slice ser_ref;
43000 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43001 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43002 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
43003 *ret_conv = HTLCOutputInCommitment_read(ser_ref);
43004 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43005 return tag_ptr(ret_conv, true);
43008 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) {
43009 LDKHTLCOutputInCommitment htlc_conv;
43010 htlc_conv.inner = untag_ptr(htlc);
43011 htlc_conv.is_owned = ptr_is_owned(htlc);
43012 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
43013 htlc_conv.is_owned = false;
43014 LDKTxCreationKeys keys_conv;
43015 keys_conv.inner = untag_ptr(keys);
43016 keys_conv.is_owned = ptr_is_owned(keys);
43017 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
43018 keys_conv.is_owned = false;
43019 LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
43020 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43021 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43022 CVec_u8Z_free(ret_var);
43026 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv *env, jclass clz, int8_tArray broadcaster, int8_tArray countersignatory) {
43027 LDKPublicKey broadcaster_ref;
43028 CHECK((*env)->GetArrayLength(env, broadcaster) == 33);
43029 (*env)->GetByteArrayRegion(env, broadcaster, 0, 33, broadcaster_ref.compressed_form);
43030 LDKPublicKey countersignatory_ref;
43031 CHECK((*env)->GetArrayLength(env, countersignatory) == 33);
43032 (*env)->GetByteArrayRegion(env, countersignatory, 0, 33, countersignatory_ref.compressed_form);
43033 LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
43034 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43035 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43036 CVec_u8Z_free(ret_var);
43040 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, jboolean use_non_zero_fee_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
43041 uint8_t commitment_txid_arr[32];
43042 CHECK((*env)->GetArrayLength(env, commitment_txid) == 32);
43043 (*env)->GetByteArrayRegion(env, commitment_txid, 0, 32, commitment_txid_arr);
43044 uint8_t (*commitment_txid_ref)[32] = &commitment_txid_arr;
43045 LDKHTLCOutputInCommitment htlc_conv;
43046 htlc_conv.inner = untag_ptr(htlc);
43047 htlc_conv.is_owned = ptr_is_owned(htlc);
43048 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
43049 htlc_conv.is_owned = false;
43050 LDKPublicKey broadcaster_delayed_payment_key_ref;
43051 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33);
43052 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
43053 LDKPublicKey revocation_key_ref;
43054 CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
43055 (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
43056 LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, use_non_zero_fee_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref);
43057 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43058 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43059 Transaction_free(ret_var);
43063 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1input_1witness(JNIEnv *env, jclass clz, int8_tArray local_sig, int8_tArray remote_sig, int8_tArray preimage, int8_tArray redeem_script, jboolean opt_anchors) {
43064 LDKSignature local_sig_ref;
43065 CHECK((*env)->GetArrayLength(env, local_sig) == 64);
43066 (*env)->GetByteArrayRegion(env, local_sig, 0, 64, local_sig_ref.compact_form);
43067 LDKSignature remote_sig_ref;
43068 CHECK((*env)->GetArrayLength(env, remote_sig) == 64);
43069 (*env)->GetByteArrayRegion(env, remote_sig, 0, 64, remote_sig_ref.compact_form);
43070 LDKThirtyTwoBytes preimage_ref;
43071 CHECK((*env)->GetArrayLength(env, preimage) == 32);
43072 (*env)->GetByteArrayRegion(env, preimage, 0, 32, preimage_ref.data);
43073 LDKu8slice redeem_script_ref;
43074 redeem_script_ref.datalen = (*env)->GetArrayLength(env, redeem_script);
43075 redeem_script_ref.data = (*env)->GetByteArrayElements (env, redeem_script, NULL);
43076 LDKWitness ret_var = build_htlc_input_witness(local_sig_ref, remote_sig_ref, preimage_ref, redeem_script_ref, opt_anchors);
43077 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43078 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43079 Witness_free(ret_var);
43080 (*env)->ReleaseByteArrayElements(env, redeem_script, (int8_t*)redeem_script_ref.data, 0);
43084 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1to_1countersignatory_1with_1anchors_1redeemscript(JNIEnv *env, jclass clz, int8_tArray payment_point) {
43085 LDKPublicKey payment_point_ref;
43086 CHECK((*env)->GetArrayLength(env, payment_point) == 33);
43087 (*env)->GetByteArrayRegion(env, payment_point, 0, 33, payment_point_ref.compressed_form);
43088 LDKCVec_u8Z ret_var = get_to_countersignatory_with_anchors_redeemscript(payment_point_ref);
43089 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43090 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43091 CVec_u8Z_free(ret_var);
43095 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript(JNIEnv *env, jclass clz, int8_tArray funding_pubkey) {
43096 LDKPublicKey funding_pubkey_ref;
43097 CHECK((*env)->GetArrayLength(env, funding_pubkey) == 33);
43098 (*env)->GetByteArrayRegion(env, funding_pubkey, 0, 33, funding_pubkey_ref.compressed_form);
43099 LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
43100 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43101 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43102 CVec_u8Z_free(ret_var);
43106 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1anchor_1input_1witness(JNIEnv *env, jclass clz, int8_tArray funding_key, int8_tArray funding_sig) {
43107 LDKPublicKey funding_key_ref;
43108 CHECK((*env)->GetArrayLength(env, funding_key) == 33);
43109 (*env)->GetByteArrayRegion(env, funding_key, 0, 33, funding_key_ref.compressed_form);
43110 LDKSignature funding_sig_ref;
43111 CHECK((*env)->GetArrayLength(env, funding_sig) == 64);
43112 (*env)->GetByteArrayRegion(env, funding_sig, 0, 64, funding_sig_ref.compact_form);
43113 LDKWitness ret_var = build_anchor_input_witness(funding_key_ref, funding_sig_ref);
43114 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43115 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43116 Witness_free(ret_var);
43120 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43121 LDKChannelTransactionParameters this_obj_conv;
43122 this_obj_conv.inner = untag_ptr(this_obj);
43123 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43125 ChannelTransactionParameters_free(this_obj_conv);
43128 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) {
43129 LDKChannelTransactionParameters this_ptr_conv;
43130 this_ptr_conv.inner = untag_ptr(this_ptr);
43131 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43133 this_ptr_conv.is_owned = false;
43134 LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv);
43135 int64_t ret_ref = 0;
43136 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43137 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43141 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43142 LDKChannelTransactionParameters this_ptr_conv;
43143 this_ptr_conv.inner = untag_ptr(this_ptr);
43144 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43146 this_ptr_conv.is_owned = false;
43147 LDKChannelPublicKeys val_conv;
43148 val_conv.inner = untag_ptr(val);
43149 val_conv.is_owned = ptr_is_owned(val);
43150 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43151 val_conv = ChannelPublicKeys_clone(&val_conv);
43152 ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv);
43155 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
43156 LDKChannelTransactionParameters this_ptr_conv;
43157 this_ptr_conv.inner = untag_ptr(this_ptr);
43158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43160 this_ptr_conv.is_owned = false;
43161 int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv);
43165 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) {
43166 LDKChannelTransactionParameters this_ptr_conv;
43167 this_ptr_conv.inner = untag_ptr(this_ptr);
43168 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43170 this_ptr_conv.is_owned = false;
43171 ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val);
43174 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr) {
43175 LDKChannelTransactionParameters this_ptr_conv;
43176 this_ptr_conv.inner = untag_ptr(this_ptr);
43177 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43179 this_ptr_conv.is_owned = false;
43180 jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv);
43184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
43185 LDKChannelTransactionParameters this_ptr_conv;
43186 this_ptr_conv.inner = untag_ptr(this_ptr);
43187 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43189 this_ptr_conv.is_owned = false;
43190 ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val);
43193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) {
43194 LDKChannelTransactionParameters this_ptr_conv;
43195 this_ptr_conv.inner = untag_ptr(this_ptr);
43196 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43198 this_ptr_conv.is_owned = false;
43199 LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
43200 int64_t ret_ref = 0;
43201 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43202 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43206 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43207 LDKChannelTransactionParameters this_ptr_conv;
43208 this_ptr_conv.inner = untag_ptr(this_ptr);
43209 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43211 this_ptr_conv.is_owned = false;
43212 LDKCounterpartyChannelTransactionParameters val_conv;
43213 val_conv.inner = untag_ptr(val);
43214 val_conv.is_owned = ptr_is_owned(val);
43215 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43216 val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv);
43217 ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv);
43220 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
43221 LDKChannelTransactionParameters this_ptr_conv;
43222 this_ptr_conv.inner = untag_ptr(this_ptr);
43223 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43224 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43225 this_ptr_conv.is_owned = false;
43226 LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
43227 int64_t ret_ref = 0;
43228 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43229 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43233 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43234 LDKChannelTransactionParameters this_ptr_conv;
43235 this_ptr_conv.inner = untag_ptr(this_ptr);
43236 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43238 this_ptr_conv.is_owned = false;
43239 LDKOutPoint val_conv;
43240 val_conv.inner = untag_ptr(val);
43241 val_conv.is_owned = ptr_is_owned(val);
43242 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43243 val_conv = OutPoint_clone(&val_conv);
43244 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
43247 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) {
43248 LDKChannelTransactionParameters this_ptr_conv;
43249 this_ptr_conv.inner = untag_ptr(this_ptr);
43250 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43251 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43252 this_ptr_conv.is_owned = false;
43253 jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
43257 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
43258 LDKChannelTransactionParameters this_ptr_conv;
43259 this_ptr_conv.inner = untag_ptr(this_ptr);
43260 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43261 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43262 this_ptr_conv.is_owned = false;
43263 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val);
43264 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
43267 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1non_1zero_1fee_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) {
43268 LDKChannelTransactionParameters this_ptr_conv;
43269 this_ptr_conv.inner = untag_ptr(this_ptr);
43270 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43272 this_ptr_conv.is_owned = false;
43273 jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_non_zero_fee_anchors(&this_ptr_conv));
43277 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1non_1zero_1fee_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
43278 LDKChannelTransactionParameters this_ptr_conv;
43279 this_ptr_conv.inner = untag_ptr(this_ptr);
43280 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43281 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43282 this_ptr_conv.is_owned = false;
43283 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val);
43284 ChannelTransactionParameters_set_opt_non_zero_fee_anchors(&this_ptr_conv, val_conv);
43287 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, jclass opt_non_zero_fee_anchors_arg) {
43288 LDKChannelPublicKeys holder_pubkeys_arg_conv;
43289 holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg);
43290 holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg);
43291 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv);
43292 holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv);
43293 LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv;
43294 counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg);
43295 counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg);
43296 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv);
43297 counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv);
43298 LDKOutPoint funding_outpoint_arg_conv;
43299 funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg);
43300 funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_arg);
43301 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
43302 funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
43303 LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_anchors_arg);
43304 LDKCOption_NoneZ opt_non_zero_fee_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_non_zero_fee_anchors_arg);
43305 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, opt_non_zero_fee_anchors_arg_conv);
43306 int64_t ret_ref = 0;
43307 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43308 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43312 static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) {
43313 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg);
43314 int64_t ret_ref = 0;
43315 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43316 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43319 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43320 LDKChannelTransactionParameters arg_conv;
43321 arg_conv.inner = untag_ptr(arg);
43322 arg_conv.is_owned = ptr_is_owned(arg);
43323 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43324 arg_conv.is_owned = false;
43325 int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv);
43329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43330 LDKChannelTransactionParameters orig_conv;
43331 orig_conv.inner = untag_ptr(orig);
43332 orig_conv.is_owned = ptr_is_owned(orig);
43333 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43334 orig_conv.is_owned = false;
43335 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv);
43336 int64_t ret_ref = 0;
43337 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43338 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43342 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43343 LDKCounterpartyChannelTransactionParameters this_obj_conv;
43344 this_obj_conv.inner = untag_ptr(this_obj);
43345 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43346 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43347 CounterpartyChannelTransactionParameters_free(this_obj_conv);
43350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) {
43351 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
43352 this_ptr_conv.inner = untag_ptr(this_ptr);
43353 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43354 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43355 this_ptr_conv.is_owned = false;
43356 LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv);
43357 int64_t ret_ref = 0;
43358 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43359 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43364 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
43365 this_ptr_conv.inner = untag_ptr(this_ptr);
43366 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43367 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43368 this_ptr_conv.is_owned = false;
43369 LDKChannelPublicKeys val_conv;
43370 val_conv.inner = untag_ptr(val);
43371 val_conv.is_owned = ptr_is_owned(val);
43372 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43373 val_conv = ChannelPublicKeys_clone(&val_conv);
43374 CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv);
43377 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
43378 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
43379 this_ptr_conv.inner = untag_ptr(this_ptr);
43380 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43381 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43382 this_ptr_conv.is_owned = false;
43383 int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv);
43387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
43388 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
43389 this_ptr_conv.inner = untag_ptr(this_ptr);
43390 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43392 this_ptr_conv.is_owned = false;
43393 CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val);
43396 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) {
43397 LDKChannelPublicKeys pubkeys_arg_conv;
43398 pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg);
43399 pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg);
43400 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv);
43401 pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
43402 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg);
43403 int64_t ret_ref = 0;
43404 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43405 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43409 static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) {
43410 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg);
43411 int64_t ret_ref = 0;
43412 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43413 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43416 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43417 LDKCounterpartyChannelTransactionParameters arg_conv;
43418 arg_conv.inner = untag_ptr(arg);
43419 arg_conv.is_owned = ptr_is_owned(arg);
43420 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43421 arg_conv.is_owned = false;
43422 int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv);
43426 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43427 LDKCounterpartyChannelTransactionParameters orig_conv;
43428 orig_conv.inner = untag_ptr(orig);
43429 orig_conv.is_owned = ptr_is_owned(orig);
43430 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43431 orig_conv.is_owned = false;
43432 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv);
43433 int64_t ret_ref = 0;
43434 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43435 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43439 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1is_1populated(JNIEnv *env, jclass clz, int64_t this_arg) {
43440 LDKChannelTransactionParameters this_arg_conv;
43441 this_arg_conv.inner = untag_ptr(this_arg);
43442 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43444 this_arg_conv.is_owned = false;
43445 jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv);
43449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1holder_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) {
43450 LDKChannelTransactionParameters this_arg_conv;
43451 this_arg_conv.inner = untag_ptr(this_arg);
43452 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43454 this_arg_conv.is_owned = false;
43455 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv);
43456 int64_t ret_ref = 0;
43457 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43458 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43462 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1counterparty_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) {
43463 LDKChannelTransactionParameters this_arg_conv;
43464 this_arg_conv.inner = untag_ptr(this_arg);
43465 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43467 this_arg_conv.is_owned = false;
43468 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv);
43469 int64_t ret_ref = 0;
43470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43471 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43475 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
43476 LDKCounterpartyChannelTransactionParameters obj_conv;
43477 obj_conv.inner = untag_ptr(obj);
43478 obj_conv.is_owned = ptr_is_owned(obj);
43479 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43480 obj_conv.is_owned = false;
43481 LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
43482 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43483 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43484 CVec_u8Z_free(ret_var);
43488 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43489 LDKu8slice ser_ref;
43490 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43491 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43492 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
43493 *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
43494 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43495 return tag_ptr(ret_conv, true);
43498 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
43499 LDKChannelTransactionParameters obj_conv;
43500 obj_conv.inner = untag_ptr(obj);
43501 obj_conv.is_owned = ptr_is_owned(obj);
43502 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43503 obj_conv.is_owned = false;
43504 LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
43505 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43506 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43507 CVec_u8Z_free(ret_var);
43511 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43512 LDKu8slice ser_ref;
43513 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43514 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43515 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
43516 *ret_conv = ChannelTransactionParameters_read(ser_ref);
43517 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43518 return tag_ptr(ret_conv, true);
43521 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43522 LDKDirectedChannelTransactionParameters this_obj_conv;
43523 this_obj_conv.inner = untag_ptr(this_obj);
43524 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43526 DirectedChannelTransactionParameters_free(this_obj_conv);
43529 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
43530 LDKDirectedChannelTransactionParameters this_arg_conv;
43531 this_arg_conv.inner = untag_ptr(this_arg);
43532 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43533 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43534 this_arg_conv.is_owned = false;
43535 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv);
43536 int64_t ret_ref = 0;
43537 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43538 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43542 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
43543 LDKDirectedChannelTransactionParameters this_arg_conv;
43544 this_arg_conv.inner = untag_ptr(this_arg);
43545 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43546 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43547 this_arg_conv.is_owned = false;
43548 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv);
43549 int64_t ret_ref = 0;
43550 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43551 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43555 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
43556 LDKDirectedChannelTransactionParameters this_arg_conv;
43557 this_arg_conv.inner = untag_ptr(this_arg);
43558 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43560 this_arg_conv.is_owned = false;
43561 int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv);
43565 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) {
43566 LDKDirectedChannelTransactionParameters this_arg_conv;
43567 this_arg_conv.inner = untag_ptr(this_arg);
43568 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43570 this_arg_conv.is_owned = false;
43571 jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv);
43575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) {
43576 LDKDirectedChannelTransactionParameters this_arg_conv;
43577 this_arg_conv.inner = untag_ptr(this_arg);
43578 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43580 this_arg_conv.is_owned = false;
43581 LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv);
43582 int64_t ret_ref = 0;
43583 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43584 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43588 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
43589 LDKDirectedChannelTransactionParameters this_arg_conv;
43590 this_arg_conv.inner = untag_ptr(this_arg);
43591 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43592 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43593 this_arg_conv.is_owned = false;
43594 jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
43598 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43599 LDKHolderCommitmentTransaction this_obj_conv;
43600 this_obj_conv.inner = untag_ptr(this_obj);
43601 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43602 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43603 HolderCommitmentTransaction_free(this_obj_conv);
43606 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) {
43607 LDKHolderCommitmentTransaction this_ptr_conv;
43608 this_ptr_conv.inner = untag_ptr(this_ptr);
43609 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43611 this_ptr_conv.is_owned = false;
43612 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
43613 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form);
43617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
43618 LDKHolderCommitmentTransaction this_ptr_conv;
43619 this_ptr_conv.inner = untag_ptr(this_ptr);
43620 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43622 this_ptr_conv.is_owned = false;
43623 LDKSignature val_ref;
43624 CHECK((*env)->GetArrayLength(env, val) == 64);
43625 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
43626 HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref);
43629 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr) {
43630 LDKHolderCommitmentTransaction this_ptr_conv;
43631 this_ptr_conv.inner = untag_ptr(this_ptr);
43632 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43634 this_ptr_conv.is_owned = false;
43635 LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_conv);
43636 jobjectArray ret_arr = NULL;
43637 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
43639 for (size_t i = 0; i < ret_var.datalen; i++) {
43640 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
43641 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
43642 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
43645 FREE(ret_var.data);
43649 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
43650 LDKHolderCommitmentTransaction this_ptr_conv;
43651 this_ptr_conv.inner = untag_ptr(this_ptr);
43652 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43653 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43654 this_ptr_conv.is_owned = false;
43655 LDKCVec_SignatureZ val_constr;
43656 val_constr.datalen = (*env)->GetArrayLength(env, val);
43657 if (val_constr.datalen > 0)
43658 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
43660 val_constr.data = NULL;
43661 for (size_t i = 0; i < val_constr.datalen; i++) {
43662 int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
43663 LDKSignature val_conv_8_ref;
43664 CHECK((*env)->GetArrayLength(env, val_conv_8) == 64);
43665 (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form);
43666 val_constr.data[i] = val_conv_8_ref;
43668 HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
43671 static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) {
43672 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg);
43673 int64_t ret_ref = 0;
43674 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43675 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43678 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43679 LDKHolderCommitmentTransaction arg_conv;
43680 arg_conv.inner = untag_ptr(arg);
43681 arg_conv.is_owned = ptr_is_owned(arg);
43682 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43683 arg_conv.is_owned = false;
43684 int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv);
43688 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43689 LDKHolderCommitmentTransaction orig_conv;
43690 orig_conv.inner = untag_ptr(orig);
43691 orig_conv.is_owned = ptr_is_owned(orig);
43692 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43693 orig_conv.is_owned = false;
43694 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
43695 int64_t ret_ref = 0;
43696 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43697 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43701 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
43702 LDKHolderCommitmentTransaction obj_conv;
43703 obj_conv.inner = untag_ptr(obj);
43704 obj_conv.is_owned = ptr_is_owned(obj);
43705 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43706 obj_conv.is_owned = false;
43707 LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
43708 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43709 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43710 CVec_u8Z_free(ret_var);
43714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43715 LDKu8slice ser_ref;
43716 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43717 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43718 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
43719 *ret_conv = HolderCommitmentTransaction_read(ser_ref);
43720 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43721 return tag_ptr(ret_conv, true);
43724 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) {
43725 LDKCommitmentTransaction commitment_tx_conv;
43726 commitment_tx_conv.inner = untag_ptr(commitment_tx);
43727 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
43728 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
43729 commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv);
43730 LDKSignature counterparty_sig_ref;
43731 CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64);
43732 (*env)->GetByteArrayRegion(env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form);
43733 LDKCVec_SignatureZ counterparty_htlc_sigs_constr;
43734 counterparty_htlc_sigs_constr.datalen = (*env)->GetArrayLength(env, counterparty_htlc_sigs);
43735 if (counterparty_htlc_sigs_constr.datalen > 0)
43736 counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
43738 counterparty_htlc_sigs_constr.data = NULL;
43739 for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) {
43740 int8_tArray counterparty_htlc_sigs_conv_8 = (*env)->GetObjectArrayElement(env, counterparty_htlc_sigs, i);
43741 LDKSignature counterparty_htlc_sigs_conv_8_ref;
43742 CHECK((*env)->GetArrayLength(env, counterparty_htlc_sigs_conv_8) == 64);
43743 (*env)->GetByteArrayRegion(env, counterparty_htlc_sigs_conv_8, 0, 64, counterparty_htlc_sigs_conv_8_ref.compact_form);
43744 counterparty_htlc_sigs_constr.data[i] = counterparty_htlc_sigs_conv_8_ref;
43746 LDKPublicKey holder_funding_key_ref;
43747 CHECK((*env)->GetArrayLength(env, holder_funding_key) == 33);
43748 (*env)->GetByteArrayRegion(env, holder_funding_key, 0, 33, holder_funding_key_ref.compressed_form);
43749 LDKPublicKey counterparty_funding_key_ref;
43750 CHECK((*env)->GetArrayLength(env, counterparty_funding_key) == 33);
43751 (*env)->GetByteArrayRegion(env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form);
43752 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
43753 int64_t ret_ref = 0;
43754 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43755 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43759 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43760 LDKBuiltCommitmentTransaction this_obj_conv;
43761 this_obj_conv.inner = untag_ptr(this_obj);
43762 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43764 BuiltCommitmentTransaction_free(this_obj_conv);
43767 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr) {
43768 LDKBuiltCommitmentTransaction this_ptr_conv;
43769 this_ptr_conv.inner = untag_ptr(this_ptr);
43770 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43772 this_ptr_conv.is_owned = false;
43773 LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
43774 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43775 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43776 Transaction_free(ret_var);
43780 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
43781 LDKBuiltCommitmentTransaction this_ptr_conv;
43782 this_ptr_conv.inner = untag_ptr(this_ptr);
43783 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43785 this_ptr_conv.is_owned = false;
43786 LDKTransaction val_ref;
43787 val_ref.datalen = (*env)->GetArrayLength(env, val);
43788 val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
43789 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
43790 val_ref.data_is_owned = true;
43791 BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref);
43794 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
43795 LDKBuiltCommitmentTransaction this_ptr_conv;
43796 this_ptr_conv.inner = untag_ptr(this_ptr);
43797 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43798 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43799 this_ptr_conv.is_owned = false;
43800 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
43801 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv));
43805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
43806 LDKBuiltCommitmentTransaction this_ptr_conv;
43807 this_ptr_conv.inner = untag_ptr(this_ptr);
43808 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43809 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43810 this_ptr_conv.is_owned = false;
43811 LDKThirtyTwoBytes val_ref;
43812 CHECK((*env)->GetArrayLength(env, val) == 32);
43813 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
43814 BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref);
43817 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new(JNIEnv *env, jclass clz, int8_tArray transaction_arg, int8_tArray txid_arg) {
43818 LDKTransaction transaction_arg_ref;
43819 transaction_arg_ref.datalen = (*env)->GetArrayLength(env, transaction_arg);
43820 transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes");
43821 (*env)->GetByteArrayRegion(env, transaction_arg, 0, transaction_arg_ref.datalen, transaction_arg_ref.data);
43822 transaction_arg_ref.data_is_owned = true;
43823 LDKThirtyTwoBytes txid_arg_ref;
43824 CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
43825 (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
43826 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
43827 int64_t ret_ref = 0;
43828 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43829 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43833 static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) {
43834 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg);
43835 int64_t ret_ref = 0;
43836 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43837 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43841 LDKBuiltCommitmentTransaction arg_conv;
43842 arg_conv.inner = untag_ptr(arg);
43843 arg_conv.is_owned = ptr_is_owned(arg);
43844 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43845 arg_conv.is_owned = false;
43846 int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv);
43850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43851 LDKBuiltCommitmentTransaction orig_conv;
43852 orig_conv.inner = untag_ptr(orig);
43853 orig_conv.is_owned = ptr_is_owned(orig);
43854 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43855 orig_conv.is_owned = false;
43856 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv);
43857 int64_t ret_ref = 0;
43858 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43859 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43863 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
43864 LDKBuiltCommitmentTransaction obj_conv;
43865 obj_conv.inner = untag_ptr(obj);
43866 obj_conv.is_owned = ptr_is_owned(obj);
43867 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43868 obj_conv.is_owned = false;
43869 LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
43870 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43871 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43872 CVec_u8Z_free(ret_var);
43876 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43877 LDKu8slice ser_ref;
43878 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43879 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43880 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
43881 *ret_conv = BuiltCommitmentTransaction_read(ser_ref);
43882 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43883 return tag_ptr(ret_conv, true);
43886 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) {
43887 LDKBuiltCommitmentTransaction this_arg_conv;
43888 this_arg_conv.inner = untag_ptr(this_arg);
43889 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43891 this_arg_conv.is_owned = false;
43892 LDKu8slice funding_redeemscript_ref;
43893 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
43894 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
43895 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
43896 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data);
43897 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
43901 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) {
43902 LDKBuiltCommitmentTransaction this_arg_conv;
43903 this_arg_conv.inner = untag_ptr(this_arg);
43904 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43906 this_arg_conv.is_owned = false;
43907 uint8_t funding_key_arr[32];
43908 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
43909 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
43910 uint8_t (*funding_key_ref)[32] = &funding_key_arr;
43911 LDKu8slice funding_redeemscript_ref;
43912 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
43913 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
43914 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
43915 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
43916 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
43920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43921 LDKClosingTransaction this_obj_conv;
43922 this_obj_conv.inner = untag_ptr(this_obj);
43923 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43925 ClosingTransaction_free(this_obj_conv);
43928 static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) {
43929 LDKClosingTransaction ret_var = ClosingTransaction_clone(arg);
43930 int64_t ret_ref = 0;
43931 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43932 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43935 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43936 LDKClosingTransaction arg_conv;
43937 arg_conv.inner = untag_ptr(arg);
43938 arg_conv.is_owned = ptr_is_owned(arg);
43939 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43940 arg_conv.is_owned = false;
43941 int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv);
43945 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43946 LDKClosingTransaction orig_conv;
43947 orig_conv.inner = untag_ptr(orig);
43948 orig_conv.is_owned = ptr_is_owned(orig);
43949 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43950 orig_conv.is_owned = false;
43951 LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
43952 int64_t ret_ref = 0;
43953 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43954 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43958 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JNIEnv *env, jclass clz, int64_t o) {
43959 LDKClosingTransaction o_conv;
43960 o_conv.inner = untag_ptr(o);
43961 o_conv.is_owned = ptr_is_owned(o);
43962 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
43963 o_conv.is_owned = false;
43964 int64_t ret_conv = ClosingTransaction_hash(&o_conv);
43968 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
43969 LDKClosingTransaction a_conv;
43970 a_conv.inner = untag_ptr(a);
43971 a_conv.is_owned = ptr_is_owned(a);
43972 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43973 a_conv.is_owned = false;
43974 LDKClosingTransaction b_conv;
43975 b_conv.inner = untag_ptr(b);
43976 b_conv.is_owned = ptr_is_owned(b);
43977 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43978 b_conv.is_owned = false;
43979 jboolean ret_conv = ClosingTransaction_eq(&a_conv, &b_conv);
43983 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) {
43984 LDKCVec_u8Z to_holder_script_ref;
43985 to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
43986 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
43987 (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data);
43988 LDKCVec_u8Z to_counterparty_script_ref;
43989 to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script);
43990 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
43991 (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data);
43992 LDKOutPoint funding_outpoint_conv;
43993 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
43994 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
43995 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
43996 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
43997 LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
43998 int64_t ret_ref = 0;
43999 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44000 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44004 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) {
44005 LDKClosingTransaction this_arg_conv;
44006 this_arg_conv.inner = untag_ptr(this_arg);
44007 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44009 this_arg_conv.is_owned = false;
44010 LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv);
44011 int64_t ret_ref = 0;
44012 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44013 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44017 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_outpoint) {
44018 LDKClosingTransaction this_arg_conv;
44019 this_arg_conv.inner = untag_ptr(this_arg);
44020 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44022 this_arg_conv.is_owned = false;
44023 LDKOutPoint funding_outpoint_conv;
44024 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
44025 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
44026 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
44027 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
44028 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
44029 *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv);
44030 return tag_ptr(ret_conv, true);
44033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
44034 LDKClosingTransaction this_arg_conv;
44035 this_arg_conv.inner = untag_ptr(this_arg);
44036 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44038 this_arg_conv.is_owned = false;
44039 int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv);
44043 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
44044 LDKClosingTransaction this_arg_conv;
44045 this_arg_conv.inner = untag_ptr(this_arg);
44046 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44048 this_arg_conv.is_owned = false;
44049 int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv);
44053 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
44054 LDKClosingTransaction this_arg_conv;
44055 this_arg_conv.inner = untag_ptr(this_arg);
44056 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44058 this_arg_conv.is_owned = false;
44059 LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv);
44060 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44061 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44065 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
44066 LDKClosingTransaction this_arg_conv;
44067 this_arg_conv.inner = untag_ptr(this_arg);
44068 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44070 this_arg_conv.is_owned = false;
44071 LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv);
44072 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44073 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44077 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44078 LDKTrustedClosingTransaction this_obj_conv;
44079 this_obj_conv.inner = untag_ptr(this_obj);
44080 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44081 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44082 TrustedClosingTransaction_free(this_obj_conv);
44085 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) {
44086 LDKTrustedClosingTransaction this_arg_conv;
44087 this_arg_conv.inner = untag_ptr(this_arg);
44088 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44089 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44090 this_arg_conv.is_owned = false;
44091 LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv);
44092 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44093 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44094 Transaction_free(ret_var);
44098 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) {
44099 LDKTrustedClosingTransaction this_arg_conv;
44100 this_arg_conv.inner = untag_ptr(this_arg);
44101 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44103 this_arg_conv.is_owned = false;
44104 LDKu8slice funding_redeemscript_ref;
44105 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
44106 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
44107 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
44108 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data);
44109 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
44113 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) {
44114 LDKTrustedClosingTransaction this_arg_conv;
44115 this_arg_conv.inner = untag_ptr(this_arg);
44116 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44118 this_arg_conv.is_owned = false;
44119 uint8_t funding_key_arr[32];
44120 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
44121 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
44122 uint8_t (*funding_key_ref)[32] = &funding_key_arr;
44123 LDKu8slice funding_redeemscript_ref;
44124 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
44125 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
44126 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
44127 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
44128 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
44132 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44133 LDKCommitmentTransaction this_obj_conv;
44134 this_obj_conv.inner = untag_ptr(this_obj);
44135 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44136 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44137 CommitmentTransaction_free(this_obj_conv);
44140 static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) {
44141 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg);
44142 int64_t ret_ref = 0;
44143 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44144 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44147 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44148 LDKCommitmentTransaction arg_conv;
44149 arg_conv.inner = untag_ptr(arg);
44150 arg_conv.is_owned = ptr_is_owned(arg);
44151 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44152 arg_conv.is_owned = false;
44153 int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv);
44157 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44158 LDKCommitmentTransaction orig_conv;
44159 orig_conv.inner = untag_ptr(orig);
44160 orig_conv.is_owned = ptr_is_owned(orig);
44161 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44162 orig_conv.is_owned = false;
44163 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv);
44164 int64_t ret_ref = 0;
44165 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44166 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44170 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
44171 LDKCommitmentTransaction obj_conv;
44172 obj_conv.inner = untag_ptr(obj);
44173 obj_conv.is_owned = ptr_is_owned(obj);
44174 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44175 obj_conv.is_owned = false;
44176 LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
44177 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44178 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44179 CVec_u8Z_free(ret_var);
44183 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
44184 LDKu8slice ser_ref;
44185 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
44186 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
44187 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
44188 *ret_conv = CommitmentTransaction_read(ser_ref);
44189 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
44190 return tag_ptr(ret_conv, true);
44193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_arg) {
44194 LDKCommitmentTransaction this_arg_conv;
44195 this_arg_conv.inner = untag_ptr(this_arg);
44196 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44198 this_arg_conv.is_owned = false;
44199 int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv);
44203 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
44204 LDKCommitmentTransaction this_arg_conv;
44205 this_arg_conv.inner = untag_ptr(this_arg);
44206 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44208 this_arg_conv.is_owned = false;
44209 int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv);
44213 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
44214 LDKCommitmentTransaction this_arg_conv;
44215 this_arg_conv.inner = untag_ptr(this_arg);
44216 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44218 this_arg_conv.is_owned = false;
44219 int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv);
44223 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_arg) {
44224 LDKCommitmentTransaction this_arg_conv;
44225 this_arg_conv.inner = untag_ptr(this_arg);
44226 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44228 this_arg_conv.is_owned = false;
44229 int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv);
44233 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) {
44234 LDKCommitmentTransaction this_arg_conv;
44235 this_arg_conv.inner = untag_ptr(this_arg);
44236 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44238 this_arg_conv.is_owned = false;
44239 LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv);
44240 int64_t ret_ref = 0;
44241 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44242 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44246 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) {
44247 LDKCommitmentTransaction this_arg_conv;
44248 this_arg_conv.inner = untag_ptr(this_arg);
44249 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44250 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44251 this_arg_conv.is_owned = false;
44252 LDKDirectedChannelTransactionParameters channel_parameters_conv;
44253 channel_parameters_conv.inner = untag_ptr(channel_parameters);
44254 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
44255 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
44256 channel_parameters_conv.is_owned = false;
44257 LDKChannelPublicKeys broadcaster_keys_conv;
44258 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
44259 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
44260 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
44261 broadcaster_keys_conv.is_owned = false;
44262 LDKChannelPublicKeys countersignatory_keys_conv;
44263 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
44264 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
44265 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
44266 countersignatory_keys_conv.is_owned = false;
44267 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
44268 *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv);
44269 return tag_ptr(ret_conv, true);
44272 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44273 LDKTrustedCommitmentTransaction this_obj_conv;
44274 this_obj_conv.inner = untag_ptr(this_obj);
44275 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44276 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44277 TrustedCommitmentTransaction_free(this_obj_conv);
44280 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid(JNIEnv *env, jclass clz, int64_t this_arg) {
44281 LDKTrustedCommitmentTransaction this_arg_conv;
44282 this_arg_conv.inner = untag_ptr(this_arg);
44283 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44285 this_arg_conv.is_owned = false;
44286 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
44287 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data);
44291 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) {
44292 LDKTrustedCommitmentTransaction this_arg_conv;
44293 this_arg_conv.inner = untag_ptr(this_arg);
44294 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44296 this_arg_conv.is_owned = false;
44297 LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv);
44298 int64_t ret_ref = 0;
44299 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44300 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44304 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys(JNIEnv *env, jclass clz, int64_t this_arg) {
44305 LDKTrustedCommitmentTransaction this_arg_conv;
44306 this_arg_conv.inner = untag_ptr(this_arg);
44307 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44308 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44309 this_arg_conv.is_owned = false;
44310 LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv);
44311 int64_t ret_ref = 0;
44312 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44313 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44317 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
44318 LDKTrustedCommitmentTransaction this_arg_conv;
44319 this_arg_conv.inner = untag_ptr(this_arg);
44320 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44322 this_arg_conv.is_owned = false;
44323 jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
44327 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) {
44328 LDKTrustedCommitmentTransaction this_arg_conv;
44329 this_arg_conv.inner = untag_ptr(this_arg);
44330 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44332 this_arg_conv.is_owned = false;
44333 uint8_t htlc_base_key_arr[32];
44334 CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32);
44335 (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr);
44336 uint8_t (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
44337 LDKDirectedChannelTransactionParameters channel_parameters_conv;
44338 channel_parameters_conv.inner = untag_ptr(channel_parameters);
44339 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
44340 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
44341 channel_parameters_conv.is_owned = false;
44342 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
44343 *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv);
44344 return tag_ptr(ret_conv, true);
44347 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) {
44348 LDKPublicKey broadcaster_payment_basepoint_ref;
44349 CHECK((*env)->GetArrayLength(env, broadcaster_payment_basepoint) == 33);
44350 (*env)->GetByteArrayRegion(env, broadcaster_payment_basepoint, 0, 33, broadcaster_payment_basepoint_ref.compressed_form);
44351 LDKPublicKey countersignatory_payment_basepoint_ref;
44352 CHECK((*env)->GetArrayLength(env, countersignatory_payment_basepoint) == 33);
44353 (*env)->GetByteArrayRegion(env, countersignatory_payment_basepoint, 0, 33, countersignatory_payment_basepoint_ref.compressed_form);
44354 int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster);
44358 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44359 LDKInitFeatures a_conv;
44360 a_conv.inner = untag_ptr(a);
44361 a_conv.is_owned = ptr_is_owned(a);
44362 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44363 a_conv.is_owned = false;
44364 LDKInitFeatures b_conv;
44365 b_conv.inner = untag_ptr(b);
44366 b_conv.is_owned = ptr_is_owned(b);
44367 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44368 b_conv.is_owned = false;
44369 jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv);
44373 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44374 LDKNodeFeatures a_conv;
44375 a_conv.inner = untag_ptr(a);
44376 a_conv.is_owned = ptr_is_owned(a);
44377 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44378 a_conv.is_owned = false;
44379 LDKNodeFeatures b_conv;
44380 b_conv.inner = untag_ptr(b);
44381 b_conv.is_owned = ptr_is_owned(b);
44382 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44383 b_conv.is_owned = false;
44384 jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv);
44388 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44389 LDKChannelFeatures a_conv;
44390 a_conv.inner = untag_ptr(a);
44391 a_conv.is_owned = ptr_is_owned(a);
44392 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44393 a_conv.is_owned = false;
44394 LDKChannelFeatures b_conv;
44395 b_conv.inner = untag_ptr(b);
44396 b_conv.is_owned = ptr_is_owned(b);
44397 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44398 b_conv.is_owned = false;
44399 jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv);
44403 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44404 LDKInvoiceFeatures a_conv;
44405 a_conv.inner = untag_ptr(a);
44406 a_conv.is_owned = ptr_is_owned(a);
44407 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44408 a_conv.is_owned = false;
44409 LDKInvoiceFeatures b_conv;
44410 b_conv.inner = untag_ptr(b);
44411 b_conv.is_owned = ptr_is_owned(b);
44412 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44413 b_conv.is_owned = false;
44414 jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv);
44418 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44419 LDKOfferFeatures a_conv;
44420 a_conv.inner = untag_ptr(a);
44421 a_conv.is_owned = ptr_is_owned(a);
44422 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44423 a_conv.is_owned = false;
44424 LDKOfferFeatures b_conv;
44425 b_conv.inner = untag_ptr(b);
44426 b_conv.is_owned = ptr_is_owned(b);
44427 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44428 b_conv.is_owned = false;
44429 jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv);
44433 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44434 LDKInvoiceRequestFeatures a_conv;
44435 a_conv.inner = untag_ptr(a);
44436 a_conv.is_owned = ptr_is_owned(a);
44437 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44438 a_conv.is_owned = false;
44439 LDKInvoiceRequestFeatures b_conv;
44440 b_conv.inner = untag_ptr(b);
44441 b_conv.is_owned = ptr_is_owned(b);
44442 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44443 b_conv.is_owned = false;
44444 jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv);
44448 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44449 LDKBolt12InvoiceFeatures a_conv;
44450 a_conv.inner = untag_ptr(a);
44451 a_conv.is_owned = ptr_is_owned(a);
44452 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44453 a_conv.is_owned = false;
44454 LDKBolt12InvoiceFeatures b_conv;
44455 b_conv.inner = untag_ptr(b);
44456 b_conv.is_owned = ptr_is_owned(b);
44457 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44458 b_conv.is_owned = false;
44459 jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv);
44463 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44464 LDKBlindedHopFeatures a_conv;
44465 a_conv.inner = untag_ptr(a);
44466 a_conv.is_owned = ptr_is_owned(a);
44467 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44468 a_conv.is_owned = false;
44469 LDKBlindedHopFeatures b_conv;
44470 b_conv.inner = untag_ptr(b);
44471 b_conv.is_owned = ptr_is_owned(b);
44472 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44473 b_conv.is_owned = false;
44474 jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv);
44478 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44479 LDKChannelTypeFeatures a_conv;
44480 a_conv.inner = untag_ptr(a);
44481 a_conv.is_owned = ptr_is_owned(a);
44482 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44483 a_conv.is_owned = false;
44484 LDKChannelTypeFeatures b_conv;
44485 b_conv.inner = untag_ptr(b);
44486 b_conv.is_owned = ptr_is_owned(b);
44487 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44488 b_conv.is_owned = false;
44489 jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv);
44493 static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
44494 LDKInitFeatures ret_var = InitFeatures_clone(arg);
44495 int64_t ret_ref = 0;
44496 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44497 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44501 LDKInitFeatures arg_conv;
44502 arg_conv.inner = untag_ptr(arg);
44503 arg_conv.is_owned = ptr_is_owned(arg);
44504 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44505 arg_conv.is_owned = false;
44506 int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv);
44510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44511 LDKInitFeatures orig_conv;
44512 orig_conv.inner = untag_ptr(orig);
44513 orig_conv.is_owned = ptr_is_owned(orig);
44514 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44515 orig_conv.is_owned = false;
44516 LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv);
44517 int64_t ret_ref = 0;
44518 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44519 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44523 static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) {
44524 LDKNodeFeatures ret_var = NodeFeatures_clone(arg);
44525 int64_t ret_ref = 0;
44526 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44527 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44530 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44531 LDKNodeFeatures arg_conv;
44532 arg_conv.inner = untag_ptr(arg);
44533 arg_conv.is_owned = ptr_is_owned(arg);
44534 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44535 arg_conv.is_owned = false;
44536 int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv);
44540 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44541 LDKNodeFeatures orig_conv;
44542 orig_conv.inner = untag_ptr(orig);
44543 orig_conv.is_owned = ptr_is_owned(orig);
44544 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44545 orig_conv.is_owned = false;
44546 LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv);
44547 int64_t ret_ref = 0;
44548 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44549 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44553 static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) {
44554 LDKChannelFeatures ret_var = ChannelFeatures_clone(arg);
44555 int64_t ret_ref = 0;
44556 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44557 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44560 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44561 LDKChannelFeatures arg_conv;
44562 arg_conv.inner = untag_ptr(arg);
44563 arg_conv.is_owned = ptr_is_owned(arg);
44564 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44565 arg_conv.is_owned = false;
44566 int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv);
44570 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44571 LDKChannelFeatures orig_conv;
44572 orig_conv.inner = untag_ptr(orig);
44573 orig_conv.is_owned = ptr_is_owned(orig);
44574 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44575 orig_conv.is_owned = false;
44576 LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv);
44577 int64_t ret_ref = 0;
44578 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44579 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44583 static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) {
44584 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg);
44585 int64_t ret_ref = 0;
44586 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44587 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44590 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44591 LDKInvoiceFeatures arg_conv;
44592 arg_conv.inner = untag_ptr(arg);
44593 arg_conv.is_owned = ptr_is_owned(arg);
44594 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44595 arg_conv.is_owned = false;
44596 int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv);
44600 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44601 LDKInvoiceFeatures orig_conv;
44602 orig_conv.inner = untag_ptr(orig);
44603 orig_conv.is_owned = ptr_is_owned(orig);
44604 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44605 orig_conv.is_owned = false;
44606 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
44607 int64_t ret_ref = 0;
44608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44613 static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) {
44614 LDKOfferFeatures ret_var = OfferFeatures_clone(arg);
44615 int64_t ret_ref = 0;
44616 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44617 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44620 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44621 LDKOfferFeatures arg_conv;
44622 arg_conv.inner = untag_ptr(arg);
44623 arg_conv.is_owned = ptr_is_owned(arg);
44624 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44625 arg_conv.is_owned = false;
44626 int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv);
44630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44631 LDKOfferFeatures orig_conv;
44632 orig_conv.inner = untag_ptr(orig);
44633 orig_conv.is_owned = ptr_is_owned(orig);
44634 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44635 orig_conv.is_owned = false;
44636 LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv);
44637 int64_t ret_ref = 0;
44638 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44639 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44643 static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) {
44644 LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg);
44645 int64_t ret_ref = 0;
44646 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44647 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44650 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44651 LDKInvoiceRequestFeatures arg_conv;
44652 arg_conv.inner = untag_ptr(arg);
44653 arg_conv.is_owned = ptr_is_owned(arg);
44654 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44655 arg_conv.is_owned = false;
44656 int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv);
44660 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44661 LDKInvoiceRequestFeatures orig_conv;
44662 orig_conv.inner = untag_ptr(orig);
44663 orig_conv.is_owned = ptr_is_owned(orig);
44664 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44665 orig_conv.is_owned = false;
44666 LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv);
44667 int64_t ret_ref = 0;
44668 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44669 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44673 static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) {
44674 LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(arg);
44675 int64_t ret_ref = 0;
44676 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44677 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44680 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44681 LDKBolt12InvoiceFeatures arg_conv;
44682 arg_conv.inner = untag_ptr(arg);
44683 arg_conv.is_owned = ptr_is_owned(arg);
44684 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44685 arg_conv.is_owned = false;
44686 int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv);
44690 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44691 LDKBolt12InvoiceFeatures orig_conv;
44692 orig_conv.inner = untag_ptr(orig);
44693 orig_conv.is_owned = ptr_is_owned(orig);
44694 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44695 orig_conv.is_owned = false;
44696 LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv);
44697 int64_t ret_ref = 0;
44698 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44699 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44703 static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) {
44704 LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(arg);
44705 int64_t ret_ref = 0;
44706 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44707 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44710 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44711 LDKBlindedHopFeatures arg_conv;
44712 arg_conv.inner = untag_ptr(arg);
44713 arg_conv.is_owned = ptr_is_owned(arg);
44714 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44715 arg_conv.is_owned = false;
44716 int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv);
44720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44721 LDKBlindedHopFeatures orig_conv;
44722 orig_conv.inner = untag_ptr(orig);
44723 orig_conv.is_owned = ptr_is_owned(orig);
44724 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44725 orig_conv.is_owned = false;
44726 LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv);
44727 int64_t ret_ref = 0;
44728 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44729 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44733 static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
44734 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
44735 int64_t ret_ref = 0;
44736 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44737 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44740 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44741 LDKChannelTypeFeatures arg_conv;
44742 arg_conv.inner = untag_ptr(arg);
44743 arg_conv.is_owned = ptr_is_owned(arg);
44744 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44745 arg_conv.is_owned = false;
44746 int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv);
44750 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44751 LDKChannelTypeFeatures orig_conv;
44752 orig_conv.inner = untag_ptr(orig);
44753 orig_conv.is_owned = ptr_is_owned(orig);
44754 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44755 orig_conv.is_owned = false;
44756 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
44757 int64_t ret_ref = 0;
44758 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44759 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44763 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44764 LDKInitFeatures this_obj_conv;
44765 this_obj_conv.inner = untag_ptr(this_obj);
44766 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44767 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44768 InitFeatures_free(this_obj_conv);
44771 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44772 LDKNodeFeatures this_obj_conv;
44773 this_obj_conv.inner = untag_ptr(this_obj);
44774 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44775 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44776 NodeFeatures_free(this_obj_conv);
44779 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44780 LDKChannelFeatures this_obj_conv;
44781 this_obj_conv.inner = untag_ptr(this_obj);
44782 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44784 ChannelFeatures_free(this_obj_conv);
44787 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44788 LDKInvoiceFeatures 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 InvoiceFeatures_free(this_obj_conv);
44795 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44796 LDKOfferFeatures this_obj_conv;
44797 this_obj_conv.inner = untag_ptr(this_obj);
44798 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44800 OfferFeatures_free(this_obj_conv);
44803 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44804 LDKInvoiceRequestFeatures this_obj_conv;
44805 this_obj_conv.inner = untag_ptr(this_obj);
44806 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44808 InvoiceRequestFeatures_free(this_obj_conv);
44811 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44812 LDKBolt12InvoiceFeatures this_obj_conv;
44813 this_obj_conv.inner = untag_ptr(this_obj);
44814 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44815 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44816 Bolt12InvoiceFeatures_free(this_obj_conv);
44819 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44820 LDKBlindedHopFeatures this_obj_conv;
44821 this_obj_conv.inner = untag_ptr(this_obj);
44822 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44823 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44824 BlindedHopFeatures_free(this_obj_conv);
44827 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44828 LDKChannelTypeFeatures this_obj_conv;
44829 this_obj_conv.inner = untag_ptr(this_obj);
44830 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44831 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44832 ChannelTypeFeatures_free(this_obj_conv);
44835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) {
44836 LDKInitFeatures ret_var = InitFeatures_empty();
44837 int64_t ret_ref = 0;
44838 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44839 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44843 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
44844 LDKInitFeatures this_arg_conv;
44845 this_arg_conv.inner = untag_ptr(this_arg);
44846 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44848 this_arg_conv.is_owned = false;
44849 jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv);
44853 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) {
44854 LDKNodeFeatures ret_var = NodeFeatures_empty();
44855 int64_t ret_ref = 0;
44856 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44857 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44861 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
44862 LDKNodeFeatures this_arg_conv;
44863 this_arg_conv.inner = untag_ptr(this_arg);
44864 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44865 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44866 this_arg_conv.is_owned = false;
44867 jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
44871 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) {
44872 LDKChannelFeatures ret_var = ChannelFeatures_empty();
44873 int64_t ret_ref = 0;
44874 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44875 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44879 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
44880 LDKChannelFeatures this_arg_conv;
44881 this_arg_conv.inner = untag_ptr(this_arg);
44882 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44884 this_arg_conv.is_owned = false;
44885 jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
44889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) {
44890 LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
44891 int64_t ret_ref = 0;
44892 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44893 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44897 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
44898 LDKInvoiceFeatures this_arg_conv;
44899 this_arg_conv.inner = untag_ptr(this_arg);
44900 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44902 this_arg_conv.is_owned = false;
44903 jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
44907 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty(JNIEnv *env, jclass clz) {
44908 LDKOfferFeatures ret_var = OfferFeatures_empty();
44909 int64_t ret_ref = 0;
44910 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44911 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44915 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
44916 LDKOfferFeatures this_arg_conv;
44917 this_arg_conv.inner = untag_ptr(this_arg);
44918 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44919 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44920 this_arg_conv.is_owned = false;
44921 jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv);
44925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty(JNIEnv *env, jclass clz) {
44926 LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty();
44927 int64_t ret_ref = 0;
44928 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44929 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44933 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
44934 LDKInvoiceRequestFeatures this_arg_conv;
44935 this_arg_conv.inner = untag_ptr(this_arg);
44936 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44938 this_arg_conv.is_owned = false;
44939 jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv);
44943 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1empty(JNIEnv *env, jclass clz) {
44944 LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty();
44945 int64_t ret_ref = 0;
44946 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44947 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44951 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
44952 LDKBolt12InvoiceFeatures this_arg_conv;
44953 this_arg_conv.inner = untag_ptr(this_arg);
44954 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44956 this_arg_conv.is_owned = false;
44957 jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
44961 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1empty(JNIEnv *env, jclass clz) {
44962 LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty();
44963 int64_t ret_ref = 0;
44964 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44965 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44969 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
44970 LDKBlindedHopFeatures this_arg_conv;
44971 this_arg_conv.inner = untag_ptr(this_arg);
44972 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44974 this_arg_conv.is_owned = false;
44975 jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv);
44979 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) {
44980 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
44981 int64_t ret_ref = 0;
44982 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44983 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44987 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
44988 LDKChannelTypeFeatures this_arg_conv;
44989 this_arg_conv.inner = untag_ptr(this_arg);
44990 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44992 this_arg_conv.is_owned = false;
44993 jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
44997 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
44998 LDKInitFeatures obj_conv;
44999 obj_conv.inner = untag_ptr(obj);
45000 obj_conv.is_owned = ptr_is_owned(obj);
45001 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45002 obj_conv.is_owned = false;
45003 LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
45004 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45005 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45006 CVec_u8Z_free(ret_var);
45010 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45011 LDKu8slice ser_ref;
45012 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45013 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45014 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
45015 *ret_conv = InitFeatures_read(ser_ref);
45016 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45017 return tag_ptr(ret_conv, true);
45020 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45021 LDKChannelFeatures obj_conv;
45022 obj_conv.inner = untag_ptr(obj);
45023 obj_conv.is_owned = ptr_is_owned(obj);
45024 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45025 obj_conv.is_owned = false;
45026 LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
45027 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45028 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45029 CVec_u8Z_free(ret_var);
45033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45034 LDKu8slice ser_ref;
45035 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45036 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45037 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
45038 *ret_conv = ChannelFeatures_read(ser_ref);
45039 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45040 return tag_ptr(ret_conv, true);
45043 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45044 LDKNodeFeatures obj_conv;
45045 obj_conv.inner = untag_ptr(obj);
45046 obj_conv.is_owned = ptr_is_owned(obj);
45047 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45048 obj_conv.is_owned = false;
45049 LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
45050 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45051 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45052 CVec_u8Z_free(ret_var);
45056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45057 LDKu8slice ser_ref;
45058 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45059 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45060 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
45061 *ret_conv = NodeFeatures_read(ser_ref);
45062 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45063 return tag_ptr(ret_conv, true);
45066 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45067 LDKInvoiceFeatures obj_conv;
45068 obj_conv.inner = untag_ptr(obj);
45069 obj_conv.is_owned = ptr_is_owned(obj);
45070 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45071 obj_conv.is_owned = false;
45072 LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
45073 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45074 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45075 CVec_u8Z_free(ret_var);
45079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45080 LDKu8slice ser_ref;
45081 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45082 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45083 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
45084 *ret_conv = InvoiceFeatures_read(ser_ref);
45085 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45086 return tag_ptr(ret_conv, true);
45089 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45090 LDKBlindedHopFeatures obj_conv;
45091 obj_conv.inner = untag_ptr(obj);
45092 obj_conv.is_owned = ptr_is_owned(obj);
45093 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45094 obj_conv.is_owned = false;
45095 LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv);
45096 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45097 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45098 CVec_u8Z_free(ret_var);
45102 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45103 LDKu8slice ser_ref;
45104 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45105 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45106 LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
45107 *ret_conv = BlindedHopFeatures_read(ser_ref);
45108 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45109 return tag_ptr(ret_conv, true);
45112 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45113 LDKChannelTypeFeatures obj_conv;
45114 obj_conv.inner = untag_ptr(obj);
45115 obj_conv.is_owned = ptr_is_owned(obj);
45116 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45117 obj_conv.is_owned = false;
45118 LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
45119 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45120 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45121 CVec_u8Z_free(ret_var);
45125 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45126 LDKu8slice ser_ref;
45127 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45128 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45129 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
45130 *ret_conv = ChannelTypeFeatures_read(ser_ref);
45131 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45132 return tag_ptr(ret_conv, true);
45135 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45136 LDKInitFeatures this_arg_conv;
45137 this_arg_conv.inner = untag_ptr(this_arg);
45138 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45140 this_arg_conv.is_owned = false;
45141 InitFeatures_set_data_loss_protect_optional(&this_arg_conv);
45144 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45145 LDKInitFeatures this_arg_conv;
45146 this_arg_conv.inner = untag_ptr(this_arg);
45147 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45149 this_arg_conv.is_owned = false;
45150 InitFeatures_set_data_loss_protect_required(&this_arg_conv);
45153 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
45154 LDKInitFeatures 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 jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv);
45163 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45164 LDKNodeFeatures this_arg_conv;
45165 this_arg_conv.inner = untag_ptr(this_arg);
45166 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45168 this_arg_conv.is_owned = false;
45169 NodeFeatures_set_data_loss_protect_optional(&this_arg_conv);
45172 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45173 LDKNodeFeatures this_arg_conv;
45174 this_arg_conv.inner = untag_ptr(this_arg);
45175 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45176 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45177 this_arg_conv.is_owned = false;
45178 NodeFeatures_set_data_loss_protect_required(&this_arg_conv);
45181 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
45182 LDKNodeFeatures this_arg_conv;
45183 this_arg_conv.inner = untag_ptr(this_arg);
45184 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45185 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45186 this_arg_conv.is_owned = false;
45187 jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv);
45191 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
45192 LDKInitFeatures this_arg_conv;
45193 this_arg_conv.inner = untag_ptr(this_arg);
45194 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45196 this_arg_conv.is_owned = false;
45197 jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv);
45201 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
45202 LDKNodeFeatures this_arg_conv;
45203 this_arg_conv.inner = untag_ptr(this_arg);
45204 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45206 this_arg_conv.is_owned = false;
45207 jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv);
45211 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45212 LDKInitFeatures this_arg_conv;
45213 this_arg_conv.inner = untag_ptr(this_arg);
45214 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45215 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45216 this_arg_conv.is_owned = false;
45217 InitFeatures_set_initial_routing_sync_optional(&this_arg_conv);
45220 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45221 LDKInitFeatures this_arg_conv;
45222 this_arg_conv.inner = untag_ptr(this_arg);
45223 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45224 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45225 this_arg_conv.is_owned = false;
45226 InitFeatures_set_initial_routing_sync_required(&this_arg_conv);
45229 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync(JNIEnv *env, jclass clz, int64_t this_arg) {
45230 LDKInitFeatures this_arg_conv;
45231 this_arg_conv.inner = untag_ptr(this_arg);
45232 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45233 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45234 this_arg_conv.is_owned = false;
45235 jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv);
45239 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45240 LDKInitFeatures this_arg_conv;
45241 this_arg_conv.inner = untag_ptr(this_arg);
45242 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45244 this_arg_conv.is_owned = false;
45245 InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
45248 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45249 LDKInitFeatures this_arg_conv;
45250 this_arg_conv.inner = untag_ptr(this_arg);
45251 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45253 this_arg_conv.is_owned = false;
45254 InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
45257 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
45258 LDKInitFeatures this_arg_conv;
45259 this_arg_conv.inner = untag_ptr(this_arg);
45260 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45261 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45262 this_arg_conv.is_owned = false;
45263 jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv);
45267 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45268 LDKNodeFeatures this_arg_conv;
45269 this_arg_conv.inner = untag_ptr(this_arg);
45270 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45272 this_arg_conv.is_owned = false;
45273 NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
45276 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45277 LDKNodeFeatures 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 NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
45285 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
45286 LDKNodeFeatures this_arg_conv;
45287 this_arg_conv.inner = untag_ptr(this_arg);
45288 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45289 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45290 this_arg_conv.is_owned = false;
45291 jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv);
45295 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
45296 LDKInitFeatures this_arg_conv;
45297 this_arg_conv.inner = untag_ptr(this_arg);
45298 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45300 this_arg_conv.is_owned = false;
45301 jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv);
45305 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
45306 LDKNodeFeatures this_arg_conv;
45307 this_arg_conv.inner = untag_ptr(this_arg);
45308 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45309 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45310 this_arg_conv.is_owned = false;
45311 jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv);
45315 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45316 LDKInitFeatures this_arg_conv;
45317 this_arg_conv.inner = untag_ptr(this_arg);
45318 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45319 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45320 this_arg_conv.is_owned = false;
45321 InitFeatures_set_gossip_queries_optional(&this_arg_conv);
45324 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45325 LDKInitFeatures this_arg_conv;
45326 this_arg_conv.inner = untag_ptr(this_arg);
45327 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45329 this_arg_conv.is_owned = false;
45330 InitFeatures_set_gossip_queries_required(&this_arg_conv);
45333 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
45334 LDKInitFeatures this_arg_conv;
45335 this_arg_conv.inner = untag_ptr(this_arg);
45336 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45337 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45338 this_arg_conv.is_owned = false;
45339 jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv);
45343 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45344 LDKNodeFeatures this_arg_conv;
45345 this_arg_conv.inner = untag_ptr(this_arg);
45346 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45348 this_arg_conv.is_owned = false;
45349 NodeFeatures_set_gossip_queries_optional(&this_arg_conv);
45352 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45353 LDKNodeFeatures this_arg_conv;
45354 this_arg_conv.inner = untag_ptr(this_arg);
45355 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45356 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45357 this_arg_conv.is_owned = false;
45358 NodeFeatures_set_gossip_queries_required(&this_arg_conv);
45361 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
45362 LDKNodeFeatures this_arg_conv;
45363 this_arg_conv.inner = untag_ptr(this_arg);
45364 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45365 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45366 this_arg_conv.is_owned = false;
45367 jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv);
45371 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
45372 LDKInitFeatures this_arg_conv;
45373 this_arg_conv.inner = untag_ptr(this_arg);
45374 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45375 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45376 this_arg_conv.is_owned = false;
45377 jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv);
45381 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
45382 LDKNodeFeatures this_arg_conv;
45383 this_arg_conv.inner = untag_ptr(this_arg);
45384 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45386 this_arg_conv.is_owned = false;
45387 jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv);
45391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45392 LDKInitFeatures this_arg_conv;
45393 this_arg_conv.inner = untag_ptr(this_arg);
45394 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45396 this_arg_conv.is_owned = false;
45397 InitFeatures_set_variable_length_onion_optional(&this_arg_conv);
45400 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45401 LDKInitFeatures this_arg_conv;
45402 this_arg_conv.inner = untag_ptr(this_arg);
45403 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45404 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45405 this_arg_conv.is_owned = false;
45406 InitFeatures_set_variable_length_onion_required(&this_arg_conv);
45409 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45410 LDKInitFeatures this_arg_conv;
45411 this_arg_conv.inner = untag_ptr(this_arg);
45412 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45414 this_arg_conv.is_owned = false;
45415 jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv);
45419 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45420 LDKNodeFeatures this_arg_conv;
45421 this_arg_conv.inner = untag_ptr(this_arg);
45422 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45423 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45424 this_arg_conv.is_owned = false;
45425 NodeFeatures_set_variable_length_onion_optional(&this_arg_conv);
45428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45429 LDKNodeFeatures this_arg_conv;
45430 this_arg_conv.inner = untag_ptr(this_arg);
45431 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45432 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45433 this_arg_conv.is_owned = false;
45434 NodeFeatures_set_variable_length_onion_required(&this_arg_conv);
45437 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45438 LDKNodeFeatures this_arg_conv;
45439 this_arg_conv.inner = untag_ptr(this_arg);
45440 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45442 this_arg_conv.is_owned = false;
45443 jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv);
45447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45448 LDKInvoiceFeatures this_arg_conv;
45449 this_arg_conv.inner = untag_ptr(this_arg);
45450 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45452 this_arg_conv.is_owned = false;
45453 InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv);
45456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45457 LDKInvoiceFeatures this_arg_conv;
45458 this_arg_conv.inner = untag_ptr(this_arg);
45459 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45461 this_arg_conv.is_owned = false;
45462 InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv);
45465 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45466 LDKInvoiceFeatures this_arg_conv;
45467 this_arg_conv.inner = untag_ptr(this_arg);
45468 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45469 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45470 this_arg_conv.is_owned = false;
45471 jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv);
45475 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45476 LDKInitFeatures this_arg_conv;
45477 this_arg_conv.inner = untag_ptr(this_arg);
45478 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45479 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45480 this_arg_conv.is_owned = false;
45481 jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv);
45485 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45486 LDKNodeFeatures this_arg_conv;
45487 this_arg_conv.inner = untag_ptr(this_arg);
45488 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45489 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45490 this_arg_conv.is_owned = false;
45491 jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv);
45495 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45496 LDKInvoiceFeatures this_arg_conv;
45497 this_arg_conv.inner = untag_ptr(this_arg);
45498 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45499 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45500 this_arg_conv.is_owned = false;
45501 jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv);
45505 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45506 LDKInitFeatures this_arg_conv;
45507 this_arg_conv.inner = untag_ptr(this_arg);
45508 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45509 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45510 this_arg_conv.is_owned = false;
45511 InitFeatures_set_static_remote_key_optional(&this_arg_conv);
45514 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45515 LDKInitFeatures this_arg_conv;
45516 this_arg_conv.inner = untag_ptr(this_arg);
45517 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45518 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45519 this_arg_conv.is_owned = false;
45520 InitFeatures_set_static_remote_key_required(&this_arg_conv);
45523 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45524 LDKInitFeatures this_arg_conv;
45525 this_arg_conv.inner = untag_ptr(this_arg);
45526 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45527 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45528 this_arg_conv.is_owned = false;
45529 jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv);
45533 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45534 LDKNodeFeatures this_arg_conv;
45535 this_arg_conv.inner = untag_ptr(this_arg);
45536 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45537 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45538 this_arg_conv.is_owned = false;
45539 NodeFeatures_set_static_remote_key_optional(&this_arg_conv);
45542 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45543 LDKNodeFeatures this_arg_conv;
45544 this_arg_conv.inner = untag_ptr(this_arg);
45545 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45546 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45547 this_arg_conv.is_owned = false;
45548 NodeFeatures_set_static_remote_key_required(&this_arg_conv);
45551 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45552 LDKNodeFeatures this_arg_conv;
45553 this_arg_conv.inner = untag_ptr(this_arg);
45554 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45555 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45556 this_arg_conv.is_owned = false;
45557 jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv);
45561 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45562 LDKChannelTypeFeatures this_arg_conv;
45563 this_arg_conv.inner = untag_ptr(this_arg);
45564 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45566 this_arg_conv.is_owned = false;
45567 ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv);
45570 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45571 LDKChannelTypeFeatures this_arg_conv;
45572 this_arg_conv.inner = untag_ptr(this_arg);
45573 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45574 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45575 this_arg_conv.is_owned = false;
45576 ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv);
45579 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45580 LDKChannelTypeFeatures this_arg_conv;
45581 this_arg_conv.inner = untag_ptr(this_arg);
45582 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45584 this_arg_conv.is_owned = false;
45585 jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv);
45589 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45590 LDKInitFeatures this_arg_conv;
45591 this_arg_conv.inner = untag_ptr(this_arg);
45592 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45593 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45594 this_arg_conv.is_owned = false;
45595 jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv);
45599 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45600 LDKNodeFeatures this_arg_conv;
45601 this_arg_conv.inner = untag_ptr(this_arg);
45602 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45604 this_arg_conv.is_owned = false;
45605 jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv);
45609 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45610 LDKChannelTypeFeatures this_arg_conv;
45611 this_arg_conv.inner = untag_ptr(this_arg);
45612 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45613 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45614 this_arg_conv.is_owned = false;
45615 jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv);
45619 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45620 LDKInitFeatures this_arg_conv;
45621 this_arg_conv.inner = untag_ptr(this_arg);
45622 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45624 this_arg_conv.is_owned = false;
45625 InitFeatures_set_payment_secret_optional(&this_arg_conv);
45628 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45629 LDKInitFeatures this_arg_conv;
45630 this_arg_conv.inner = untag_ptr(this_arg);
45631 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45633 this_arg_conv.is_owned = false;
45634 InitFeatures_set_payment_secret_required(&this_arg_conv);
45637 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45638 LDKInitFeatures this_arg_conv;
45639 this_arg_conv.inner = untag_ptr(this_arg);
45640 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45641 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45642 this_arg_conv.is_owned = false;
45643 jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv);
45647 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45648 LDKNodeFeatures this_arg_conv;
45649 this_arg_conv.inner = untag_ptr(this_arg);
45650 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45651 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45652 this_arg_conv.is_owned = false;
45653 NodeFeatures_set_payment_secret_optional(&this_arg_conv);
45656 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45657 LDKNodeFeatures this_arg_conv;
45658 this_arg_conv.inner = untag_ptr(this_arg);
45659 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45661 this_arg_conv.is_owned = false;
45662 NodeFeatures_set_payment_secret_required(&this_arg_conv);
45665 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45666 LDKNodeFeatures this_arg_conv;
45667 this_arg_conv.inner = untag_ptr(this_arg);
45668 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45670 this_arg_conv.is_owned = false;
45671 jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv);
45675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45676 LDKInvoiceFeatures this_arg_conv;
45677 this_arg_conv.inner = untag_ptr(this_arg);
45678 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45680 this_arg_conv.is_owned = false;
45681 InvoiceFeatures_set_payment_secret_optional(&this_arg_conv);
45684 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45685 LDKInvoiceFeatures this_arg_conv;
45686 this_arg_conv.inner = untag_ptr(this_arg);
45687 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45689 this_arg_conv.is_owned = false;
45690 InvoiceFeatures_set_payment_secret_required(&this_arg_conv);
45693 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45694 LDKInvoiceFeatures this_arg_conv;
45695 this_arg_conv.inner = untag_ptr(this_arg);
45696 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45698 this_arg_conv.is_owned = false;
45699 jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
45703 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45704 LDKInitFeatures this_arg_conv;
45705 this_arg_conv.inner = untag_ptr(this_arg);
45706 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45708 this_arg_conv.is_owned = false;
45709 jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv);
45713 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45714 LDKNodeFeatures this_arg_conv;
45715 this_arg_conv.inner = untag_ptr(this_arg);
45716 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45718 this_arg_conv.is_owned = false;
45719 jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv);
45723 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45724 LDKInvoiceFeatures this_arg_conv;
45725 this_arg_conv.inner = untag_ptr(this_arg);
45726 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45728 this_arg_conv.is_owned = false;
45729 jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv);
45733 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45734 LDKInitFeatures this_arg_conv;
45735 this_arg_conv.inner = untag_ptr(this_arg);
45736 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45738 this_arg_conv.is_owned = false;
45739 InitFeatures_set_basic_mpp_optional(&this_arg_conv);
45742 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45743 LDKInitFeatures this_arg_conv;
45744 this_arg_conv.inner = untag_ptr(this_arg);
45745 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45747 this_arg_conv.is_owned = false;
45748 InitFeatures_set_basic_mpp_required(&this_arg_conv);
45751 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45752 LDKInitFeatures this_arg_conv;
45753 this_arg_conv.inner = untag_ptr(this_arg);
45754 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45755 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45756 this_arg_conv.is_owned = false;
45757 jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv);
45761 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45762 LDKNodeFeatures this_arg_conv;
45763 this_arg_conv.inner = untag_ptr(this_arg);
45764 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45765 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45766 this_arg_conv.is_owned = false;
45767 NodeFeatures_set_basic_mpp_optional(&this_arg_conv);
45770 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45771 LDKNodeFeatures this_arg_conv;
45772 this_arg_conv.inner = untag_ptr(this_arg);
45773 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45775 this_arg_conv.is_owned = false;
45776 NodeFeatures_set_basic_mpp_required(&this_arg_conv);
45779 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45780 LDKNodeFeatures this_arg_conv;
45781 this_arg_conv.inner = untag_ptr(this_arg);
45782 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45784 this_arg_conv.is_owned = false;
45785 jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv);
45789 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45790 LDKInvoiceFeatures this_arg_conv;
45791 this_arg_conv.inner = untag_ptr(this_arg);
45792 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45794 this_arg_conv.is_owned = false;
45795 InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
45798 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45799 LDKInvoiceFeatures this_arg_conv;
45800 this_arg_conv.inner = untag_ptr(this_arg);
45801 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45802 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45803 this_arg_conv.is_owned = false;
45804 InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
45807 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45808 LDKInvoiceFeatures this_arg_conv;
45809 this_arg_conv.inner = untag_ptr(this_arg);
45810 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45811 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45812 this_arg_conv.is_owned = false;
45813 jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
45817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45818 LDKBolt12InvoiceFeatures this_arg_conv;
45819 this_arg_conv.inner = untag_ptr(this_arg);
45820 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45821 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45822 this_arg_conv.is_owned = false;
45823 Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
45826 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45827 LDKBolt12InvoiceFeatures this_arg_conv;
45828 this_arg_conv.inner = untag_ptr(this_arg);
45829 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45830 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45831 this_arg_conv.is_owned = false;
45832 Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
45835 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45836 LDKBolt12InvoiceFeatures this_arg_conv;
45837 this_arg_conv.inner = untag_ptr(this_arg);
45838 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45840 this_arg_conv.is_owned = false;
45841 jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
45845 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45846 LDKInitFeatures this_arg_conv;
45847 this_arg_conv.inner = untag_ptr(this_arg);
45848 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45849 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45850 this_arg_conv.is_owned = false;
45851 jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv);
45855 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45856 LDKNodeFeatures this_arg_conv;
45857 this_arg_conv.inner = untag_ptr(this_arg);
45858 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45860 this_arg_conv.is_owned = false;
45861 jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv);
45865 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45866 LDKInvoiceFeatures this_arg_conv;
45867 this_arg_conv.inner = untag_ptr(this_arg);
45868 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45869 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45870 this_arg_conv.is_owned = false;
45871 jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
45875 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45876 LDKBolt12InvoiceFeatures this_arg_conv;
45877 this_arg_conv.inner = untag_ptr(this_arg);
45878 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45880 this_arg_conv.is_owned = false;
45881 jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
45885 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45886 LDKInitFeatures this_arg_conv;
45887 this_arg_conv.inner = untag_ptr(this_arg);
45888 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45890 this_arg_conv.is_owned = false;
45891 InitFeatures_set_wumbo_optional(&this_arg_conv);
45894 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45895 LDKInitFeatures this_arg_conv;
45896 this_arg_conv.inner = untag_ptr(this_arg);
45897 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45899 this_arg_conv.is_owned = false;
45900 InitFeatures_set_wumbo_required(&this_arg_conv);
45903 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
45904 LDKInitFeatures this_arg_conv;
45905 this_arg_conv.inner = untag_ptr(this_arg);
45906 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45908 this_arg_conv.is_owned = false;
45909 jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv);
45913 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45914 LDKNodeFeatures this_arg_conv;
45915 this_arg_conv.inner = untag_ptr(this_arg);
45916 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45917 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45918 this_arg_conv.is_owned = false;
45919 NodeFeatures_set_wumbo_optional(&this_arg_conv);
45922 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45923 LDKNodeFeatures this_arg_conv;
45924 this_arg_conv.inner = untag_ptr(this_arg);
45925 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45926 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45927 this_arg_conv.is_owned = false;
45928 NodeFeatures_set_wumbo_required(&this_arg_conv);
45931 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
45932 LDKNodeFeatures this_arg_conv;
45933 this_arg_conv.inner = untag_ptr(this_arg);
45934 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45936 this_arg_conv.is_owned = false;
45937 jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv);
45941 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
45942 LDKInitFeatures this_arg_conv;
45943 this_arg_conv.inner = untag_ptr(this_arg);
45944 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45945 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45946 this_arg_conv.is_owned = false;
45947 jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv);
45951 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
45952 LDKNodeFeatures this_arg_conv;
45953 this_arg_conv.inner = untag_ptr(this_arg);
45954 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45956 this_arg_conv.is_owned = false;
45957 jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv);
45961 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45962 LDKInitFeatures this_arg_conv;
45963 this_arg_conv.inner = untag_ptr(this_arg);
45964 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45966 this_arg_conv.is_owned = false;
45967 InitFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv);
45970 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45971 LDKInitFeatures this_arg_conv;
45972 this_arg_conv.inner = untag_ptr(this_arg);
45973 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45975 this_arg_conv.is_owned = false;
45976 InitFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv);
45979 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
45980 LDKInitFeatures this_arg_conv;
45981 this_arg_conv.inner = untag_ptr(this_arg);
45982 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45984 this_arg_conv.is_owned = false;
45985 jboolean ret_conv = InitFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv);
45989 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45990 LDKNodeFeatures this_arg_conv;
45991 this_arg_conv.inner = untag_ptr(this_arg);
45992 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45994 this_arg_conv.is_owned = false;
45995 NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv);
45998 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45999 LDKNodeFeatures this_arg_conv;
46000 this_arg_conv.inner = untag_ptr(this_arg);
46001 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46003 this_arg_conv.is_owned = false;
46004 NodeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv);
46007 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46008 LDKNodeFeatures this_arg_conv;
46009 this_arg_conv.inner = untag_ptr(this_arg);
46010 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46012 this_arg_conv.is_owned = false;
46013 jboolean ret_conv = NodeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv);
46017 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46018 LDKChannelTypeFeatures this_arg_conv;
46019 this_arg_conv.inner = untag_ptr(this_arg);
46020 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46022 this_arg_conv.is_owned = false;
46023 ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv);
46026 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46027 LDKChannelTypeFeatures this_arg_conv;
46028 this_arg_conv.inner = untag_ptr(this_arg);
46029 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46030 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46031 this_arg_conv.is_owned = false;
46032 ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv);
46035 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46036 LDKChannelTypeFeatures this_arg_conv;
46037 this_arg_conv.inner = untag_ptr(this_arg);
46038 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46040 this_arg_conv.is_owned = false;
46041 jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv);
46045 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46046 LDKInitFeatures this_arg_conv;
46047 this_arg_conv.inner = untag_ptr(this_arg);
46048 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46050 this_arg_conv.is_owned = false;
46051 jboolean ret_conv = InitFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv);
46055 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46056 LDKNodeFeatures this_arg_conv;
46057 this_arg_conv.inner = untag_ptr(this_arg);
46058 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46060 this_arg_conv.is_owned = false;
46061 jboolean ret_conv = NodeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv);
46065 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46066 LDKChannelTypeFeatures this_arg_conv;
46067 this_arg_conv.inner = untag_ptr(this_arg);
46068 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46070 this_arg_conv.is_owned = false;
46071 jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv);
46075 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46076 LDKInitFeatures this_arg_conv;
46077 this_arg_conv.inner = untag_ptr(this_arg);
46078 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46080 this_arg_conv.is_owned = false;
46081 InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
46084 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46085 LDKInitFeatures this_arg_conv;
46086 this_arg_conv.inner = untag_ptr(this_arg);
46087 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46088 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46089 this_arg_conv.is_owned = false;
46090 InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
46093 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
46094 LDKInitFeatures this_arg_conv;
46095 this_arg_conv.inner = untag_ptr(this_arg);
46096 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46098 this_arg_conv.is_owned = false;
46099 jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv);
46103 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46104 LDKNodeFeatures this_arg_conv;
46105 this_arg_conv.inner = untag_ptr(this_arg);
46106 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46108 this_arg_conv.is_owned = false;
46109 NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
46112 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46113 LDKNodeFeatures this_arg_conv;
46114 this_arg_conv.inner = untag_ptr(this_arg);
46115 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46117 this_arg_conv.is_owned = false;
46118 NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
46121 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
46122 LDKNodeFeatures this_arg_conv;
46123 this_arg_conv.inner = untag_ptr(this_arg);
46124 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46125 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46126 this_arg_conv.is_owned = false;
46127 jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv);
46131 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
46132 LDKInitFeatures this_arg_conv;
46133 this_arg_conv.inner = untag_ptr(this_arg);
46134 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46136 this_arg_conv.is_owned = false;
46137 jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv);
46141 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
46142 LDKNodeFeatures this_arg_conv;
46143 this_arg_conv.inner = untag_ptr(this_arg);
46144 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46146 this_arg_conv.is_owned = false;
46147 jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv);
46151 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46152 LDKInitFeatures this_arg_conv;
46153 this_arg_conv.inner = untag_ptr(this_arg);
46154 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46155 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46156 this_arg_conv.is_owned = false;
46157 InitFeatures_set_onion_messages_optional(&this_arg_conv);
46160 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46161 LDKInitFeatures this_arg_conv;
46162 this_arg_conv.inner = untag_ptr(this_arg);
46163 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46164 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46165 this_arg_conv.is_owned = false;
46166 InitFeatures_set_onion_messages_required(&this_arg_conv);
46169 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
46170 LDKInitFeatures this_arg_conv;
46171 this_arg_conv.inner = untag_ptr(this_arg);
46172 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46173 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46174 this_arg_conv.is_owned = false;
46175 jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv);
46179 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46180 LDKNodeFeatures this_arg_conv;
46181 this_arg_conv.inner = untag_ptr(this_arg);
46182 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46183 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46184 this_arg_conv.is_owned = false;
46185 NodeFeatures_set_onion_messages_optional(&this_arg_conv);
46188 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46189 LDKNodeFeatures this_arg_conv;
46190 this_arg_conv.inner = untag_ptr(this_arg);
46191 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46193 this_arg_conv.is_owned = false;
46194 NodeFeatures_set_onion_messages_required(&this_arg_conv);
46197 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
46198 LDKNodeFeatures this_arg_conv;
46199 this_arg_conv.inner = untag_ptr(this_arg);
46200 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46202 this_arg_conv.is_owned = false;
46203 jboolean ret_conv = NodeFeatures_supports_onion_messages(&this_arg_conv);
46207 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
46208 LDKInitFeatures this_arg_conv;
46209 this_arg_conv.inner = untag_ptr(this_arg);
46210 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46211 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46212 this_arg_conv.is_owned = false;
46213 jboolean ret_conv = InitFeatures_requires_onion_messages(&this_arg_conv);
46217 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
46218 LDKNodeFeatures this_arg_conv;
46219 this_arg_conv.inner = untag_ptr(this_arg);
46220 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46221 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46222 this_arg_conv.is_owned = false;
46223 jboolean ret_conv = NodeFeatures_requires_onion_messages(&this_arg_conv);
46227 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46228 LDKInitFeatures this_arg_conv;
46229 this_arg_conv.inner = untag_ptr(this_arg);
46230 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46232 this_arg_conv.is_owned = false;
46233 InitFeatures_set_channel_type_optional(&this_arg_conv);
46236 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46237 LDKInitFeatures this_arg_conv;
46238 this_arg_conv.inner = untag_ptr(this_arg);
46239 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46240 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46241 this_arg_conv.is_owned = false;
46242 InitFeatures_set_channel_type_required(&this_arg_conv);
46245 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
46246 LDKInitFeatures this_arg_conv;
46247 this_arg_conv.inner = untag_ptr(this_arg);
46248 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46250 this_arg_conv.is_owned = false;
46251 jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv);
46255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46256 LDKNodeFeatures this_arg_conv;
46257 this_arg_conv.inner = untag_ptr(this_arg);
46258 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46259 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46260 this_arg_conv.is_owned = false;
46261 NodeFeatures_set_channel_type_optional(&this_arg_conv);
46264 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46265 LDKNodeFeatures this_arg_conv;
46266 this_arg_conv.inner = untag_ptr(this_arg);
46267 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46269 this_arg_conv.is_owned = false;
46270 NodeFeatures_set_channel_type_required(&this_arg_conv);
46273 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
46274 LDKNodeFeatures this_arg_conv;
46275 this_arg_conv.inner = untag_ptr(this_arg);
46276 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46278 this_arg_conv.is_owned = false;
46279 jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv);
46283 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
46284 LDKInitFeatures this_arg_conv;
46285 this_arg_conv.inner = untag_ptr(this_arg);
46286 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46288 this_arg_conv.is_owned = false;
46289 jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv);
46293 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
46294 LDKNodeFeatures this_arg_conv;
46295 this_arg_conv.inner = untag_ptr(this_arg);
46296 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46298 this_arg_conv.is_owned = false;
46299 jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv);
46303 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46304 LDKInitFeatures this_arg_conv;
46305 this_arg_conv.inner = untag_ptr(this_arg);
46306 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46308 this_arg_conv.is_owned = false;
46309 InitFeatures_set_scid_privacy_optional(&this_arg_conv);
46312 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46313 LDKInitFeatures this_arg_conv;
46314 this_arg_conv.inner = untag_ptr(this_arg);
46315 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46317 this_arg_conv.is_owned = false;
46318 InitFeatures_set_scid_privacy_required(&this_arg_conv);
46321 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46322 LDKInitFeatures this_arg_conv;
46323 this_arg_conv.inner = untag_ptr(this_arg);
46324 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46326 this_arg_conv.is_owned = false;
46327 jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv);
46331 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46332 LDKNodeFeatures this_arg_conv;
46333 this_arg_conv.inner = untag_ptr(this_arg);
46334 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46335 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46336 this_arg_conv.is_owned = false;
46337 NodeFeatures_set_scid_privacy_optional(&this_arg_conv);
46340 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46341 LDKNodeFeatures this_arg_conv;
46342 this_arg_conv.inner = untag_ptr(this_arg);
46343 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46344 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46345 this_arg_conv.is_owned = false;
46346 NodeFeatures_set_scid_privacy_required(&this_arg_conv);
46349 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46350 LDKNodeFeatures this_arg_conv;
46351 this_arg_conv.inner = untag_ptr(this_arg);
46352 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46353 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46354 this_arg_conv.is_owned = false;
46355 jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv);
46359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46360 LDKChannelTypeFeatures this_arg_conv;
46361 this_arg_conv.inner = untag_ptr(this_arg);
46362 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46363 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46364 this_arg_conv.is_owned = false;
46365 ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv);
46368 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46369 LDKChannelTypeFeatures this_arg_conv;
46370 this_arg_conv.inner = untag_ptr(this_arg);
46371 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46373 this_arg_conv.is_owned = false;
46374 ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv);
46377 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46378 LDKChannelTypeFeatures this_arg_conv;
46379 this_arg_conv.inner = untag_ptr(this_arg);
46380 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46381 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46382 this_arg_conv.is_owned = false;
46383 jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv);
46387 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46388 LDKInitFeatures this_arg_conv;
46389 this_arg_conv.inner = untag_ptr(this_arg);
46390 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46392 this_arg_conv.is_owned = false;
46393 jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv);
46397 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46398 LDKNodeFeatures this_arg_conv;
46399 this_arg_conv.inner = untag_ptr(this_arg);
46400 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46402 this_arg_conv.is_owned = false;
46403 jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv);
46407 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46408 LDKChannelTypeFeatures this_arg_conv;
46409 this_arg_conv.inner = untag_ptr(this_arg);
46410 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46412 this_arg_conv.is_owned = false;
46413 jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv);
46417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46418 LDKInitFeatures this_arg_conv;
46419 this_arg_conv.inner = untag_ptr(this_arg);
46420 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46422 this_arg_conv.is_owned = false;
46423 InitFeatures_set_zero_conf_optional(&this_arg_conv);
46426 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46427 LDKInitFeatures this_arg_conv;
46428 this_arg_conv.inner = untag_ptr(this_arg);
46429 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46430 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46431 this_arg_conv.is_owned = false;
46432 InitFeatures_set_zero_conf_required(&this_arg_conv);
46435 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46436 LDKInitFeatures this_arg_conv;
46437 this_arg_conv.inner = untag_ptr(this_arg);
46438 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46440 this_arg_conv.is_owned = false;
46441 jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv);
46445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46446 LDKNodeFeatures this_arg_conv;
46447 this_arg_conv.inner = untag_ptr(this_arg);
46448 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46450 this_arg_conv.is_owned = false;
46451 NodeFeatures_set_zero_conf_optional(&this_arg_conv);
46454 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46455 LDKNodeFeatures this_arg_conv;
46456 this_arg_conv.inner = untag_ptr(this_arg);
46457 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46458 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46459 this_arg_conv.is_owned = false;
46460 NodeFeatures_set_zero_conf_required(&this_arg_conv);
46463 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46464 LDKNodeFeatures this_arg_conv;
46465 this_arg_conv.inner = untag_ptr(this_arg);
46466 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46468 this_arg_conv.is_owned = false;
46469 jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv);
46473 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46474 LDKChannelTypeFeatures this_arg_conv;
46475 this_arg_conv.inner = untag_ptr(this_arg);
46476 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46478 this_arg_conv.is_owned = false;
46479 ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv);
46482 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46483 LDKChannelTypeFeatures this_arg_conv;
46484 this_arg_conv.inner = untag_ptr(this_arg);
46485 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46486 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46487 this_arg_conv.is_owned = false;
46488 ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv);
46491 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46492 LDKChannelTypeFeatures this_arg_conv;
46493 this_arg_conv.inner = untag_ptr(this_arg);
46494 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46496 this_arg_conv.is_owned = false;
46497 jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv);
46501 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46502 LDKInitFeatures this_arg_conv;
46503 this_arg_conv.inner = untag_ptr(this_arg);
46504 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46505 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46506 this_arg_conv.is_owned = false;
46507 jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv);
46511 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46512 LDKNodeFeatures this_arg_conv;
46513 this_arg_conv.inner = untag_ptr(this_arg);
46514 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46516 this_arg_conv.is_owned = false;
46517 jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv);
46521 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46522 LDKChannelTypeFeatures this_arg_conv;
46523 this_arg_conv.inner = untag_ptr(this_arg);
46524 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46526 this_arg_conv.is_owned = false;
46527 jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv);
46531 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46532 LDKNodeFeatures this_arg_conv;
46533 this_arg_conv.inner = untag_ptr(this_arg);
46534 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46535 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46536 this_arg_conv.is_owned = false;
46537 NodeFeatures_set_keysend_optional(&this_arg_conv);
46540 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46541 LDKNodeFeatures this_arg_conv;
46542 this_arg_conv.inner = untag_ptr(this_arg);
46543 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46545 this_arg_conv.is_owned = false;
46546 NodeFeatures_set_keysend_required(&this_arg_conv);
46549 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) {
46550 LDKNodeFeatures this_arg_conv;
46551 this_arg_conv.inner = untag_ptr(this_arg);
46552 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46553 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46554 this_arg_conv.is_owned = false;
46555 jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv);
46559 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) {
46560 LDKNodeFeatures this_arg_conv;
46561 this_arg_conv.inner = untag_ptr(this_arg);
46562 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46564 this_arg_conv.is_owned = false;
46565 jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv);
46569 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46570 LDKShutdownScript this_obj_conv;
46571 this_obj_conv.inner = untag_ptr(this_obj);
46572 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46574 ShutdownScript_free(this_obj_conv);
46577 static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) {
46578 LDKShutdownScript ret_var = ShutdownScript_clone(arg);
46579 int64_t ret_ref = 0;
46580 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46581 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46585 LDKShutdownScript arg_conv;
46586 arg_conv.inner = untag_ptr(arg);
46587 arg_conv.is_owned = ptr_is_owned(arg);
46588 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46589 arg_conv.is_owned = false;
46590 int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv);
46594 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46595 LDKShutdownScript orig_conv;
46596 orig_conv.inner = untag_ptr(orig);
46597 orig_conv.is_owned = ptr_is_owned(orig);
46598 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46599 orig_conv.is_owned = false;
46600 LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
46601 int64_t ret_ref = 0;
46602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46607 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46608 LDKShutdownScript a_conv;
46609 a_conv.inner = untag_ptr(a);
46610 a_conv.is_owned = ptr_is_owned(a);
46611 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46612 a_conv.is_owned = false;
46613 LDKShutdownScript b_conv;
46614 b_conv.inner = untag_ptr(b);
46615 b_conv.is_owned = ptr_is_owned(b);
46616 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46617 b_conv.is_owned = false;
46618 jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv);
46622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46623 LDKInvalidShutdownScript this_obj_conv;
46624 this_obj_conv.inner = untag_ptr(this_obj);
46625 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46626 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46627 InvalidShutdownScript_free(this_obj_conv);
46630 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1get_1script(JNIEnv *env, jclass clz, int64_t this_ptr) {
46631 LDKInvalidShutdownScript this_ptr_conv;
46632 this_ptr_conv.inner = untag_ptr(this_ptr);
46633 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46635 this_ptr_conv.is_owned = false;
46636 LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
46637 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
46638 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
46642 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1script(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
46643 LDKInvalidShutdownScript this_ptr_conv;
46644 this_ptr_conv.inner = untag_ptr(this_ptr);
46645 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46646 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46647 this_ptr_conv.is_owned = false;
46648 LDKCVec_u8Z val_ref;
46649 val_ref.datalen = (*env)->GetArrayLength(env, val);
46650 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
46651 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
46652 InvalidShutdownScript_set_script(&this_ptr_conv, val_ref);
46655 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new(JNIEnv *env, jclass clz, int8_tArray script_arg) {
46656 LDKCVec_u8Z script_arg_ref;
46657 script_arg_ref.datalen = (*env)->GetArrayLength(env, script_arg);
46658 script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
46659 (*env)->GetByteArrayRegion(env, script_arg, 0, script_arg_ref.datalen, script_arg_ref.data);
46660 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
46661 int64_t ret_ref = 0;
46662 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46663 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46667 static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) {
46668 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg);
46669 int64_t ret_ref = 0;
46670 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46671 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46675 LDKInvalidShutdownScript arg_conv;
46676 arg_conv.inner = untag_ptr(arg);
46677 arg_conv.is_owned = ptr_is_owned(arg);
46678 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46679 arg_conv.is_owned = false;
46680 int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv);
46684 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46685 LDKInvalidShutdownScript orig_conv;
46686 orig_conv.inner = untag_ptr(orig);
46687 orig_conv.is_owned = ptr_is_owned(orig);
46688 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46689 orig_conv.is_owned = false;
46690 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
46691 int64_t ret_ref = 0;
46692 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46693 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46697 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(JNIEnv *env, jclass clz, int64_t obj) {
46698 LDKShutdownScript obj_conv;
46699 obj_conv.inner = untag_ptr(obj);
46700 obj_conv.is_owned = ptr_is_owned(obj);
46701 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
46702 obj_conv.is_owned = false;
46703 LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
46704 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
46705 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
46706 CVec_u8Z_free(ret_var);
46710 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
46711 LDKu8slice ser_ref;
46712 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
46713 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
46714 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
46715 *ret_conv = ShutdownScript_read(ser_ref);
46716 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
46717 return tag_ptr(ret_conv, true);
46720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh(JNIEnv *env, jclass clz, int8_tArray pubkey_hash) {
46721 uint8_t pubkey_hash_arr[20];
46722 CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20);
46723 (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr);
46724 uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
46725 LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
46726 int64_t ret_ref = 0;
46727 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46728 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46732 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh(JNIEnv *env, jclass clz, int8_tArray script_hash) {
46733 uint8_t script_hash_arr[32];
46734 CHECK((*env)->GetArrayLength(env, script_hash) == 32);
46735 (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr);
46736 uint8_t (*script_hash_ref)[32] = &script_hash_arr;
46737 LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
46738 int64_t ret_ref = 0;
46739 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46740 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) {
46746 LDKu8slice program_ref;
46747 program_ref.datalen = (*env)->GetArrayLength(env, program);
46748 program_ref.data = (*env)->GetByteArrayElements (env, program, NULL);
46749 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
46750 *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
46751 (*env)->ReleaseByteArrayElements(env, program, (int8_t*)program_ref.data, 0);
46752 return tag_ptr(ret_conv, true);
46755 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
46756 LDKShutdownScript this_arg_conv;
46757 this_arg_conv.inner = untag_ptr(this_arg);
46758 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46760 this_arg_conv = ShutdownScript_clone(&this_arg_conv);
46761 LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
46762 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
46763 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
46764 CVec_u8Z_free(ret_var);
46768 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1legacy_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
46769 LDKShutdownScript this_arg_conv;
46770 this_arg_conv.inner = untag_ptr(this_arg);
46771 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46773 this_arg_conv.is_owned = false;
46774 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
46775 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form);
46779 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compatible(JNIEnv *env, jclass clz, int64_t this_arg, int64_t features) {
46780 LDKShutdownScript this_arg_conv;
46781 this_arg_conv.inner = untag_ptr(this_arg);
46782 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46784 this_arg_conv.is_owned = false;
46785 LDKInitFeatures features_conv;
46786 features_conv.inner = untag_ptr(features);
46787 features_conv.is_owned = ptr_is_owned(features);
46788 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
46789 features_conv.is_owned = false;
46790 jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
46794 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
46795 if (!ptr_is_owned(this_ptr)) return;
46796 void* this_ptr_ptr = untag_ptr(this_ptr);
46797 CHECK_ACCESS(this_ptr_ptr);
46798 LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
46799 FREE(untag_ptr(this_ptr));
46800 Retry_free(this_ptr_conv);
46803 static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
46804 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
46805 *ret_copy = Retry_clone(arg);
46806 int64_t ret_ref = tag_ptr(ret_copy, true);
46809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46810 LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
46811 int64_t ret_conv = Retry_clone_ptr(arg_conv);
46815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46816 LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
46817 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
46818 *ret_copy = Retry_clone(orig_conv);
46819 int64_t ret_ref = tag_ptr(ret_copy, true);
46823 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1attempts(JNIEnv *env, jclass clz, int64_t a) {
46824 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
46825 *ret_copy = Retry_attempts(a);
46826 int64_t ret_ref = tag_ptr(ret_copy, true);
46830 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1timeout(JNIEnv *env, jclass clz, int64_t a) {
46831 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
46832 *ret_copy = Retry_timeout(a);
46833 int64_t ret_ref = tag_ptr(ret_copy, true);
46837 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46838 LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
46839 LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
46840 jboolean ret_conv = Retry_eq(a_conv, b_conv);
46844 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1hash(JNIEnv *env, jclass clz, int64_t o) {
46845 LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
46846 int64_t ret_conv = Retry_hash(o_conv);
46850 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46851 LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig);
46852 jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_clone(orig_conv));
46856 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1payment_1expired(JNIEnv *env, jclass clz) {
46857 jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_payment_expired());
46861 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1route_1not_1found(JNIEnv *env, jclass clz) {
46862 jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_route_not_found());
46866 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) {
46867 jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_duplicate_payment());
46871 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
46872 if (!ptr_is_owned(this_ptr)) return;
46873 void* this_ptr_ptr = untag_ptr(this_ptr);
46874 CHECK_ACCESS(this_ptr_ptr);
46875 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
46876 FREE(untag_ptr(this_ptr));
46877 PaymentSendFailure_free(this_ptr_conv);
46880 static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
46881 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
46882 *ret_copy = PaymentSendFailure_clone(arg);
46883 int64_t ret_ref = tag_ptr(ret_copy, true);
46886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46887 LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
46888 int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
46892 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46893 LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
46894 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
46895 *ret_copy = PaymentSendFailure_clone(orig_conv);
46896 int64_t ret_ref = tag_ptr(ret_copy, true);
46900 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) {
46901 void* a_ptr = untag_ptr(a);
46902 CHECK_ACCESS(a_ptr);
46903 LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
46904 a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
46905 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
46906 *ret_copy = PaymentSendFailure_parameter_error(a_conv);
46907 int64_t ret_ref = tag_ptr(ret_copy, true);
46911 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) {
46912 LDKCVec_CResult_NoneAPIErrorZZ a_constr;
46913 a_constr.datalen = (*env)->GetArrayLength(env, a);
46914 if (a_constr.datalen > 0)
46915 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
46917 a_constr.data = NULL;
46918 int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
46919 for (size_t w = 0; w < a_constr.datalen; w++) {
46920 int64_t a_conv_22 = a_vals[w];
46921 void* a_conv_22_ptr = untag_ptr(a_conv_22);
46922 CHECK_ACCESS(a_conv_22_ptr);
46923 LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
46924 a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
46925 a_constr.data[w] = a_conv_22_conv;
46927 (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
46928 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
46929 *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
46930 int64_t ret_ref = tag_ptr(ret_copy, true);
46934 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe(JNIEnv *env, jclass clz, int64_tArray a) {
46935 LDKCVec_APIErrorZ a_constr;
46936 a_constr.datalen = (*env)->GetArrayLength(env, a);
46937 if (a_constr.datalen > 0)
46938 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
46940 a_constr.data = NULL;
46941 int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
46942 for (size_t k = 0; k < a_constr.datalen; k++) {
46943 int64_t a_conv_10 = a_vals[k];
46944 void* a_conv_10_ptr = untag_ptr(a_conv_10);
46945 CHECK_ACCESS(a_conv_10_ptr);
46946 LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
46947 a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
46948 a_constr.data[k] = a_conv_10_conv;
46950 (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
46951 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
46952 *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr);
46953 int64_t ret_ref = tag_ptr(ret_copy, true);
46957 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) {
46958 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
46959 *ret_copy = PaymentSendFailure_duplicate_payment();
46960 int64_t ret_ref = tag_ptr(ret_copy, true);
46964 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) {
46965 LDKCVec_CResult_NoneAPIErrorZZ results_constr;
46966 results_constr.datalen = (*env)->GetArrayLength(env, results);
46967 if (results_constr.datalen > 0)
46968 results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
46970 results_constr.data = NULL;
46971 int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL);
46972 for (size_t w = 0; w < results_constr.datalen; w++) {
46973 int64_t results_conv_22 = results_vals[w];
46974 void* results_conv_22_ptr = untag_ptr(results_conv_22);
46975 CHECK_ACCESS(results_conv_22_ptr);
46976 LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
46977 results_constr.data[w] = results_conv_22_conv;
46979 (*env)->ReleaseLongArrayElements(env, results, results_vals, 0);
46980 LDKRouteParameters failed_paths_retry_conv;
46981 failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
46982 failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
46983 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
46984 failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
46985 LDKThirtyTwoBytes payment_id_ref;
46986 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
46987 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
46988 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
46989 *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
46990 int64_t ret_ref = tag_ptr(ret_copy, true);
46994 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
46995 if (!ptr_is_owned(this_ptr)) return;
46996 void* this_ptr_ptr = untag_ptr(this_ptr);
46997 CHECK_ACCESS(this_ptr_ptr);
46998 LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
46999 FREE(untag_ptr(this_ptr));
47000 CustomMessageReader_free(this_ptr_conv);
47003 static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) {
47004 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
47005 *ret_ret = Type_clone(arg);
47006 return tag_ptr(ret_ret, true);
47008 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47009 void* arg_ptr = untag_ptr(arg);
47010 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
47011 LDKType* arg_conv = (LDKType*)arg_ptr;
47012 int64_t ret_conv = Type_clone_ptr(arg_conv);
47016 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47017 void* orig_ptr = untag_ptr(orig);
47018 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
47019 LDKType* orig_conv = (LDKType*)orig_ptr;
47020 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
47021 *ret_ret = Type_clone(orig_conv);
47022 return tag_ptr(ret_ret, true);
47025 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47026 if (!ptr_is_owned(this_ptr)) return;
47027 void* this_ptr_ptr = untag_ptr(this_ptr);
47028 CHECK_ACCESS(this_ptr_ptr);
47029 LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
47030 FREE(untag_ptr(this_ptr));
47031 Type_free(this_ptr_conv);
47034 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47035 LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig);
47036 jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_clone(orig_conv));
47040 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1chain(JNIEnv *env, jclass clz) {
47041 jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_chain());
47045 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1tx(JNIEnv *env, jclass clz) {
47046 jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_tx());
47050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoResult_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47051 if (!ptr_is_owned(this_ptr)) return;
47052 void* this_ptr_ptr = untag_ptr(this_ptr);
47053 CHECK_ACCESS(this_ptr_ptr);
47054 LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr);
47055 FREE(untag_ptr(this_ptr));
47056 UtxoResult_free(this_ptr_conv);
47059 static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) {
47060 LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
47061 *ret_copy = UtxoResult_clone(arg);
47062 int64_t ret_ref = tag_ptr(ret_copy, true);
47065 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47066 LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg);
47067 int64_t ret_conv = UtxoResult_clone_ptr(arg_conv);
47071 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47072 LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig);
47073 LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
47074 *ret_copy = UtxoResult_clone(orig_conv);
47075 int64_t ret_ref = tag_ptr(ret_copy, true);
47079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1sync(JNIEnv *env, jclass clz, int64_t a) {
47080 void* a_ptr = untag_ptr(a);
47081 CHECK_ACCESS(a_ptr);
47082 LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr);
47083 a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a));
47084 LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
47085 *ret_copy = UtxoResult_sync(a_conv);
47086 int64_t ret_ref = tag_ptr(ret_copy, true);
47090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1async(JNIEnv *env, jclass clz, int64_t a) {
47091 LDKUtxoFuture a_conv;
47092 a_conv.inner = untag_ptr(a);
47093 a_conv.is_owned = ptr_is_owned(a);
47094 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
47095 a_conv = UtxoFuture_clone(&a_conv);
47096 LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
47097 *ret_copy = UtxoResult_async(a_conv);
47098 int64_t ret_ref = tag_ptr(ret_copy, true);
47102 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoLookup_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47103 if (!ptr_is_owned(this_ptr)) return;
47104 void* this_ptr_ptr = untag_ptr(this_ptr);
47105 CHECK_ACCESS(this_ptr_ptr);
47106 LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr);
47107 FREE(untag_ptr(this_ptr));
47108 UtxoLookup_free(this_ptr_conv);
47111 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47112 LDKUtxoFuture this_obj_conv;
47113 this_obj_conv.inner = untag_ptr(this_obj);
47114 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47116 UtxoFuture_free(this_obj_conv);
47119 static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) {
47120 LDKUtxoFuture ret_var = UtxoFuture_clone(arg);
47121 int64_t ret_ref = 0;
47122 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47123 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47127 LDKUtxoFuture arg_conv;
47128 arg_conv.inner = untag_ptr(arg);
47129 arg_conv.is_owned = ptr_is_owned(arg);
47130 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47131 arg_conv.is_owned = false;
47132 int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv);
47136 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47137 LDKUtxoFuture orig_conv;
47138 orig_conv.inner = untag_ptr(orig);
47139 orig_conv.is_owned = ptr_is_owned(orig);
47140 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47141 orig_conv.is_owned = false;
47142 LDKUtxoFuture ret_var = UtxoFuture_clone(&orig_conv);
47143 int64_t ret_ref = 0;
47144 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47145 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47149 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1new(JNIEnv *env, jclass clz) {
47150 LDKUtxoFuture ret_var = UtxoFuture_new();
47151 int64_t ret_ref = 0;
47152 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47153 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve_1without_1forwarding(JNIEnv *env, jclass clz, int64_t this_arg, int64_t graph, int64_t result) {
47158 LDKUtxoFuture this_arg_conv;
47159 this_arg_conv.inner = untag_ptr(this_arg);
47160 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47162 this_arg_conv.is_owned = false;
47163 LDKNetworkGraph graph_conv;
47164 graph_conv.inner = untag_ptr(graph);
47165 graph_conv.is_owned = ptr_is_owned(graph);
47166 CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv);
47167 graph_conv.is_owned = false;
47168 void* result_ptr = untag_ptr(result);
47169 CHECK_ACCESS(result_ptr);
47170 LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr);
47171 UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv);
47174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve(JNIEnv *env, jclass clz, int64_t this_arg, int64_t graph, int64_t gossip, int64_t result) {
47175 LDKUtxoFuture this_arg_conv;
47176 this_arg_conv.inner = untag_ptr(this_arg);
47177 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47179 this_arg_conv.is_owned = false;
47180 LDKNetworkGraph graph_conv;
47181 graph_conv.inner = untag_ptr(graph);
47182 graph_conv.is_owned = ptr_is_owned(graph);
47183 CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv);
47184 graph_conv.is_owned = false;
47185 LDKP2PGossipSync gossip_conv;
47186 gossip_conv.inner = untag_ptr(gossip);
47187 gossip_conv.is_owned = ptr_is_owned(gossip);
47188 CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv);
47189 gossip_conv.is_owned = false;
47190 void* result_ptr = untag_ptr(result);
47191 CHECK_ACCESS(result_ptr);
47192 LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr);
47193 UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv);
47196 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47197 LDKNodeId this_obj_conv;
47198 this_obj_conv.inner = untag_ptr(this_obj);
47199 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47201 NodeId_free(this_obj_conv);
47204 static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) {
47205 LDKNodeId ret_var = NodeId_clone(arg);
47206 int64_t ret_ref = 0;
47207 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47208 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47211 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47212 LDKNodeId arg_conv;
47213 arg_conv.inner = untag_ptr(arg);
47214 arg_conv.is_owned = ptr_is_owned(arg);
47215 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47216 arg_conv.is_owned = false;
47217 int64_t ret_conv = NodeId_clone_ptr(&arg_conv);
47221 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47222 LDKNodeId orig_conv;
47223 orig_conv.inner = untag_ptr(orig);
47224 orig_conv.is_owned = ptr_is_owned(orig);
47225 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47226 orig_conv.is_owned = false;
47227 LDKNodeId ret_var = NodeId_clone(&orig_conv);
47228 int64_t ret_ref = 0;
47229 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47230 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47234 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv *env, jclass clz, int8_tArray pubkey) {
47235 LDKPublicKey pubkey_ref;
47236 CHECK((*env)->GetArrayLength(env, pubkey) == 33);
47237 (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
47238 LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
47239 int64_t ret_ref = 0;
47240 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47241 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47245 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEnv *env, jclass clz, int64_t this_arg) {
47246 LDKNodeId this_arg_conv;
47247 this_arg_conv.inner = untag_ptr(this_arg);
47248 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47250 this_arg_conv.is_owned = false;
47251 LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv);
47252 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47253 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47257 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, jclass clz, int64_t o) {
47259 o_conv.inner = untag_ptr(o);
47260 o_conv.is_owned = ptr_is_owned(o);
47261 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
47262 o_conv.is_owned = false;
47263 int64_t ret_conv = NodeId_hash(&o_conv);
47267 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *env, jclass clz, int64_t obj) {
47268 LDKNodeId obj_conv;
47269 obj_conv.inner = untag_ptr(obj);
47270 obj_conv.is_owned = ptr_is_owned(obj);
47271 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47272 obj_conv.is_owned = false;
47273 LDKCVec_u8Z ret_var = NodeId_write(&obj_conv);
47274 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47275 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47276 CVec_u8Z_free(ret_var);
47280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
47281 LDKu8slice ser_ref;
47282 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
47283 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
47284 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
47285 *ret_conv = NodeId_read(ser_ref);
47286 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
47287 return tag_ptr(ret_conv, true);
47290 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47291 LDKNetworkGraph this_obj_conv;
47292 this_obj_conv.inner = untag_ptr(this_obj);
47293 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47295 NetworkGraph_free(this_obj_conv);
47298 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47299 LDKReadOnlyNetworkGraph this_obj_conv;
47300 this_obj_conv.inner = untag_ptr(this_obj);
47301 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47302 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47303 ReadOnlyNetworkGraph_free(this_obj_conv);
47306 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47307 if (!ptr_is_owned(this_ptr)) return;
47308 void* this_ptr_ptr = untag_ptr(this_ptr);
47309 CHECK_ACCESS(this_ptr_ptr);
47310 LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
47311 FREE(untag_ptr(this_ptr));
47312 NetworkUpdate_free(this_ptr_conv);
47315 static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) {
47316 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
47317 *ret_copy = NetworkUpdate_clone(arg);
47318 int64_t ret_ref = tag_ptr(ret_copy, true);
47321 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47322 LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg);
47323 int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv);
47327 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47328 LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig);
47329 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
47330 *ret_copy = NetworkUpdate_clone(orig_conv);
47331 int64_t ret_ref = tag_ptr(ret_copy, true);
47335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1update_1message(JNIEnv *env, jclass clz, int64_t msg) {
47336 LDKChannelUpdate msg_conv;
47337 msg_conv.inner = untag_ptr(msg);
47338 msg_conv.is_owned = ptr_is_owned(msg);
47339 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
47340 msg_conv = ChannelUpdate_clone(&msg_conv);
47341 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
47342 *ret_copy = NetworkUpdate_channel_update_message(msg_conv);
47343 int64_t ret_ref = tag_ptr(ret_copy, true);
47347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) {
47348 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
47349 *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent);
47350 int64_t ret_ref = tag_ptr(ret_copy, true);
47354 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure(JNIEnv *env, jclass clz, int8_tArray node_id, jboolean is_permanent) {
47355 LDKPublicKey node_id_ref;
47356 CHECK((*env)->GetArrayLength(env, node_id) == 33);
47357 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
47358 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
47359 *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent);
47360 int64_t ret_ref = tag_ptr(ret_copy, true);
47364 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47365 LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a);
47366 LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b);
47367 jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv);
47371 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
47372 LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
47373 LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
47374 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47375 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47376 CVec_u8Z_free(ret_var);
47380 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
47381 LDKu8slice ser_ref;
47382 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
47383 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
47384 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
47385 *ret_conv = NetworkUpdate_read(ser_ref);
47386 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
47387 return tag_ptr(ret_conv, true);
47390 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47391 LDKP2PGossipSync this_obj_conv;
47392 this_obj_conv.inner = untag_ptr(this_obj);
47393 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47394 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47395 P2PGossipSync_free(this_obj_conv);
47398 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t utxo_lookup, int64_t logger) {
47399 LDKNetworkGraph network_graph_conv;
47400 network_graph_conv.inner = untag_ptr(network_graph);
47401 network_graph_conv.is_owned = ptr_is_owned(network_graph);
47402 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
47403 network_graph_conv.is_owned = false;
47404 void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
47405 CHECK_ACCESS(utxo_lookup_ptr);
47406 LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
47407 // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
47408 if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
47409 // Manually implement clone for Java trait instances
47410 if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
47411 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47412 LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
47415 void* logger_ptr = untag_ptr(logger);
47416 CHECK_ACCESS(logger_ptr);
47417 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
47418 if (logger_conv.free == LDKLogger_JCalls_free) {
47419 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47420 LDKLogger_JCalls_cloned(&logger_conv);
47422 LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv);
47423 int64_t ret_ref = 0;
47424 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47425 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1utxo_1lookup(JNIEnv *env, jclass clz, int64_t this_arg, int64_t utxo_lookup) {
47430 LDKP2PGossipSync this_arg_conv;
47431 this_arg_conv.inner = untag_ptr(this_arg);
47432 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47434 this_arg_conv.is_owned = false;
47435 void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
47436 CHECK_ACCESS(utxo_lookup_ptr);
47437 LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
47438 // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
47439 if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
47440 // Manually implement clone for Java trait instances
47441 if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
47442 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
47443 LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
47446 P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv);
47449 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_update) {
47450 LDKNetworkGraph this_arg_conv;
47451 this_arg_conv.inner = untag_ptr(this_arg);
47452 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47454 this_arg_conv.is_owned = false;
47455 LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update);
47456 NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv);
47459 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
47460 LDKP2PGossipSync this_arg_conv;
47461 this_arg_conv.inner = untag_ptr(this_arg);
47462 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47463 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47464 this_arg_conv.is_owned = false;
47465 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
47466 *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv);
47467 return tag_ptr(ret_ret, true);
47470 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
47471 LDKP2PGossipSync this_arg_conv;
47472 this_arg_conv.inner = untag_ptr(this_arg);
47473 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47474 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47475 this_arg_conv.is_owned = false;
47476 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
47477 *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv);
47478 return tag_ptr(ret_ret, true);
47481 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47482 LDKChannelUpdateInfo this_obj_conv;
47483 this_obj_conv.inner = untag_ptr(this_obj);
47484 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47486 ChannelUpdateInfo_free(this_obj_conv);
47489 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) {
47490 LDKChannelUpdateInfo this_ptr_conv;
47491 this_ptr_conv.inner = untag_ptr(this_ptr);
47492 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47494 this_ptr_conv.is_owned = false;
47495 int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv);
47499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
47500 LDKChannelUpdateInfo this_ptr_conv;
47501 this_ptr_conv.inner = untag_ptr(this_ptr);
47502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47504 this_ptr_conv.is_owned = false;
47505 ChannelUpdateInfo_set_last_update(&this_ptr_conv, val);
47508 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr) {
47509 LDKChannelUpdateInfo this_ptr_conv;
47510 this_ptr_conv.inner = untag_ptr(this_ptr);
47511 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47513 this_ptr_conv.is_owned = false;
47514 jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv);
47518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
47519 LDKChannelUpdateInfo this_ptr_conv;
47520 this_ptr_conv.inner = untag_ptr(this_ptr);
47521 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47523 this_ptr_conv.is_owned = false;
47524 ChannelUpdateInfo_set_enabled(&this_ptr_conv, val);
47527 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
47528 LDKChannelUpdateInfo this_ptr_conv;
47529 this_ptr_conv.inner = untag_ptr(this_ptr);
47530 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47532 this_ptr_conv.is_owned = false;
47533 int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv);
47537 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
47538 LDKChannelUpdateInfo this_ptr_conv;
47539 this_ptr_conv.inner = untag_ptr(this_ptr);
47540 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47542 this_ptr_conv.is_owned = false;
47543 ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
47546 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
47547 LDKChannelUpdateInfo this_ptr_conv;
47548 this_ptr_conv.inner = untag_ptr(this_ptr);
47549 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47551 this_ptr_conv.is_owned = false;
47552 int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv);
47556 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47557 LDKChannelUpdateInfo this_ptr_conv;
47558 this_ptr_conv.inner = untag_ptr(this_ptr);
47559 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47561 this_ptr_conv.is_owned = false;
47562 ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
47565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
47566 LDKChannelUpdateInfo this_ptr_conv;
47567 this_ptr_conv.inner = untag_ptr(this_ptr);
47568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47570 this_ptr_conv.is_owned = false;
47571 int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv);
47575 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47576 LDKChannelUpdateInfo this_ptr_conv;
47577 this_ptr_conv.inner = untag_ptr(this_ptr);
47578 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47580 this_ptr_conv.is_owned = false;
47581 ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val);
47584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) {
47585 LDKChannelUpdateInfo this_ptr_conv;
47586 this_ptr_conv.inner = untag_ptr(this_ptr);
47587 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47589 this_ptr_conv.is_owned = false;
47590 LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv);
47591 int64_t ret_ref = 0;
47592 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47593 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47597 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47598 LDKChannelUpdateInfo this_ptr_conv;
47599 this_ptr_conv.inner = untag_ptr(this_ptr);
47600 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47601 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47602 this_ptr_conv.is_owned = false;
47603 LDKRoutingFees val_conv;
47604 val_conv.inner = untag_ptr(val);
47605 val_conv.is_owned = ptr_is_owned(val);
47606 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47607 val_conv = RoutingFees_clone(&val_conv);
47608 ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv);
47611 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
47612 LDKChannelUpdateInfo this_ptr_conv;
47613 this_ptr_conv.inner = untag_ptr(this_ptr);
47614 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47616 this_ptr_conv.is_owned = false;
47617 LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv);
47618 int64_t ret_ref = 0;
47619 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47620 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47624 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47625 LDKChannelUpdateInfo this_ptr_conv;
47626 this_ptr_conv.inner = untag_ptr(this_ptr);
47627 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47628 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47629 this_ptr_conv.is_owned = false;
47630 LDKChannelUpdate val_conv;
47631 val_conv.inner = untag_ptr(val);
47632 val_conv.is_owned = ptr_is_owned(val);
47633 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47634 val_conv = ChannelUpdate_clone(&val_conv);
47635 ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv);
47638 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) {
47639 LDKRoutingFees fees_arg_conv;
47640 fees_arg_conv.inner = untag_ptr(fees_arg);
47641 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
47642 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
47643 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
47644 LDKChannelUpdate last_update_message_arg_conv;
47645 last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg);
47646 last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg);
47647 CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv);
47648 last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
47649 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);
47650 int64_t ret_ref = 0;
47651 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47652 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47656 static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) {
47657 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg);
47658 int64_t ret_ref = 0;
47659 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47660 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47663 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47664 LDKChannelUpdateInfo arg_conv;
47665 arg_conv.inner = untag_ptr(arg);
47666 arg_conv.is_owned = ptr_is_owned(arg);
47667 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47668 arg_conv.is_owned = false;
47669 int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv);
47673 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47674 LDKChannelUpdateInfo orig_conv;
47675 orig_conv.inner = untag_ptr(orig);
47676 orig_conv.is_owned = ptr_is_owned(orig);
47677 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47678 orig_conv.is_owned = false;
47679 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv);
47680 int64_t ret_ref = 0;
47681 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47682 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47686 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47687 LDKChannelUpdateInfo a_conv;
47688 a_conv.inner = untag_ptr(a);
47689 a_conv.is_owned = ptr_is_owned(a);
47690 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
47691 a_conv.is_owned = false;
47692 LDKChannelUpdateInfo b_conv;
47693 b_conv.inner = untag_ptr(b);
47694 b_conv.is_owned = ptr_is_owned(b);
47695 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
47696 b_conv.is_owned = false;
47697 jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv);
47701 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
47702 LDKChannelUpdateInfo obj_conv;
47703 obj_conv.inner = untag_ptr(obj);
47704 obj_conv.is_owned = ptr_is_owned(obj);
47705 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47706 obj_conv.is_owned = false;
47707 LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv);
47708 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47709 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47710 CVec_u8Z_free(ret_var);
47714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
47715 LDKu8slice ser_ref;
47716 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
47717 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
47718 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
47719 *ret_conv = ChannelUpdateInfo_read(ser_ref);
47720 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
47721 return tag_ptr(ret_conv, true);
47724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47725 LDKChannelInfo this_obj_conv;
47726 this_obj_conv.inner = untag_ptr(this_obj);
47727 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47729 ChannelInfo_free(this_obj_conv);
47732 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
47733 LDKChannelInfo this_ptr_conv;
47734 this_ptr_conv.inner = untag_ptr(this_ptr);
47735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47737 this_ptr_conv.is_owned = false;
47738 LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
47739 int64_t ret_ref = 0;
47740 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47741 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47745 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47746 LDKChannelInfo this_ptr_conv;
47747 this_ptr_conv.inner = untag_ptr(this_ptr);
47748 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47750 this_ptr_conv.is_owned = false;
47751 LDKChannelFeatures val_conv;
47752 val_conv.inner = untag_ptr(val);
47753 val_conv.is_owned = ptr_is_owned(val);
47754 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47755 val_conv = ChannelFeatures_clone(&val_conv);
47756 ChannelInfo_set_features(&this_ptr_conv, val_conv);
47759 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr) {
47760 LDKChannelInfo this_ptr_conv;
47761 this_ptr_conv.inner = untag_ptr(this_ptr);
47762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47764 this_ptr_conv.is_owned = false;
47765 LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv);
47766 int64_t ret_ref = 0;
47767 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47768 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47772 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47773 LDKChannelInfo this_ptr_conv;
47774 this_ptr_conv.inner = untag_ptr(this_ptr);
47775 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47776 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47777 this_ptr_conv.is_owned = false;
47778 LDKNodeId val_conv;
47779 val_conv.inner = untag_ptr(val);
47780 val_conv.is_owned = ptr_is_owned(val);
47781 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47782 val_conv = NodeId_clone(&val_conv);
47783 ChannelInfo_set_node_one(&this_ptr_conv, val_conv);
47786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr) {
47787 LDKChannelInfo this_ptr_conv;
47788 this_ptr_conv.inner = untag_ptr(this_ptr);
47789 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47790 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47791 this_ptr_conv.is_owned = false;
47792 LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
47793 int64_t ret_ref = 0;
47794 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47795 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47799 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47800 LDKChannelInfo this_ptr_conv;
47801 this_ptr_conv.inner = untag_ptr(this_ptr);
47802 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47804 this_ptr_conv.is_owned = false;
47805 LDKChannelUpdateInfo val_conv;
47806 val_conv.inner = untag_ptr(val);
47807 val_conv.is_owned = ptr_is_owned(val);
47808 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47809 val_conv = ChannelUpdateInfo_clone(&val_conv);
47810 ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv);
47813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr) {
47814 LDKChannelInfo this_ptr_conv;
47815 this_ptr_conv.inner = untag_ptr(this_ptr);
47816 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47818 this_ptr_conv.is_owned = false;
47819 LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv);
47820 int64_t ret_ref = 0;
47821 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47822 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47826 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47827 LDKChannelInfo this_ptr_conv;
47828 this_ptr_conv.inner = untag_ptr(this_ptr);
47829 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47830 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47831 this_ptr_conv.is_owned = false;
47832 LDKNodeId val_conv;
47833 val_conv.inner = untag_ptr(val);
47834 val_conv.is_owned = ptr_is_owned(val);
47835 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47836 val_conv = NodeId_clone(&val_conv);
47837 ChannelInfo_set_node_two(&this_ptr_conv, val_conv);
47840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr) {
47841 LDKChannelInfo this_ptr_conv;
47842 this_ptr_conv.inner = untag_ptr(this_ptr);
47843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47845 this_ptr_conv.is_owned = false;
47846 LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
47847 int64_t ret_ref = 0;
47848 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47849 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47854 LDKChannelInfo this_ptr_conv;
47855 this_ptr_conv.inner = untag_ptr(this_ptr);
47856 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47858 this_ptr_conv.is_owned = false;
47859 LDKChannelUpdateInfo val_conv;
47860 val_conv.inner = untag_ptr(val);
47861 val_conv.is_owned = ptr_is_owned(val);
47862 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47863 val_conv = ChannelUpdateInfo_clone(&val_conv);
47864 ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv);
47867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr) {
47868 LDKChannelInfo this_ptr_conv;
47869 this_ptr_conv.inner = untag_ptr(this_ptr);
47870 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47872 this_ptr_conv.is_owned = false;
47873 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
47874 *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv);
47875 int64_t ret_ref = tag_ptr(ret_copy, true);
47879 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47880 LDKChannelInfo this_ptr_conv;
47881 this_ptr_conv.inner = untag_ptr(this_ptr);
47882 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47884 this_ptr_conv.is_owned = false;
47885 void* val_ptr = untag_ptr(val);
47886 CHECK_ACCESS(val_ptr);
47887 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
47888 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
47889 ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
47892 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
47893 LDKChannelInfo this_ptr_conv;
47894 this_ptr_conv.inner = untag_ptr(this_ptr);
47895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47897 this_ptr_conv.is_owned = false;
47898 LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
47899 int64_t ret_ref = 0;
47900 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47901 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47905 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47906 LDKChannelInfo this_ptr_conv;
47907 this_ptr_conv.inner = untag_ptr(this_ptr);
47908 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47910 this_ptr_conv.is_owned = false;
47911 LDKChannelAnnouncement val_conv;
47912 val_conv.inner = untag_ptr(val);
47913 val_conv.is_owned = ptr_is_owned(val);
47914 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47915 val_conv = ChannelAnnouncement_clone(&val_conv);
47916 ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
47919 static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
47920 LDKChannelInfo ret_var = ChannelInfo_clone(arg);
47921 int64_t ret_ref = 0;
47922 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47923 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47926 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47927 LDKChannelInfo arg_conv;
47928 arg_conv.inner = untag_ptr(arg);
47929 arg_conv.is_owned = ptr_is_owned(arg);
47930 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47931 arg_conv.is_owned = false;
47932 int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv);
47936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47937 LDKChannelInfo orig_conv;
47938 orig_conv.inner = untag_ptr(orig);
47939 orig_conv.is_owned = ptr_is_owned(orig);
47940 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47941 orig_conv.is_owned = false;
47942 LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
47943 int64_t ret_ref = 0;
47944 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47945 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47949 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47950 LDKChannelInfo a_conv;
47951 a_conv.inner = untag_ptr(a);
47952 a_conv.is_owned = ptr_is_owned(a);
47953 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
47954 a_conv.is_owned = false;
47955 LDKChannelInfo b_conv;
47956 b_conv.inner = untag_ptr(b);
47957 b_conv.is_owned = ptr_is_owned(b);
47958 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
47959 b_conv.is_owned = false;
47960 jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv);
47964 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) {
47965 LDKChannelInfo this_arg_conv;
47966 this_arg_conv.inner = untag_ptr(this_arg);
47967 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47969 this_arg_conv.is_owned = false;
47970 LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags);
47971 int64_t ret_ref = 0;
47972 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47973 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47977 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
47978 LDKChannelInfo obj_conv;
47979 obj_conv.inner = untag_ptr(obj);
47980 obj_conv.is_owned = ptr_is_owned(obj);
47981 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47982 obj_conv.is_owned = false;
47983 LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
47984 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47985 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47986 CVec_u8Z_free(ret_var);
47990 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
47991 LDKu8slice ser_ref;
47992 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
47993 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
47994 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
47995 *ret_conv = ChannelInfo_read(ser_ref);
47996 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
47997 return tag_ptr(ret_conv, true);
48000 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48001 LDKDirectedChannelInfo this_obj_conv;
48002 this_obj_conv.inner = untag_ptr(this_obj);
48003 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48005 DirectedChannelInfo_free(this_obj_conv);
48008 static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) {
48009 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg);
48010 int64_t ret_ref = 0;
48011 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48012 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48015 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48016 LDKDirectedChannelInfo arg_conv;
48017 arg_conv.inner = untag_ptr(arg);
48018 arg_conv.is_owned = ptr_is_owned(arg);
48019 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48020 arg_conv.is_owned = false;
48021 int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv);
48025 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48026 LDKDirectedChannelInfo orig_conv;
48027 orig_conv.inner = untag_ptr(orig);
48028 orig_conv.is_owned = ptr_is_owned(orig);
48029 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48030 orig_conv.is_owned = false;
48031 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv);
48032 int64_t ret_ref = 0;
48033 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48034 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48038 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel(JNIEnv *env, jclass clz, int64_t this_arg) {
48039 LDKDirectedChannelInfo this_arg_conv;
48040 this_arg_conv.inner = untag_ptr(this_arg);
48041 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48043 this_arg_conv.is_owned = false;
48044 LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv);
48045 int64_t ret_ref = 0;
48046 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48047 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48051 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) {
48052 LDKDirectedChannelInfo this_arg_conv;
48053 this_arg_conv.inner = untag_ptr(this_arg);
48054 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48056 this_arg_conv.is_owned = false;
48057 int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv);
48061 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_arg) {
48062 LDKDirectedChannelInfo this_arg_conv;
48063 this_arg_conv.inner = untag_ptr(this_arg);
48064 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48065 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48066 this_arg_conv.is_owned = false;
48067 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
48068 *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv);
48069 int64_t ret_ref = tag_ptr(ret_copy, true);
48073 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
48074 if (!ptr_is_owned(this_ptr)) return;
48075 void* this_ptr_ptr = untag_ptr(this_ptr);
48076 CHECK_ACCESS(this_ptr_ptr);
48077 LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr);
48078 FREE(untag_ptr(this_ptr));
48079 EffectiveCapacity_free(this_ptr_conv);
48082 static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) {
48083 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
48084 *ret_copy = EffectiveCapacity_clone(arg);
48085 int64_t ret_ref = tag_ptr(ret_copy, true);
48088 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48089 LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg);
48090 int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv);
48094 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48095 LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig);
48096 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
48097 *ret_copy = EffectiveCapacity_clone(orig_conv);
48098 int64_t ret_ref = tag_ptr(ret_copy, true);
48102 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1exact_1liquidity(JNIEnv *env, jclass clz, int64_t liquidity_msat) {
48103 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
48104 *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat);
48105 int64_t ret_ref = tag_ptr(ret_copy, true);
48109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1maximum_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) {
48110 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
48111 *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat);
48112 int64_t ret_ref = tag_ptr(ret_copy, true);
48116 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total(JNIEnv *env, jclass clz, int64_t capacity_msat, int64_t htlc_maximum_msat) {
48117 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
48118 *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat);
48119 int64_t ret_ref = tag_ptr(ret_copy, true);
48123 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1infinite(JNIEnv *env, jclass clz) {
48124 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
48125 *ret_copy = EffectiveCapacity_infinite();
48126 int64_t ret_ref = tag_ptr(ret_copy, true);
48130 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1unknown(JNIEnv *env, jclass clz) {
48131 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
48132 *ret_copy = EffectiveCapacity_unknown();
48133 int64_t ret_ref = tag_ptr(ret_copy, true);
48137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1as_1msat(JNIEnv *env, jclass clz, int64_t this_arg) {
48138 LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg);
48139 int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv);
48143 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48144 LDKRoutingFees this_obj_conv;
48145 this_obj_conv.inner = untag_ptr(this_obj);
48146 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48147 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48148 RoutingFees_free(this_obj_conv);
48151 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48152 LDKRoutingFees this_ptr_conv;
48153 this_ptr_conv.inner = untag_ptr(this_ptr);
48154 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48155 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48156 this_ptr_conv.is_owned = false;
48157 int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv);
48161 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
48162 LDKRoutingFees this_ptr_conv;
48163 this_ptr_conv.inner = untag_ptr(this_ptr);
48164 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48166 this_ptr_conv.is_owned = false;
48167 RoutingFees_set_base_msat(&this_ptr_conv, val);
48170 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
48171 LDKRoutingFees this_ptr_conv;
48172 this_ptr_conv.inner = untag_ptr(this_ptr);
48173 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48175 this_ptr_conv.is_owned = false;
48176 int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv);
48180 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
48181 LDKRoutingFees this_ptr_conv;
48182 this_ptr_conv.inner = untag_ptr(this_ptr);
48183 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48185 this_ptr_conv.is_owned = false;
48186 RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
48189 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) {
48190 LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
48191 int64_t ret_ref = 0;
48192 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48193 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48197 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
48198 LDKRoutingFees a_conv;
48199 a_conv.inner = untag_ptr(a);
48200 a_conv.is_owned = ptr_is_owned(a);
48201 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
48202 a_conv.is_owned = false;
48203 LDKRoutingFees b_conv;
48204 b_conv.inner = untag_ptr(b);
48205 b_conv.is_owned = ptr_is_owned(b);
48206 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
48207 b_conv.is_owned = false;
48208 jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv);
48212 static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) {
48213 LDKRoutingFees ret_var = RoutingFees_clone(arg);
48214 int64_t ret_ref = 0;
48215 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48216 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48219 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48220 LDKRoutingFees arg_conv;
48221 arg_conv.inner = untag_ptr(arg);
48222 arg_conv.is_owned = ptr_is_owned(arg);
48223 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48224 arg_conv.is_owned = false;
48225 int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv);
48229 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48230 LDKRoutingFees orig_conv;
48231 orig_conv.inner = untag_ptr(orig);
48232 orig_conv.is_owned = ptr_is_owned(orig);
48233 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48234 orig_conv.is_owned = false;
48235 LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
48236 int64_t ret_ref = 0;
48237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48242 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *env, jclass clz, int64_t o) {
48243 LDKRoutingFees o_conv;
48244 o_conv.inner = untag_ptr(o);
48245 o_conv.is_owned = ptr_is_owned(o);
48246 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
48247 o_conv.is_owned = false;
48248 int64_t ret_conv = RoutingFees_hash(&o_conv);
48252 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv *env, jclass clz, int64_t obj) {
48253 LDKRoutingFees obj_conv;
48254 obj_conv.inner = untag_ptr(obj);
48255 obj_conv.is_owned = ptr_is_owned(obj);
48256 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48257 obj_conv.is_owned = false;
48258 LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
48259 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48260 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48261 CVec_u8Z_free(ret_var);
48265 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
48266 LDKu8slice ser_ref;
48267 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48268 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48269 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
48270 *ret_conv = RoutingFees_read(ser_ref);
48271 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48272 return tag_ptr(ret_conv, true);
48275 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48276 LDKNodeAnnouncementInfo this_obj_conv;
48277 this_obj_conv.inner = untag_ptr(this_obj);
48278 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48280 NodeAnnouncementInfo_free(this_obj_conv);
48283 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
48284 LDKNodeAnnouncementInfo this_ptr_conv;
48285 this_ptr_conv.inner = untag_ptr(this_ptr);
48286 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48288 this_ptr_conv.is_owned = false;
48289 LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
48290 int64_t ret_ref = 0;
48291 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48292 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48296 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48297 LDKNodeAnnouncementInfo this_ptr_conv;
48298 this_ptr_conv.inner = untag_ptr(this_ptr);
48299 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48301 this_ptr_conv.is_owned = false;
48302 LDKNodeFeatures val_conv;
48303 val_conv.inner = untag_ptr(val);
48304 val_conv.is_owned = ptr_is_owned(val);
48305 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
48306 val_conv = NodeFeatures_clone(&val_conv);
48307 NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv);
48310 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) {
48311 LDKNodeAnnouncementInfo this_ptr_conv;
48312 this_ptr_conv.inner = untag_ptr(this_ptr);
48313 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48314 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48315 this_ptr_conv.is_owned = false;
48316 int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
48320 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
48321 LDKNodeAnnouncementInfo this_ptr_conv;
48322 this_ptr_conv.inner = untag_ptr(this_ptr);
48323 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48325 this_ptr_conv.is_owned = false;
48326 NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
48329 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) {
48330 LDKNodeAnnouncementInfo this_ptr_conv;
48331 this_ptr_conv.inner = untag_ptr(this_ptr);
48332 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48333 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48334 this_ptr_conv.is_owned = false;
48335 int8_tArray ret_arr = (*env)->NewByteArray(env, 3);
48336 (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv));
48340 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
48341 LDKNodeAnnouncementInfo this_ptr_conv;
48342 this_ptr_conv.inner = untag_ptr(this_ptr);
48343 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48344 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48345 this_ptr_conv.is_owned = false;
48346 LDKThreeBytes val_ref;
48347 CHECK((*env)->GetArrayLength(env, val) == 3);
48348 (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data);
48349 NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref);
48352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
48353 LDKNodeAnnouncementInfo this_ptr_conv;
48354 this_ptr_conv.inner = untag_ptr(this_ptr);
48355 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48356 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48357 this_ptr_conv.is_owned = false;
48358 LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv);
48359 int64_t ret_ref = 0;
48360 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48361 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48365 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48366 LDKNodeAnnouncementInfo this_ptr_conv;
48367 this_ptr_conv.inner = untag_ptr(this_ptr);
48368 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48369 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48370 this_ptr_conv.is_owned = false;
48371 LDKNodeAlias val_conv;
48372 val_conv.inner = untag_ptr(val);
48373 val_conv.is_owned = ptr_is_owned(val);
48374 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
48375 val_conv = NodeAlias_clone(&val_conv);
48376 NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv);
48379 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) {
48380 LDKNodeAnnouncementInfo this_ptr_conv;
48381 this_ptr_conv.inner = untag_ptr(this_ptr);
48382 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48384 this_ptr_conv.is_owned = false;
48385 LDKCVec_NetAddressZ ret_var = NodeAnnouncementInfo_get_addresses(&this_ptr_conv);
48386 int64_tArray ret_arr = NULL;
48387 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
48388 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
48389 for (size_t m = 0; m < ret_var.datalen; m++) {
48390 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
48391 *ret_conv_12_copy = ret_var.data[m];
48392 int64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
48393 ret_arr_ptr[m] = ret_conv_12_ref;
48395 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
48396 FREE(ret_var.data);
48400 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
48401 LDKNodeAnnouncementInfo this_ptr_conv;
48402 this_ptr_conv.inner = untag_ptr(this_ptr);
48403 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48404 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48405 this_ptr_conv.is_owned = false;
48406 LDKCVec_NetAddressZ val_constr;
48407 val_constr.datalen = (*env)->GetArrayLength(env, val);
48408 if (val_constr.datalen > 0)
48409 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
48411 val_constr.data = NULL;
48412 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
48413 for (size_t m = 0; m < val_constr.datalen; m++) {
48414 int64_t val_conv_12 = val_vals[m];
48415 void* val_conv_12_ptr = untag_ptr(val_conv_12);
48416 CHECK_ACCESS(val_conv_12_ptr);
48417 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
48418 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
48419 val_constr.data[m] = val_conv_12_conv;
48421 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
48422 NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
48425 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
48426 LDKNodeAnnouncementInfo this_ptr_conv;
48427 this_ptr_conv.inner = untag_ptr(this_ptr);
48428 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48430 this_ptr_conv.is_owned = false;
48431 LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
48432 int64_t ret_ref = 0;
48433 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48434 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48438 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48439 LDKNodeAnnouncementInfo this_ptr_conv;
48440 this_ptr_conv.inner = untag_ptr(this_ptr);
48441 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48442 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48443 this_ptr_conv.is_owned = false;
48444 LDKNodeAnnouncement val_conv;
48445 val_conv.inner = untag_ptr(val);
48446 val_conv.is_owned = ptr_is_owned(val);
48447 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
48448 val_conv = NodeAnnouncement_clone(&val_conv);
48449 NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv);
48452 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) {
48453 LDKNodeFeatures features_arg_conv;
48454 features_arg_conv.inner = untag_ptr(features_arg);
48455 features_arg_conv.is_owned = ptr_is_owned(features_arg);
48456 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
48457 features_arg_conv = NodeFeatures_clone(&features_arg_conv);
48458 LDKThreeBytes rgb_arg_ref;
48459 CHECK((*env)->GetArrayLength(env, rgb_arg) == 3);
48460 (*env)->GetByteArrayRegion(env, rgb_arg, 0, 3, rgb_arg_ref.data);
48461 LDKNodeAlias alias_arg_conv;
48462 alias_arg_conv.inner = untag_ptr(alias_arg);
48463 alias_arg_conv.is_owned = ptr_is_owned(alias_arg);
48464 CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv);
48465 alias_arg_conv = NodeAlias_clone(&alias_arg_conv);
48466 LDKCVec_NetAddressZ addresses_arg_constr;
48467 addresses_arg_constr.datalen = (*env)->GetArrayLength(env, addresses_arg);
48468 if (addresses_arg_constr.datalen > 0)
48469 addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
48471 addresses_arg_constr.data = NULL;
48472 int64_t* addresses_arg_vals = (*env)->GetLongArrayElements (env, addresses_arg, NULL);
48473 for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
48474 int64_t addresses_arg_conv_12 = addresses_arg_vals[m];
48475 void* addresses_arg_conv_12_ptr = untag_ptr(addresses_arg_conv_12);
48476 CHECK_ACCESS(addresses_arg_conv_12_ptr);
48477 LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
48478 addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
48480 (*env)->ReleaseLongArrayElements(env, addresses_arg, addresses_arg_vals, 0);
48481 LDKNodeAnnouncement announcement_message_arg_conv;
48482 announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg);
48483 announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg);
48484 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
48485 announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
48486 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, announcement_message_arg_conv);
48487 int64_t ret_ref = 0;
48488 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48489 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48493 static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) {
48494 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg);
48495 int64_t ret_ref = 0;
48496 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48497 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48501 LDKNodeAnnouncementInfo arg_conv;
48502 arg_conv.inner = untag_ptr(arg);
48503 arg_conv.is_owned = ptr_is_owned(arg);
48504 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48505 arg_conv.is_owned = false;
48506 int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv);
48510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48511 LDKNodeAnnouncementInfo orig_conv;
48512 orig_conv.inner = untag_ptr(orig);
48513 orig_conv.is_owned = ptr_is_owned(orig);
48514 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48515 orig_conv.is_owned = false;
48516 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv);
48517 int64_t ret_ref = 0;
48518 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48519 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48523 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
48524 LDKNodeAnnouncementInfo a_conv;
48525 a_conv.inner = untag_ptr(a);
48526 a_conv.is_owned = ptr_is_owned(a);
48527 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
48528 a_conv.is_owned = false;
48529 LDKNodeAnnouncementInfo b_conv;
48530 b_conv.inner = untag_ptr(b);
48531 b_conv.is_owned = ptr_is_owned(b);
48532 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
48533 b_conv.is_owned = false;
48534 jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv);
48538 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
48539 LDKNodeAnnouncementInfo obj_conv;
48540 obj_conv.inner = untag_ptr(obj);
48541 obj_conv.is_owned = ptr_is_owned(obj);
48542 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48543 obj_conv.is_owned = false;
48544 LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
48545 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48546 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48547 CVec_u8Z_free(ret_var);
48551 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
48552 LDKu8slice ser_ref;
48553 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48554 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48555 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
48556 *ret_conv = NodeAnnouncementInfo_read(ser_ref);
48557 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48558 return tag_ptr(ret_conv, true);
48561 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48562 LDKNodeAlias this_obj_conv;
48563 this_obj_conv.inner = untag_ptr(this_obj);
48564 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48566 NodeAlias_free(this_obj_conv);
48569 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
48570 LDKNodeAlias this_ptr_conv;
48571 this_ptr_conv.inner = untag_ptr(this_ptr);
48572 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48574 this_ptr_conv.is_owned = false;
48575 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
48576 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAlias_get_a(&this_ptr_conv));
48580 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
48581 LDKNodeAlias this_ptr_conv;
48582 this_ptr_conv.inner = untag_ptr(this_ptr);
48583 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48584 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48585 this_ptr_conv.is_owned = false;
48586 LDKThirtyTwoBytes val_ref;
48587 CHECK((*env)->GetArrayLength(env, val) == 32);
48588 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
48589 NodeAlias_set_a(&this_ptr_conv, val_ref);
48592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) {
48593 LDKThirtyTwoBytes a_arg_ref;
48594 CHECK((*env)->GetArrayLength(env, a_arg) == 32);
48595 (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data);
48596 LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref);
48597 int64_t ret_ref = 0;
48598 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48599 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48603 static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) {
48604 LDKNodeAlias ret_var = NodeAlias_clone(arg);
48605 int64_t ret_ref = 0;
48606 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48607 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48610 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48611 LDKNodeAlias arg_conv;
48612 arg_conv.inner = untag_ptr(arg);
48613 arg_conv.is_owned = ptr_is_owned(arg);
48614 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48615 arg_conv.is_owned = false;
48616 int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv);
48620 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48621 LDKNodeAlias orig_conv;
48622 orig_conv.inner = untag_ptr(orig);
48623 orig_conv.is_owned = ptr_is_owned(orig);
48624 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48625 orig_conv.is_owned = false;
48626 LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv);
48627 int64_t ret_ref = 0;
48628 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48629 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48633 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
48634 LDKNodeAlias a_conv;
48635 a_conv.inner = untag_ptr(a);
48636 a_conv.is_owned = ptr_is_owned(a);
48637 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
48638 a_conv.is_owned = false;
48639 LDKNodeAlias b_conv;
48640 b_conv.inner = untag_ptr(b);
48641 b_conv.is_owned = ptr_is_owned(b);
48642 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
48643 b_conv.is_owned = false;
48644 jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv);
48648 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write(JNIEnv *env, jclass clz, int64_t obj) {
48649 LDKNodeAlias obj_conv;
48650 obj_conv.inner = untag_ptr(obj);
48651 obj_conv.is_owned = ptr_is_owned(obj);
48652 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48653 obj_conv.is_owned = false;
48654 LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv);
48655 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48656 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48657 CVec_u8Z_free(ret_var);
48661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
48662 LDKu8slice ser_ref;
48663 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48664 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48665 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
48666 *ret_conv = NodeAlias_read(ser_ref);
48667 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48668 return tag_ptr(ret_conv, true);
48671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48672 LDKNodeInfo this_obj_conv;
48673 this_obj_conv.inner = untag_ptr(this_obj);
48674 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48676 NodeInfo_free(this_obj_conv);
48679 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
48680 LDKNodeInfo this_ptr_conv;
48681 this_ptr_conv.inner = untag_ptr(this_ptr);
48682 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48684 this_ptr_conv.is_owned = false;
48685 LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv);
48686 int64_tArray ret_arr = NULL;
48687 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
48688 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
48689 for (size_t g = 0; g < ret_var.datalen; g++) {
48690 int64_t ret_conv_6_conv = ret_var.data[g];
48691 ret_arr_ptr[g] = ret_conv_6_conv;
48693 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
48694 FREE(ret_var.data);
48698 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
48699 LDKNodeInfo this_ptr_conv;
48700 this_ptr_conv.inner = untag_ptr(this_ptr);
48701 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48703 this_ptr_conv.is_owned = false;
48704 LDKCVec_u64Z val_constr;
48705 val_constr.datalen = (*env)->GetArrayLength(env, val);
48706 if (val_constr.datalen > 0)
48707 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
48709 val_constr.data = NULL;
48710 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
48711 for (size_t g = 0; g < val_constr.datalen; g++) {
48712 int64_t val_conv_6 = val_vals[g];
48713 val_constr.data[g] = val_conv_6;
48715 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
48716 NodeInfo_set_channels(&this_ptr_conv, val_constr);
48719 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr) {
48720 LDKNodeInfo this_ptr_conv;
48721 this_ptr_conv.inner = untag_ptr(this_ptr);
48722 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48724 this_ptr_conv.is_owned = false;
48725 LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
48726 int64_t ret_ref = 0;
48727 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48728 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48733 LDKNodeInfo this_ptr_conv;
48734 this_ptr_conv.inner = untag_ptr(this_ptr);
48735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48737 this_ptr_conv.is_owned = false;
48738 LDKNodeAnnouncementInfo val_conv;
48739 val_conv.inner = untag_ptr(val);
48740 val_conv.is_owned = ptr_is_owned(val);
48741 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
48742 val_conv = NodeAnnouncementInfo_clone(&val_conv);
48743 NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
48746 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, jclass clz, int64_tArray channels_arg, int64_t announcement_info_arg) {
48747 LDKCVec_u64Z channels_arg_constr;
48748 channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg);
48749 if (channels_arg_constr.datalen > 0)
48750 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
48752 channels_arg_constr.data = NULL;
48753 int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL);
48754 for (size_t g = 0; g < channels_arg_constr.datalen; g++) {
48755 int64_t channels_arg_conv_6 = channels_arg_vals[g];
48756 channels_arg_constr.data[g] = channels_arg_conv_6;
48758 (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0);
48759 LDKNodeAnnouncementInfo announcement_info_arg_conv;
48760 announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg);
48761 announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg);
48762 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
48763 announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
48764 LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, announcement_info_arg_conv);
48765 int64_t ret_ref = 0;
48766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48771 static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) {
48772 LDKNodeInfo ret_var = NodeInfo_clone(arg);
48773 int64_t ret_ref = 0;
48774 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48775 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48779 LDKNodeInfo arg_conv;
48780 arg_conv.inner = untag_ptr(arg);
48781 arg_conv.is_owned = ptr_is_owned(arg);
48782 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48783 arg_conv.is_owned = false;
48784 int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv);
48788 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48789 LDKNodeInfo orig_conv;
48790 orig_conv.inner = untag_ptr(orig);
48791 orig_conv.is_owned = ptr_is_owned(orig);
48792 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48793 orig_conv.is_owned = false;
48794 LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv);
48795 int64_t ret_ref = 0;
48796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48801 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
48802 LDKNodeInfo a_conv;
48803 a_conv.inner = untag_ptr(a);
48804 a_conv.is_owned = ptr_is_owned(a);
48805 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
48806 a_conv.is_owned = false;
48807 LDKNodeInfo b_conv;
48808 b_conv.inner = untag_ptr(b);
48809 b_conv.is_owned = ptr_is_owned(b);
48810 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
48811 b_conv.is_owned = false;
48812 jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv);
48816 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
48817 LDKNodeInfo obj_conv;
48818 obj_conv.inner = untag_ptr(obj);
48819 obj_conv.is_owned = ptr_is_owned(obj);
48820 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48821 obj_conv.is_owned = false;
48822 LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
48823 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48824 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48825 CVec_u8Z_free(ret_var);
48829 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
48830 LDKu8slice ser_ref;
48831 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48832 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48833 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
48834 *ret_conv = NodeInfo_read(ser_ref);
48835 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48836 return tag_ptr(ret_conv, true);
48839 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv *env, jclass clz, int64_t obj) {
48840 LDKNetworkGraph obj_conv;
48841 obj_conv.inner = untag_ptr(obj);
48842 obj_conv.is_owned = ptr_is_owned(obj);
48843 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48844 obj_conv.is_owned = false;
48845 LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
48846 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48847 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48848 CVec_u8Z_free(ret_var);
48852 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
48853 LDKu8slice ser_ref;
48854 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48855 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48856 void* arg_ptr = untag_ptr(arg);
48857 CHECK_ACCESS(arg_ptr);
48858 LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
48859 if (arg_conv.free == LDKLogger_JCalls_free) {
48860 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48861 LDKLogger_JCalls_cloned(&arg_conv);
48863 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
48864 *ret_conv = NetworkGraph_read(ser_ref, arg_conv);
48865 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48866 return tag_ptr(ret_conv, true);
48869 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, jclass network, int64_t logger) {
48870 LDKNetwork network_conv = LDKNetwork_from_java(env, network);
48871 void* logger_ptr = untag_ptr(logger);
48872 CHECK_ACCESS(logger_ptr);
48873 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
48874 if (logger_conv.free == LDKLogger_JCalls_free) {
48875 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48876 LDKLogger_JCalls_cloned(&logger_conv);
48878 LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv);
48879 int64_t ret_ref = 0;
48880 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48881 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JNIEnv *env, jclass clz, int64_t this_arg) {
48886 LDKNetworkGraph this_arg_conv;
48887 this_arg_conv.inner = untag_ptr(this_arg);
48888 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48890 this_arg_conv.is_owned = false;
48891 LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv);
48892 int64_t ret_ref = 0;
48893 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48894 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
48899 LDKNetworkGraph this_arg_conv;
48900 this_arg_conv.inner = untag_ptr(this_arg);
48901 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48903 this_arg_conv.is_owned = false;
48904 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
48905 *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv);
48906 int64_t ret_ref = tag_ptr(ret_copy, true);
48910 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) {
48911 LDKNetworkGraph this_arg_conv;
48912 this_arg_conv.inner = untag_ptr(this_arg);
48913 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48915 this_arg_conv.is_owned = false;
48916 NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp);
48919 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) {
48920 LDKNetworkGraph this_arg_conv;
48921 this_arg_conv.inner = untag_ptr(this_arg);
48922 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48924 this_arg_conv.is_owned = false;
48925 LDKNodeAnnouncement msg_conv;
48926 msg_conv.inner = untag_ptr(msg);
48927 msg_conv.is_owned = ptr_is_owned(msg);
48928 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
48929 msg_conv.is_owned = false;
48930 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
48931 *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv);
48932 return tag_ptr(ret_conv, true);
48935 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) {
48936 LDKNetworkGraph this_arg_conv;
48937 this_arg_conv.inner = untag_ptr(this_arg);
48938 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48939 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48940 this_arg_conv.is_owned = false;
48941 LDKUnsignedNodeAnnouncement msg_conv;
48942 msg_conv.inner = untag_ptr(msg);
48943 msg_conv.is_owned = ptr_is_owned(msg);
48944 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
48945 msg_conv.is_owned = false;
48946 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
48947 *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv);
48948 return tag_ptr(ret_conv, true);
48951 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 utxo_lookup) {
48952 LDKNetworkGraph this_arg_conv;
48953 this_arg_conv.inner = untag_ptr(this_arg);
48954 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48956 this_arg_conv.is_owned = false;
48957 LDKChannelAnnouncement msg_conv;
48958 msg_conv.inner = untag_ptr(msg);
48959 msg_conv.is_owned = ptr_is_owned(msg);
48960 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
48961 msg_conv.is_owned = false;
48962 void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
48963 CHECK_ACCESS(utxo_lookup_ptr);
48964 LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
48965 // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
48966 if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
48967 // Manually implement clone for Java trait instances
48968 if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
48969 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48970 LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
48973 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
48974 *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv);
48975 return tag_ptr(ret_conv, true);
48978 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 utxo_lookup) {
48979 LDKNetworkGraph this_arg_conv;
48980 this_arg_conv.inner = untag_ptr(this_arg);
48981 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48983 this_arg_conv.is_owned = false;
48984 LDKUnsignedChannelAnnouncement msg_conv;
48985 msg_conv.inner = untag_ptr(msg);
48986 msg_conv.is_owned = ptr_is_owned(msg);
48987 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
48988 msg_conv.is_owned = false;
48989 void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
48990 CHECK_ACCESS(utxo_lookup_ptr);
48991 LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
48992 // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
48993 if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
48994 // Manually implement clone for Java trait instances
48995 if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
48996 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48997 LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
49000 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
49001 *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv);
49002 return tag_ptr(ret_conv, true);
49005 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) {
49006 LDKNetworkGraph this_arg_conv;
49007 this_arg_conv.inner = untag_ptr(this_arg);
49008 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49010 this_arg_conv.is_owned = false;
49011 LDKChannelFeatures features_conv;
49012 features_conv.inner = untag_ptr(features);
49013 features_conv.is_owned = ptr_is_owned(features);
49014 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
49015 features_conv = ChannelFeatures_clone(&features_conv);
49016 LDKPublicKey node_id_1_ref;
49017 CHECK((*env)->GetArrayLength(env, node_id_1) == 33);
49018 (*env)->GetByteArrayRegion(env, node_id_1, 0, 33, node_id_1_ref.compressed_form);
49019 LDKPublicKey node_id_2_ref;
49020 CHECK((*env)->GetArrayLength(env, node_id_2) == 33);
49021 (*env)->GetByteArrayRegion(env, node_id_2, 0, 33, node_id_2_ref.compressed_form);
49022 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
49023 *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);
49024 return tag_ptr(ret_conv, true);
49027 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) {
49028 LDKNetworkGraph this_arg_conv;
49029 this_arg_conv.inner = untag_ptr(this_arg);
49030 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49032 this_arg_conv.is_owned = false;
49033 NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
49036 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id) {
49037 LDKNetworkGraph this_arg_conv;
49038 this_arg_conv.inner = untag_ptr(this_arg);
49039 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49041 this_arg_conv.is_owned = false;
49042 LDKPublicKey node_id_ref;
49043 CHECK((*env)->GetArrayLength(env, node_id) == 33);
49044 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
49045 NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref);
49048 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking(JNIEnv *env, jclass clz, int64_t this_arg) {
49049 LDKNetworkGraph this_arg_conv;
49050 this_arg_conv.inner = untag_ptr(this_arg);
49051 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49052 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49053 this_arg_conv.is_owned = false;
49054 NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv);
49057 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) {
49058 LDKNetworkGraph this_arg_conv;
49059 this_arg_conv.inner = untag_ptr(this_arg);
49060 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49061 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49062 this_arg_conv.is_owned = false;
49063 NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix);
49066 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
49067 LDKNetworkGraph this_arg_conv;
49068 this_arg_conv.inner = untag_ptr(this_arg);
49069 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49070 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49071 this_arg_conv.is_owned = false;
49072 LDKChannelUpdate msg_conv;
49073 msg_conv.inner = untag_ptr(msg);
49074 msg_conv.is_owned = ptr_is_owned(msg);
49075 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
49076 msg_conv.is_owned = false;
49077 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
49078 *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv);
49079 return tag_ptr(ret_conv, true);
49082 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
49083 LDKNetworkGraph this_arg_conv;
49084 this_arg_conv.inner = untag_ptr(this_arg);
49085 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49087 this_arg_conv.is_owned = false;
49088 LDKUnsignedChannelUpdate msg_conv;
49089 msg_conv.inner = untag_ptr(msg);
49090 msg_conv.is_owned = ptr_is_owned(msg);
49091 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
49092 msg_conv.is_owned = false;
49093 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
49094 *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv);
49095 return tag_ptr(ret_conv, true);
49098 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) {
49099 LDKReadOnlyNetworkGraph this_arg_conv;
49100 this_arg_conv.inner = untag_ptr(this_arg);
49101 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49103 this_arg_conv.is_owned = false;
49104 LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id);
49105 int64_t ret_ref = 0;
49106 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49107 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49111 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
49112 LDKReadOnlyNetworkGraph this_arg_conv;
49113 this_arg_conv.inner = untag_ptr(this_arg);
49114 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49116 this_arg_conv.is_owned = false;
49117 LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv);
49118 int64_tArray ret_arr = NULL;
49119 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
49120 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
49121 for (size_t g = 0; g < ret_var.datalen; g++) {
49122 int64_t ret_conv_6_conv = ret_var.data[g];
49123 ret_arr_ptr[g] = ret_conv_6_conv;
49125 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
49126 FREE(ret_var.data);
49130 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1node(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
49131 LDKReadOnlyNetworkGraph this_arg_conv;
49132 this_arg_conv.inner = untag_ptr(this_arg);
49133 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49134 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49135 this_arg_conv.is_owned = false;
49136 LDKNodeId node_id_conv;
49137 node_id_conv.inner = untag_ptr(node_id);
49138 node_id_conv.is_owned = ptr_is_owned(node_id);
49139 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
49140 node_id_conv.is_owned = false;
49141 LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv);
49142 int64_t ret_ref = 0;
49143 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49144 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49148 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1nodes(JNIEnv *env, jclass clz, int64_t this_arg) {
49149 LDKReadOnlyNetworkGraph this_arg_conv;
49150 this_arg_conv.inner = untag_ptr(this_arg);
49151 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49153 this_arg_conv.is_owned = false;
49154 LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv);
49155 int64_tArray ret_arr = NULL;
49156 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
49157 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
49158 for (size_t i = 0; i < ret_var.datalen; i++) {
49159 LDKNodeId ret_conv_8_var = ret_var.data[i];
49160 int64_t ret_conv_8_ref = 0;
49161 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var);
49162 ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned);
49163 ret_arr_ptr[i] = ret_conv_8_ref;
49165 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
49166 FREE(ret_var.data);
49170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey) {
49171 LDKReadOnlyNetworkGraph this_arg_conv;
49172 this_arg_conv.inner = untag_ptr(this_arg);
49173 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49175 this_arg_conv.is_owned = false;
49176 LDKPublicKey pubkey_ref;
49177 CHECK((*env)->GetArrayLength(env, pubkey) == 33);
49178 (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
49179 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
49180 *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref);
49181 int64_t ret_ref = tag_ptr(ret_copy, true);
49185 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49186 LDKDefaultRouter this_obj_conv;
49187 this_obj_conv.inner = untag_ptr(this_obj);
49188 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49190 DefaultRouter_free(this_obj_conv);
49193 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes, int64_t scorer) {
49194 LDKNetworkGraph network_graph_conv;
49195 network_graph_conv.inner = untag_ptr(network_graph);
49196 network_graph_conv.is_owned = ptr_is_owned(network_graph);
49197 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
49198 network_graph_conv.is_owned = false;
49199 void* logger_ptr = untag_ptr(logger);
49200 CHECK_ACCESS(logger_ptr);
49201 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
49202 if (logger_conv.free == LDKLogger_JCalls_free) {
49203 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
49204 LDKLogger_JCalls_cloned(&logger_conv);
49206 LDKThirtyTwoBytes random_seed_bytes_ref;
49207 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
49208 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_ref.data);
49209 void* scorer_ptr = untag_ptr(scorer);
49210 CHECK_ACCESS(scorer_ptr);
49211 LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr);
49212 if (scorer_conv.free == LDKLockableScore_JCalls_free) {
49213 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
49214 LDKLockableScore_JCalls_cloned(&scorer_conv);
49216 LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv);
49217 int64_t ret_ref = 0;
49218 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49219 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49223 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) {
49224 LDKDefaultRouter this_arg_conv;
49225 this_arg_conv.inner = untag_ptr(this_arg);
49226 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49228 this_arg_conv.is_owned = false;
49229 LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
49230 *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
49231 return tag_ptr(ret_ret, true);
49234 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
49235 if (!ptr_is_owned(this_ptr)) return;
49236 void* this_ptr_ptr = untag_ptr(this_ptr);
49237 CHECK_ACCESS(this_ptr_ptr);
49238 LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
49239 FREE(untag_ptr(this_ptr));
49240 Router_free(this_ptr_conv);
49243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49244 LDKScorerAccountingForInFlightHtlcs this_obj_conv;
49245 this_obj_conv.inner = untag_ptr(this_obj);
49246 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49248 ScorerAccountingForInFlightHtlcs_free(this_obj_conv);
49251 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new(JNIEnv *env, jclass clz, int64_t scorer, int64_t inflight_htlcs) {
49252 void* scorer_ptr = untag_ptr(scorer);
49253 CHECK_ACCESS(scorer_ptr);
49254 LDKScore scorer_conv = *(LDKScore*)(scorer_ptr);
49255 if (scorer_conv.free == LDKScore_JCalls_free) {
49256 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
49257 LDKScore_JCalls_cloned(&scorer_conv);
49259 LDKInFlightHtlcs inflight_htlcs_conv;
49260 inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
49261 inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
49262 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
49263 inflight_htlcs_conv.is_owned = false;
49264 LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv);
49265 int64_t ret_ref = 0;
49266 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49267 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49271 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) {
49272 LDKScorerAccountingForInFlightHtlcs obj_conv;
49273 obj_conv.inner = untag_ptr(obj);
49274 obj_conv.is_owned = ptr_is_owned(obj);
49275 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
49276 obj_conv.is_owned = false;
49277 LDKCVec_u8Z ret_var = ScorerAccountingForInFlightHtlcs_write(&obj_conv);
49278 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
49279 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
49280 CVec_u8Z_free(ret_var);
49284 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
49285 LDKScorerAccountingForInFlightHtlcs this_arg_conv;
49286 this_arg_conv.inner = untag_ptr(this_arg);
49287 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49288 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49289 this_arg_conv.is_owned = false;
49290 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
49291 *ret_ret = ScorerAccountingForInFlightHtlcs_as_Score(&this_arg_conv);
49292 return tag_ptr(ret_ret, true);
49295 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49296 LDKInFlightHtlcs this_obj_conv;
49297 this_obj_conv.inner = untag_ptr(this_obj);
49298 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49300 InFlightHtlcs_free(this_obj_conv);
49303 static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) {
49304 LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg);
49305 int64_t ret_ref = 0;
49306 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49307 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49310 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49311 LDKInFlightHtlcs arg_conv;
49312 arg_conv.inner = untag_ptr(arg);
49313 arg_conv.is_owned = ptr_is_owned(arg);
49314 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49315 arg_conv.is_owned = false;
49316 int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv);
49320 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49321 LDKInFlightHtlcs orig_conv;
49322 orig_conv.inner = untag_ptr(orig);
49323 orig_conv.is_owned = ptr_is_owned(orig);
49324 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49325 orig_conv.is_owned = false;
49326 LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv);
49327 int64_t ret_ref = 0;
49328 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49329 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49333 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new(JNIEnv *env, jclass clz) {
49334 LDKInFlightHtlcs ret_var = InFlightHtlcs_new();
49335 int64_t ret_ref = 0;
49336 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49337 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49341 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) {
49342 LDKInFlightHtlcs this_arg_conv;
49343 this_arg_conv.inner = untag_ptr(this_arg);
49344 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49345 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49346 this_arg_conv.is_owned = false;
49347 LDKNodeId source_conv;
49348 source_conv.inner = untag_ptr(source);
49349 source_conv.is_owned = ptr_is_owned(source);
49350 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
49351 source_conv.is_owned = false;
49352 LDKNodeId target_conv;
49353 target_conv.inner = untag_ptr(target);
49354 target_conv.is_owned = ptr_is_owned(target);
49355 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
49356 target_conv.is_owned = false;
49357 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
49358 *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid);
49359 int64_t ret_ref = tag_ptr(ret_copy, true);
49363 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) {
49364 LDKInFlightHtlcs obj_conv;
49365 obj_conv.inner = untag_ptr(obj);
49366 obj_conv.is_owned = ptr_is_owned(obj);
49367 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
49368 obj_conv.is_owned = false;
49369 LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv);
49370 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
49371 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
49372 CVec_u8Z_free(ret_var);
49376 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
49377 LDKu8slice ser_ref;
49378 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
49379 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
49380 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
49381 *ret_conv = InFlightHtlcs_read(ser_ref);
49382 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
49383 return tag_ptr(ret_conv, true);
49386 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49387 LDKRouteHop this_obj_conv;
49388 this_obj_conv.inner = untag_ptr(this_obj);
49389 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49391 RouteHop_free(this_obj_conv);
49394 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
49395 LDKRouteHop this_ptr_conv;
49396 this_ptr_conv.inner = untag_ptr(this_ptr);
49397 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49399 this_ptr_conv.is_owned = false;
49400 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
49401 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form);
49405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
49406 LDKRouteHop this_ptr_conv;
49407 this_ptr_conv.inner = untag_ptr(this_ptr);
49408 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49410 this_ptr_conv.is_owned = false;
49411 LDKPublicKey val_ref;
49412 CHECK((*env)->GetArrayLength(env, val) == 33);
49413 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
49414 RouteHop_set_pubkey(&this_ptr_conv, val_ref);
49417 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
49418 LDKRouteHop this_ptr_conv;
49419 this_ptr_conv.inner = untag_ptr(this_ptr);
49420 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49422 this_ptr_conv.is_owned = false;
49423 LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
49424 int64_t ret_ref = 0;
49425 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49426 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49430 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49431 LDKRouteHop this_ptr_conv;
49432 this_ptr_conv.inner = untag_ptr(this_ptr);
49433 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49435 this_ptr_conv.is_owned = false;
49436 LDKNodeFeatures val_conv;
49437 val_conv.inner = untag_ptr(val);
49438 val_conv.is_owned = ptr_is_owned(val);
49439 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49440 val_conv = NodeFeatures_clone(&val_conv);
49441 RouteHop_set_node_features(&this_ptr_conv, val_conv);
49444 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
49445 LDKRouteHop this_ptr_conv;
49446 this_ptr_conv.inner = untag_ptr(this_ptr);
49447 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49449 this_ptr_conv.is_owned = false;
49450 int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv);
49454 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49455 LDKRouteHop this_ptr_conv;
49456 this_ptr_conv.inner = untag_ptr(this_ptr);
49457 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49458 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49459 this_ptr_conv.is_owned = false;
49460 RouteHop_set_short_channel_id(&this_ptr_conv, val);
49463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
49464 LDKRouteHop this_ptr_conv;
49465 this_ptr_conv.inner = untag_ptr(this_ptr);
49466 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49468 this_ptr_conv.is_owned = false;
49469 LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
49470 int64_t ret_ref = 0;
49471 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49472 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49476 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49477 LDKRouteHop this_ptr_conv;
49478 this_ptr_conv.inner = untag_ptr(this_ptr);
49479 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49480 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49481 this_ptr_conv.is_owned = false;
49482 LDKChannelFeatures val_conv;
49483 val_conv.inner = untag_ptr(val);
49484 val_conv.is_owned = ptr_is_owned(val);
49485 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49486 val_conv = ChannelFeatures_clone(&val_conv);
49487 RouteHop_set_channel_features(&this_ptr_conv, val_conv);
49490 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
49491 LDKRouteHop this_ptr_conv;
49492 this_ptr_conv.inner = untag_ptr(this_ptr);
49493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49495 this_ptr_conv.is_owned = false;
49496 int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv);
49500 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49501 LDKRouteHop this_ptr_conv;
49502 this_ptr_conv.inner = untag_ptr(this_ptr);
49503 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49505 this_ptr_conv.is_owned = false;
49506 RouteHop_set_fee_msat(&this_ptr_conv, val);
49509 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
49510 LDKRouteHop this_ptr_conv;
49511 this_ptr_conv.inner = untag_ptr(this_ptr);
49512 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49514 this_ptr_conv.is_owned = false;
49515 int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
49519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
49520 LDKRouteHop this_ptr_conv;
49521 this_ptr_conv.inner = untag_ptr(this_ptr);
49522 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49524 this_ptr_conv.is_owned = false;
49525 RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
49528 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) {
49529 LDKPublicKey pubkey_arg_ref;
49530 CHECK((*env)->GetArrayLength(env, pubkey_arg) == 33);
49531 (*env)->GetByteArrayRegion(env, pubkey_arg, 0, 33, pubkey_arg_ref.compressed_form);
49532 LDKNodeFeatures node_features_arg_conv;
49533 node_features_arg_conv.inner = untag_ptr(node_features_arg);
49534 node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg);
49535 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv);
49536 node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv);
49537 LDKChannelFeatures channel_features_arg_conv;
49538 channel_features_arg_conv.inner = untag_ptr(channel_features_arg);
49539 channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg);
49540 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv);
49541 channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
49542 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);
49543 int64_t ret_ref = 0;
49544 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49545 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49549 static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) {
49550 LDKRouteHop ret_var = RouteHop_clone(arg);
49551 int64_t ret_ref = 0;
49552 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49553 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49556 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49557 LDKRouteHop arg_conv;
49558 arg_conv.inner = untag_ptr(arg);
49559 arg_conv.is_owned = ptr_is_owned(arg);
49560 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49561 arg_conv.is_owned = false;
49562 int64_t ret_conv = RouteHop_clone_ptr(&arg_conv);
49566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49567 LDKRouteHop orig_conv;
49568 orig_conv.inner = untag_ptr(orig);
49569 orig_conv.is_owned = ptr_is_owned(orig);
49570 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49571 orig_conv.is_owned = false;
49572 LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
49573 int64_t ret_ref = 0;
49574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49579 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, jclass clz, int64_t o) {
49580 LDKRouteHop o_conv;
49581 o_conv.inner = untag_ptr(o);
49582 o_conv.is_owned = ptr_is_owned(o);
49583 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
49584 o_conv.is_owned = false;
49585 int64_t ret_conv = RouteHop_hash(&o_conv);
49589 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49590 LDKRouteHop a_conv;
49591 a_conv.inner = untag_ptr(a);
49592 a_conv.is_owned = ptr_is_owned(a);
49593 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49594 a_conv.is_owned = false;
49595 LDKRouteHop b_conv;
49596 b_conv.inner = untag_ptr(b);
49597 b_conv.is_owned = ptr_is_owned(b);
49598 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49599 b_conv.is_owned = false;
49600 jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv);
49604 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
49605 LDKRouteHop obj_conv;
49606 obj_conv.inner = untag_ptr(obj);
49607 obj_conv.is_owned = ptr_is_owned(obj);
49608 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
49609 obj_conv.is_owned = false;
49610 LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv);
49611 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
49612 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
49613 CVec_u8Z_free(ret_var);
49617 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
49618 LDKu8slice ser_ref;
49619 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
49620 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
49621 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
49622 *ret_conv = RouteHop_read(ser_ref);
49623 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
49624 return tag_ptr(ret_conv, true);
49627 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49628 LDKRoute this_obj_conv;
49629 this_obj_conv.inner = untag_ptr(this_obj);
49630 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49631 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49632 Route_free(this_obj_conv);
49635 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIEnv *env, jclass clz, int64_t this_ptr) {
49636 LDKRoute this_ptr_conv;
49637 this_ptr_conv.inner = untag_ptr(this_ptr);
49638 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49639 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49640 this_ptr_conv.is_owned = false;
49641 LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
49642 jobjectArray ret_arr = NULL;
49643 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL);
49645 for (size_t m = 0; m < ret_var.datalen; m++) {
49646 LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
49647 int64_tArray ret_conv_12_arr = NULL;
49648 ret_conv_12_arr = (*env)->NewLongArray(env, ret_conv_12_var.datalen);
49649 int64_t *ret_conv_12_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_conv_12_arr, NULL);
49650 for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
49651 LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
49652 int64_t ret_conv_12_conv_10_ref = 0;
49653 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var);
49654 ret_conv_12_conv_10_ref = tag_ptr(ret_conv_12_conv_10_var.inner, ret_conv_12_conv_10_var.is_owned);
49655 ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref;
49657 (*env)->ReleasePrimitiveArrayCritical(env, ret_conv_12_arr, ret_conv_12_arr_ptr, 0);
49658 FREE(ret_conv_12_var.data);
49659 (*env)->SetObjectArrayElement(env, ret_arr, m, ret_conv_12_arr);
49662 FREE(ret_var.data);
49666 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
49667 LDKRoute this_ptr_conv;
49668 this_ptr_conv.inner = untag_ptr(this_ptr);
49669 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49670 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49671 this_ptr_conv.is_owned = false;
49672 LDKCVec_CVec_RouteHopZZ val_constr;
49673 val_constr.datalen = (*env)->GetArrayLength(env, val);
49674 if (val_constr.datalen > 0)
49675 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
49677 val_constr.data = NULL;
49678 for (size_t m = 0; m < val_constr.datalen; m++) {
49679 int64_tArray val_conv_12 = (*env)->GetObjectArrayElement(env, val, m);
49680 LDKCVec_RouteHopZ val_conv_12_constr;
49681 val_conv_12_constr.datalen = (*env)->GetArrayLength(env, val_conv_12);
49682 if (val_conv_12_constr.datalen > 0)
49683 val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
49685 val_conv_12_constr.data = NULL;
49686 int64_t* val_conv_12_vals = (*env)->GetLongArrayElements (env, val_conv_12, NULL);
49687 for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
49688 int64_t val_conv_12_conv_10 = val_conv_12_vals[k];
49689 LDKRouteHop val_conv_12_conv_10_conv;
49690 val_conv_12_conv_10_conv.inner = untag_ptr(val_conv_12_conv_10);
49691 val_conv_12_conv_10_conv.is_owned = ptr_is_owned(val_conv_12_conv_10);
49692 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv);
49693 val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
49694 val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
49696 (*env)->ReleaseLongArrayElements(env, val_conv_12, val_conv_12_vals, 0);
49697 val_constr.data[m] = val_conv_12_constr;
49699 Route_set_paths(&this_ptr_conv, val_constr);
49702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) {
49703 LDKRoute this_ptr_conv;
49704 this_ptr_conv.inner = untag_ptr(this_ptr);
49705 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49707 this_ptr_conv.is_owned = false;
49708 LDKPaymentParameters ret_var = Route_get_payment_params(&this_ptr_conv);
49709 int64_t ret_ref = 0;
49710 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49711 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49715 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49716 LDKRoute this_ptr_conv;
49717 this_ptr_conv.inner = untag_ptr(this_ptr);
49718 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49719 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49720 this_ptr_conv.is_owned = false;
49721 LDKPaymentParameters val_conv;
49722 val_conv.inner = untag_ptr(val);
49723 val_conv.is_owned = ptr_is_owned(val);
49724 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49725 val_conv = PaymentParameters_clone(&val_conv);
49726 Route_set_payment_params(&this_ptr_conv, val_conv);
49729 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, jobjectArray paths_arg, int64_t payment_params_arg) {
49730 LDKCVec_CVec_RouteHopZZ paths_arg_constr;
49731 paths_arg_constr.datalen = (*env)->GetArrayLength(env, paths_arg);
49732 if (paths_arg_constr.datalen > 0)
49733 paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
49735 paths_arg_constr.data = NULL;
49736 for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
49737 int64_tArray paths_arg_conv_12 = (*env)->GetObjectArrayElement(env, paths_arg, m);
49738 LDKCVec_RouteHopZ paths_arg_conv_12_constr;
49739 paths_arg_conv_12_constr.datalen = (*env)->GetArrayLength(env, paths_arg_conv_12);
49740 if (paths_arg_conv_12_constr.datalen > 0)
49741 paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
49743 paths_arg_conv_12_constr.data = NULL;
49744 int64_t* paths_arg_conv_12_vals = (*env)->GetLongArrayElements (env, paths_arg_conv_12, NULL);
49745 for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
49746 int64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
49747 LDKRouteHop paths_arg_conv_12_conv_10_conv;
49748 paths_arg_conv_12_conv_10_conv.inner = untag_ptr(paths_arg_conv_12_conv_10);
49749 paths_arg_conv_12_conv_10_conv.is_owned = ptr_is_owned(paths_arg_conv_12_conv_10);
49750 CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv);
49751 paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
49752 paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
49754 (*env)->ReleaseLongArrayElements(env, paths_arg_conv_12, paths_arg_conv_12_vals, 0);
49755 paths_arg_constr.data[m] = paths_arg_conv_12_constr;
49757 LDKPaymentParameters payment_params_arg_conv;
49758 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
49759 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
49760 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
49761 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
49762 LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_arg_conv);
49763 int64_t ret_ref = 0;
49764 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49765 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49769 static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) {
49770 LDKRoute ret_var = Route_clone(arg);
49771 int64_t ret_ref = 0;
49772 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49773 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49776 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49778 arg_conv.inner = untag_ptr(arg);
49779 arg_conv.is_owned = ptr_is_owned(arg);
49780 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49781 arg_conv.is_owned = false;
49782 int64_t ret_conv = Route_clone_ptr(&arg_conv);
49786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49787 LDKRoute orig_conv;
49788 orig_conv.inner = untag_ptr(orig);
49789 orig_conv.is_owned = ptr_is_owned(orig);
49790 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49791 orig_conv.is_owned = false;
49792 LDKRoute ret_var = Route_clone(&orig_conv);
49793 int64_t ret_ref = 0;
49794 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49795 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49799 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jclass clz, int64_t o) {
49801 o_conv.inner = untag_ptr(o);
49802 o_conv.is_owned = ptr_is_owned(o);
49803 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
49804 o_conv.is_owned = false;
49805 int64_t ret_conv = Route_hash(&o_conv);
49809 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49811 a_conv.inner = untag_ptr(a);
49812 a_conv.is_owned = ptr_is_owned(a);
49813 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49814 a_conv.is_owned = false;
49816 b_conv.inner = untag_ptr(b);
49817 b_conv.is_owned = ptr_is_owned(b);
49818 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49819 b_conv.is_owned = false;
49820 jboolean ret_conv = Route_eq(&a_conv, &b_conv);
49824 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) {
49825 LDKRoute this_arg_conv;
49826 this_arg_conv.inner = untag_ptr(this_arg);
49827 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49829 this_arg_conv.is_owned = false;
49830 int64_t ret_conv = Route_get_total_fees(&this_arg_conv);
49834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) {
49835 LDKRoute this_arg_conv;
49836 this_arg_conv.inner = untag_ptr(this_arg);
49837 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49839 this_arg_conv.is_owned = false;
49840 int64_t ret_conv = Route_get_total_amount(&this_arg_conv);
49844 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) {
49846 obj_conv.inner = untag_ptr(obj);
49847 obj_conv.is_owned = ptr_is_owned(obj);
49848 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
49849 obj_conv.is_owned = false;
49850 LDKCVec_u8Z ret_var = Route_write(&obj_conv);
49851 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
49852 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
49853 CVec_u8Z_free(ret_var);
49857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
49858 LDKu8slice ser_ref;
49859 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
49860 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
49861 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
49862 *ret_conv = Route_read(ser_ref);
49863 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
49864 return tag_ptr(ret_conv, true);
49867 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49868 LDKRouteParameters this_obj_conv;
49869 this_obj_conv.inner = untag_ptr(this_obj);
49870 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49872 RouteParameters_free(this_obj_conv);
49875 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) {
49876 LDKRouteParameters this_ptr_conv;
49877 this_ptr_conv.inner = untag_ptr(this_ptr);
49878 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49880 this_ptr_conv.is_owned = false;
49881 LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv);
49882 int64_t ret_ref = 0;
49883 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49884 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49889 LDKRouteParameters this_ptr_conv;
49890 this_ptr_conv.inner = untag_ptr(this_ptr);
49891 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49893 this_ptr_conv.is_owned = false;
49894 LDKPaymentParameters val_conv;
49895 val_conv.inner = untag_ptr(val);
49896 val_conv.is_owned = ptr_is_owned(val);
49897 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49898 val_conv = PaymentParameters_clone(&val_conv);
49899 RouteParameters_set_payment_params(&this_ptr_conv, val_conv);
49902 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
49903 LDKRouteParameters this_ptr_conv;
49904 this_ptr_conv.inner = untag_ptr(this_ptr);
49905 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49906 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49907 this_ptr_conv.is_owned = false;
49908 int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv);
49912 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49913 LDKRouteParameters this_ptr_conv;
49914 this_ptr_conv.inner = untag_ptr(this_ptr);
49915 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49917 this_ptr_conv.is_owned = false;
49918 RouteParameters_set_final_value_msat(&this_ptr_conv, val);
49921 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) {
49922 LDKPaymentParameters payment_params_arg_conv;
49923 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
49924 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
49925 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
49926 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
49927 LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg);
49928 int64_t ret_ref = 0;
49929 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49930 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49934 static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) {
49935 LDKRouteParameters ret_var = RouteParameters_clone(arg);
49936 int64_t ret_ref = 0;
49937 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49938 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49941 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49942 LDKRouteParameters arg_conv;
49943 arg_conv.inner = untag_ptr(arg);
49944 arg_conv.is_owned = ptr_is_owned(arg);
49945 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49946 arg_conv.is_owned = false;
49947 int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv);
49951 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49952 LDKRouteParameters orig_conv;
49953 orig_conv.inner = untag_ptr(orig);
49954 orig_conv.is_owned = ptr_is_owned(orig);
49955 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49956 orig_conv.is_owned = false;
49957 LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv);
49958 int64_t ret_ref = 0;
49959 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49960 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49964 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49965 LDKRouteParameters a_conv;
49966 a_conv.inner = untag_ptr(a);
49967 a_conv.is_owned = ptr_is_owned(a);
49968 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49969 a_conv.is_owned = false;
49970 LDKRouteParameters b_conv;
49971 b_conv.inner = untag_ptr(b);
49972 b_conv.is_owned = ptr_is_owned(b);
49973 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49974 b_conv.is_owned = false;
49975 jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv);
49979 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
49980 LDKRouteParameters obj_conv;
49981 obj_conv.inner = untag_ptr(obj);
49982 obj_conv.is_owned = ptr_is_owned(obj);
49983 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
49984 obj_conv.is_owned = false;
49985 LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv);
49986 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
49987 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
49988 CVec_u8Z_free(ret_var);
49992 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
49993 LDKu8slice ser_ref;
49994 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
49995 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
49996 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
49997 *ret_conv = RouteParameters_read(ser_ref);
49998 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
49999 return tag_ptr(ret_conv, true);
50002 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50003 LDKPaymentParameters this_obj_conv;
50004 this_obj_conv.inner = untag_ptr(this_obj);
50005 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50007 PaymentParameters_free(this_obj_conv);
50010 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1payee_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
50011 LDKPaymentParameters this_ptr_conv;
50012 this_ptr_conv.inner = untag_ptr(this_ptr);
50013 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50014 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50015 this_ptr_conv.is_owned = false;
50016 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
50017 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form);
50021 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1payee_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
50022 LDKPaymentParameters this_ptr_conv;
50023 this_ptr_conv.inner = untag_ptr(this_ptr);
50024 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50025 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50026 this_ptr_conv.is_owned = false;
50027 LDKPublicKey val_ref;
50028 CHECK((*env)->GetArrayLength(env, val) == 33);
50029 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
50030 PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref);
50033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
50034 LDKPaymentParameters this_ptr_conv;
50035 this_ptr_conv.inner = untag_ptr(this_ptr);
50036 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50038 this_ptr_conv.is_owned = false;
50039 LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&this_ptr_conv);
50040 int64_t ret_ref = 0;
50041 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50042 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50046 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50047 LDKPaymentParameters this_ptr_conv;
50048 this_ptr_conv.inner = untag_ptr(this_ptr);
50049 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50050 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50051 this_ptr_conv.is_owned = false;
50052 LDKInvoiceFeatures val_conv;
50053 val_conv.inner = untag_ptr(val);
50054 val_conv.is_owned = ptr_is_owned(val);
50055 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
50056 val_conv = InvoiceFeatures_clone(&val_conv);
50057 PaymentParameters_set_features(&this_ptr_conv, val_conv);
50060 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr) {
50061 LDKPaymentParameters this_ptr_conv;
50062 this_ptr_conv.inner = untag_ptr(this_ptr);
50063 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50065 this_ptr_conv.is_owned = false;
50066 LDKCVec_RouteHintZ ret_var = PaymentParameters_get_route_hints(&this_ptr_conv);
50067 int64_tArray ret_arr = NULL;
50068 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
50069 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
50070 for (size_t l = 0; l < ret_var.datalen; l++) {
50071 LDKRouteHint ret_conv_11_var = ret_var.data[l];
50072 int64_t ret_conv_11_ref = 0;
50073 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
50074 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
50075 ret_arr_ptr[l] = ret_conv_11_ref;
50077 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
50078 FREE(ret_var.data);
50082 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
50083 LDKPaymentParameters this_ptr_conv;
50084 this_ptr_conv.inner = untag_ptr(this_ptr);
50085 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50087 this_ptr_conv.is_owned = false;
50088 LDKCVec_RouteHintZ val_constr;
50089 val_constr.datalen = (*env)->GetArrayLength(env, val);
50090 if (val_constr.datalen > 0)
50091 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
50093 val_constr.data = NULL;
50094 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
50095 for (size_t l = 0; l < val_constr.datalen; l++) {
50096 int64_t val_conv_11 = val_vals[l];
50097 LDKRouteHint val_conv_11_conv;
50098 val_conv_11_conv.inner = untag_ptr(val_conv_11);
50099 val_conv_11_conv.is_owned = ptr_is_owned(val_conv_11);
50100 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv);
50101 val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
50102 val_constr.data[l] = val_conv_11_conv;
50104 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
50105 PaymentParameters_set_route_hints(&this_ptr_conv, val_constr);
50108 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr) {
50109 LDKPaymentParameters this_ptr_conv;
50110 this_ptr_conv.inner = untag_ptr(this_ptr);
50111 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50112 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50113 this_ptr_conv.is_owned = false;
50114 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
50115 *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv);
50116 int64_t ret_ref = tag_ptr(ret_copy, true);
50120 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50121 LDKPaymentParameters this_ptr_conv;
50122 this_ptr_conv.inner = untag_ptr(this_ptr);
50123 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50125 this_ptr_conv.is_owned = false;
50126 void* val_ptr = untag_ptr(val);
50127 CHECK_ACCESS(val_ptr);
50128 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
50129 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
50130 PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv);
50133 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
50134 LDKPaymentParameters this_ptr_conv;
50135 this_ptr_conv.inner = untag_ptr(this_ptr);
50136 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50137 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50138 this_ptr_conv.is_owned = false;
50139 int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv);
50143 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) {
50144 LDKPaymentParameters this_ptr_conv;
50145 this_ptr_conv.inner = untag_ptr(this_ptr);
50146 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50147 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50148 this_ptr_conv.is_owned = false;
50149 PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val);
50152 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr) {
50153 LDKPaymentParameters this_ptr_conv;
50154 this_ptr_conv.inner = untag_ptr(this_ptr);
50155 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50156 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50157 this_ptr_conv.is_owned = false;
50158 int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv);
50162 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
50163 LDKPaymentParameters this_ptr_conv;
50164 this_ptr_conv.inner = untag_ptr(this_ptr);
50165 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50166 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50167 this_ptr_conv.is_owned = false;
50168 PaymentParameters_set_max_path_count(&this_ptr_conv, val);
50171 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) {
50172 LDKPaymentParameters this_ptr_conv;
50173 this_ptr_conv.inner = untag_ptr(this_ptr);
50174 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50175 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50176 this_ptr_conv.is_owned = false;
50177 int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv);
50181 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) {
50182 LDKPaymentParameters this_ptr_conv;
50183 this_ptr_conv.inner = untag_ptr(this_ptr);
50184 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50185 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50186 this_ptr_conv.is_owned = false;
50187 PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val);
50190 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
50191 LDKPaymentParameters this_ptr_conv;
50192 this_ptr_conv.inner = untag_ptr(this_ptr);
50193 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50194 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50195 this_ptr_conv.is_owned = false;
50196 LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv);
50197 int64_tArray ret_arr = NULL;
50198 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
50199 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
50200 for (size_t g = 0; g < ret_var.datalen; g++) {
50201 int64_t ret_conv_6_conv = ret_var.data[g];
50202 ret_arr_ptr[g] = ret_conv_6_conv;
50204 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
50205 FREE(ret_var.data);
50209 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
50210 LDKPaymentParameters this_ptr_conv;
50211 this_ptr_conv.inner = untag_ptr(this_ptr);
50212 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50214 this_ptr_conv.is_owned = false;
50215 LDKCVec_u64Z val_constr;
50216 val_constr.datalen = (*env)->GetArrayLength(env, val);
50217 if (val_constr.datalen > 0)
50218 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
50220 val_constr.data = NULL;
50221 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
50222 for (size_t g = 0; g < val_constr.datalen; g++) {
50223 int64_t val_conv_6 = val_vals[g];
50224 val_constr.data[g] = val_conv_6;
50226 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
50227 PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr);
50230 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
50231 LDKPaymentParameters this_ptr_conv;
50232 this_ptr_conv.inner = untag_ptr(this_ptr);
50233 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50235 this_ptr_conv.is_owned = false;
50236 int32_t ret_conv = PaymentParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
50240 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
50241 LDKPaymentParameters this_ptr_conv;
50242 this_ptr_conv.inner = untag_ptr(this_ptr);
50243 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50245 this_ptr_conv.is_owned = false;
50246 PaymentParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
50249 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, int32_t final_cltv_expiry_delta_arg) {
50250 LDKPublicKey payee_pubkey_arg_ref;
50251 CHECK((*env)->GetArrayLength(env, payee_pubkey_arg) == 33);
50252 (*env)->GetByteArrayRegion(env, payee_pubkey_arg, 0, 33, payee_pubkey_arg_ref.compressed_form);
50253 LDKInvoiceFeatures features_arg_conv;
50254 features_arg_conv.inner = untag_ptr(features_arg);
50255 features_arg_conv.is_owned = ptr_is_owned(features_arg);
50256 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
50257 features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
50258 LDKCVec_RouteHintZ route_hints_arg_constr;
50259 route_hints_arg_constr.datalen = (*env)->GetArrayLength(env, route_hints_arg);
50260 if (route_hints_arg_constr.datalen > 0)
50261 route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
50263 route_hints_arg_constr.data = NULL;
50264 int64_t* route_hints_arg_vals = (*env)->GetLongArrayElements (env, route_hints_arg, NULL);
50265 for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
50266 int64_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
50267 LDKRouteHint route_hints_arg_conv_11_conv;
50268 route_hints_arg_conv_11_conv.inner = untag_ptr(route_hints_arg_conv_11);
50269 route_hints_arg_conv_11_conv.is_owned = ptr_is_owned(route_hints_arg_conv_11);
50270 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv);
50271 route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
50272 route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
50274 (*env)->ReleaseLongArrayElements(env, route_hints_arg, route_hints_arg_vals, 0);
50275 void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg);
50276 CHECK_ACCESS(expiry_time_arg_ptr);
50277 LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
50278 expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg));
50279 LDKCVec_u64Z previously_failed_channels_arg_constr;
50280 previously_failed_channels_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_channels_arg);
50281 if (previously_failed_channels_arg_constr.datalen > 0)
50282 previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
50284 previously_failed_channels_arg_constr.data = NULL;
50285 int64_t* previously_failed_channels_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_channels_arg, NULL);
50286 for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) {
50287 int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g];
50288 previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6;
50290 (*env)->ReleaseLongArrayElements(env, previously_failed_channels_arg, previously_failed_channels_arg_vals, 0);
50291 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, final_cltv_expiry_delta_arg);
50292 int64_t ret_ref = 0;
50293 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50294 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50298 static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) {
50299 LDKPaymentParameters ret_var = PaymentParameters_clone(arg);
50300 int64_t ret_ref = 0;
50301 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50302 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50305 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50306 LDKPaymentParameters arg_conv;
50307 arg_conv.inner = untag_ptr(arg);
50308 arg_conv.is_owned = ptr_is_owned(arg);
50309 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50310 arg_conv.is_owned = false;
50311 int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv);
50315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50316 LDKPaymentParameters orig_conv;
50317 orig_conv.inner = untag_ptr(orig);
50318 orig_conv.is_owned = ptr_is_owned(orig);
50319 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50320 orig_conv.is_owned = false;
50321 LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv);
50322 int64_t ret_ref = 0;
50323 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50324 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1hash(JNIEnv *env, jclass clz, int64_t o) {
50329 LDKPaymentParameters o_conv;
50330 o_conv.inner = untag_ptr(o);
50331 o_conv.is_owned = ptr_is_owned(o);
50332 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
50333 o_conv.is_owned = false;
50334 int64_t ret_conv = PaymentParameters_hash(&o_conv);
50338 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50339 LDKPaymentParameters a_conv;
50340 a_conv.inner = untag_ptr(a);
50341 a_conv.is_owned = ptr_is_owned(a);
50342 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50343 a_conv.is_owned = false;
50344 LDKPaymentParameters b_conv;
50345 b_conv.inner = untag_ptr(b);
50346 b_conv.is_owned = ptr_is_owned(b);
50347 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50348 b_conv.is_owned = false;
50349 jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv);
50353 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
50354 LDKPaymentParameters obj_conv;
50355 obj_conv.inner = untag_ptr(obj);
50356 obj_conv.is_owned = ptr_is_owned(obj);
50357 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
50358 obj_conv.is_owned = false;
50359 LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv);
50360 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
50361 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
50362 CVec_u8Z_free(ret_var);
50366 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser, int32_t arg) {
50367 LDKu8slice ser_ref;
50368 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
50369 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
50370 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
50371 *ret_conv = PaymentParameters_read(ser_ref, arg);
50372 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
50373 return tag_ptr(ret_conv, true);
50376 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1node_1id(JNIEnv *env, jclass clz, int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) {
50377 LDKPublicKey payee_pubkey_ref;
50378 CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33);
50379 (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form);
50380 LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta);
50381 int64_t ret_ref = 0;
50382 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50383 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50387 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1for_1keysend(JNIEnv *env, jclass clz, int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) {
50388 LDKPublicKey payee_pubkey_ref;
50389 CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33);
50390 (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form);
50391 LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta);
50392 int64_t ret_ref = 0;
50393 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50394 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50399 LDKRouteHint this_obj_conv;
50400 this_obj_conv.inner = untag_ptr(this_obj);
50401 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50402 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50403 RouteHint_free(this_obj_conv);
50406 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
50407 LDKRouteHint this_ptr_conv;
50408 this_ptr_conv.inner = untag_ptr(this_ptr);
50409 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50410 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50411 this_ptr_conv.is_owned = false;
50412 LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
50413 int64_tArray ret_arr = NULL;
50414 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
50415 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
50416 for (size_t o = 0; o < ret_var.datalen; o++) {
50417 LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
50418 int64_t ret_conv_14_ref = 0;
50419 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
50420 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
50421 ret_arr_ptr[o] = ret_conv_14_ref;
50423 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
50424 FREE(ret_var.data);
50428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
50429 LDKRouteHint this_ptr_conv;
50430 this_ptr_conv.inner = untag_ptr(this_ptr);
50431 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50432 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50433 this_ptr_conv.is_owned = false;
50434 LDKCVec_RouteHintHopZ val_constr;
50435 val_constr.datalen = (*env)->GetArrayLength(env, val);
50436 if (val_constr.datalen > 0)
50437 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
50439 val_constr.data = NULL;
50440 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
50441 for (size_t o = 0; o < val_constr.datalen; o++) {
50442 int64_t val_conv_14 = val_vals[o];
50443 LDKRouteHintHop val_conv_14_conv;
50444 val_conv_14_conv.inner = untag_ptr(val_conv_14);
50445 val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14);
50446 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv);
50447 val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
50448 val_constr.data[o] = val_conv_14_conv;
50450 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
50451 RouteHint_set_a(&this_ptr_conv, val_constr);
50454 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int64_tArray a_arg) {
50455 LDKCVec_RouteHintHopZ a_arg_constr;
50456 a_arg_constr.datalen = (*env)->GetArrayLength(env, a_arg);
50457 if (a_arg_constr.datalen > 0)
50458 a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
50460 a_arg_constr.data = NULL;
50461 int64_t* a_arg_vals = (*env)->GetLongArrayElements (env, a_arg, NULL);
50462 for (size_t o = 0; o < a_arg_constr.datalen; o++) {
50463 int64_t a_arg_conv_14 = a_arg_vals[o];
50464 LDKRouteHintHop a_arg_conv_14_conv;
50465 a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14);
50466 a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14);
50467 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv);
50468 a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
50469 a_arg_constr.data[o] = a_arg_conv_14_conv;
50471 (*env)->ReleaseLongArrayElements(env, a_arg, a_arg_vals, 0);
50472 LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
50473 int64_t ret_ref = 0;
50474 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50475 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50479 static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) {
50480 LDKRouteHint ret_var = RouteHint_clone(arg);
50481 int64_t ret_ref = 0;
50482 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50483 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50486 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50487 LDKRouteHint arg_conv;
50488 arg_conv.inner = untag_ptr(arg);
50489 arg_conv.is_owned = ptr_is_owned(arg);
50490 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50491 arg_conv.is_owned = false;
50492 int64_t ret_conv = RouteHint_clone_ptr(&arg_conv);
50496 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50497 LDKRouteHint orig_conv;
50498 orig_conv.inner = untag_ptr(orig);
50499 orig_conv.is_owned = ptr_is_owned(orig);
50500 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50501 orig_conv.is_owned = false;
50502 LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
50503 int64_t ret_ref = 0;
50504 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50505 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50509 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env, jclass clz, int64_t o) {
50510 LDKRouteHint o_conv;
50511 o_conv.inner = untag_ptr(o);
50512 o_conv.is_owned = ptr_is_owned(o);
50513 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
50514 o_conv.is_owned = false;
50515 int64_t ret_conv = RouteHint_hash(&o_conv);
50519 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50520 LDKRouteHint a_conv;
50521 a_conv.inner = untag_ptr(a);
50522 a_conv.is_owned = ptr_is_owned(a);
50523 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50524 a_conv.is_owned = false;
50525 LDKRouteHint b_conv;
50526 b_conv.inner = untag_ptr(b);
50527 b_conv.is_owned = ptr_is_owned(b);
50528 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50529 b_conv.is_owned = false;
50530 jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv);
50534 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv *env, jclass clz, int64_t obj) {
50535 LDKRouteHint obj_conv;
50536 obj_conv.inner = untag_ptr(obj);
50537 obj_conv.is_owned = ptr_is_owned(obj);
50538 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
50539 obj_conv.is_owned = false;
50540 LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv);
50541 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
50542 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
50543 CVec_u8Z_free(ret_var);
50547 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
50548 LDKu8slice ser_ref;
50549 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
50550 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
50551 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
50552 *ret_conv = RouteHint_read(ser_ref);
50553 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
50554 return tag_ptr(ret_conv, true);
50557 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50558 LDKRouteHintHop this_obj_conv;
50559 this_obj_conv.inner = untag_ptr(this_obj);
50560 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50562 RouteHintHop_free(this_obj_conv);
50565 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
50566 LDKRouteHintHop this_ptr_conv;
50567 this_ptr_conv.inner = untag_ptr(this_ptr);
50568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50570 this_ptr_conv.is_owned = false;
50571 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
50572 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form);
50576 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
50577 LDKRouteHintHop this_ptr_conv;
50578 this_ptr_conv.inner = untag_ptr(this_ptr);
50579 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50580 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50581 this_ptr_conv.is_owned = false;
50582 LDKPublicKey val_ref;
50583 CHECK((*env)->GetArrayLength(env, val) == 33);
50584 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
50585 RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref);
50588 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
50589 LDKRouteHintHop this_ptr_conv;
50590 this_ptr_conv.inner = untag_ptr(this_ptr);
50591 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50592 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50593 this_ptr_conv.is_owned = false;
50594 int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv);
50598 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50599 LDKRouteHintHop this_ptr_conv;
50600 this_ptr_conv.inner = untag_ptr(this_ptr);
50601 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50602 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50603 this_ptr_conv.is_owned = false;
50604 RouteHintHop_set_short_channel_id(&this_ptr_conv, val);
50607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) {
50608 LDKRouteHintHop this_ptr_conv;
50609 this_ptr_conv.inner = untag_ptr(this_ptr);
50610 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50612 this_ptr_conv.is_owned = false;
50613 LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv);
50614 int64_t ret_ref = 0;
50615 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50616 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50620 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50621 LDKRouteHintHop this_ptr_conv;
50622 this_ptr_conv.inner = untag_ptr(this_ptr);
50623 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50625 this_ptr_conv.is_owned = false;
50626 LDKRoutingFees val_conv;
50627 val_conv.inner = untag_ptr(val);
50628 val_conv.is_owned = ptr_is_owned(val);
50629 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
50630 val_conv = RoutingFees_clone(&val_conv);
50631 RouteHintHop_set_fees(&this_ptr_conv, val_conv);
50634 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
50635 LDKRouteHintHop this_ptr_conv;
50636 this_ptr_conv.inner = untag_ptr(this_ptr);
50637 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50638 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50639 this_ptr_conv.is_owned = false;
50640 int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv);
50644 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
50645 LDKRouteHintHop this_ptr_conv;
50646 this_ptr_conv.inner = untag_ptr(this_ptr);
50647 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50649 this_ptr_conv.is_owned = false;
50650 RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val);
50653 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
50654 LDKRouteHintHop this_ptr_conv;
50655 this_ptr_conv.inner = untag_ptr(this_ptr);
50656 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50658 this_ptr_conv.is_owned = false;
50659 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
50660 *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv);
50661 int64_t ret_ref = tag_ptr(ret_copy, true);
50665 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50666 LDKRouteHintHop this_ptr_conv;
50667 this_ptr_conv.inner = untag_ptr(this_ptr);
50668 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50669 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50670 this_ptr_conv.is_owned = false;
50671 void* val_ptr = untag_ptr(val);
50672 CHECK_ACCESS(val_ptr);
50673 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
50674 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
50675 RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
50678 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
50679 LDKRouteHintHop this_ptr_conv;
50680 this_ptr_conv.inner = untag_ptr(this_ptr);
50681 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50683 this_ptr_conv.is_owned = false;
50684 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
50685 *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv);
50686 int64_t ret_ref = tag_ptr(ret_copy, true);
50690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50691 LDKRouteHintHop this_ptr_conv;
50692 this_ptr_conv.inner = untag_ptr(this_ptr);
50693 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50695 this_ptr_conv.is_owned = false;
50696 void* val_ptr = untag_ptr(val);
50697 CHECK_ACCESS(val_ptr);
50698 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
50699 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
50700 RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
50703 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) {
50704 LDKPublicKey src_node_id_arg_ref;
50705 CHECK((*env)->GetArrayLength(env, src_node_id_arg) == 33);
50706 (*env)->GetByteArrayRegion(env, src_node_id_arg, 0, 33, src_node_id_arg_ref.compressed_form);
50707 LDKRoutingFees fees_arg_conv;
50708 fees_arg_conv.inner = untag_ptr(fees_arg);
50709 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
50710 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
50711 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
50712 void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg);
50713 CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
50714 LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
50715 htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg));
50716 void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg);
50717 CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
50718 LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
50719 htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg));
50720 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);
50721 int64_t ret_ref = 0;
50722 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50723 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50727 static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) {
50728 LDKRouteHintHop ret_var = RouteHintHop_clone(arg);
50729 int64_t ret_ref = 0;
50730 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50731 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50735 LDKRouteHintHop arg_conv;
50736 arg_conv.inner = untag_ptr(arg);
50737 arg_conv.is_owned = ptr_is_owned(arg);
50738 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50739 arg_conv.is_owned = false;
50740 int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv);
50744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50745 LDKRouteHintHop orig_conv;
50746 orig_conv.inner = untag_ptr(orig);
50747 orig_conv.is_owned = ptr_is_owned(orig);
50748 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50749 orig_conv.is_owned = false;
50750 LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv);
50751 int64_t ret_ref = 0;
50752 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50753 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50757 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv *env, jclass clz, int64_t o) {
50758 LDKRouteHintHop o_conv;
50759 o_conv.inner = untag_ptr(o);
50760 o_conv.is_owned = ptr_is_owned(o);
50761 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
50762 o_conv.is_owned = false;
50763 int64_t ret_conv = RouteHintHop_hash(&o_conv);
50767 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50768 LDKRouteHintHop a_conv;
50769 a_conv.inner = untag_ptr(a);
50770 a_conv.is_owned = ptr_is_owned(a);
50771 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50772 a_conv.is_owned = false;
50773 LDKRouteHintHop b_conv;
50774 b_conv.inner = untag_ptr(b);
50775 b_conv.is_owned = ptr_is_owned(b);
50776 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50777 b_conv.is_owned = false;
50778 jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv);
50782 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
50783 LDKRouteHintHop obj_conv;
50784 obj_conv.inner = untag_ptr(obj);
50785 obj_conv.is_owned = ptr_is_owned(obj);
50786 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
50787 obj_conv.is_owned = false;
50788 LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv);
50789 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
50790 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
50791 CVec_u8Z_free(ret_var);
50795 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
50796 LDKu8slice ser_ref;
50797 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
50798 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
50799 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
50800 *ret_conv = RouteHintHop_read(ser_ref);
50801 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
50802 return tag_ptr(ret_conv, true);
50805 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) {
50806 LDKPublicKey our_node_pubkey_ref;
50807 CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
50808 (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
50809 LDKRouteParameters route_params_conv;
50810 route_params_conv.inner = untag_ptr(route_params);
50811 route_params_conv.is_owned = ptr_is_owned(route_params);
50812 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
50813 route_params_conv.is_owned = false;
50814 LDKNetworkGraph network_graph_conv;
50815 network_graph_conv.inner = untag_ptr(network_graph);
50816 network_graph_conv.is_owned = ptr_is_owned(network_graph);
50817 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
50818 network_graph_conv.is_owned = false;
50819 LDKCVec_ChannelDetailsZ first_hops_constr;
50820 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
50821 if (first_hops != NULL) {
50822 first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
50823 if (first_hops_constr.datalen > 0)
50824 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
50826 first_hops_constr.data = NULL;
50827 int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
50828 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
50829 int64_t first_hops_conv_16 = first_hops_vals[q];
50830 LDKChannelDetails first_hops_conv_16_conv;
50831 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
50832 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
50833 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
50834 first_hops_conv_16_conv.is_owned = false;
50835 first_hops_constr.data[q] = first_hops_conv_16_conv;
50837 (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
50838 first_hops_ptr = &first_hops_constr;
50840 void* logger_ptr = untag_ptr(logger);
50841 CHECK_ACCESS(logger_ptr);
50842 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
50843 if (logger_conv.free == LDKLogger_JCalls_free) {
50844 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
50845 LDKLogger_JCalls_cloned(&logger_conv);
50847 void* scorer_ptr = untag_ptr(scorer);
50848 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
50849 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
50850 uint8_t random_seed_bytes_arr[32];
50851 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
50852 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr);
50853 uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
50854 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
50855 *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);
50856 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
50857 return tag_ptr(ret_conv, true);
50860 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) {
50861 LDKPublicKey our_node_pubkey_ref;
50862 CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
50863 (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
50864 LDKCVec_PublicKeyZ hops_constr;
50865 hops_constr.datalen = (*env)->GetArrayLength(env, hops);
50866 if (hops_constr.datalen > 0)
50867 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
50869 hops_constr.data = NULL;
50870 for (size_t i = 0; i < hops_constr.datalen; i++) {
50871 int8_tArray hops_conv_8 = (*env)->GetObjectArrayElement(env, hops, i);
50872 LDKPublicKey hops_conv_8_ref;
50873 CHECK((*env)->GetArrayLength(env, hops_conv_8) == 33);
50874 (*env)->GetByteArrayRegion(env, hops_conv_8, 0, 33, hops_conv_8_ref.compressed_form);
50875 hops_constr.data[i] = hops_conv_8_ref;
50877 LDKRouteParameters route_params_conv;
50878 route_params_conv.inner = untag_ptr(route_params);
50879 route_params_conv.is_owned = ptr_is_owned(route_params);
50880 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
50881 route_params_conv.is_owned = false;
50882 LDKNetworkGraph network_graph_conv;
50883 network_graph_conv.inner = untag_ptr(network_graph);
50884 network_graph_conv.is_owned = ptr_is_owned(network_graph);
50885 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
50886 network_graph_conv.is_owned = false;
50887 void* logger_ptr = untag_ptr(logger);
50888 CHECK_ACCESS(logger_ptr);
50889 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
50890 if (logger_conv.free == LDKLogger_JCalls_free) {
50891 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
50892 LDKLogger_JCalls_cloned(&logger_conv);
50894 uint8_t random_seed_bytes_arr[32];
50895 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
50896 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr);
50897 uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
50898 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
50899 *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref);
50900 return tag_ptr(ret_conv, true);
50903 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
50904 if (!ptr_is_owned(this_ptr)) return;
50905 void* this_ptr_ptr = untag_ptr(this_ptr);
50906 CHECK_ACCESS(this_ptr_ptr);
50907 LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
50908 FREE(untag_ptr(this_ptr));
50909 Score_free(this_ptr_conv);
50912 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
50913 if (!ptr_is_owned(this_ptr)) return;
50914 void* this_ptr_ptr = untag_ptr(this_ptr);
50915 CHECK_ACCESS(this_ptr_ptr);
50916 LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
50917 FREE(untag_ptr(this_ptr));
50918 LockableScore_free(this_ptr_conv);
50921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
50922 if (!ptr_is_owned(this_ptr)) return;
50923 void* this_ptr_ptr = untag_ptr(this_ptr);
50924 CHECK_ACCESS(this_ptr_ptr);
50925 LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr);
50926 FREE(untag_ptr(this_ptr));
50927 WriteableScore_free(this_ptr_conv);
50930 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50931 LDKMultiThreadedLockableScore this_obj_conv;
50932 this_obj_conv.inner = untag_ptr(this_obj);
50933 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50935 MultiThreadedLockableScore_free(this_obj_conv);
50938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLock_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50939 LDKMultiThreadedScoreLock this_obj_conv;
50940 this_obj_conv.inner = untag_ptr(this_obj);
50941 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50943 MultiThreadedScoreLock_free(this_obj_conv);
50946 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLock_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
50947 LDKMultiThreadedScoreLock this_arg_conv;
50948 this_arg_conv.inner = untag_ptr(this_arg);
50949 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50951 this_arg_conv.is_owned = false;
50952 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
50953 *ret_ret = MultiThreadedScoreLock_as_Score(&this_arg_conv);
50954 return tag_ptr(ret_ret, true);
50957 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLock_1write(JNIEnv *env, jclass clz, int64_t obj) {
50958 LDKMultiThreadedScoreLock obj_conv;
50959 obj_conv.inner = untag_ptr(obj);
50960 obj_conv.is_owned = ptr_is_owned(obj);
50961 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
50962 obj_conv.is_owned = false;
50963 LDKCVec_u8Z ret_var = MultiThreadedScoreLock_write(&obj_conv);
50964 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
50965 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
50966 CVec_u8Z_free(ret_var);
50970 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1LockableScore(JNIEnv *env, jclass clz, int64_t this_arg) {
50971 LDKMultiThreadedLockableScore this_arg_conv;
50972 this_arg_conv.inner = untag_ptr(this_arg);
50973 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50975 this_arg_conv.is_owned = false;
50976 LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
50977 *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv);
50978 return tag_ptr(ret_ret, true);
50981 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) {
50982 LDKMultiThreadedLockableScore obj_conv;
50983 obj_conv.inner = untag_ptr(obj);
50984 obj_conv.is_owned = ptr_is_owned(obj);
50985 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
50986 obj_conv.is_owned = false;
50987 LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv);
50988 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
50989 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
50990 CVec_u8Z_free(ret_var);
50994 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1WriteableScore(JNIEnv *env, jclass clz, int64_t this_arg) {
50995 LDKMultiThreadedLockableScore this_arg_conv;
50996 this_arg_conv.inner = untag_ptr(this_arg);
50997 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50999 this_arg_conv.is_owned = false;
51000 LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
51001 *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv);
51002 return tag_ptr(ret_ret, true);
51005 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) {
51006 void* score_ptr = untag_ptr(score);
51007 CHECK_ACCESS(score_ptr);
51008 LDKScore score_conv = *(LDKScore*)(score_ptr);
51009 if (score_conv.free == LDKScore_JCalls_free) {
51010 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51011 LDKScore_JCalls_cloned(&score_conv);
51013 LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
51014 int64_t ret_ref = 0;
51015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51021 LDKChannelUsage this_obj_conv;
51022 this_obj_conv.inner = untag_ptr(this_obj);
51023 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51025 ChannelUsage_free(this_obj_conv);
51028 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51029 LDKChannelUsage this_ptr_conv;
51030 this_ptr_conv.inner = untag_ptr(this_ptr);
51031 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51033 this_ptr_conv.is_owned = false;
51034 int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv);
51038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51039 LDKChannelUsage this_ptr_conv;
51040 this_ptr_conv.inner = untag_ptr(this_ptr);
51041 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51043 this_ptr_conv.is_owned = false;
51044 ChannelUsage_set_amount_msat(&this_ptr_conv, val);
51047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51048 LDKChannelUsage this_ptr_conv;
51049 this_ptr_conv.inner = untag_ptr(this_ptr);
51050 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51051 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51052 this_ptr_conv.is_owned = false;
51053 int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv);
51057 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51058 LDKChannelUsage this_ptr_conv;
51059 this_ptr_conv.inner = untag_ptr(this_ptr);
51060 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51061 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51062 this_ptr_conv.is_owned = false;
51063 ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val);
51066 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr) {
51067 LDKChannelUsage this_ptr_conv;
51068 this_ptr_conv.inner = untag_ptr(this_ptr);
51069 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51070 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51071 this_ptr_conv.is_owned = false;
51072 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
51073 *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv);
51074 int64_t ret_ref = tag_ptr(ret_copy, true);
51078 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51079 LDKChannelUsage this_ptr_conv;
51080 this_ptr_conv.inner = untag_ptr(this_ptr);
51081 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51083 this_ptr_conv.is_owned = false;
51084 void* val_ptr = untag_ptr(val);
51085 CHECK_ACCESS(val_ptr);
51086 LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr);
51087 val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val));
51088 ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv);
51091 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) {
51092 void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg);
51093 CHECK_ACCESS(effective_capacity_arg_ptr);
51094 LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr);
51095 effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg));
51096 LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv);
51097 int64_t ret_ref = 0;
51098 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51099 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51103 static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) {
51104 LDKChannelUsage ret_var = ChannelUsage_clone(arg);
51105 int64_t ret_ref = 0;
51106 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51107 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51110 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51111 LDKChannelUsage arg_conv;
51112 arg_conv.inner = untag_ptr(arg);
51113 arg_conv.is_owned = ptr_is_owned(arg);
51114 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
51115 arg_conv.is_owned = false;
51116 int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv);
51120 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51121 LDKChannelUsage orig_conv;
51122 orig_conv.inner = untag_ptr(orig);
51123 orig_conv.is_owned = ptr_is_owned(orig);
51124 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
51125 orig_conv.is_owned = false;
51126 LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv);
51127 int64_t ret_ref = 0;
51128 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51129 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51133 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51134 LDKFixedPenaltyScorer this_obj_conv;
51135 this_obj_conv.inner = untag_ptr(this_obj);
51136 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51137 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51138 FixedPenaltyScorer_free(this_obj_conv);
51141 static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) {
51142 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg);
51143 int64_t ret_ref = 0;
51144 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51145 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51148 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51149 LDKFixedPenaltyScorer arg_conv;
51150 arg_conv.inner = untag_ptr(arg);
51151 arg_conv.is_owned = ptr_is_owned(arg);
51152 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
51153 arg_conv.is_owned = false;
51154 int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv);
51158 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51159 LDKFixedPenaltyScorer orig_conv;
51160 orig_conv.inner = untag_ptr(orig);
51161 orig_conv.is_owned = ptr_is_owned(orig);
51162 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
51163 orig_conv.is_owned = false;
51164 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv);
51165 int64_t ret_ref = 0;
51166 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51167 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51171 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) {
51172 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat);
51173 int64_t ret_ref = 0;
51174 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51175 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
51180 LDKFixedPenaltyScorer this_arg_conv;
51181 this_arg_conv.inner = untag_ptr(this_arg);
51182 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51183 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51184 this_arg_conv.is_owned = false;
51185 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
51186 *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv);
51187 return tag_ptr(ret_ret, true);
51190 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) {
51191 LDKFixedPenaltyScorer obj_conv;
51192 obj_conv.inner = untag_ptr(obj);
51193 obj_conv.is_owned = ptr_is_owned(obj);
51194 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
51195 obj_conv.is_owned = false;
51196 LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv);
51197 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
51198 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
51199 CVec_u8Z_free(ret_var);
51203 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
51204 LDKu8slice ser_ref;
51205 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
51206 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
51207 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
51208 *ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
51209 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
51210 return tag_ptr(ret_conv, true);
51213 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51214 LDKProbabilisticScorer this_obj_conv;
51215 this_obj_conv.inner = untag_ptr(this_obj);
51216 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51218 ProbabilisticScorer_free(this_obj_conv);
51221 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51222 LDKProbabilisticScoringParameters this_obj_conv;
51223 this_obj_conv.inner = untag_ptr(this_obj);
51224 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51225 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51226 ProbabilisticScoringParameters_free(this_obj_conv);
51229 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51230 LDKProbabilisticScoringParameters this_ptr_conv;
51231 this_ptr_conv.inner = untag_ptr(this_ptr);
51232 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51233 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51234 this_ptr_conv.is_owned = false;
51235 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_msat(&this_ptr_conv);
51239 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51240 LDKProbabilisticScoringParameters this_ptr_conv;
51241 this_ptr_conv.inner = untag_ptr(this_ptr);
51242 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51244 this_ptr_conv.is_owned = false;
51245 ProbabilisticScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
51248 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51249 LDKProbabilisticScoringParameters this_ptr_conv;
51250 this_ptr_conv.inner = untag_ptr(this_ptr);
51251 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51253 this_ptr_conv.is_owned = false;
51254 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv);
51258 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) {
51259 LDKProbabilisticScoringParameters this_ptr_conv;
51260 this_ptr_conv.inner = untag_ptr(this_ptr);
51261 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51262 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51263 this_ptr_conv.is_owned = false;
51264 ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val);
51267 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51268 LDKProbabilisticScoringParameters this_ptr_conv;
51269 this_ptr_conv.inner = untag_ptr(this_ptr);
51270 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51272 this_ptr_conv.is_owned = false;
51273 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv);
51277 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) {
51278 LDKProbabilisticScoringParameters this_ptr_conv;
51279 this_ptr_conv.inner = untag_ptr(this_ptr);
51280 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51281 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51282 this_ptr_conv.is_owned = false;
51283 ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
51286 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
51287 LDKProbabilisticScoringParameters this_ptr_conv;
51288 this_ptr_conv.inner = untag_ptr(this_ptr);
51289 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51290 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51291 this_ptr_conv.is_owned = false;
51292 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_offset_half_life(&this_ptr_conv);
51296 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) {
51297 LDKProbabilisticScoringParameters this_ptr_conv;
51298 this_ptr_conv.inner = untag_ptr(this_ptr);
51299 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51301 this_ptr_conv.is_owned = false;
51302 ProbabilisticScoringParameters_set_liquidity_offset_half_life(&this_ptr_conv, val);
51305 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51306 LDKProbabilisticScoringParameters this_ptr_conv;
51307 this_ptr_conv.inner = untag_ptr(this_ptr);
51308 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51309 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51310 this_ptr_conv.is_owned = false;
51311 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
51315 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) {
51316 LDKProbabilisticScoringParameters this_ptr_conv;
51317 this_ptr_conv.inner = untag_ptr(this_ptr);
51318 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51319 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51320 this_ptr_conv.is_owned = false;
51321 ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
51324 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51325 LDKProbabilisticScoringParameters this_ptr_conv;
51326 this_ptr_conv.inner = untag_ptr(this_ptr);
51327 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51329 this_ptr_conv.is_owned = false;
51330 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv);
51334 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51335 LDKProbabilisticScoringParameters this_ptr_conv;
51336 this_ptr_conv.inner = untag_ptr(this_ptr);
51337 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51339 this_ptr_conv.is_owned = false;
51340 ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
51343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51344 LDKProbabilisticScoringParameters this_ptr_conv;
51345 this_ptr_conv.inner = untag_ptr(this_ptr);
51346 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51348 this_ptr_conv.is_owned = false;
51349 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
51353 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51354 LDKProbabilisticScoringParameters this_ptr_conv;
51355 this_ptr_conv.inner = untag_ptr(this_ptr);
51356 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51357 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51358 this_ptr_conv.is_owned = false;
51359 ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
51362 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
51363 LDKProbabilisticScoringParameters this_ptr_conv;
51364 this_ptr_conv.inner = untag_ptr(this_ptr);
51365 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51367 this_ptr_conv.is_owned = false;
51368 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_no_updates_half_life(&this_ptr_conv);
51372 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51373 LDKProbabilisticScoringParameters this_ptr_conv;
51374 this_ptr_conv.inner = untag_ptr(this_ptr);
51375 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51376 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51377 this_ptr_conv.is_owned = false;
51378 ProbabilisticScoringParameters_set_historical_no_updates_half_life(&this_ptr_conv, val);
51381 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51382 LDKProbabilisticScoringParameters this_ptr_conv;
51383 this_ptr_conv.inner = untag_ptr(this_ptr);
51384 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51386 this_ptr_conv.is_owned = false;
51387 int64_t ret_conv = ProbabilisticScoringParameters_get_anti_probing_penalty_msat(&this_ptr_conv);
51391 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) {
51392 LDKProbabilisticScoringParameters this_ptr_conv;
51393 this_ptr_conv.inner = untag_ptr(this_ptr);
51394 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51396 this_ptr_conv.is_owned = false;
51397 ProbabilisticScoringParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val);
51400 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51401 LDKProbabilisticScoringParameters this_ptr_conv;
51402 this_ptr_conv.inner = untag_ptr(this_ptr);
51403 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51404 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51405 this_ptr_conv.is_owned = false;
51406 int64_t ret_conv = ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(&this_ptr_conv);
51410 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) {
51411 LDKProbabilisticScoringParameters this_ptr_conv;
51412 this_ptr_conv.inner = untag_ptr(this_ptr);
51413 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51415 this_ptr_conv.is_owned = false;
51416 ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val);
51419 static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) {
51420 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(arg);
51421 int64_t ret_ref = 0;
51422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51423 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51426 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51427 LDKProbabilisticScoringParameters arg_conv;
51428 arg_conv.inner = untag_ptr(arg);
51429 arg_conv.is_owned = ptr_is_owned(arg);
51430 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
51431 arg_conv.is_owned = false;
51432 int64_t ret_conv = ProbabilisticScoringParameters_clone_ptr(&arg_conv);
51436 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51437 LDKProbabilisticScoringParameters orig_conv;
51438 orig_conv.inner = untag_ptr(orig);
51439 orig_conv.is_owned = ptr_is_owned(orig);
51440 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
51441 orig_conv.is_owned = false;
51442 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(&orig_conv);
51443 int64_t ret_ref = 0;
51444 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51445 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51449 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) {
51450 LDKProbabilisticScoringParameters params_conv;
51451 params_conv.inner = untag_ptr(params);
51452 params_conv.is_owned = ptr_is_owned(params);
51453 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
51454 params_conv = ProbabilisticScoringParameters_clone(¶ms_conv);
51455 LDKNetworkGraph network_graph_conv;
51456 network_graph_conv.inner = untag_ptr(network_graph);
51457 network_graph_conv.is_owned = ptr_is_owned(network_graph);
51458 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
51459 network_graph_conv.is_owned = false;
51460 void* logger_ptr = untag_ptr(logger);
51461 CHECK_ACCESS(logger_ptr);
51462 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
51463 if (logger_conv.free == LDKLogger_JCalls_free) {
51464 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51465 LDKLogger_JCalls_cloned(&logger_conv);
51467 LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv);
51468 int64_t ret_ref = 0;
51469 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51470 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51474 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats(JNIEnv *env, jclass clz, int64_t this_arg) {
51475 LDKProbabilisticScorer this_arg_conv;
51476 this_arg_conv.inner = untag_ptr(this_arg);
51477 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51478 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51479 this_arg_conv.is_owned = false;
51480 ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv);
51483 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) {
51484 LDKProbabilisticScorer this_arg_conv;
51485 this_arg_conv.inner = untag_ptr(this_arg);
51486 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51487 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51488 this_arg_conv.is_owned = false;
51489 LDKNodeId target_conv;
51490 target_conv.inner = untag_ptr(target);
51491 target_conv.is_owned = ptr_is_owned(target);
51492 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
51493 target_conv.is_owned = false;
51494 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
51495 *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv);
51496 int64_t ret_ref = tag_ptr(ret_copy, true);
51500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1channel_1liquidity_1probabilities(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target) {
51501 LDKProbabilisticScorer this_arg_conv;
51502 this_arg_conv.inner = untag_ptr(this_arg);
51503 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51505 this_arg_conv.is_owned = false;
51506 LDKNodeId target_conv;
51507 target_conv.inner = untag_ptr(target);
51508 target_conv.is_owned = ptr_is_owned(target);
51509 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
51510 target_conv.is_owned = false;
51511 LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
51512 *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv);
51513 int64_t ret_ref = tag_ptr(ret_copy, true);
51517 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1add_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
51518 LDKProbabilisticScorer this_arg_conv;
51519 this_arg_conv.inner = untag_ptr(this_arg);
51520 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51521 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51522 this_arg_conv.is_owned = false;
51523 LDKNodeId node_id_conv;
51524 node_id_conv.inner = untag_ptr(node_id);
51525 node_id_conv.is_owned = ptr_is_owned(node_id);
51526 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
51527 node_id_conv.is_owned = false;
51528 ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv);
51531 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1remove_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
51532 LDKProbabilisticScorer this_arg_conv;
51533 this_arg_conv.inner = untag_ptr(this_arg);
51534 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51535 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51536 this_arg_conv.is_owned = false;
51537 LDKNodeId node_id_conv;
51538 node_id_conv.inner = untag_ptr(node_id);
51539 node_id_conv.is_owned = ptr_is_owned(node_id);
51540 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
51541 node_id_conv.is_owned = false;
51542 ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv);
51545 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) {
51546 LDKProbabilisticScorer this_arg_conv;
51547 this_arg_conv.inner = untag_ptr(this_arg);
51548 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51549 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51550 this_arg_conv.is_owned = false;
51551 LDKNodeId node_id_conv;
51552 node_id_conv.inner = untag_ptr(node_id);
51553 node_id_conv.is_owned = ptr_is_owned(node_id);
51554 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
51555 node_id_conv.is_owned = false;
51556 ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty);
51559 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1remove_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
51560 LDKProbabilisticScorer this_arg_conv;
51561 this_arg_conv.inner = untag_ptr(this_arg);
51562 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51564 this_arg_conv.is_owned = false;
51565 LDKNodeId node_id_conv;
51566 node_id_conv.inner = untag_ptr(node_id);
51567 node_id_conv.is_owned = ptr_is_owned(node_id);
51568 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
51569 node_id_conv.is_owned = false;
51570 ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv);
51573 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1clear_1manual_1penalties(JNIEnv *env, jclass clz, int64_t this_arg) {
51574 LDKProbabilisticScorer this_arg_conv;
51575 this_arg_conv.inner = untag_ptr(this_arg);
51576 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51577 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51578 this_arg_conv.is_owned = false;
51579 ProbabilisticScorer_clear_manual_penalties(&this_arg_conv);
51582 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) {
51583 LDKProbabilisticScoringParameters this_arg_conv;
51584 this_arg_conv.inner = untag_ptr(this_arg);
51585 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51587 this_arg_conv.is_owned = false;
51588 LDKCVec_NodeIdZ node_ids_constr;
51589 node_ids_constr.datalen = (*env)->GetArrayLength(env, node_ids);
51590 if (node_ids_constr.datalen > 0)
51591 node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
51593 node_ids_constr.data = NULL;
51594 int64_t* node_ids_vals = (*env)->GetLongArrayElements (env, node_ids, NULL);
51595 for (size_t i = 0; i < node_ids_constr.datalen; i++) {
51596 int64_t node_ids_conv_8 = node_ids_vals[i];
51597 LDKNodeId node_ids_conv_8_conv;
51598 node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8);
51599 node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8);
51600 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv);
51601 node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv);
51602 node_ids_constr.data[i] = node_ids_conv_8_conv;
51604 (*env)->ReleaseLongArrayElements(env, node_ids, node_ids_vals, 0);
51605 ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr);
51608 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1default(JNIEnv *env, jclass clz) {
51609 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default();
51610 int64_t ret_ref = 0;
51611 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51612 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51616 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
51617 LDKProbabilisticScorer this_arg_conv;
51618 this_arg_conv.inner = untag_ptr(this_arg);
51619 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51620 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51621 this_arg_conv.is_owned = false;
51622 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
51623 *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv);
51624 return tag_ptr(ret_ret, true);
51627 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1write(JNIEnv *env, jclass clz, int64_t obj) {
51628 LDKProbabilisticScorer obj_conv;
51629 obj_conv.inner = untag_ptr(obj);
51630 obj_conv.is_owned = ptr_is_owned(obj);
51631 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
51632 obj_conv.is_owned = false;
51633 LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv);
51634 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
51635 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
51636 CVec_u8Z_free(ret_var);
51640 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) {
51641 LDKu8slice ser_ref;
51642 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
51643 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
51644 LDKProbabilisticScoringParameters arg_a_conv;
51645 arg_a_conv.inner = untag_ptr(arg_a);
51646 arg_a_conv.is_owned = ptr_is_owned(arg_a);
51647 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv);
51648 arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv);
51649 LDKNetworkGraph arg_b_conv;
51650 arg_b_conv.inner = untag_ptr(arg_b);
51651 arg_b_conv.is_owned = ptr_is_owned(arg_b);
51652 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv);
51653 arg_b_conv.is_owned = false;
51654 void* arg_c_ptr = untag_ptr(arg_c);
51655 CHECK_ACCESS(arg_c_ptr);
51656 LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr);
51657 if (arg_c_conv.free == LDKLogger_JCalls_free) {
51658 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51659 LDKLogger_JCalls_cloned(&arg_c_conv);
51661 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
51662 *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
51663 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
51664 return tag_ptr(ret_conv, true);
51667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51668 LDKBlindedPath this_obj_conv;
51669 this_obj_conv.inner = untag_ptr(this_obj);
51670 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51672 BlindedPath_free(this_obj_conv);
51675 static inline uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg) {
51676 LDKBlindedPath ret_var = BlindedPath_clone(arg);
51677 int64_t ret_ref = 0;
51678 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51679 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51682 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51683 LDKBlindedPath arg_conv;
51684 arg_conv.inner = untag_ptr(arg);
51685 arg_conv.is_owned = ptr_is_owned(arg);
51686 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
51687 arg_conv.is_owned = false;
51688 int64_t ret_conv = BlindedPath_clone_ptr(&arg_conv);
51692 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51693 LDKBlindedPath orig_conv;
51694 orig_conv.inner = untag_ptr(orig);
51695 orig_conv.is_owned = ptr_is_owned(orig);
51696 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
51697 orig_conv.is_owned = false;
51698 LDKBlindedPath ret_var = BlindedPath_clone(&orig_conv);
51699 int64_t ret_ref = 0;
51700 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51701 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51706 LDKBlindedHop this_obj_conv;
51707 this_obj_conv.inner = untag_ptr(this_obj);
51708 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51709 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51710 BlindedHop_free(this_obj_conv);
51713 static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) {
51714 LDKBlindedHop ret_var = BlindedHop_clone(arg);
51715 int64_t ret_ref = 0;
51716 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51717 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51721 LDKBlindedHop arg_conv;
51722 arg_conv.inner = untag_ptr(arg);
51723 arg_conv.is_owned = ptr_is_owned(arg);
51724 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
51725 arg_conv.is_owned = false;
51726 int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv);
51730 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51731 LDKBlindedHop orig_conv;
51732 orig_conv.inner = untag_ptr(orig);
51733 orig_conv.is_owned = ptr_is_owned(orig);
51734 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
51735 orig_conv.is_owned = false;
51736 LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv);
51737 int64_t ret_ref = 0;
51738 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51739 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51743 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new(JNIEnv *env, jclass clz, jobjectArray node_pks, int64_t entropy_source) {
51744 LDKCVec_PublicKeyZ node_pks_constr;
51745 node_pks_constr.datalen = (*env)->GetArrayLength(env, node_pks);
51746 if (node_pks_constr.datalen > 0)
51747 node_pks_constr.data = MALLOC(node_pks_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
51749 node_pks_constr.data = NULL;
51750 for (size_t i = 0; i < node_pks_constr.datalen; i++) {
51751 int8_tArray node_pks_conv_8 = (*env)->GetObjectArrayElement(env, node_pks, i);
51752 LDKPublicKey node_pks_conv_8_ref;
51753 CHECK((*env)->GetArrayLength(env, node_pks_conv_8) == 33);
51754 (*env)->GetByteArrayRegion(env, node_pks_conv_8, 0, 33, node_pks_conv_8_ref.compressed_form);
51755 node_pks_constr.data[i] = node_pks_conv_8_ref;
51757 void* entropy_source_ptr = untag_ptr(entropy_source);
51758 if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); }
51759 LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr;
51760 LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
51761 *ret_conv = BlindedPath_new(node_pks_constr, entropy_source_conv);
51762 return tag_ptr(ret_conv, true);
51765 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1write(JNIEnv *env, jclass clz, int64_t obj) {
51766 LDKBlindedPath obj_conv;
51767 obj_conv.inner = untag_ptr(obj);
51768 obj_conv.is_owned = ptr_is_owned(obj);
51769 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
51770 obj_conv.is_owned = false;
51771 LDKCVec_u8Z ret_var = BlindedPath_write(&obj_conv);
51772 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
51773 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
51774 CVec_u8Z_free(ret_var);
51778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
51779 LDKu8slice ser_ref;
51780 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
51781 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
51782 LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
51783 *ret_conv = BlindedPath_read(ser_ref);
51784 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
51785 return tag_ptr(ret_conv, true);
51788 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
51789 LDKBlindedHop obj_conv;
51790 obj_conv.inner = untag_ptr(obj);
51791 obj_conv.is_owned = ptr_is_owned(obj);
51792 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
51793 obj_conv.is_owned = false;
51794 LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv);
51795 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
51796 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
51797 CVec_u8Z_free(ret_var);
51801 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
51802 LDKu8slice ser_ref;
51803 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
51804 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
51805 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
51806 *ret_conv = BlindedHop_read(ser_ref);
51807 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
51808 return tag_ptr(ret_conv, true);
51811 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51812 LDKOnionMessenger this_obj_conv;
51813 this_obj_conv.inner = untag_ptr(this_obj);
51814 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51815 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51816 OnionMessenger_free(this_obj_conv);
51819 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
51820 if (!ptr_is_owned(this_ptr)) return;
51821 void* this_ptr_ptr = untag_ptr(this_ptr);
51822 CHECK_ACCESS(this_ptr_ptr);
51823 LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr);
51824 FREE(untag_ptr(this_ptr));
51825 Destination_free(this_ptr_conv);
51828 static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) {
51829 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
51830 *ret_copy = Destination_clone(arg);
51831 int64_t ret_ref = tag_ptr(ret_copy, true);
51834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51835 LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg);
51836 int64_t ret_conv = Destination_clone_ptr(arg_conv);
51840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51841 LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig);
51842 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
51843 *ret_copy = Destination_clone(orig_conv);
51844 int64_t ret_ref = tag_ptr(ret_copy, true);
51848 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *env, jclass clz, int8_tArray a) {
51849 LDKPublicKey a_ref;
51850 CHECK((*env)->GetArrayLength(env, a) == 33);
51851 (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
51852 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
51853 *ret_copy = Destination_node(a_ref);
51854 int64_t ret_ref = tag_ptr(ret_copy, true);
51858 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path(JNIEnv *env, jclass clz, int64_t a) {
51859 LDKBlindedPath a_conv;
51860 a_conv.inner = untag_ptr(a);
51861 a_conv.is_owned = ptr_is_owned(a);
51862 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
51863 a_conv = BlindedPath_clone(&a_conv);
51864 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
51865 *ret_copy = Destination_blinded_path(a_conv);
51866 int64_t ret_ref = tag_ptr(ret_copy, true);
51870 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
51871 if (!ptr_is_owned(this_ptr)) return;
51872 void* this_ptr_ptr = untag_ptr(this_ptr);
51873 CHECK_ACCESS(this_ptr_ptr);
51874 LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr);
51875 FREE(untag_ptr(this_ptr));
51876 SendError_free(this_ptr_conv);
51879 static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) {
51880 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
51881 *ret_copy = SendError_clone(arg);
51882 int64_t ret_ref = tag_ptr(ret_copy, true);
51885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51886 LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg);
51887 int64_t ret_conv = SendError_clone_ptr(arg_conv);
51891 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51892 LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig);
51893 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
51894 *ret_copy = SendError_clone(orig_conv);
51895 int64_t ret_ref = tag_ptr(ret_copy, true);
51899 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1secp256k1(JNIEnv *env, jclass clz, jclass a) {
51900 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a);
51901 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
51902 *ret_copy = SendError_secp256k1(a_conv);
51903 int64_t ret_ref = tag_ptr(ret_copy, true);
51907 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1big_1packet(JNIEnv *env, jclass clz) {
51908 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
51909 *ret_copy = SendError_too_big_packet();
51910 int64_t ret_ref = tag_ptr(ret_copy, true);
51914 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1few_1blinded_1hops(JNIEnv *env, jclass clz) {
51915 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
51916 *ret_copy = SendError_too_few_blinded_hops();
51917 int64_t ret_ref = tag_ptr(ret_copy, true);
51921 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1first_1hop(JNIEnv *env, jclass clz) {
51922 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
51923 *ret_copy = SendError_invalid_first_hop();
51924 int64_t ret_ref = tag_ptr(ret_copy, true);
51928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message(JNIEnv *env, jclass clz) {
51929 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
51930 *ret_copy = SendError_invalid_message();
51931 int64_t ret_ref = tag_ptr(ret_copy, true);
51935 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNIEnv *env, jclass clz) {
51936 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
51937 *ret_copy = SendError_buffer_full();
51938 int64_t ret_ref = tag_ptr(ret_copy, true);
51942 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed(JNIEnv *env, jclass clz) {
51943 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
51944 *ret_copy = SendError_get_node_id_failed();
51945 int64_t ret_ref = tag_ptr(ret_copy, true);
51949 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed(JNIEnv *env, jclass clz) {
51950 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
51951 *ret_copy = SendError_blinded_path_advance_failed();
51952 int64_t ret_ref = tag_ptr(ret_copy, true);
51956 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
51957 LDKSendError* a_conv = (LDKSendError*)untag_ptr(a);
51958 LDKSendError* b_conv = (LDKSendError*)untag_ptr(b);
51959 jboolean ret_conv = SendError_eq(a_conv, b_conv);
51963 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
51964 if (!ptr_is_owned(this_ptr)) return;
51965 void* this_ptr_ptr = untag_ptr(this_ptr);
51966 CHECK_ACCESS(this_ptr_ptr);
51967 LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr);
51968 FREE(untag_ptr(this_ptr));
51969 CustomOnionMessageHandler_free(this_ptr_conv);
51972 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t custom_handler) {
51973 void* entropy_source_ptr = untag_ptr(entropy_source);
51974 CHECK_ACCESS(entropy_source_ptr);
51975 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
51976 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
51977 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51978 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
51980 void* node_signer_ptr = untag_ptr(node_signer);
51981 CHECK_ACCESS(node_signer_ptr);
51982 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
51983 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
51984 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51985 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
51987 void* logger_ptr = untag_ptr(logger);
51988 CHECK_ACCESS(logger_ptr);
51989 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
51990 if (logger_conv.free == LDKLogger_JCalls_free) {
51991 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51992 LDKLogger_JCalls_cloned(&logger_conv);
51994 void* custom_handler_ptr = untag_ptr(custom_handler);
51995 CHECK_ACCESS(custom_handler_ptr);
51996 LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr);
51997 if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) {
51998 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
51999 LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv);
52001 LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, custom_handler_conv);
52002 int64_t ret_ref = 0;
52003 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52004 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52008 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, jobjectArray intermediate_nodes, int64_t destination, int64_t message, int64_t reply_path) {
52009 LDKOnionMessenger this_arg_conv;
52010 this_arg_conv.inner = untag_ptr(this_arg);
52011 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52012 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52013 this_arg_conv.is_owned = false;
52014 LDKCVec_PublicKeyZ intermediate_nodes_constr;
52015 intermediate_nodes_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes);
52016 if (intermediate_nodes_constr.datalen > 0)
52017 intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
52019 intermediate_nodes_constr.data = NULL;
52020 for (size_t i = 0; i < intermediate_nodes_constr.datalen; i++) {
52021 int8_tArray intermediate_nodes_conv_8 = (*env)->GetObjectArrayElement(env, intermediate_nodes, i);
52022 LDKPublicKey intermediate_nodes_conv_8_ref;
52023 CHECK((*env)->GetArrayLength(env, intermediate_nodes_conv_8) == 33);
52024 (*env)->GetByteArrayRegion(env, intermediate_nodes_conv_8, 0, 33, intermediate_nodes_conv_8_ref.compressed_form);
52025 intermediate_nodes_constr.data[i] = intermediate_nodes_conv_8_ref;
52027 void* destination_ptr = untag_ptr(destination);
52028 CHECK_ACCESS(destination_ptr);
52029 LDKDestination destination_conv = *(LDKDestination*)(destination_ptr);
52030 destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination));
52031 void* message_ptr = untag_ptr(message);
52032 CHECK_ACCESS(message_ptr);
52033 LDKOnionMessageContents message_conv = *(LDKOnionMessageContents*)(message_ptr);
52034 message_conv = OnionMessageContents_clone((LDKOnionMessageContents*)untag_ptr(message));
52035 LDKBlindedPath reply_path_conv;
52036 reply_path_conv.inner = untag_ptr(reply_path);
52037 reply_path_conv.is_owned = ptr_is_owned(reply_path);
52038 CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv);
52039 reply_path_conv = BlindedPath_clone(&reply_path_conv);
52040 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
52041 *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, message_conv, reply_path_conv);
52042 return tag_ptr(ret_conv, true);
52045 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
52046 LDKOnionMessenger this_arg_conv;
52047 this_arg_conv.inner = untag_ptr(this_arg);
52048 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52050 this_arg_conv.is_owned = false;
52051 LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
52052 *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv);
52053 return tag_ptr(ret_ret, true);
52056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
52057 LDKOnionMessenger this_arg_conv;
52058 this_arg_conv.inner = untag_ptr(this_arg);
52059 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52060 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52061 this_arg_conv.is_owned = false;
52062 LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
52063 *ret_ret = OnionMessenger_as_OnionMessageProvider(&this_arg_conv);
52064 return tag_ptr(ret_ret, true);
52067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
52068 if (!ptr_is_owned(this_ptr)) return;
52069 void* this_ptr_ptr = untag_ptr(this_ptr);
52070 CHECK_ACCESS(this_ptr_ptr);
52071 LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr);
52072 FREE(untag_ptr(this_ptr));
52073 OnionMessageContents_free(this_ptr_conv);
52076 static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) {
52077 LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents");
52078 *ret_copy = OnionMessageContents_clone(arg);
52079 int64_t ret_ref = tag_ptr(ret_copy, true);
52082 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52083 LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)untag_ptr(arg);
52084 int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv);
52088 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52089 LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)untag_ptr(orig);
52090 LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents");
52091 *ret_copy = OnionMessageContents_clone(orig_conv);
52092 int64_t ret_ref = tag_ptr(ret_copy, true);
52096 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1custom(JNIEnv *env, jclass clz, int64_t a) {
52097 void* a_ptr = untag_ptr(a);
52098 CHECK_ACCESS(a_ptr);
52099 LDKCustomOnionMessageContents a_conv = *(LDKCustomOnionMessageContents*)(a_ptr);
52100 if (a_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
52101 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
52102 LDKCustomOnionMessageContents_JCalls_cloned(&a_conv);
52104 LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents");
52105 *ret_copy = OnionMessageContents_custom(a_conv);
52106 int64_t ret_ref = tag_ptr(ret_copy, true);
52110 static inline uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg) {
52111 LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
52112 *ret_ret = CustomOnionMessageContents_clone(arg);
52113 return tag_ptr(ret_ret, true);
52115 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52116 void* arg_ptr = untag_ptr(arg);
52117 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
52118 LDKCustomOnionMessageContents* arg_conv = (LDKCustomOnionMessageContents*)arg_ptr;
52119 int64_t ret_conv = CustomOnionMessageContents_clone_ptr(arg_conv);
52123 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52124 void* orig_ptr = untag_ptr(orig);
52125 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
52126 LDKCustomOnionMessageContents* orig_conv = (LDKCustomOnionMessageContents*)orig_ptr;
52127 LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
52128 *ret_ret = CustomOnionMessageContents_clone(orig_conv);
52129 return tag_ptr(ret_ret, true);
52132 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
52133 if (!ptr_is_owned(this_ptr)) return;
52134 void* this_ptr_ptr = untag_ptr(this_ptr);
52135 CHECK_ACCESS(this_ptr_ptr);
52136 LDKCustomOnionMessageContents this_ptr_conv = *(LDKCustomOnionMessageContents*)(this_ptr_ptr);
52137 FREE(untag_ptr(this_ptr));
52138 CustomOnionMessageContents_free(this_ptr_conv);
52141 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52142 LDKFilesystemPersister this_obj_conv;
52143 this_obj_conv.inner = untag_ptr(this_obj);
52144 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52146 FilesystemPersister_free(this_obj_conv);
52149 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1new(JNIEnv *env, jclass clz, jstring path_to_channel_data) {
52150 LDKStr path_to_channel_data_conv = java_to_owned_str(env, path_to_channel_data);
52151 LDKFilesystemPersister ret_var = FilesystemPersister_new(path_to_channel_data_conv);
52152 int64_t ret_ref = 0;
52153 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52154 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52158 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1data_1dir(JNIEnv *env, jclass clz, int64_t this_arg) {
52159 LDKFilesystemPersister this_arg_conv;
52160 this_arg_conv.inner = untag_ptr(this_arg);
52161 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52162 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52163 this_arg_conv.is_owned = false;
52164 LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv);
52165 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
52170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1channelmonitors(JNIEnv *env, jclass clz, int64_t this_arg, int64_t entropy_source, int64_t signer_provider) {
52171 LDKFilesystemPersister this_arg_conv;
52172 this_arg_conv.inner = untag_ptr(this_arg);
52173 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52175 this_arg_conv.is_owned = false;
52176 void* entropy_source_ptr = untag_ptr(entropy_source);
52177 CHECK_ACCESS(entropy_source_ptr);
52178 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
52179 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
52180 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
52181 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
52183 void* signer_provider_ptr = untag_ptr(signer_provider);
52184 if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); }
52185 LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr;
52186 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
52187 *ret_conv = FilesystemPersister_read_channelmonitors(&this_arg_conv, entropy_source_conv, signer_provider_conv);
52188 return tag_ptr(ret_conv, true);
52191 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52192 LDKBackgroundProcessor this_obj_conv;
52193 this_obj_conv.inner = untag_ptr(this_obj);
52194 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52196 BackgroundProcessor_free(this_obj_conv);
52199 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipSync_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
52200 if (!ptr_is_owned(this_ptr)) return;
52201 void* this_ptr_ptr = untag_ptr(this_ptr);
52202 CHECK_ACCESS(this_ptr_ptr);
52203 LDKGossipSync this_ptr_conv = *(LDKGossipSync*)(this_ptr_ptr);
52204 FREE(untag_ptr(this_ptr));
52205 GossipSync_free(this_ptr_conv);
52208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1p2_1p(JNIEnv *env, jclass clz, int64_t a) {
52209 LDKP2PGossipSync a_conv;
52210 a_conv.inner = untag_ptr(a);
52211 a_conv.is_owned = ptr_is_owned(a);
52212 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
52213 a_conv.is_owned = false;
52214 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
52215 *ret_copy = GossipSync_p2_p(&a_conv);
52216 int64_t ret_ref = tag_ptr(ret_copy, true);
52220 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1rapid(JNIEnv *env, jclass clz, int64_t a) {
52221 LDKRapidGossipSync a_conv;
52222 a_conv.inner = untag_ptr(a);
52223 a_conv.is_owned = ptr_is_owned(a);
52224 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
52225 a_conv.is_owned = false;
52226 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
52227 *ret_copy = GossipSync_rapid(&a_conv);
52228 int64_t ret_ref = tag_ptr(ret_copy, true);
52232 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1none(JNIEnv *env, jclass clz) {
52233 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
52234 *ret_copy = GossipSync_none();
52235 int64_t ret_ref = tag_ptr(ret_copy, true);
52239 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) {
52240 void* persister_ptr = untag_ptr(persister);
52241 CHECK_ACCESS(persister_ptr);
52242 LDKPersister persister_conv = *(LDKPersister*)(persister_ptr);
52243 if (persister_conv.free == LDKPersister_JCalls_free) {
52244 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
52245 LDKPersister_JCalls_cloned(&persister_conv);
52247 void* event_handler_ptr = untag_ptr(event_handler);
52248 CHECK_ACCESS(event_handler_ptr);
52249 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
52250 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
52251 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
52252 LDKEventHandler_JCalls_cloned(&event_handler_conv);
52254 LDKChainMonitor chain_monitor_conv;
52255 chain_monitor_conv.inner = untag_ptr(chain_monitor);
52256 chain_monitor_conv.is_owned = ptr_is_owned(chain_monitor);
52257 CHECK_INNER_FIELD_ACCESS_OR_NULL(chain_monitor_conv);
52258 chain_monitor_conv.is_owned = false;
52259 LDKChannelManager channel_manager_conv;
52260 channel_manager_conv.inner = untag_ptr(channel_manager);
52261 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
52262 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
52263 channel_manager_conv.is_owned = false;
52264 void* gossip_sync_ptr = untag_ptr(gossip_sync);
52265 CHECK_ACCESS(gossip_sync_ptr);
52266 LDKGossipSync gossip_sync_conv = *(LDKGossipSync*)(gossip_sync_ptr);
52267 // WARNING: we may need a move here but no clone is available for LDKGossipSync
52268 LDKPeerManager peer_manager_conv;
52269 peer_manager_conv.inner = untag_ptr(peer_manager);
52270 peer_manager_conv.is_owned = ptr_is_owned(peer_manager);
52271 CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_manager_conv);
52272 peer_manager_conv.is_owned = false;
52273 void* logger_ptr = untag_ptr(logger);
52274 CHECK_ACCESS(logger_ptr);
52275 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
52276 if (logger_conv.free == LDKLogger_JCalls_free) {
52277 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
52278 LDKLogger_JCalls_cloned(&logger_conv);
52280 void* scorer_ptr = untag_ptr(scorer);
52281 CHECK_ACCESS(scorer_ptr);
52282 LDKCOption_WriteableScoreZ scorer_conv = *(LDKCOption_WriteableScoreZ*)(scorer_ptr);
52283 // WARNING: we may need a move here but no clone is available for LDKCOption_WriteableScoreZ
52284 if (scorer_conv.tag == LDKCOption_WriteableScoreZ_Some) {
52285 // Manually implement clone for Java trait instances
52286 if (scorer_conv.some.free == LDKWriteableScore_JCalls_free) {
52287 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
52288 LDKWriteableScore_JCalls_cloned(&scorer_conv.some);
52291 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);
52292 int64_t ret_ref = 0;
52293 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52294 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52298 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1join(JNIEnv *env, jclass clz, int64_t this_arg) {
52299 LDKBackgroundProcessor this_arg_conv;
52300 this_arg_conv.inner = untag_ptr(this_arg);
52301 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52302 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52303 // WARNING: we need a move here but no clone is available for LDKBackgroundProcessor
52305 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
52306 *ret_conv = BackgroundProcessor_join(this_arg_conv);
52307 return tag_ptr(ret_conv, true);
52310 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1stop(JNIEnv *env, jclass clz, int64_t this_arg) {
52311 LDKBackgroundProcessor this_arg_conv;
52312 this_arg_conv.inner = untag_ptr(this_arg);
52313 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52314 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52315 // WARNING: we need a move here but no clone is available for LDKBackgroundProcessor
52317 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
52318 *ret_conv = BackgroundProcessor_stop(this_arg_conv);
52319 return tag_ptr(ret_conv, true);
52322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
52323 if (!ptr_is_owned(this_ptr)) return;
52324 void* this_ptr_ptr = untag_ptr(this_ptr);
52325 CHECK_ACCESS(this_ptr_ptr);
52326 LDKParseError this_ptr_conv = *(LDKParseError*)(this_ptr_ptr);
52327 FREE(untag_ptr(this_ptr));
52328 ParseError_free(this_ptr_conv);
52331 static inline uint64_t ParseError_clone_ptr(LDKParseError *NONNULL_PTR arg) {
52332 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52333 *ret_copy = ParseError_clone(arg);
52334 int64_t ret_ref = tag_ptr(ret_copy, true);
52337 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52338 LDKParseError* arg_conv = (LDKParseError*)untag_ptr(arg);
52339 int64_t ret_conv = ParseError_clone_ptr(arg_conv);
52343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52344 LDKParseError* orig_conv = (LDKParseError*)untag_ptr(orig);
52345 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52346 *ret_copy = ParseError_clone(orig_conv);
52347 int64_t ret_ref = tag_ptr(ret_copy, true);
52351 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1bech32_1error(JNIEnv *env, jclass clz, int64_t a) {
52352 void* a_ptr = untag_ptr(a);
52353 CHECK_ACCESS(a_ptr);
52354 LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr);
52355 a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a));
52356 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52357 *ret_copy = ParseError_bech32_error(a_conv);
52358 int64_t ret_ref = tag_ptr(ret_copy, true);
52362 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1parse_1amount_1error(JNIEnv *env, jclass clz, int32_t a) {
52364 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52365 *ret_copy = ParseError_parse_amount_error((LDKError){ ._dummy = 0 });
52366 int64_t ret_ref = tag_ptr(ret_copy, true);
52370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1malformed_1signature(JNIEnv *env, jclass clz, jclass a) {
52371 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a);
52372 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52373 *ret_copy = ParseError_malformed_signature(a_conv);
52374 int64_t ret_ref = tag_ptr(ret_copy, true);
52378 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1bad_1prefix(JNIEnv *env, jclass clz) {
52379 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52380 *ret_copy = ParseError_bad_prefix();
52381 int64_t ret_ref = tag_ptr(ret_copy, true);
52385 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unknown_1currency(JNIEnv *env, jclass clz) {
52386 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52387 *ret_copy = ParseError_unknown_currency();
52388 int64_t ret_ref = tag_ptr(ret_copy, true);
52392 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unknown_1si_1prefix(JNIEnv *env, jclass clz) {
52393 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52394 *ret_copy = ParseError_unknown_si_prefix();
52395 int64_t ret_ref = tag_ptr(ret_copy, true);
52399 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1malformed_1hrp(JNIEnv *env, jclass clz) {
52400 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52401 *ret_copy = ParseError_malformed_hrp();
52402 int64_t ret_ref = tag_ptr(ret_copy, true);
52406 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1too_1short_1data_1part(JNIEnv *env, jclass clz) {
52407 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52408 *ret_copy = ParseError_too_short_data_part();
52409 int64_t ret_ref = tag_ptr(ret_copy, true);
52413 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unexpected_1end_1of_1tagged_1fields(JNIEnv *env, jclass clz) {
52414 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52415 *ret_copy = ParseError_unexpected_end_of_tagged_fields();
52416 int64_t ret_ref = tag_ptr(ret_copy, true);
52420 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1description_1decode_1error(JNIEnv *env, jclass clz, int32_t a) {
52422 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52423 *ret_copy = ParseError_description_decode_error((LDKError){ ._dummy = 0 });
52424 int64_t ret_ref = tag_ptr(ret_copy, true);
52428 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1padding_1error(JNIEnv *env, jclass clz) {
52429 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52430 *ret_copy = ParseError_padding_error();
52431 int64_t ret_ref = tag_ptr(ret_copy, true);
52435 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1integer_1overflow_1error(JNIEnv *env, jclass clz) {
52436 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52437 *ret_copy = ParseError_integer_overflow_error();
52438 int64_t ret_ref = tag_ptr(ret_copy, true);
52442 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1seg_1wit_1program_1length(JNIEnv *env, jclass clz) {
52443 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52444 *ret_copy = ParseError_invalid_seg_wit_program_length();
52445 int64_t ret_ref = tag_ptr(ret_copy, true);
52449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1pub_1key_1hash_1length(JNIEnv *env, jclass clz) {
52450 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52451 *ret_copy = ParseError_invalid_pub_key_hash_length();
52452 int64_t ret_ref = tag_ptr(ret_copy, true);
52456 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1script_1hash_1length(JNIEnv *env, jclass clz) {
52457 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52458 *ret_copy = ParseError_invalid_script_hash_length();
52459 int64_t ret_ref = tag_ptr(ret_copy, true);
52463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) {
52464 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52465 *ret_copy = ParseError_invalid_recovery_id();
52466 int64_t ret_ref = tag_ptr(ret_copy, true);
52470 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1slice_1length(JNIEnv *env, jclass clz, jstring a) {
52471 LDKStr a_conv = java_to_owned_str(env, a);
52472 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52473 *ret_copy = ParseError_invalid_slice_length(a_conv);
52474 int64_t ret_ref = tag_ptr(ret_copy, true);
52478 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1skip(JNIEnv *env, jclass clz) {
52479 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
52480 *ret_copy = ParseError_skip();
52481 int64_t ret_ref = tag_ptr(ret_copy, true);
52485 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52486 LDKParseError* a_conv = (LDKParseError*)untag_ptr(a);
52487 LDKParseError* b_conv = (LDKParseError*)untag_ptr(b);
52488 jboolean ret_conv = ParseError_eq(a_conv, b_conv);
52492 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
52493 if (!ptr_is_owned(this_ptr)) return;
52494 void* this_ptr_ptr = untag_ptr(this_ptr);
52495 CHECK_ACCESS(this_ptr_ptr);
52496 LDKParseOrSemanticError this_ptr_conv = *(LDKParseOrSemanticError*)(this_ptr_ptr);
52497 FREE(untag_ptr(this_ptr));
52498 ParseOrSemanticError_free(this_ptr_conv);
52501 static inline uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg) {
52502 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
52503 *ret_copy = ParseOrSemanticError_clone(arg);
52504 int64_t ret_ref = tag_ptr(ret_copy, true);
52507 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52508 LDKParseOrSemanticError* arg_conv = (LDKParseOrSemanticError*)untag_ptr(arg);
52509 int64_t ret_conv = ParseOrSemanticError_clone_ptr(arg_conv);
52513 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52514 LDKParseOrSemanticError* orig_conv = (LDKParseOrSemanticError*)untag_ptr(orig);
52515 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
52516 *ret_copy = ParseOrSemanticError_clone(orig_conv);
52517 int64_t ret_ref = tag_ptr(ret_copy, true);
52521 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1parse_1error(JNIEnv *env, jclass clz, int64_t a) {
52522 void* a_ptr = untag_ptr(a);
52523 CHECK_ACCESS(a_ptr);
52524 LDKParseError a_conv = *(LDKParseError*)(a_ptr);
52525 a_conv = ParseError_clone((LDKParseError*)untag_ptr(a));
52526 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
52527 *ret_copy = ParseOrSemanticError_parse_error(a_conv);
52528 int64_t ret_ref = tag_ptr(ret_copy, true);
52532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1semantic_1error(JNIEnv *env, jclass clz, jclass a) {
52533 LDKSemanticError a_conv = LDKSemanticError_from_java(env, a);
52534 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
52535 *ret_copy = ParseOrSemanticError_semantic_error(a_conv);
52536 int64_t ret_ref = tag_ptr(ret_copy, true);
52540 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52541 LDKParseOrSemanticError* a_conv = (LDKParseOrSemanticError*)untag_ptr(a);
52542 LDKParseOrSemanticError* b_conv = (LDKParseOrSemanticError*)untag_ptr(b);
52543 jboolean ret_conv = ParseOrSemanticError_eq(a_conv, b_conv);
52547 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52548 LDKInvoice this_obj_conv;
52549 this_obj_conv.inner = untag_ptr(this_obj);
52550 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52552 Invoice_free(this_obj_conv);
52555 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52557 a_conv.inner = untag_ptr(a);
52558 a_conv.is_owned = ptr_is_owned(a);
52559 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
52560 a_conv.is_owned = false;
52562 b_conv.inner = untag_ptr(b);
52563 b_conv.is_owned = ptr_is_owned(b);
52564 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
52565 b_conv.is_owned = false;
52566 jboolean ret_conv = Invoice_eq(&a_conv, &b_conv);
52570 static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) {
52571 LDKInvoice ret_var = Invoice_clone(arg);
52572 int64_t ret_ref = 0;
52573 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52574 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52577 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52578 LDKInvoice arg_conv;
52579 arg_conv.inner = untag_ptr(arg);
52580 arg_conv.is_owned = ptr_is_owned(arg);
52581 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
52582 arg_conv.is_owned = false;
52583 int64_t ret_conv = Invoice_clone_ptr(&arg_conv);
52587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52588 LDKInvoice orig_conv;
52589 orig_conv.inner = untag_ptr(orig);
52590 orig_conv.is_owned = ptr_is_owned(orig);
52591 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
52592 orig_conv.is_owned = false;
52593 LDKInvoice ret_var = Invoice_clone(&orig_conv);
52594 int64_t ret_ref = 0;
52595 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52596 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52600 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1hash(JNIEnv *env, jclass clz, int64_t o) {
52602 o_conv.inner = untag_ptr(o);
52603 o_conv.is_owned = ptr_is_owned(o);
52604 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
52605 o_conv.is_owned = false;
52606 int64_t ret_conv = Invoice_hash(&o_conv);
52610 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52611 LDKSignedRawInvoice this_obj_conv;
52612 this_obj_conv.inner = untag_ptr(this_obj);
52613 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52614 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52615 SignedRawInvoice_free(this_obj_conv);
52618 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52619 LDKSignedRawInvoice a_conv;
52620 a_conv.inner = untag_ptr(a);
52621 a_conv.is_owned = ptr_is_owned(a);
52622 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
52623 a_conv.is_owned = false;
52624 LDKSignedRawInvoice b_conv;
52625 b_conv.inner = untag_ptr(b);
52626 b_conv.is_owned = ptr_is_owned(b);
52627 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
52628 b_conv.is_owned = false;
52629 jboolean ret_conv = SignedRawInvoice_eq(&a_conv, &b_conv);
52633 static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) {
52634 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg);
52635 int64_t ret_ref = 0;
52636 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52637 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52640 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52641 LDKSignedRawInvoice arg_conv;
52642 arg_conv.inner = untag_ptr(arg);
52643 arg_conv.is_owned = ptr_is_owned(arg);
52644 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
52645 arg_conv.is_owned = false;
52646 int64_t ret_conv = SignedRawInvoice_clone_ptr(&arg_conv);
52650 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52651 LDKSignedRawInvoice orig_conv;
52652 orig_conv.inner = untag_ptr(orig);
52653 orig_conv.is_owned = ptr_is_owned(orig);
52654 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
52655 orig_conv.is_owned = false;
52656 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv);
52657 int64_t ret_ref = 0;
52658 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52659 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52663 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1hash(JNIEnv *env, jclass clz, int64_t o) {
52664 LDKSignedRawInvoice o_conv;
52665 o_conv.inner = untag_ptr(o);
52666 o_conv.is_owned = ptr_is_owned(o);
52667 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
52668 o_conv.is_owned = false;
52669 int64_t ret_conv = SignedRawInvoice_hash(&o_conv);
52673 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52674 LDKRawInvoice this_obj_conv;
52675 this_obj_conv.inner = untag_ptr(this_obj);
52676 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52677 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52678 RawInvoice_free(this_obj_conv);
52681 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
52682 LDKRawInvoice this_ptr_conv;
52683 this_ptr_conv.inner = untag_ptr(this_ptr);
52684 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52685 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52686 this_ptr_conv.is_owned = false;
52687 LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv);
52688 int64_t ret_ref = 0;
52689 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52690 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52694 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
52695 LDKRawInvoice this_ptr_conv;
52696 this_ptr_conv.inner = untag_ptr(this_ptr);
52697 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52699 this_ptr_conv.is_owned = false;
52700 LDKRawDataPart val_conv;
52701 val_conv.inner = untag_ptr(val);
52702 val_conv.is_owned = ptr_is_owned(val);
52703 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
52704 val_conv = RawDataPart_clone(&val_conv);
52705 RawInvoice_set_data(&this_ptr_conv, val_conv);
52708 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawInvoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52709 LDKRawInvoice a_conv;
52710 a_conv.inner = untag_ptr(a);
52711 a_conv.is_owned = ptr_is_owned(a);
52712 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
52713 a_conv.is_owned = false;
52714 LDKRawInvoice b_conv;
52715 b_conv.inner = untag_ptr(b);
52716 b_conv.is_owned = ptr_is_owned(b);
52717 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
52718 b_conv.is_owned = false;
52719 jboolean ret_conv = RawInvoice_eq(&a_conv, &b_conv);
52723 static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) {
52724 LDKRawInvoice ret_var = RawInvoice_clone(arg);
52725 int64_t ret_ref = 0;
52726 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52727 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52730 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52731 LDKRawInvoice arg_conv;
52732 arg_conv.inner = untag_ptr(arg);
52733 arg_conv.is_owned = ptr_is_owned(arg);
52734 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
52735 arg_conv.is_owned = false;
52736 int64_t ret_conv = RawInvoice_clone_ptr(&arg_conv);
52740 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52741 LDKRawInvoice orig_conv;
52742 orig_conv.inner = untag_ptr(orig);
52743 orig_conv.is_owned = ptr_is_owned(orig);
52744 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
52745 orig_conv.is_owned = false;
52746 LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv);
52747 int64_t ret_ref = 0;
52748 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52749 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52753 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1hash(JNIEnv *env, jclass clz, int64_t o) {
52754 LDKRawInvoice o_conv;
52755 o_conv.inner = untag_ptr(o);
52756 o_conv.is_owned = ptr_is_owned(o);
52757 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
52758 o_conv.is_owned = false;
52759 int64_t ret_conv = RawInvoice_hash(&o_conv);
52763 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52764 LDKRawDataPart this_obj_conv;
52765 this_obj_conv.inner = untag_ptr(this_obj);
52766 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52767 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52768 RawDataPart_free(this_obj_conv);
52771 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
52772 LDKRawDataPart this_ptr_conv;
52773 this_ptr_conv.inner = untag_ptr(this_ptr);
52774 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52775 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52776 this_ptr_conv.is_owned = false;
52777 LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv);
52778 int64_t ret_ref = 0;
52779 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52780 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52784 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
52785 LDKRawDataPart this_ptr_conv;
52786 this_ptr_conv.inner = untag_ptr(this_ptr);
52787 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52789 this_ptr_conv.is_owned = false;
52790 LDKPositiveTimestamp val_conv;
52791 val_conv.inner = untag_ptr(val);
52792 val_conv.is_owned = ptr_is_owned(val);
52793 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
52794 val_conv = PositiveTimestamp_clone(&val_conv);
52795 RawDataPart_set_timestamp(&this_ptr_conv, val_conv);
52798 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawDataPart_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52799 LDKRawDataPart a_conv;
52800 a_conv.inner = untag_ptr(a);
52801 a_conv.is_owned = ptr_is_owned(a);
52802 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
52803 a_conv.is_owned = false;
52804 LDKRawDataPart b_conv;
52805 b_conv.inner = untag_ptr(b);
52806 b_conv.is_owned = ptr_is_owned(b);
52807 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
52808 b_conv.is_owned = false;
52809 jboolean ret_conv = RawDataPart_eq(&a_conv, &b_conv);
52813 static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) {
52814 LDKRawDataPart ret_var = RawDataPart_clone(arg);
52815 int64_t ret_ref = 0;
52816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52820 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52821 LDKRawDataPart arg_conv;
52822 arg_conv.inner = untag_ptr(arg);
52823 arg_conv.is_owned = ptr_is_owned(arg);
52824 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
52825 arg_conv.is_owned = false;
52826 int64_t ret_conv = RawDataPart_clone_ptr(&arg_conv);
52830 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52831 LDKRawDataPart orig_conv;
52832 orig_conv.inner = untag_ptr(orig);
52833 orig_conv.is_owned = ptr_is_owned(orig);
52834 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
52835 orig_conv.is_owned = false;
52836 LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv);
52837 int64_t ret_ref = 0;
52838 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52839 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52843 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1hash(JNIEnv *env, jclass clz, int64_t o) {
52844 LDKRawDataPart o_conv;
52845 o_conv.inner = untag_ptr(o);
52846 o_conv.is_owned = ptr_is_owned(o);
52847 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
52848 o_conv.is_owned = false;
52849 int64_t ret_conv = RawDataPart_hash(&o_conv);
52853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52854 LDKPositiveTimestamp this_obj_conv;
52855 this_obj_conv.inner = untag_ptr(this_obj);
52856 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52858 PositiveTimestamp_free(this_obj_conv);
52861 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52862 LDKPositiveTimestamp a_conv;
52863 a_conv.inner = untag_ptr(a);
52864 a_conv.is_owned = ptr_is_owned(a);
52865 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
52866 a_conv.is_owned = false;
52867 LDKPositiveTimestamp b_conv;
52868 b_conv.inner = untag_ptr(b);
52869 b_conv.is_owned = ptr_is_owned(b);
52870 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
52871 b_conv.is_owned = false;
52872 jboolean ret_conv = PositiveTimestamp_eq(&a_conv, &b_conv);
52876 static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) {
52877 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg);
52878 int64_t ret_ref = 0;
52879 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52880 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52883 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52884 LDKPositiveTimestamp arg_conv;
52885 arg_conv.inner = untag_ptr(arg);
52886 arg_conv.is_owned = ptr_is_owned(arg);
52887 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
52888 arg_conv.is_owned = false;
52889 int64_t ret_conv = PositiveTimestamp_clone_ptr(&arg_conv);
52893 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52894 LDKPositiveTimestamp orig_conv;
52895 orig_conv.inner = untag_ptr(orig);
52896 orig_conv.is_owned = ptr_is_owned(orig);
52897 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
52898 orig_conv.is_owned = false;
52899 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv);
52900 int64_t ret_ref = 0;
52901 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52902 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52906 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1hash(JNIEnv *env, jclass clz, int64_t o) {
52907 LDKPositiveTimestamp o_conv;
52908 o_conv.inner = untag_ptr(o);
52909 o_conv.is_owned = ptr_is_owned(o);
52910 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
52911 o_conv.is_owned = false;
52912 int64_t ret_conv = PositiveTimestamp_hash(&o_conv);
52916 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52917 LDKSiPrefix* orig_conv = (LDKSiPrefix*)untag_ptr(orig);
52918 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_clone(orig_conv));
52922 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1milli(JNIEnv *env, jclass clz) {
52923 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_milli());
52927 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1micro(JNIEnv *env, jclass clz) {
52928 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_micro());
52932 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1nano(JNIEnv *env, jclass clz) {
52933 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_nano());
52937 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1pico(JNIEnv *env, jclass clz) {
52938 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_pico());
52942 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SiPrefix_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52943 LDKSiPrefix* a_conv = (LDKSiPrefix*)untag_ptr(a);
52944 LDKSiPrefix* b_conv = (LDKSiPrefix*)untag_ptr(b);
52945 jboolean ret_conv = SiPrefix_eq(a_conv, b_conv);
52949 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1hash(JNIEnv *env, jclass clz, int64_t o) {
52950 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
52951 int64_t ret_conv = SiPrefix_hash(o_conv);
52955 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1multiplier(JNIEnv *env, jclass clz, int64_t this_arg) {
52956 LDKSiPrefix* this_arg_conv = (LDKSiPrefix*)untag_ptr(this_arg);
52957 int64_t ret_conv = SiPrefix_multiplier(this_arg_conv);
52961 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52962 LDKCurrency* orig_conv = (LDKCurrency*)untag_ptr(orig);
52963 jclass ret_conv = LDKCurrency_to_java(env, Currency_clone(orig_conv));
52967 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin(JNIEnv *env, jclass clz) {
52968 jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin());
52972 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin_1testnet(JNIEnv *env, jclass clz) {
52973 jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin_testnet());
52977 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1regtest(JNIEnv *env, jclass clz) {
52978 jclass ret_conv = LDKCurrency_to_java(env, Currency_regtest());
52982 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1simnet(JNIEnv *env, jclass clz) {
52983 jclass ret_conv = LDKCurrency_to_java(env, Currency_simnet());
52987 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1signet(JNIEnv *env, jclass clz) {
52988 jclass ret_conv = LDKCurrency_to_java(env, Currency_signet());
52992 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Currency_1hash(JNIEnv *env, jclass clz, int64_t o) {
52993 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
52994 int64_t ret_conv = Currency_hash(o_conv);
52998 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Currency_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52999 LDKCurrency* a_conv = (LDKCurrency*)untag_ptr(a);
53000 LDKCurrency* b_conv = (LDKCurrency*)untag_ptr(b);
53001 jboolean ret_conv = Currency_eq(a_conv, b_conv);
53005 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sha256_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
53006 LDKSha256 this_obj_conv;
53007 this_obj_conv.inner = untag_ptr(this_obj);
53008 this_obj_conv.is_owned = ptr_is_owned(this_obj);
53009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
53010 Sha256_free(this_obj_conv);
53013 static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) {
53014 LDKSha256 ret_var = Sha256_clone(arg);
53015 int64_t ret_ref = 0;
53016 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53017 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53020 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53021 LDKSha256 arg_conv;
53022 arg_conv.inner = untag_ptr(arg);
53023 arg_conv.is_owned = ptr_is_owned(arg);
53024 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
53025 arg_conv.is_owned = false;
53026 int64_t ret_conv = Sha256_clone_ptr(&arg_conv);
53030 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53031 LDKSha256 orig_conv;
53032 orig_conv.inner = untag_ptr(orig);
53033 orig_conv.is_owned = ptr_is_owned(orig);
53034 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
53035 orig_conv.is_owned = false;
53036 LDKSha256 ret_var = Sha256_clone(&orig_conv);
53037 int64_t ret_ref = 0;
53038 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53039 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53043 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1hash(JNIEnv *env, jclass clz, int64_t o) {
53045 o_conv.inner = untag_ptr(o);
53046 o_conv.is_owned = ptr_is_owned(o);
53047 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
53048 o_conv.is_owned = false;
53049 int64_t ret_conv = Sha256_hash(&o_conv);
53053 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Sha256_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53055 a_conv.inner = untag_ptr(a);
53056 a_conv.is_owned = ptr_is_owned(a);
53057 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
53058 a_conv.is_owned = false;
53060 b_conv.inner = untag_ptr(b);
53061 b_conv.is_owned = ptr_is_owned(b);
53062 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
53063 b_conv.is_owned = false;
53064 jboolean ret_conv = Sha256_eq(&a_conv, &b_conv);
53068 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Description_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
53069 LDKDescription this_obj_conv;
53070 this_obj_conv.inner = untag_ptr(this_obj);
53071 this_obj_conv.is_owned = ptr_is_owned(this_obj);
53072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
53073 Description_free(this_obj_conv);
53076 static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) {
53077 LDKDescription ret_var = Description_clone(arg);
53078 int64_t ret_ref = 0;
53079 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53080 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53083 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53084 LDKDescription arg_conv;
53085 arg_conv.inner = untag_ptr(arg);
53086 arg_conv.is_owned = ptr_is_owned(arg);
53087 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
53088 arg_conv.is_owned = false;
53089 int64_t ret_conv = Description_clone_ptr(&arg_conv);
53093 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53094 LDKDescription orig_conv;
53095 orig_conv.inner = untag_ptr(orig);
53096 orig_conv.is_owned = ptr_is_owned(orig);
53097 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
53098 orig_conv.is_owned = false;
53099 LDKDescription ret_var = Description_clone(&orig_conv);
53100 int64_t ret_ref = 0;
53101 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53102 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53106 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1hash(JNIEnv *env, jclass clz, int64_t o) {
53107 LDKDescription o_conv;
53108 o_conv.inner = untag_ptr(o);
53109 o_conv.is_owned = ptr_is_owned(o);
53110 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
53111 o_conv.is_owned = false;
53112 int64_t ret_conv = Description_hash(&o_conv);
53116 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Description_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53117 LDKDescription a_conv;
53118 a_conv.inner = untag_ptr(a);
53119 a_conv.is_owned = ptr_is_owned(a);
53120 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
53121 a_conv.is_owned = false;
53122 LDKDescription b_conv;
53123 b_conv.inner = untag_ptr(b);
53124 b_conv.is_owned = ptr_is_owned(b);
53125 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
53126 b_conv.is_owned = false;
53127 jboolean ret_conv = Description_eq(&a_conv, &b_conv);
53131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
53132 LDKPayeePubKey this_obj_conv;
53133 this_obj_conv.inner = untag_ptr(this_obj);
53134 this_obj_conv.is_owned = ptr_is_owned(this_obj);
53135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
53136 PayeePubKey_free(this_obj_conv);
53139 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
53140 LDKPayeePubKey this_ptr_conv;
53141 this_ptr_conv.inner = untag_ptr(this_ptr);
53142 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53144 this_ptr_conv.is_owned = false;
53145 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
53146 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PayeePubKey_get_a(&this_ptr_conv).compressed_form);
53150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
53151 LDKPayeePubKey this_ptr_conv;
53152 this_ptr_conv.inner = untag_ptr(this_ptr);
53153 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53154 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53155 this_ptr_conv.is_owned = false;
53156 LDKPublicKey val_ref;
53157 CHECK((*env)->GetArrayLength(env, val) == 33);
53158 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
53159 PayeePubKey_set_a(&this_ptr_conv, val_ref);
53162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) {
53163 LDKPublicKey a_arg_ref;
53164 CHECK((*env)->GetArrayLength(env, a_arg) == 33);
53165 (*env)->GetByteArrayRegion(env, a_arg, 0, 33, a_arg_ref.compressed_form);
53166 LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
53167 int64_t ret_ref = 0;
53168 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53169 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53173 static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) {
53174 LDKPayeePubKey ret_var = PayeePubKey_clone(arg);
53175 int64_t ret_ref = 0;
53176 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53177 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53181 LDKPayeePubKey arg_conv;
53182 arg_conv.inner = untag_ptr(arg);
53183 arg_conv.is_owned = ptr_is_owned(arg);
53184 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
53185 arg_conv.is_owned = false;
53186 int64_t ret_conv = PayeePubKey_clone_ptr(&arg_conv);
53190 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53191 LDKPayeePubKey orig_conv;
53192 orig_conv.inner = untag_ptr(orig);
53193 orig_conv.is_owned = ptr_is_owned(orig);
53194 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
53195 orig_conv.is_owned = false;
53196 LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv);
53197 int64_t ret_ref = 0;
53198 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53199 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53203 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1hash(JNIEnv *env, jclass clz, int64_t o) {
53204 LDKPayeePubKey o_conv;
53205 o_conv.inner = untag_ptr(o);
53206 o_conv.is_owned = ptr_is_owned(o);
53207 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
53208 o_conv.is_owned = false;
53209 int64_t ret_conv = PayeePubKey_hash(&o_conv);
53213 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53214 LDKPayeePubKey a_conv;
53215 a_conv.inner = untag_ptr(a);
53216 a_conv.is_owned = ptr_is_owned(a);
53217 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
53218 a_conv.is_owned = false;
53219 LDKPayeePubKey b_conv;
53220 b_conv.inner = untag_ptr(b);
53221 b_conv.is_owned = ptr_is_owned(b);
53222 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
53223 b_conv.is_owned = false;
53224 jboolean ret_conv = PayeePubKey_eq(&a_conv, &b_conv);
53228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
53229 LDKExpiryTime this_obj_conv;
53230 this_obj_conv.inner = untag_ptr(this_obj);
53231 this_obj_conv.is_owned = ptr_is_owned(this_obj);
53232 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
53233 ExpiryTime_free(this_obj_conv);
53236 static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) {
53237 LDKExpiryTime ret_var = ExpiryTime_clone(arg);
53238 int64_t ret_ref = 0;
53239 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53240 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53243 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53244 LDKExpiryTime arg_conv;
53245 arg_conv.inner = untag_ptr(arg);
53246 arg_conv.is_owned = ptr_is_owned(arg);
53247 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
53248 arg_conv.is_owned = false;
53249 int64_t ret_conv = ExpiryTime_clone_ptr(&arg_conv);
53253 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53254 LDKExpiryTime orig_conv;
53255 orig_conv.inner = untag_ptr(orig);
53256 orig_conv.is_owned = ptr_is_owned(orig);
53257 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
53258 orig_conv.is_owned = false;
53259 LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv);
53260 int64_t ret_ref = 0;
53261 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53262 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53266 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1hash(JNIEnv *env, jclass clz, int64_t o) {
53267 LDKExpiryTime o_conv;
53268 o_conv.inner = untag_ptr(o);
53269 o_conv.is_owned = ptr_is_owned(o);
53270 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
53271 o_conv.is_owned = false;
53272 int64_t ret_conv = ExpiryTime_hash(&o_conv);
53276 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53277 LDKExpiryTime a_conv;
53278 a_conv.inner = untag_ptr(a);
53279 a_conv.is_owned = ptr_is_owned(a);
53280 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
53281 a_conv.is_owned = false;
53282 LDKExpiryTime b_conv;
53283 b_conv.inner = untag_ptr(b);
53284 b_conv.is_owned = ptr_is_owned(b);
53285 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
53286 b_conv.is_owned = false;
53287 jboolean ret_conv = ExpiryTime_eq(&a_conv, &b_conv);
53291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
53292 LDKMinFinalCltvExpiryDelta this_obj_conv;
53293 this_obj_conv.inner = untag_ptr(this_obj);
53294 this_obj_conv.is_owned = ptr_is_owned(this_obj);
53295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
53296 MinFinalCltvExpiryDelta_free(this_obj_conv);
53299 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
53300 LDKMinFinalCltvExpiryDelta this_ptr_conv;
53301 this_ptr_conv.inner = untag_ptr(this_ptr);
53302 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53304 this_ptr_conv.is_owned = false;
53305 int64_t ret_conv = MinFinalCltvExpiryDelta_get_a(&this_ptr_conv);
53309 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
53310 LDKMinFinalCltvExpiryDelta this_ptr_conv;
53311 this_ptr_conv.inner = untag_ptr(this_ptr);
53312 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53314 this_ptr_conv.is_owned = false;
53315 MinFinalCltvExpiryDelta_set_a(&this_ptr_conv, val);
53318 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
53319 LDKMinFinalCltvExpiryDelta ret_var = MinFinalCltvExpiryDelta_new(a_arg);
53320 int64_t ret_ref = 0;
53321 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53322 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53326 static inline uint64_t MinFinalCltvExpiryDelta_clone_ptr(LDKMinFinalCltvExpiryDelta *NONNULL_PTR arg) {
53327 LDKMinFinalCltvExpiryDelta ret_var = MinFinalCltvExpiryDelta_clone(arg);
53328 int64_t ret_ref = 0;
53329 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53330 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53333 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53334 LDKMinFinalCltvExpiryDelta arg_conv;
53335 arg_conv.inner = untag_ptr(arg);
53336 arg_conv.is_owned = ptr_is_owned(arg);
53337 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
53338 arg_conv.is_owned = false;
53339 int64_t ret_conv = MinFinalCltvExpiryDelta_clone_ptr(&arg_conv);
53343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53344 LDKMinFinalCltvExpiryDelta orig_conv;
53345 orig_conv.inner = untag_ptr(orig);
53346 orig_conv.is_owned = ptr_is_owned(orig);
53347 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
53348 orig_conv.is_owned = false;
53349 LDKMinFinalCltvExpiryDelta ret_var = MinFinalCltvExpiryDelta_clone(&orig_conv);
53350 int64_t ret_ref = 0;
53351 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53352 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53356 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1hash(JNIEnv *env, jclass clz, int64_t o) {
53357 LDKMinFinalCltvExpiryDelta o_conv;
53358 o_conv.inner = untag_ptr(o);
53359 o_conv.is_owned = ptr_is_owned(o);
53360 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
53361 o_conv.is_owned = false;
53362 int64_t ret_conv = MinFinalCltvExpiryDelta_hash(&o_conv);
53366 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53367 LDKMinFinalCltvExpiryDelta a_conv;
53368 a_conv.inner = untag_ptr(a);
53369 a_conv.is_owned = ptr_is_owned(a);
53370 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
53371 a_conv.is_owned = false;
53372 LDKMinFinalCltvExpiryDelta b_conv;
53373 b_conv.inner = untag_ptr(b);
53374 b_conv.is_owned = ptr_is_owned(b);
53375 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
53376 b_conv.is_owned = false;
53377 jboolean ret_conv = MinFinalCltvExpiryDelta_eq(&a_conv, &b_conv);
53381 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
53382 if (!ptr_is_owned(this_ptr)) return;
53383 void* this_ptr_ptr = untag_ptr(this_ptr);
53384 CHECK_ACCESS(this_ptr_ptr);
53385 LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
53386 FREE(untag_ptr(this_ptr));
53387 Fallback_free(this_ptr_conv);
53390 static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) {
53391 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
53392 *ret_copy = Fallback_clone(arg);
53393 int64_t ret_ref = tag_ptr(ret_copy, true);
53396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53397 LDKFallback* arg_conv = (LDKFallback*)untag_ptr(arg);
53398 int64_t ret_conv = Fallback_clone_ptr(arg_conv);
53402 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53403 LDKFallback* orig_conv = (LDKFallback*)untag_ptr(orig);
53404 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
53405 *ret_copy = Fallback_clone(orig_conv);
53406 int64_t ret_ref = tag_ptr(ret_copy, true);
53410 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1seg_1wit_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) {
53412 LDKCVec_u8Z program_ref;
53413 program_ref.datalen = (*env)->GetArrayLength(env, program);
53414 program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
53415 (*env)->GetByteArrayRegion(env, program, 0, program_ref.datalen, program_ref.data);
53416 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
53417 *ret_copy = Fallback_seg_wit_program((LDKU5){ ._0 = version }, program_ref);
53418 int64_t ret_ref = tag_ptr(ret_copy, true);
53422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1pub_1key_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
53423 LDKTwentyBytes a_ref;
53424 CHECK((*env)->GetArrayLength(env, a) == 20);
53425 (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
53426 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
53427 *ret_copy = Fallback_pub_key_hash(a_ref);
53428 int64_t ret_ref = tag_ptr(ret_copy, true);
53432 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1script_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
53433 LDKTwentyBytes a_ref;
53434 CHECK((*env)->GetArrayLength(env, a) == 20);
53435 (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
53436 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
53437 *ret_copy = Fallback_script_hash(a_ref);
53438 int64_t ret_ref = tag_ptr(ret_copy, true);
53442 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1hash(JNIEnv *env, jclass clz, int64_t o) {
53443 LDKFallback* o_conv = (LDKFallback*)untag_ptr(o);
53444 int64_t ret_conv = Fallback_hash(o_conv);
53448 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Fallback_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53449 LDKFallback* a_conv = (LDKFallback*)untag_ptr(a);
53450 LDKFallback* b_conv = (LDKFallback*)untag_ptr(b);
53451 jboolean ret_conv = Fallback_eq(a_conv, b_conv);
53455 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
53456 LDKInvoiceSignature this_obj_conv;
53457 this_obj_conv.inner = untag_ptr(this_obj);
53458 this_obj_conv.is_owned = ptr_is_owned(this_obj);
53459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
53460 InvoiceSignature_free(this_obj_conv);
53463 static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) {
53464 LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg);
53465 int64_t ret_ref = 0;
53466 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53467 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53470 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53471 LDKInvoiceSignature arg_conv;
53472 arg_conv.inner = untag_ptr(arg);
53473 arg_conv.is_owned = ptr_is_owned(arg);
53474 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
53475 arg_conv.is_owned = false;
53476 int64_t ret_conv = InvoiceSignature_clone_ptr(&arg_conv);
53480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53481 LDKInvoiceSignature orig_conv;
53482 orig_conv.inner = untag_ptr(orig);
53483 orig_conv.is_owned = ptr_is_owned(orig);
53484 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
53485 orig_conv.is_owned = false;
53486 LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv);
53487 int64_t ret_ref = 0;
53488 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53489 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53493 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1hash(JNIEnv *env, jclass clz, int64_t o) {
53494 LDKInvoiceSignature o_conv;
53495 o_conv.inner = untag_ptr(o);
53496 o_conv.is_owned = ptr_is_owned(o);
53497 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
53498 o_conv.is_owned = false;
53499 int64_t ret_conv = InvoiceSignature_hash(&o_conv);
53503 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53504 LDKInvoiceSignature a_conv;
53505 a_conv.inner = untag_ptr(a);
53506 a_conv.is_owned = ptr_is_owned(a);
53507 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
53508 a_conv.is_owned = false;
53509 LDKInvoiceSignature b_conv;
53510 b_conv.inner = untag_ptr(b);
53511 b_conv.is_owned = ptr_is_owned(b);
53512 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
53513 b_conv.is_owned = false;
53514 jboolean ret_conv = InvoiceSignature_eq(&a_conv, &b_conv);
53518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
53519 LDKPrivateRoute this_obj_conv;
53520 this_obj_conv.inner = untag_ptr(this_obj);
53521 this_obj_conv.is_owned = ptr_is_owned(this_obj);
53522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
53523 PrivateRoute_free(this_obj_conv);
53526 static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) {
53527 LDKPrivateRoute ret_var = PrivateRoute_clone(arg);
53528 int64_t ret_ref = 0;
53529 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53530 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53533 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53534 LDKPrivateRoute arg_conv;
53535 arg_conv.inner = untag_ptr(arg);
53536 arg_conv.is_owned = ptr_is_owned(arg);
53537 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
53538 arg_conv.is_owned = false;
53539 int64_t ret_conv = PrivateRoute_clone_ptr(&arg_conv);
53543 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53544 LDKPrivateRoute orig_conv;
53545 orig_conv.inner = untag_ptr(orig);
53546 orig_conv.is_owned = ptr_is_owned(orig);
53547 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
53548 orig_conv.is_owned = false;
53549 LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv);
53550 int64_t ret_ref = 0;
53551 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53552 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53556 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1hash(JNIEnv *env, jclass clz, int64_t o) {
53557 LDKPrivateRoute o_conv;
53558 o_conv.inner = untag_ptr(o);
53559 o_conv.is_owned = ptr_is_owned(o);
53560 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
53561 o_conv.is_owned = false;
53562 int64_t ret_conv = PrivateRoute_hash(&o_conv);
53566 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53567 LDKPrivateRoute a_conv;
53568 a_conv.inner = untag_ptr(a);
53569 a_conv.is_owned = ptr_is_owned(a);
53570 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
53571 a_conv.is_owned = false;
53572 LDKPrivateRoute b_conv;
53573 b_conv.inner = untag_ptr(b);
53574 b_conv.is_owned = ptr_is_owned(b);
53575 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
53576 b_conv.is_owned = false;
53577 jboolean ret_conv = PrivateRoute_eq(&a_conv, &b_conv);
53581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1into_1parts(JNIEnv *env, jclass clz, int64_t this_arg) {
53582 LDKSignedRawInvoice this_arg_conv;
53583 this_arg_conv.inner = untag_ptr(this_arg);
53584 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53586 this_arg_conv = SignedRawInvoice_clone(&this_arg_conv);
53587 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
53588 *ret_conv = SignedRawInvoice_into_parts(this_arg_conv);
53589 return tag_ptr(ret_conv, true);
53592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1raw_1invoice(JNIEnv *env, jclass clz, int64_t this_arg) {
53593 LDKSignedRawInvoice this_arg_conv;
53594 this_arg_conv.inner = untag_ptr(this_arg);
53595 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53596 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53597 this_arg_conv.is_owned = false;
53598 LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv);
53599 int64_t ret_ref = 0;
53600 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53601 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53605 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
53606 LDKSignedRawInvoice this_arg_conv;
53607 this_arg_conv.inner = untag_ptr(this_arg);
53608 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53609 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53610 this_arg_conv.is_owned = false;
53611 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
53612 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SignedRawInvoice_signable_hash(&this_arg_conv));
53616 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
53617 LDKSignedRawInvoice this_arg_conv;
53618 this_arg_conv.inner = untag_ptr(this_arg);
53619 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53620 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53621 this_arg_conv.is_owned = false;
53622 LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv);
53623 int64_t ret_ref = 0;
53624 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53625 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53629 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1recover_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
53630 LDKSignedRawInvoice this_arg_conv;
53631 this_arg_conv.inner = untag_ptr(this_arg);
53632 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53634 this_arg_conv.is_owned = false;
53635 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
53636 *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv);
53637 return tag_ptr(ret_conv, true);
53640 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1check_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
53641 LDKSignedRawInvoice this_arg_conv;
53642 this_arg_conv.inner = untag_ptr(this_arg);
53643 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53645 this_arg_conv.is_owned = false;
53646 jboolean ret_conv = SignedRawInvoice_check_signature(&this_arg_conv);
53650 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
53651 LDKRawInvoice this_arg_conv;
53652 this_arg_conv.inner = untag_ptr(this_arg);
53653 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53655 this_arg_conv.is_owned = false;
53656 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
53657 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_signable_hash(&this_arg_conv).data);
53661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
53662 LDKRawInvoice this_arg_conv;
53663 this_arg_conv.inner = untag_ptr(this_arg);
53664 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53666 this_arg_conv.is_owned = false;
53667 LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
53668 int64_t ret_ref = 0;
53669 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53670 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) {
53675 LDKRawInvoice this_arg_conv;
53676 this_arg_conv.inner = untag_ptr(this_arg);
53677 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53679 this_arg_conv.is_owned = false;
53680 LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
53681 int64_t ret_ref = 0;
53682 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53683 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53687 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
53688 LDKRawInvoice this_arg_conv;
53689 this_arg_conv.inner = untag_ptr(this_arg);
53690 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53692 this_arg_conv.is_owned = false;
53693 LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
53694 int64_t ret_ref = 0;
53695 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53696 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53700 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
53701 LDKRawInvoice this_arg_conv;
53702 this_arg_conv.inner = untag_ptr(this_arg);
53703 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53704 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53705 this_arg_conv.is_owned = false;
53706 LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
53707 int64_t ret_ref = 0;
53708 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53709 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53713 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
53714 LDKRawInvoice this_arg_conv;
53715 this_arg_conv.inner = untag_ptr(this_arg);
53716 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53718 this_arg_conv.is_owned = false;
53719 LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
53720 int64_t ret_ref = 0;
53721 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53722 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53726 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1min_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) {
53727 LDKRawInvoice this_arg_conv;
53728 this_arg_conv.inner = untag_ptr(this_arg);
53729 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53731 this_arg_conv.is_owned = false;
53732 LDKMinFinalCltvExpiryDelta ret_var = RawInvoice_min_final_cltv_expiry_delta(&this_arg_conv);
53733 int64_t ret_ref = 0;
53734 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53735 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53739 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
53740 LDKRawInvoice this_arg_conv;
53741 this_arg_conv.inner = untag_ptr(this_arg);
53742 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53743 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53744 this_arg_conv.is_owned = false;
53745 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
53746 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_payment_secret(&this_arg_conv).data);
53750 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
53751 LDKRawInvoice this_arg_conv;
53752 this_arg_conv.inner = untag_ptr(this_arg);
53753 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53754 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53755 this_arg_conv.is_owned = false;
53756 LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
53757 int64_t ret_ref = 0;
53758 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53759 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53763 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1routes(JNIEnv *env, jclass clz, int64_t this_arg) {
53764 LDKRawInvoice this_arg_conv;
53765 this_arg_conv.inner = untag_ptr(this_arg);
53766 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53767 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53768 this_arg_conv.is_owned = false;
53769 LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
53770 int64_tArray ret_arr = NULL;
53771 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
53772 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
53773 for (size_t o = 0; o < ret_var.datalen; o++) {
53774 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
53775 int64_t ret_conv_14_ref = 0;
53776 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
53777 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
53778 ret_arr_ptr[o] = ret_conv_14_ref;
53780 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
53781 FREE(ret_var.data);
53785 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1amount_1pico_1btc(JNIEnv *env, jclass clz, int64_t this_arg) {
53786 LDKRawInvoice this_arg_conv;
53787 this_arg_conv.inner = untag_ptr(this_arg);
53788 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53789 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53790 this_arg_conv.is_owned = false;
53791 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
53792 *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv);
53793 int64_t ret_ref = tag_ptr(ret_copy, true);
53797 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RawInvoice_1currency(JNIEnv *env, jclass clz, int64_t this_arg) {
53798 LDKRawInvoice this_arg_conv;
53799 this_arg_conv.inner = untag_ptr(this_arg);
53800 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53802 this_arg_conv.is_owned = false;
53803 jclass ret_conv = LDKCurrency_to_java(env, RawInvoice_currency(&this_arg_conv));
53807 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1unix_1timestamp(JNIEnv *env, jclass clz, int64_t unix_seconds) {
53808 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
53809 *ret_conv = PositiveTimestamp_from_unix_timestamp(unix_seconds);
53810 return tag_ptr(ret_conv, true);
53813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1system_1time(JNIEnv *env, jclass clz, int64_t time) {
53814 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
53815 *ret_conv = PositiveTimestamp_from_system_time(time);
53816 return tag_ptr(ret_conv, true);
53819 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t duration) {
53820 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
53821 *ret_conv = PositiveTimestamp_from_duration_since_epoch(duration);
53822 return tag_ptr(ret_conv, true);
53825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1unix_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
53826 LDKPositiveTimestamp this_arg_conv;
53827 this_arg_conv.inner = untag_ptr(this_arg);
53828 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53829 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53830 this_arg_conv.is_owned = false;
53831 int64_t ret_conv = PositiveTimestamp_as_unix_timestamp(&this_arg_conv);
53835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t this_arg) {
53836 LDKPositiveTimestamp this_arg_conv;
53837 this_arg_conv.inner = untag_ptr(this_arg);
53838 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53840 this_arg_conv.is_owned = false;
53841 int64_t ret_conv = PositiveTimestamp_as_duration_since_epoch(&this_arg_conv);
53845 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
53846 LDKPositiveTimestamp this_arg_conv;
53847 this_arg_conv.inner = untag_ptr(this_arg);
53848 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53849 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53850 this_arg_conv.is_owned = false;
53851 int64_t ret_conv = PositiveTimestamp_as_time(&this_arg_conv);
53855 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1into_1signed_1raw(JNIEnv *env, jclass clz, int64_t this_arg) {
53856 LDKInvoice this_arg_conv;
53857 this_arg_conv.inner = untag_ptr(this_arg);
53858 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53859 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53860 this_arg_conv = Invoice_clone(&this_arg_conv);
53861 LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv);
53862 int64_t ret_ref = 0;
53863 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53864 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53868 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1check_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
53869 LDKInvoice this_arg_conv;
53870 this_arg_conv.inner = untag_ptr(this_arg);
53871 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53873 this_arg_conv.is_owned = false;
53874 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
53875 *ret_conv = Invoice_check_signature(&this_arg_conv);
53876 return tag_ptr(ret_conv, true);
53879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1signed(JNIEnv *env, jclass clz, int64_t signed_invoice) {
53880 LDKSignedRawInvoice signed_invoice_conv;
53881 signed_invoice_conv.inner = untag_ptr(signed_invoice);
53882 signed_invoice_conv.is_owned = ptr_is_owned(signed_invoice);
53883 CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv);
53884 signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv);
53885 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
53886 *ret_conv = Invoice_from_signed(signed_invoice_conv);
53887 return tag_ptr(ret_conv, true);
53890 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
53891 LDKInvoice this_arg_conv;
53892 this_arg_conv.inner = untag_ptr(this_arg);
53893 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53895 this_arg_conv.is_owned = false;
53896 int64_t ret_conv = Invoice_timestamp(&this_arg_conv);
53900 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t this_arg) {
53901 LDKInvoice this_arg_conv;
53902 this_arg_conv.inner = untag_ptr(this_arg);
53903 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53904 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53905 this_arg_conv.is_owned = false;
53906 int64_t ret_conv = Invoice_duration_since_epoch(&this_arg_conv);
53910 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
53911 LDKInvoice this_arg_conv;
53912 this_arg_conv.inner = untag_ptr(this_arg);
53913 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53915 this_arg_conv.is_owned = false;
53916 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
53917 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_hash(&this_arg_conv));
53921 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
53922 LDKInvoice this_arg_conv;
53923 this_arg_conv.inner = untag_ptr(this_arg);
53924 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53926 this_arg_conv.is_owned = false;
53927 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
53928 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_payee_pub_key(&this_arg_conv).compressed_form);
53932 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
53933 LDKInvoice this_arg_conv;
53934 this_arg_conv.inner = untag_ptr(this_arg);
53935 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53936 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53937 this_arg_conv.is_owned = false;
53938 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
53939 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_secret(&this_arg_conv));
53943 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
53944 LDKInvoice this_arg_conv;
53945 this_arg_conv.inner = untag_ptr(this_arg);
53946 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53948 this_arg_conv.is_owned = false;
53949 LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
53950 int64_t ret_ref = 0;
53951 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53952 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53956 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1recover_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
53957 LDKInvoice this_arg_conv;
53958 this_arg_conv.inner = untag_ptr(this_arg);
53959 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53961 this_arg_conv.is_owned = false;
53962 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
53963 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form);
53967 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
53968 LDKInvoice this_arg_conv;
53969 this_arg_conv.inner = untag_ptr(this_arg);
53970 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53972 this_arg_conv.is_owned = false;
53973 int64_t ret_conv = Invoice_expiry_time(&this_arg_conv);
53977 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) {
53978 LDKInvoice this_arg_conv;
53979 this_arg_conv.inner = untag_ptr(this_arg);
53980 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53982 this_arg_conv.is_owned = false;
53983 jboolean ret_conv = Invoice_is_expired(&this_arg_conv);
53987 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1would_1expire(JNIEnv *env, jclass clz, int64_t this_arg, int64_t at_time) {
53988 LDKInvoice this_arg_conv;
53989 this_arg_conv.inner = untag_ptr(this_arg);
53990 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53992 this_arg_conv.is_owned = false;
53993 jboolean ret_conv = Invoice_would_expire(&this_arg_conv, at_time);
53997 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1min_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) {
53998 LDKInvoice this_arg_conv;
53999 this_arg_conv.inner = untag_ptr(this_arg);
54000 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54002 this_arg_conv.is_owned = false;
54003 int64_t ret_conv = Invoice_min_final_cltv_expiry_delta(&this_arg_conv);
54007 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1routes(JNIEnv *env, jclass clz, int64_t this_arg) {
54008 LDKInvoice this_arg_conv;
54009 this_arg_conv.inner = untag_ptr(this_arg);
54010 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54012 this_arg_conv.is_owned = false;
54013 LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
54014 int64_tArray ret_arr = NULL;
54015 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
54016 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
54017 for (size_t o = 0; o < ret_var.datalen; o++) {
54018 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
54019 int64_t ret_conv_14_ref = 0;
54020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
54021 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
54022 ret_arr_ptr[o] = ret_conv_14_ref;
54024 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
54025 FREE(ret_var.data);
54029 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) {
54030 LDKInvoice this_arg_conv;
54031 this_arg_conv.inner = untag_ptr(this_arg);
54032 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54033 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54034 this_arg_conv.is_owned = false;
54035 LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
54036 int64_tArray ret_arr = NULL;
54037 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
54038 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
54039 for (size_t l = 0; l < ret_var.datalen; l++) {
54040 LDKRouteHint ret_conv_11_var = ret_var.data[l];
54041 int64_t ret_conv_11_ref = 0;
54042 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
54043 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
54044 ret_arr_ptr[l] = ret_conv_11_ref;
54046 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
54047 FREE(ret_var.data);
54051 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Invoice_1currency(JNIEnv *env, jclass clz, int64_t this_arg) {
54052 LDKInvoice this_arg_conv;
54053 this_arg_conv.inner = untag_ptr(this_arg);
54054 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54056 this_arg_conv.is_owned = false;
54057 jclass ret_conv = LDKCurrency_to_java(env, Invoice_currency(&this_arg_conv));
54061 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1satoshis(JNIEnv *env, jclass clz, int64_t this_arg) {
54062 LDKInvoice this_arg_conv;
54063 this_arg_conv.inner = untag_ptr(this_arg);
54064 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54065 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54066 this_arg_conv.is_owned = false;
54067 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
54068 *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
54069 int64_t ret_ref = tag_ptr(ret_copy, true);
54073 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1new(JNIEnv *env, jclass clz, jstring description) {
54074 LDKStr description_conv = java_to_owned_str(env, description);
54075 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
54076 *ret_conv = Description_new(description_conv);
54077 return tag_ptr(ret_conv, true);
54080 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
54081 LDKDescription this_arg_conv;
54082 this_arg_conv.inner = untag_ptr(this_arg);
54083 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54085 this_arg_conv = Description_clone(&this_arg_conv);
54086 LDKStr ret_str = Description_into_inner(this_arg_conv);
54087 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
54092 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1from_1seconds(JNIEnv *env, jclass clz, int64_t seconds) {
54093 LDKExpiryTime ret_var = ExpiryTime_from_seconds(seconds);
54094 int64_t ret_ref = 0;
54095 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
54096 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
54100 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1from_1duration(JNIEnv *env, jclass clz, int64_t duration) {
54101 LDKExpiryTime ret_var = ExpiryTime_from_duration(duration);
54102 int64_t ret_ref = 0;
54103 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
54104 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
54108 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1seconds(JNIEnv *env, jclass clz, int64_t this_arg) {
54109 LDKExpiryTime this_arg_conv;
54110 this_arg_conv.inner = untag_ptr(this_arg);
54111 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54112 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54113 this_arg_conv.is_owned = false;
54114 int64_t ret_conv = ExpiryTime_as_seconds(&this_arg_conv);
54118 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1duration(JNIEnv *env, jclass clz, int64_t this_arg) {
54119 LDKExpiryTime this_arg_conv;
54120 this_arg_conv.inner = untag_ptr(this_arg);
54121 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54122 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54123 this_arg_conv.is_owned = false;
54124 int64_t ret_conv = ExpiryTime_as_duration(&this_arg_conv);
54128 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1new(JNIEnv *env, jclass clz, int64_t hops) {
54129 LDKRouteHint hops_conv;
54130 hops_conv.inner = untag_ptr(hops);
54131 hops_conv.is_owned = ptr_is_owned(hops);
54132 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv);
54133 hops_conv = RouteHint_clone(&hops_conv);
54134 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
54135 *ret_conv = PrivateRoute_new(hops_conv);
54136 return tag_ptr(ret_conv, true);
54139 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
54140 LDKPrivateRoute this_arg_conv;
54141 this_arg_conv.inner = untag_ptr(this_arg);
54142 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54144 this_arg_conv = PrivateRoute_clone(&this_arg_conv);
54145 LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv);
54146 int64_t ret_ref = 0;
54147 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
54148 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
54152 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
54153 LDKCreationError* orig_conv = (LDKCreationError*)untag_ptr(orig);
54154 jclass ret_conv = LDKCreationError_to_java(env, CreationError_clone(orig_conv));
54158 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1description_1too_1long(JNIEnv *env, jclass clz) {
54159 jclass ret_conv = LDKCreationError_to_java(env, CreationError_description_too_long());
54163 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1route_1too_1long(JNIEnv *env, jclass clz) {
54164 jclass ret_conv = LDKCreationError_to_java(env, CreationError_route_too_long());
54168 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1timestamp_1out_1of_1bounds(JNIEnv *env, jclass clz) {
54169 jclass ret_conv = LDKCreationError_to_java(env, CreationError_timestamp_out_of_bounds());
54173 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1invalid_1amount(JNIEnv *env, jclass clz) {
54174 jclass ret_conv = LDKCreationError_to_java(env, CreationError_invalid_amount());
54178 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1missing_1route_1hints(JNIEnv *env, jclass clz) {
54179 jclass ret_conv = LDKCreationError_to_java(env, CreationError_missing_route_hints());
54183 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1min_1final_1cltv_1expiry_1delta_1too_1short(JNIEnv *env, jclass clz) {
54184 jclass ret_conv = LDKCreationError_to_java(env, CreationError_min_final_cltv_expiry_delta_too_short());
54188 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
54189 LDKCreationError* a_conv = (LDKCreationError*)untag_ptr(a);
54190 LDKCreationError* b_conv = (LDKCreationError*)untag_ptr(b);
54191 jboolean ret_conv = CreationError_eq(a_conv, b_conv);
54195 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CreationError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
54196 LDKCreationError* o_conv = (LDKCreationError*)untag_ptr(o);
54197 LDKStr ret_str = CreationError_to_str(o_conv);
54198 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
54203 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
54204 LDKSemanticError* orig_conv = (LDKSemanticError*)untag_ptr(orig);
54205 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_clone(orig_conv));
54209 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1hash(JNIEnv *env, jclass clz) {
54210 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_payment_hash());
54214 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1hashes(JNIEnv *env, jclass clz) {
54215 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_hashes());
54219 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1description(JNIEnv *env, jclass clz) {
54220 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_description());
54224 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1descriptions(JNIEnv *env, jclass clz) {
54225 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_descriptions());
54229 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1secret(JNIEnv *env, jclass clz) {
54230 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_payment_secret());
54234 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1secrets(JNIEnv *env, jclass clz) {
54235 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_secrets());
54239 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1features(JNIEnv *env, jclass clz) {
54240 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_features());
54244 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) {
54245 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_recovery_id());
54249 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1signature(JNIEnv *env, jclass clz) {
54250 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_signature());
54254 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1imprecise_1amount(JNIEnv *env, jclass clz) {
54255 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_imprecise_amount());
54259 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
54260 LDKSemanticError* a_conv = (LDKSemanticError*)untag_ptr(a);
54261 LDKSemanticError* b_conv = (LDKSemanticError*)untag_ptr(b);
54262 jboolean ret_conv = SemanticError_eq(a_conv, b_conv);
54266 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SemanticError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
54267 LDKSemanticError* o_conv = (LDKSemanticError*)untag_ptr(o);
54268 LDKStr ret_str = SemanticError_to_str(o_conv);
54269 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
54274 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
54275 if (!ptr_is_owned(this_ptr)) return;
54276 void* this_ptr_ptr = untag_ptr(this_ptr);
54277 CHECK_ACCESS(this_ptr_ptr);
54278 LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
54279 FREE(untag_ptr(this_ptr));
54280 SignOrCreationError_free(this_ptr_conv);
54283 static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) {
54284 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
54285 *ret_copy = SignOrCreationError_clone(arg);
54286 int64_t ret_ref = tag_ptr(ret_copy, true);
54289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
54290 LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)untag_ptr(arg);
54291 int64_t ret_conv = SignOrCreationError_clone_ptr(arg_conv);
54295 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
54296 LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)untag_ptr(orig);
54297 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
54298 *ret_copy = SignOrCreationError_clone(orig_conv);
54299 int64_t ret_ref = tag_ptr(ret_copy, true);
54303 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1sign_1error(JNIEnv *env, jclass clz) {
54304 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
54305 *ret_copy = SignOrCreationError_sign_error();
54306 int64_t ret_ref = tag_ptr(ret_copy, true);
54310 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1creation_1error(JNIEnv *env, jclass clz, jclass a) {
54311 LDKCreationError a_conv = LDKCreationError_from_java(env, a);
54312 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
54313 *ret_copy = SignOrCreationError_creation_error(a_conv);
54314 int64_t ret_ref = tag_ptr(ret_copy, true);
54318 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
54319 LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)untag_ptr(a);
54320 LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)untag_ptr(b);
54321 jboolean ret_conv = SignOrCreationError_eq(a_conv, b_conv);
54325 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
54326 LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)untag_ptr(o);
54327 LDKStr ret_str = SignOrCreationError_to_str(o_conv);
54328 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
54333 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_pay_1invoice(JNIEnv *env, jclass clz, int64_t invoice, int64_t retry_strategy, int64_t channelmanager) {
54334 LDKInvoice invoice_conv;
54335 invoice_conv.inner = untag_ptr(invoice);
54336 invoice_conv.is_owned = ptr_is_owned(invoice);
54337 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
54338 invoice_conv.is_owned = false;
54339 void* retry_strategy_ptr = untag_ptr(retry_strategy);
54340 CHECK_ACCESS(retry_strategy_ptr);
54341 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
54342 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
54343 LDKChannelManager channelmanager_conv;
54344 channelmanager_conv.inner = untag_ptr(channelmanager);
54345 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
54346 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
54347 channelmanager_conv.is_owned = false;
54348 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
54349 *ret_conv = pay_invoice(&invoice_conv, retry_strategy_conv, &channelmanager_conv);
54350 return tag_ptr(ret_conv, true);
54353 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_pay_1invoice_1with_1id(JNIEnv *env, jclass clz, int64_t invoice, int8_tArray payment_id, int64_t retry_strategy, int64_t channelmanager) {
54354 LDKInvoice invoice_conv;
54355 invoice_conv.inner = untag_ptr(invoice);
54356 invoice_conv.is_owned = ptr_is_owned(invoice);
54357 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
54358 invoice_conv.is_owned = false;
54359 LDKThirtyTwoBytes payment_id_ref;
54360 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
54361 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
54362 void* retry_strategy_ptr = untag_ptr(retry_strategy);
54363 CHECK_ACCESS(retry_strategy_ptr);
54364 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
54365 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
54366 LDKChannelManager channelmanager_conv;
54367 channelmanager_conv.inner = untag_ptr(channelmanager);
54368 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
54369 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
54370 channelmanager_conv.is_owned = false;
54371 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
54372 *ret_conv = pay_invoice_with_id(&invoice_conv, payment_id_ref, retry_strategy_conv, &channelmanager_conv);
54373 return tag_ptr(ret_conv, true);
54376 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_pay_1zero_1value_1invoice(JNIEnv *env, jclass clz, int64_t invoice, int64_t amount_msats, int64_t retry_strategy, int64_t channelmanager) {
54377 LDKInvoice invoice_conv;
54378 invoice_conv.inner = untag_ptr(invoice);
54379 invoice_conv.is_owned = ptr_is_owned(invoice);
54380 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
54381 invoice_conv.is_owned = false;
54382 void* retry_strategy_ptr = untag_ptr(retry_strategy);
54383 CHECK_ACCESS(retry_strategy_ptr);
54384 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
54385 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
54386 LDKChannelManager channelmanager_conv;
54387 channelmanager_conv.inner = untag_ptr(channelmanager);
54388 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
54389 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
54390 channelmanager_conv.is_owned = false;
54391 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
54392 *ret_conv = pay_zero_value_invoice(&invoice_conv, amount_msats, retry_strategy_conv, &channelmanager_conv);
54393 return tag_ptr(ret_conv, true);
54396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_pay_1zero_1value_1invoice_1with_1id(JNIEnv *env, jclass clz, int64_t invoice, int64_t amount_msats, int8_tArray payment_id, int64_t retry_strategy, int64_t channelmanager) {
54397 LDKInvoice invoice_conv;
54398 invoice_conv.inner = untag_ptr(invoice);
54399 invoice_conv.is_owned = ptr_is_owned(invoice);
54400 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
54401 invoice_conv.is_owned = false;
54402 LDKThirtyTwoBytes payment_id_ref;
54403 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
54404 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
54405 void* retry_strategy_ptr = untag_ptr(retry_strategy);
54406 CHECK_ACCESS(retry_strategy_ptr);
54407 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
54408 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
54409 LDKChannelManager channelmanager_conv;
54410 channelmanager_conv.inner = untag_ptr(channelmanager);
54411 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
54412 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
54413 channelmanager_conv.is_owned = false;
54414 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
54415 *ret_conv = pay_zero_value_invoice_with_id(&invoice_conv, amount_msats, payment_id_ref, retry_strategy_conv, &channelmanager_conv);
54416 return tag_ptr(ret_conv, true);
54419 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
54420 if (!ptr_is_owned(this_ptr)) return;
54421 void* this_ptr_ptr = untag_ptr(this_ptr);
54422 CHECK_ACCESS(this_ptr_ptr);
54423 LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
54424 FREE(untag_ptr(this_ptr));
54425 PaymentError_free(this_ptr_conv);
54428 static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) {
54429 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
54430 *ret_copy = PaymentError_clone(arg);
54431 int64_t ret_ref = tag_ptr(ret_copy, true);
54434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
54435 LDKPaymentError* arg_conv = (LDKPaymentError*)untag_ptr(arg);
54436 int64_t ret_conv = PaymentError_clone_ptr(arg_conv);
54440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
54441 LDKPaymentError* orig_conv = (LDKPaymentError*)untag_ptr(orig);
54442 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
54443 *ret_copy = PaymentError_clone(orig_conv);
54444 int64_t ret_ref = tag_ptr(ret_copy, true);
54448 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1invoice(JNIEnv *env, jclass clz, jstring a) {
54449 LDKStr a_conv = java_to_owned_str(env, a);
54450 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
54451 *ret_copy = PaymentError_invoice(a_conv);
54452 int64_t ret_ref = tag_ptr(ret_copy, true);
54456 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1sending(JNIEnv *env, jclass clz, jclass a) {
54457 LDKRetryableSendFailure a_conv = LDKRetryableSendFailure_from_java(env, a);
54458 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
54459 *ret_copy = PaymentError_sending(a_conv);
54460 int64_t ret_ref = tag_ptr(ret_copy, true);
54464 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 entropy_source, int64_t node_signer, int64_t logger, jclass network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) {
54465 void* amt_msat_ptr = untag_ptr(amt_msat);
54466 CHECK_ACCESS(amt_msat_ptr);
54467 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
54468 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
54469 LDKThirtyTwoBytes payment_hash_ref;
54470 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54471 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54472 LDKStr description_conv = java_to_owned_str(env, description);
54473 LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr;
54474 phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints);
54475 if (phantom_route_hints_constr.datalen > 0)
54476 phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
54478 phantom_route_hints_constr.data = NULL;
54479 int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL);
54480 for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) {
54481 int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t];
54482 LDKPhantomRouteHints phantom_route_hints_conv_19_conv;
54483 phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19);
54484 phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19);
54485 CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv);
54486 phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv);
54487 phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv;
54489 (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0);
54490 void* entropy_source_ptr = untag_ptr(entropy_source);
54491 CHECK_ACCESS(entropy_source_ptr);
54492 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
54493 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
54494 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54495 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
54497 void* node_signer_ptr = untag_ptr(node_signer);
54498 CHECK_ACCESS(node_signer_ptr);
54499 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
54500 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
54501 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54502 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
54504 void* logger_ptr = untag_ptr(logger);
54505 CHECK_ACCESS(logger_ptr);
54506 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
54507 if (logger_conv.free == LDKLogger_JCalls_free) {
54508 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54509 LDKLogger_JCalls_cloned(&logger_conv);
54511 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
54512 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
54513 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
54514 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
54515 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
54516 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
54517 *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_ref, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch);
54518 return tag_ptr(ret_conv, true);
54521 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 entropy_source, int64_t node_signer, int64_t logger, jclass network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) {
54522 void* amt_msat_ptr = untag_ptr(amt_msat);
54523 CHECK_ACCESS(amt_msat_ptr);
54524 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
54525 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
54526 LDKThirtyTwoBytes payment_hash_ref;
54527 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54528 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54529 LDKSha256 description_hash_conv;
54530 description_hash_conv.inner = untag_ptr(description_hash);
54531 description_hash_conv.is_owned = ptr_is_owned(description_hash);
54532 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
54533 description_hash_conv = Sha256_clone(&description_hash_conv);
54534 LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr;
54535 phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints);
54536 if (phantom_route_hints_constr.datalen > 0)
54537 phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
54539 phantom_route_hints_constr.data = NULL;
54540 int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL);
54541 for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) {
54542 int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t];
54543 LDKPhantomRouteHints phantom_route_hints_conv_19_conv;
54544 phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19);
54545 phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19);
54546 CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv);
54547 phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv);
54548 phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv;
54550 (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0);
54551 void* entropy_source_ptr = untag_ptr(entropy_source);
54552 CHECK_ACCESS(entropy_source_ptr);
54553 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
54554 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
54555 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54556 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
54558 void* node_signer_ptr = untag_ptr(node_signer);
54559 CHECK_ACCESS(node_signer_ptr);
54560 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
54561 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
54562 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54563 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
54565 void* logger_ptr = untag_ptr(logger);
54566 CHECK_ACCESS(logger_ptr);
54567 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
54568 if (logger_conv.free == LDKLogger_JCalls_free) {
54569 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54570 LDKLogger_JCalls_cloned(&logger_conv);
54572 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
54573 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
54574 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
54575 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
54576 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
54577 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
54578 *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, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch);
54579 return tag_ptr(ret_conv, true);
54582 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) {
54583 LDKChannelManager channelmanager_conv;
54584 channelmanager_conv.inner = untag_ptr(channelmanager);
54585 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
54586 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
54587 channelmanager_conv.is_owned = false;
54588 void* node_signer_ptr = untag_ptr(node_signer);
54589 CHECK_ACCESS(node_signer_ptr);
54590 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
54591 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
54592 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54593 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
54595 void* logger_ptr = untag_ptr(logger);
54596 CHECK_ACCESS(logger_ptr);
54597 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
54598 if (logger_conv.free == LDKLogger_JCalls_free) {
54599 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54600 LDKLogger_JCalls_cloned(&logger_conv);
54602 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
54603 void* amt_msat_ptr = untag_ptr(amt_msat);
54604 CHECK_ACCESS(amt_msat_ptr);
54605 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
54606 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
54607 LDKStr description_conv = java_to_owned_str(env, description);
54608 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
54609 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
54610 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
54611 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
54612 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
54613 *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv);
54614 return tag_ptr(ret_conv, true);
54617 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 node_signer, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) {
54618 LDKChannelManager channelmanager_conv;
54619 channelmanager_conv.inner = untag_ptr(channelmanager);
54620 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
54621 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
54622 channelmanager_conv.is_owned = false;
54623 void* node_signer_ptr = untag_ptr(node_signer);
54624 CHECK_ACCESS(node_signer_ptr);
54625 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
54626 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
54627 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54628 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
54630 void* logger_ptr = untag_ptr(logger);
54631 CHECK_ACCESS(logger_ptr);
54632 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
54633 if (logger_conv.free == LDKLogger_JCalls_free) {
54634 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54635 LDKLogger_JCalls_cloned(&logger_conv);
54637 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
54638 void* amt_msat_ptr = untag_ptr(amt_msat);
54639 CHECK_ACCESS(amt_msat_ptr);
54640 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
54641 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
54642 LDKSha256 description_hash_conv;
54643 description_hash_conv.inner = untag_ptr(description_hash);
54644 description_hash_conv.is_owned = ptr_is_owned(description_hash);
54645 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
54646 description_hash_conv = Sha256_clone(&description_hash_conv);
54647 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
54648 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
54649 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
54650 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
54651 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
54652 *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv);
54653 return tag_ptr(ret_conv, true);
54656 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 node_signer, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) {
54657 LDKChannelManager channelmanager_conv;
54658 channelmanager_conv.inner = untag_ptr(channelmanager);
54659 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
54660 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
54661 channelmanager_conv.is_owned = false;
54662 void* node_signer_ptr = untag_ptr(node_signer);
54663 CHECK_ACCESS(node_signer_ptr);
54664 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
54665 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
54666 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54667 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
54669 void* logger_ptr = untag_ptr(logger);
54670 CHECK_ACCESS(logger_ptr);
54671 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
54672 if (logger_conv.free == LDKLogger_JCalls_free) {
54673 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54674 LDKLogger_JCalls_cloned(&logger_conv);
54676 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
54677 void* amt_msat_ptr = untag_ptr(amt_msat);
54678 CHECK_ACCESS(amt_msat_ptr);
54679 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
54680 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
54681 LDKSha256 description_hash_conv;
54682 description_hash_conv.inner = untag_ptr(description_hash);
54683 description_hash_conv.is_owned = ptr_is_owned(description_hash);
54684 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
54685 description_hash_conv = Sha256_clone(&description_hash_conv);
54686 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
54687 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
54688 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
54689 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
54690 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
54691 *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv);
54692 return tag_ptr(ret_conv, true);
54695 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 node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) {
54696 LDKChannelManager channelmanager_conv;
54697 channelmanager_conv.inner = untag_ptr(channelmanager);
54698 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
54699 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
54700 channelmanager_conv.is_owned = false;
54701 void* node_signer_ptr = untag_ptr(node_signer);
54702 CHECK_ACCESS(node_signer_ptr);
54703 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
54704 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
54705 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54706 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
54708 void* logger_ptr = untag_ptr(logger);
54709 CHECK_ACCESS(logger_ptr);
54710 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
54711 if (logger_conv.free == LDKLogger_JCalls_free) {
54712 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54713 LDKLogger_JCalls_cloned(&logger_conv);
54715 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
54716 void* amt_msat_ptr = untag_ptr(amt_msat);
54717 CHECK_ACCESS(amt_msat_ptr);
54718 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
54719 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
54720 LDKStr description_conv = java_to_owned_str(env, description);
54721 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
54722 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
54723 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
54724 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
54725 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
54726 *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv);
54727 return tag_ptr(ret_conv, true);
54730 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch_1with_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash, int64_t min_final_cltv_expiry_delta) {
54731 LDKChannelManager channelmanager_conv;
54732 channelmanager_conv.inner = untag_ptr(channelmanager);
54733 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
54734 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
54735 channelmanager_conv.is_owned = false;
54736 void* node_signer_ptr = untag_ptr(node_signer);
54737 CHECK_ACCESS(node_signer_ptr);
54738 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
54739 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
54740 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54741 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
54743 void* logger_ptr = untag_ptr(logger);
54744 CHECK_ACCESS(logger_ptr);
54745 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
54746 if (logger_conv.free == LDKLogger_JCalls_free) {
54747 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54748 LDKLogger_JCalls_cloned(&logger_conv);
54750 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
54751 void* amt_msat_ptr = untag_ptr(amt_msat);
54752 CHECK_ACCESS(amt_msat_ptr);
54753 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
54754 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
54755 LDKStr description_conv = java_to_owned_str(env, description);
54756 LDKThirtyTwoBytes payment_hash_ref;
54757 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54758 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54759 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
54760 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
54761 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
54762 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
54763 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
54764 *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref, min_final_cltv_expiry_delta_conv);
54765 return tag_ptr(ret_conv, true);
54768 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1from_1str(JNIEnv *env, jclass clz, jstring s) {
54769 LDKStr s_conv = java_to_owned_str(env, s);
54770 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
54771 *ret_conv = SiPrefix_from_str(s_conv);
54772 return tag_ptr(ret_conv, true);
54775 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1str(JNIEnv *env, jclass clz, jstring s) {
54776 LDKStr s_conv = java_to_owned_str(env, s);
54777 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
54778 *ret_conv = Invoice_from_str(s_conv);
54779 return tag_ptr(ret_conv, true);
54782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1from_1str(JNIEnv *env, jclass clz, jstring s) {
54783 LDKStr s_conv = java_to_owned_str(env, s);
54784 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
54785 *ret_conv = SignedRawInvoice_from_str(s_conv);
54786 return tag_ptr(ret_conv, true);
54789 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ParseError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
54790 LDKParseError* o_conv = (LDKParseError*)untag_ptr(o);
54791 LDKStr ret_str = ParseError_to_str(o_conv);
54792 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
54797 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
54798 LDKParseOrSemanticError* o_conv = (LDKParseOrSemanticError*)untag_ptr(o);
54799 LDKStr ret_str = ParseOrSemanticError_to_str(o_conv);
54800 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
54805 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Invoice_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
54807 o_conv.inner = untag_ptr(o);
54808 o_conv.is_owned = ptr_is_owned(o);
54809 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
54810 o_conv.is_owned = false;
54811 LDKStr ret_str = Invoice_to_str(&o_conv);
54812 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
54817 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
54818 LDKSignedRawInvoice o_conv;
54819 o_conv.inner = untag_ptr(o);
54820 o_conv.is_owned = ptr_is_owned(o);
54821 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
54822 o_conv.is_owned = false;
54823 LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
54824 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
54829 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Currency_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
54830 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
54831 LDKStr ret_str = Currency_to_str(o_conv);
54832 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
54837 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SiPrefix_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
54838 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
54839 LDKStr ret_str = SiPrefix_to_str(o_conv);
54840 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
54845 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
54846 LDKRapidGossipSync this_obj_conv;
54847 this_obj_conv.inner = untag_ptr(this_obj);
54848 this_obj_conv.is_owned = ptr_is_owned(this_obj);
54849 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
54850 RapidGossipSync_free(this_obj_conv);
54853 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger) {
54854 LDKNetworkGraph network_graph_conv;
54855 network_graph_conv.inner = untag_ptr(network_graph);
54856 network_graph_conv.is_owned = ptr_is_owned(network_graph);
54857 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
54858 network_graph_conv.is_owned = false;
54859 void* logger_ptr = untag_ptr(logger);
54860 CHECK_ACCESS(logger_ptr);
54861 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
54862 if (logger_conv.free == LDKLogger_JCalls_free) {
54863 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
54864 LDKLogger_JCalls_cloned(&logger_conv);
54866 LDKRapidGossipSync ret_var = RapidGossipSync_new(&network_graph_conv, logger_conv);
54867 int64_t ret_ref = 0;
54868 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
54869 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
54873 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) {
54874 LDKRapidGossipSync this_arg_conv;
54875 this_arg_conv.inner = untag_ptr(this_arg);
54876 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54877 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54878 this_arg_conv.is_owned = false;
54879 LDKu8slice update_data_ref;
54880 update_data_ref.datalen = (*env)->GetArrayLength(env, update_data);
54881 update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL);
54882 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
54883 *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref);
54884 (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0);
54885 return tag_ptr(ret_conv, true);
54888 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray update_data, int64_t current_time_unix) {
54889 LDKRapidGossipSync this_arg_conv;
54890 this_arg_conv.inner = untag_ptr(this_arg);
54891 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54893 this_arg_conv.is_owned = false;
54894 LDKu8slice update_data_ref;
54895 update_data_ref.datalen = (*env)->GetArrayLength(env, update_data);
54896 update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL);
54897 void* current_time_unix_ptr = untag_ptr(current_time_unix);
54898 CHECK_ACCESS(current_time_unix_ptr);
54899 LDKCOption_u64Z current_time_unix_conv = *(LDKCOption_u64Z*)(current_time_unix_ptr);
54900 current_time_unix_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(current_time_unix));
54901 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
54902 *ret_conv = RapidGossipSync_update_network_graph_no_std(&this_arg_conv, update_data_ref, current_time_unix_conv);
54903 (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0);
54904 return tag_ptr(ret_conv, true);
54907 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1is_1initial_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_arg) {
54908 LDKRapidGossipSync this_arg_conv;
54909 this_arg_conv.inner = untag_ptr(this_arg);
54910 this_arg_conv.is_owned = ptr_is_owned(this_arg);
54911 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
54912 this_arg_conv.is_owned = false;
54913 jboolean ret_conv = RapidGossipSync_is_initial_sync_complete(&this_arg_conv);
54917 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
54918 if (!ptr_is_owned(this_ptr)) return;
54919 void* this_ptr_ptr = untag_ptr(this_ptr);
54920 CHECK_ACCESS(this_ptr_ptr);
54921 LDKGraphSyncError this_ptr_conv = *(LDKGraphSyncError*)(this_ptr_ptr);
54922 FREE(untag_ptr(this_ptr));
54923 GraphSyncError_free(this_ptr_conv);
54926 static inline uint64_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg) {
54927 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
54928 *ret_copy = GraphSyncError_clone(arg);
54929 int64_t ret_ref = tag_ptr(ret_copy, true);
54932 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
54933 LDKGraphSyncError* arg_conv = (LDKGraphSyncError*)untag_ptr(arg);
54934 int64_t ret_conv = GraphSyncError_clone_ptr(arg_conv);
54938 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
54939 LDKGraphSyncError* orig_conv = (LDKGraphSyncError*)untag_ptr(orig);
54940 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
54941 *ret_copy = GraphSyncError_clone(orig_conv);
54942 int64_t ret_ref = tag_ptr(ret_copy, true);
54946 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1decode_1error(JNIEnv *env, jclass clz, int64_t a) {
54947 void* a_ptr = untag_ptr(a);
54948 CHECK_ACCESS(a_ptr);
54949 LDKDecodeError a_conv = *(LDKDecodeError*)(a_ptr);
54950 a_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(a));
54951 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
54952 *ret_copy = GraphSyncError_decode_error(a_conv);
54953 int64_t ret_ref = tag_ptr(ret_copy, true);
54957 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1lightning_1error(JNIEnv *env, jclass clz, int64_t a) {
54958 LDKLightningError a_conv;
54959 a_conv.inner = untag_ptr(a);
54960 a_conv.is_owned = ptr_is_owned(a);
54961 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
54962 a_conv = LightningError_clone(&a_conv);
54963 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
54964 *ret_copy = GraphSyncError_lightning_error(a_conv);
54965 int64_t ret_ref = tag_ptr(ret_copy, true);